Format: application/octet-stream
⬇ Download File (2.4 KB)
   1  import datetime
   2  from decimal import Decimal
   3  from typing import Any, TypeVar, overload, Union
   4  
   5  from django.utils.functional import Promise
   6  from typing_extensions import Literal
   7  
   8  class DjangoUnicodeDecodeError(UnicodeDecodeError):
   9      obj: bytes = ...
  10      def __init__(self, obj: bytes, *args: Any) -> None: ...
  11  
  12  _P = TypeVar("_P", bound=Promise)
  13  _S = TypeVar("_S", bound=str)
  14  _PT = TypeVar("_PT", None, int, float, Decimal, datetime.datetime, datetime.date, datetime.time)
  15  @overload
  16  def smart_text(s: _P, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _P: ...
  17  @overload
  18  def smart_text(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ...
  19  @overload
  20  def smart_text(s: _S, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _S: ...
  21  @overload
  22  def smart_text(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> str: ...
  23  def is_protected_type(obj: Any) -> bool: ...
  24  @overload
  25  def force_text(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ...
  26  @overload
  27  def force_text(s: _S, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _S: ...
  28  @overload
  29  def force_text(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> str: ...
  30  @overload
  31  def smart_bytes(s: _P, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> _P: ...
  32  @overload
  33  def smart_bytes(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ...
  34  @overload
  35  def smart_bytes(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> bytes: ...
  36  @overload
  37  def force_bytes(s: _PT, encoding: str = ..., strings_only: Literal[True] = ..., errors: str = ...) -> _PT: ...
  38  @overload
  39  def force_bytes(s: Any, encoding: str = ..., strings_only: bool = ..., errors: str = ...) -> bytes: ...
  40  
  41  smart_str = smart_text
  42  force_str = force_text
  43  @overload
  44  def iri_to_uri(iri: None) -> None: ...
  45  @overload
  46  def iri_to_uri(iri: Union[str, Promise]) -> str: ...
  47  @overload
  48  def uri_to_iri(iri: None) -> None: ...
  49  @overload
  50  def uri_to_iri(iri: str) -> str: ...
  51  def escape_uri_path(path: str) -> str: ...
  52  def repercent_broken_unicode(path: bytes) -> bytes: ...
  53  @overload
  54  def filepath_to_uri(path: None) -> None: ...
  55  @overload
  56  def filepath_to_uri(path: str) -> str: ...
  57  def get_system_encoding() -> str: ...
  58  
  59  DEFAULT_LOCALE_ENCODING: Any
  60