py3compat.pyi 835 B

123456789101112131415161718192021222324252627282930313233
  1. from typing import Union, Any, Optional, IO
  2. Buffer = Union[bytes, bytearray, memoryview]
  3. import sys
  4. def b(s: str) -> bytes: ...
  5. def bchr(s: int) -> bytes: ...
  6. def bord(s: bytes) -> int: ...
  7. def tobytes(s: Union[bytes, str]) -> bytes: ...
  8. def tostr(b: bytes) -> str: ...
  9. def bytestring(x: Any) -> bool: ...
  10. def is_native_int(s: Any) -> bool: ...
  11. def is_string(x: Any) -> bool: ...
  12. def BytesIO(b: bytes) -> IO[bytes]: ...
  13. def StringIO(s: str) -> IO[str]: ...
  14. if sys.version_info[0] == 2:
  15. from sys import maxint
  16. iter_range = xrange
  17. else:
  18. from sys import maxsize as maxint
  19. iter_range = range
  20. class FileNotFoundError:
  21. def __init__(self, err: int, msg: str, filename: str) -> None:
  22. pass
  23. def _copy_bytes(start: Optional[int], end: Optional[int], seq: Buffer) -> bytes: ...