py3compat.pyi 766 B

12345678910111213141516171819202122232425262728293031
  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. if sys.version_info[0] == 2:
  14. from sys import maxint
  15. iter_range = xrange
  16. else:
  17. from sys import maxsize as maxint
  18. iter_range = range
  19. class FileNotFoundError:
  20. def __init__(self, err: int, msg: str, filename: str) -> None:
  21. pass
  22. def _copy_bytes(start: Optional[int], end: Optional[int], seq: Buffer) -> bytes: ...