mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-19 01:22:51 +08:00
Move contents of builtins/* to stdlib/*. This simplifies finding stubs.
This commit is contained in:
51
stdlib/3/_codecs.pyi
Normal file
51
stdlib/3/_codecs.pyi
Normal file
@@ -0,0 +1,51 @@
|
||||
"""Stub file for the '_codecs' module."""
|
||||
|
||||
from typing import Any, AnyStr, Callable, Tuple, Optional, Dict
|
||||
|
||||
import codecs
|
||||
|
||||
# For convenience:
|
||||
_Handler = Callable[[Exception], Tuple[str, int]]
|
||||
|
||||
def register(search_function: Callable[[str], Any]) -> None: ...
|
||||
def register_error(errors: str, handler: _Handler) -> None: ...
|
||||
def lookup(a: str) -> codecs.CodecInfo: ...
|
||||
def lookup_error(a: str) -> _Handler: ...
|
||||
def decode(obj: Any, encoding:str = ..., errors:str = ...) -> Any: ...
|
||||
def encode(obj: Any, encoding:str = ..., errors:str = ...) -> Any: ...
|
||||
def charmap_build(a: str) -> Dict[int, int]: ...
|
||||
|
||||
def ascii_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def ascii_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def charbuffer_encode(data: AnyStr, errors: str = ...) -> Tuple[bytes, int]: ...
|
||||
def charmap_decode(data: AnyStr, errors: str = ..., mapping: Optional[Dict[int, int]] = ...) -> Tuple[str, int]: ...
|
||||
def charmap_encode(data: AnyStr, errors: str, mapping: Optional[Dict[int, int]] = ...) -> Tuple[bytes, int]: ...
|
||||
def escape_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def escape_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def latin_1_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def latin_1_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def raw_unicode_escape_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def raw_unicode_escape_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def readbuffer_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def unicode_escape_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def unicode_escape_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def unicode_internal_decode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def unicode_internal_encode(data: AnyStr, errors:str = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_16_be_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_be_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_16_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_16_ex_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_le_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_le_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_32_be_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_be_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_32_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_32_ex_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_le_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_le_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_7_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_7_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
def utf_8_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_8_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[bytes, int]: ...
|
||||
48
stdlib/3/_io.pyi
Normal file
48
stdlib/3/_io.pyi
Normal file
@@ -0,0 +1,48 @@
|
||||
# Stubs for _io (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
class _IOBase:
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
@property
|
||||
def closed(self): ...
|
||||
def close(self): ...
|
||||
def fileno(self): ...
|
||||
def flush(self): ...
|
||||
def isatty(self): ...
|
||||
def readable(self): ...
|
||||
def readline(self, size: int = ...): ...
|
||||
def readlines(self, hint: int = ...): ...
|
||||
def seek(self, offset, whence=...): ...
|
||||
def seekable(self): ...
|
||||
def tell(self): ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
def writable(self): ...
|
||||
def writelines(self, lines): ...
|
||||
def __del__(self): ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc_type, exc_val, exc_tb): ...
|
||||
def __iter__(self): ...
|
||||
def __next__(self): ...
|
||||
|
||||
class _BufferedIOBase(_IOBase):
|
||||
def detach(self): ...
|
||||
def read(self, size: int = ...): ...
|
||||
def read1(self, size: int = ...): ...
|
||||
def readinto(self, b): ...
|
||||
def write(self, b): ...
|
||||
|
||||
class _RawIOBase(_IOBase):
|
||||
def read(self, size: int = ...): ...
|
||||
def readall(self): ...
|
||||
|
||||
class _TextIOBase(_IOBase):
|
||||
encoding = ... # type: Any
|
||||
errors = ... # type: Any
|
||||
newlines = ... # type: Any
|
||||
def detach(self): ...
|
||||
def read(self, size: int = ...): ...
|
||||
def readline(self, size: int = ...): ...
|
||||
def write(self, b): ...
|
||||
30
stdlib/3/_json.pyi
Normal file
30
stdlib/3/_json.pyi
Normal file
@@ -0,0 +1,30 @@
|
||||
"""Stub file for the '_json' module."""
|
||||
|
||||
from typing import Any, Tuple
|
||||
|
||||
class make_encoder:
|
||||
sort_keys = ... # type: Any
|
||||
skipkeys = ... # type: Any
|
||||
key_separator = ... # type: Any
|
||||
indent = ... # type: Any
|
||||
markers = ... # type: Any
|
||||
default = ... # type: Any
|
||||
encoder = ... # type: Any
|
||||
item_separator = ... # type: Any
|
||||
def __init__(self, markers, default, encoder, indent, key_separator,
|
||||
item_separator, sort_keys, skipkeys, allow_nan) -> None: ...
|
||||
def __call__(self, *args, **kwargs) -> Any: ...
|
||||
|
||||
class make_scanner:
|
||||
object_hook = ... # type: Any
|
||||
object_pairs_hook = ... # type: Any
|
||||
parse_int = ... # type: Any
|
||||
parse_constant = ... # type: Any
|
||||
parse_float = ... # type: Any
|
||||
strict = ... # type: bool
|
||||
# TODO: 'context' needs the attrs above (ducktype), but not __call__.
|
||||
def __init__(self, context: "make_scanner") -> None: ...
|
||||
def __call__(self, string: str, index: int) -> Tuple[Any, int]: ...
|
||||
|
||||
def encode_basestring_ascii(s: str) -> str: ...
|
||||
def scanstring(string: str, end: int, strict:bool = ...) -> Tuple[str, int]: ...
|
||||
84
stdlib/3/_locale.pyi
Normal file
84
stdlib/3/_locale.pyi
Normal file
@@ -0,0 +1,84 @@
|
||||
# Stubs for _locale (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Iterable
|
||||
|
||||
ABDAY_1 = ... # type: int
|
||||
ABDAY_2 = ... # type: int
|
||||
ABDAY_3 = ... # type: int
|
||||
ABDAY_4 = ... # type: int
|
||||
ABDAY_5 = ... # type: int
|
||||
ABDAY_6 = ... # type: int
|
||||
ABDAY_7 = ... # type: int
|
||||
ABMON_1 = ... # type: int
|
||||
ABMON_10 = ... # type: int
|
||||
ABMON_11 = ... # type: int
|
||||
ABMON_12 = ... # type: int
|
||||
ABMON_2 = ... # type: int
|
||||
ABMON_3 = ... # type: int
|
||||
ABMON_4 = ... # type: int
|
||||
ABMON_5 = ... # type: int
|
||||
ABMON_6 = ... # type: int
|
||||
ABMON_7 = ... # type: int
|
||||
ABMON_8 = ... # type: int
|
||||
ABMON_9 = ... # type: int
|
||||
ALT_DIGITS = ... # type: int
|
||||
AM_STR = ... # type: int
|
||||
CHAR_MAX = ... # type: int
|
||||
CODESET = ... # type: int
|
||||
CRNCYSTR = ... # type: int
|
||||
DAY_1 = ... # type: int
|
||||
DAY_2 = ... # type: int
|
||||
DAY_3 = ... # type: int
|
||||
DAY_4 = ... # type: int
|
||||
DAY_5 = ... # type: int
|
||||
DAY_6 = ... # type: int
|
||||
DAY_7 = ... # type: int
|
||||
D_FMT = ... # type: int
|
||||
D_T_FMT = ... # type: int
|
||||
ERA = ... # type: int
|
||||
ERA_D_FMT = ... # type: int
|
||||
ERA_D_T_FMT = ... # type: int
|
||||
ERA_T_FMT = ... # type: int
|
||||
LC_ALL = ... # type: int
|
||||
LC_COLLATE = ... # type: int
|
||||
LC_CTYPE = ... # type: int
|
||||
LC_MESSAGES = ... # type: int
|
||||
LC_MONETARY = ... # type: int
|
||||
LC_NUMERIC = ... # type: int
|
||||
LC_TIME = ... # type: int
|
||||
MON_1 = ... # type: int
|
||||
MON_10 = ... # type: int
|
||||
MON_11 = ... # type: int
|
||||
MON_12 = ... # type: int
|
||||
MON_2 = ... # type: int
|
||||
MON_3 = ... # type: int
|
||||
MON_4 = ... # type: int
|
||||
MON_5 = ... # type: int
|
||||
MON_6 = ... # type: int
|
||||
MON_7 = ... # type: int
|
||||
MON_8 = ... # type: int
|
||||
MON_9 = ... # type: int
|
||||
NOEXPR = ... # type: int
|
||||
PM_STR = ... # type: int
|
||||
RADIXCHAR = ... # type: int
|
||||
THOUSEP = ... # type: int
|
||||
T_FMT = ... # type: int
|
||||
T_FMT_AMPM = ... # type: int
|
||||
YESEXPR = ... # type: int
|
||||
_DATE_FMT = ... # type: int
|
||||
|
||||
def bind_textdomain_codeset(domain, codeset): ...
|
||||
def bindtextdomain(domain, dir): ...
|
||||
def dcgettext(domain, msg, category): ...
|
||||
def dgettext(domain, msg): ...
|
||||
def gettext(msg): ...
|
||||
def localeconv(): ...
|
||||
def nl_langinfo(key): ...
|
||||
def setlocale(category: int, locale: Iterable[str] = ...) -> str: ...
|
||||
def strcoll(string1, string2) -> int: ...
|
||||
def strxfrm(string): ...
|
||||
def textdomain(domain): ...
|
||||
|
||||
class Error(Exception): ...
|
||||
12
stdlib/3/_random.pyi
Normal file
12
stdlib/3/_random.pyi
Normal file
@@ -0,0 +1,12 @@
|
||||
# Stubs for _random
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import Any
|
||||
|
||||
class Random:
|
||||
def seed(self, x: Any = ...) -> None: ...
|
||||
def getstate(self) -> tuple: ...
|
||||
def setstate(self, state: tuple) -> None: ...
|
||||
def random(self) -> float: ...
|
||||
def getrandbits(self, k: int) -> int: ...
|
||||
11
stdlib/3/_warnings.pyi
Normal file
11
stdlib/3/_warnings.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Any, List
|
||||
|
||||
_defaultaction = ... # type: str
|
||||
_onceregistry = ... # type: dict
|
||||
filters = ... # type: List[tuple]
|
||||
|
||||
def warn(message: Warning, category:type = ..., stacklevel:int = ...) -> None: ...
|
||||
def warn_explicit(message: Warning, category:type,
|
||||
filename: str, lineno: int,
|
||||
module:Any = ..., registry:dict = ...,
|
||||
module_globals:dict = ...) -> None: ...
|
||||
49
stdlib/3/array.pyi
Normal file
49
stdlib/3/array.pyi
Normal file
@@ -0,0 +1,49 @@
|
||||
# Stubs for array
|
||||
|
||||
# Based on http://docs.python.org/3.2/library/array.html
|
||||
|
||||
from typing import Any, Iterable, Tuple, List, Iterator, BinaryIO, overload
|
||||
|
||||
typecodes = ... # type: str
|
||||
|
||||
class array:
|
||||
typecode = ... # type: str
|
||||
itemsize = ... # type: int
|
||||
def __init__(self, typecode: str,
|
||||
initializer: Iterable[Any] = ...) -> None: ...
|
||||
def append(self, x: Any) -> None: ...
|
||||
def buffer_info(self) -> Tuple[int, int]: ...
|
||||
def byteswap(self) -> None: ...
|
||||
def count(self, x: Any) -> int: ...
|
||||
def extend(self, iterable: Iterable[Any]) -> None: ...
|
||||
def frombytes(self, s: bytes) -> None: ...
|
||||
def fromfile(self, f: BinaryIO, n: int) -> None: ...
|
||||
def fromlist(self, list: List[Any]) -> None: ...
|
||||
def fromstring(self, s: bytes) -> None: ...
|
||||
def fromunicode(self, s: str) -> None: ...
|
||||
def index(self, x: Any) -> int: ...
|
||||
def insert(self, i: int, x: Any) -> None: ...
|
||||
def pop(self, i: int = ...) -> Any: ...
|
||||
def remove(self, x: Any) -> None: ...
|
||||
def reverse(self) -> None: ...
|
||||
def tobytes(self) -> bytes: ...
|
||||
def tofile(self, f: BinaryIO) -> None: ...
|
||||
def tolist(self) -> List[Any]: ...
|
||||
def tostring(self) -> bytes: ...
|
||||
def tounicode(self) -> str: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[Any]: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> Any: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> 'array': ...
|
||||
|
||||
def __setitem__(self, i: int, o: Any) -> None: ...
|
||||
def __delitem__(self, i: int) -> None: ...
|
||||
def __add__(self, x: 'array') -> 'array': ...
|
||||
def __mul__(self, n: int) -> 'array': ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
9
stdlib/3/atexit.pyi
Normal file
9
stdlib/3/atexit.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
"""Stub file for the 'atexit' module."""
|
||||
|
||||
from typing import Any, Callable
|
||||
|
||||
def _clear() -> None: ...
|
||||
def _ncallbacks() -> int: ...
|
||||
def _run_exitfuncs() -> None: ...
|
||||
def register(func: Callable[..., Any], *args, **kwargs) -> Callable[..., Any]: ...
|
||||
def unregister(func: Callable[..., Any]) -> None: ...
|
||||
26
stdlib/3/binascii.pyi
Normal file
26
stdlib/3/binascii.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
# Stubs for binascii
|
||||
|
||||
# Based on http://docs.python.org/3.2/library/binascii.html
|
||||
|
||||
import typing
|
||||
|
||||
def a2b_uu(string: bytes) -> bytes: ...
|
||||
def b2a_uu(data: bytes) -> bytes: ...
|
||||
def a2b_base64(string: bytes) -> bytes: ...
|
||||
def b2a_base64(data: bytes) -> bytes: ...
|
||||
def a2b_qp(string: bytes, header: bool = ...) -> bytes: ...
|
||||
def b2a_qp(data: bytes, quotetabs: bool = ..., istext: bool = ...,
|
||||
header: bool = ...) -> bytes: ...
|
||||
def a2b_hqx(string: bytes) -> bytes: ...
|
||||
def rledecode_hqx(data: bytes) -> bytes: ...
|
||||
def rlecode_hqx(data: bytes) -> bytes: ...
|
||||
def b2a_hqx(data: bytes) -> bytes: ...
|
||||
def crc_hqx(data: bytes, crc: int) -> int: ...
|
||||
def crc32(data: bytes, crc: int = ...) -> int: ...
|
||||
def b2a_hex(data: bytes) -> bytes: ...
|
||||
def hexlify(data: bytes) -> bytes: ...
|
||||
def a2b_hex(hexstr: bytes) -> bytes: ...
|
||||
def unhexlify(hexlify: bytes) -> bytes: ...
|
||||
|
||||
class Error(Exception): ...
|
||||
class Incomplete(Exception): ...
|
||||
806
stdlib/3/builtins.pyi
Normal file
806
stdlib/3/builtins.pyi
Normal file
@@ -0,0 +1,806 @@
|
||||
# Stubs for builtins (Python 3)
|
||||
|
||||
from typing import (
|
||||
TypeVar, Iterator, Iterable, overload,
|
||||
Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic,
|
||||
Set, AbstractSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsBytes,
|
||||
SupportsAbs, SupportsRound, IO, Union, ItemsView, KeysView, ValuesView, ByteString
|
||||
)
|
||||
from abc import abstractmethod, ABCMeta
|
||||
|
||||
# Note that names imported above are not automatically made visible via the
|
||||
# implicit builtins import.
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_T_co = TypeVar('_T_co', covariant=True)
|
||||
_KT = TypeVar('_KT')
|
||||
_VT = TypeVar('_VT')
|
||||
_S = TypeVar('_S')
|
||||
_T1 = TypeVar('_T1')
|
||||
_T2 = TypeVar('_T2')
|
||||
_T3 = TypeVar('_T3')
|
||||
_T4 = TypeVar('_T4')
|
||||
|
||||
staticmethod = object() # Only valid as a decorator.
|
||||
classmethod = object() # Only valid as a decorator.
|
||||
property = object()
|
||||
|
||||
class object:
|
||||
__doc__ = ... # type: str
|
||||
__class__ = ... # type: type
|
||||
|
||||
def __init__(self) -> None: ...
|
||||
def __new__(cls) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __eq__(self, o: object) -> bool: ...
|
||||
def __ne__(self, o: object) -> bool: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class type:
|
||||
__name__ = ... # type: str
|
||||
__qualname__ = ... # type: str
|
||||
__module__ = ... # type: str
|
||||
__dict__ = ... # type: Dict[str, Any]
|
||||
|
||||
def __init__(self, o: object) -> None: ...
|
||||
@staticmethod
|
||||
def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ...
|
||||
|
||||
class int(SupportsInt, SupportsFloat, SupportsAbs[int]):
|
||||
def __init__(self, x: Union[SupportsInt, str, bytes] = None, base: int = None) -> None: ...
|
||||
def bit_length(self) -> int: ...
|
||||
def to_bytes(self, length: int, byteorder: str, *, signed: bool = False) -> bytes: ...
|
||||
@classmethod
|
||||
def from_bytes(cls, bytes: Sequence[int], byteorder: str, *,
|
||||
signed: bool = False) -> int: ... # TODO buffer object argument
|
||||
|
||||
def __add__(self, x: int) -> int: ...
|
||||
def __sub__(self, x: int) -> int: ...
|
||||
def __mul__(self, x: int) -> int: ...
|
||||
def __floordiv__(self, x: int) -> int: ...
|
||||
def __truediv__(self, x: int) -> float: ...
|
||||
def __mod__(self, x: int) -> int: ...
|
||||
def __radd__(self, x: int) -> int: ...
|
||||
def __rsub__(self, x: int) -> int: ...
|
||||
def __rmul__(self, x: int) -> int: ...
|
||||
def __rfloordiv__(self, x: int) -> int: ...
|
||||
def __rtruediv__(self, x: int) -> float: ...
|
||||
def __rmod__(self, x: int) -> int: ...
|
||||
def __pow__(self, x: int) -> Any: ... # Return type can be int or float, depending on x.
|
||||
def __rpow__(self, x: int) -> Any: ...
|
||||
def __and__(self, n: int) -> int: ...
|
||||
def __or__(self, n: int) -> int: ...
|
||||
def __xor__(self, n: int) -> int: ...
|
||||
def __lshift__(self, n: int) -> int: ...
|
||||
def __rshift__(self, n: int) -> int: ...
|
||||
def __rand__(self, n: int) -> int: ...
|
||||
def __ror__(self, n: int) -> int: ...
|
||||
def __rxor__(self, n: int) -> int: ...
|
||||
def __rlshift__(self, n: int) -> int: ...
|
||||
def __rrshift__(self, n: int) -> int: ...
|
||||
def __neg__(self) -> int: ...
|
||||
def __pos__(self) -> int: ...
|
||||
def __invert__(self) -> int: ...
|
||||
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: int) -> bool: ...
|
||||
def __le__(self, x: int) -> bool: ...
|
||||
def __gt__(self, x: int) -> bool: ...
|
||||
def __ge__(self, x: int) -> bool: ...
|
||||
|
||||
def __str__(self) -> str: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __int__(self) -> int: return self
|
||||
def __abs__(self) -> int: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class float(SupportsFloat, SupportsInt, SupportsAbs[float]):
|
||||
def __init__(self, x: Union[SupportsFloat, str, bytes]=None) -> None: ...
|
||||
def as_integer_ratio(self) -> Tuple[int, int]: ...
|
||||
def hex(self) -> str: ...
|
||||
def is_integer(self) -> bool: ...
|
||||
@classmethod
|
||||
def fromhex(cls, s: str) -> float: ...
|
||||
|
||||
def __add__(self, x: float) -> float: ...
|
||||
def __sub__(self, x: float) -> float: ...
|
||||
def __mul__(self, x: float) -> float: ...
|
||||
def __floordiv__(self, x: float) -> float: ...
|
||||
def __truediv__(self, x: float) -> float: ...
|
||||
def __mod__(self, x: float) -> float: ...
|
||||
def __pow__(self, x: float) -> float: ...
|
||||
def __radd__(self, x: float) -> float: ...
|
||||
def __rsub__(self, x: float) -> float: ...
|
||||
def __rmul__(self, x: float) -> float: ...
|
||||
def __rfloordiv__(self, x: float) -> float: ...
|
||||
def __rtruediv__(self, x: float) -> float: ...
|
||||
def __rmod__(self, x: float) -> float: ...
|
||||
def __rpow__(self, x: float) -> float: ...
|
||||
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: float) -> bool: ...
|
||||
def __le__(self, x: float) -> bool: ...
|
||||
def __gt__(self, x: float) -> bool: ...
|
||||
def __ge__(self, x: float) -> bool: ...
|
||||
def __neg__(self) -> float: ...
|
||||
def __pos__(self) -> float: ...
|
||||
|
||||
def __str__(self) -> str: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __abs__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class complex(SupportsAbs[float]):
|
||||
@overload
|
||||
def __init__(self, re: float = 0.0, im: float = 0.0) -> None: ...
|
||||
@overload
|
||||
def __init__(self, s: str) -> None: ...
|
||||
|
||||
@property
|
||||
def real(self) -> float: ...
|
||||
@property
|
||||
def imag(self) -> float: ...
|
||||
|
||||
def conjugate(self) -> complex: ...
|
||||
|
||||
def __add__(self, x: complex) -> complex: ...
|
||||
def __sub__(self, x: complex) -> complex: ...
|
||||
def __mul__(self, x: complex) -> complex: ...
|
||||
def __pow__(self, x: complex) -> complex: ...
|
||||
def __truediv__(self, x: complex) -> complex: ...
|
||||
def __radd__(self, x: complex) -> complex: ...
|
||||
def __rsub__(self, x: complex) -> complex: ...
|
||||
def __rmul__(self, x: complex) -> complex: ...
|
||||
def __rpow__(self, x: complex) -> complex: ...
|
||||
def __rtruediv__(self, x: complex) -> complex: ...
|
||||
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __neg__(self) -> complex: ...
|
||||
def __pos__(self) -> complex: ...
|
||||
|
||||
def __str__(self) -> str: ...
|
||||
def __abs__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class str(Sequence[str]):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, o: object) -> None: ...
|
||||
@overload
|
||||
def __init__(self, o: bytes, encoding: str = None, errors: str = 'strict') -> None: ...
|
||||
def capitalize(self) -> str: ...
|
||||
def center(self, width: int, fillchar: str = ' ') -> str: ...
|
||||
def count(self, x: str) -> int: ...
|
||||
def encode(self, encoding: str = 'utf-8', errors: str = 'strict') -> bytes: ...
|
||||
def endswith(self, suffix: Union[str, Tuple[str, ...]], start: int = None,
|
||||
end: int = None) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = 8) -> str: ...
|
||||
def find(self, sub: str, start: int = 0, end: int = 0) -> int: ...
|
||||
def format(self, *args: Any, **kwargs: Any) -> str: ...
|
||||
def format_map(self, map: Mapping[str, Any]) -> str: ...
|
||||
def index(self, sub: str, start: int = 0, end: int = 0) -> int: ...
|
||||
def isalnum(self) -> bool: ...
|
||||
def isalpha(self) -> bool: ...
|
||||
def isdecimal(self) -> bool: ...
|
||||
def isdigit(self) -> bool: ...
|
||||
def isidentifier(self) -> bool: ...
|
||||
def islower(self) -> bool: ...
|
||||
def isnumeric(self) -> bool: ...
|
||||
def isprintable(self) -> bool: ...
|
||||
def isspace(self) -> bool: ...
|
||||
def istitle(self) -> bool: ...
|
||||
def isupper(self) -> bool: ...
|
||||
def join(self, iterable: Iterable[str]) -> str: ...
|
||||
def ljust(self, width: int, fillchar: str = ' ') -> str: ...
|
||||
def lower(self) -> str: ...
|
||||
def lstrip(self, chars: str = None) -> str: ...
|
||||
def partition(self, sep: str) -> Tuple[str, str, str]: ...
|
||||
def replace(self, old: str, new: str, count: int = -1) -> str: ...
|
||||
def rfind(self, sub: str, start: int = 0, end: int = 0) -> int: ...
|
||||
def rindex(self, sub: str, start: int = 0, end: int = 0) -> int: ...
|
||||
def rjust(self, width: int, fillchar: str = ' ') -> str: ...
|
||||
def rpartition(self, sep: str) -> Tuple[str, str, str]: ...
|
||||
def rsplit(self, sep: str = None, maxsplit: int = -1) -> List[str]: ...
|
||||
def rstrip(self, chars: str = None) -> str: ...
|
||||
def split(self, sep: str = None, maxsplit: int = -1) -> List[str]: ...
|
||||
def splitlines(self, keepends: bool = False) -> List[str]: ...
|
||||
def startswith(self, prefix: Union[str, Tuple[str, ...]], start: int = None,
|
||||
end: int = None) -> bool: ...
|
||||
def strip(self, chars: str = None) -> str: ...
|
||||
def swapcase(self) -> str: ...
|
||||
def title(self) -> str: ...
|
||||
def translate(self, table: Dict[int, Any]) -> str: ...
|
||||
def upper(self) -> str: ...
|
||||
def zfill(self, width: int) -> str: ...
|
||||
@staticmethod
|
||||
@overload
|
||||
def maketrans(self, x: Union[Dict[int, Any], Dict[str, Any]]) -> Dict[int, Any]: ...
|
||||
@staticmethod
|
||||
@overload
|
||||
def maketrans(self, x: str, y: str, z: str = ...) -> Dict[int, Any]: ...
|
||||
|
||||
def __getitem__(self, i: Union[int, slice]) -> str: ...
|
||||
def __add__(self, s: str) -> str: ...
|
||||
def __mul__(self, n: int) -> str: ...
|
||||
def __rmul__(self, n: int) -> str: ...
|
||||
def __mod__(self, *args: Any) -> str: ...
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: str) -> bool: ...
|
||||
def __le__(self, x: str) -> bool: ...
|
||||
def __gt__(self, x: str) -> bool: ...
|
||||
def __ge__(self, x: str) -> bool: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, s: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def __str__(self) -> str: return self
|
||||
def __repr__(self) -> str: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class bytes(ByteString):
|
||||
@overload
|
||||
def __init__(self, ints: Iterable[int]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, string: str, encoding: str,
|
||||
errors: str = 'strict') -> None: ...
|
||||
@overload
|
||||
def __init__(self, length: int) -> None: ...
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, o: SupportsBytes) -> None: ...
|
||||
def capitalize(self) -> bytes: ...
|
||||
def center(self, width: int, fillchar: bytes = None) -> bytes: ...
|
||||
def count(self, x: bytes) -> int: ...
|
||||
def decode(self, encoding: str = 'utf-8', errors: str = 'strict') -> str: ...
|
||||
def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = 8) -> bytes: ...
|
||||
def find(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
|
||||
def index(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
|
||||
def isalnum(self) -> bool: ...
|
||||
def isalpha(self) -> bool: ...
|
||||
def isdigit(self) -> bool: ...
|
||||
def islower(self) -> bool: ...
|
||||
def isspace(self) -> bool: ...
|
||||
def istitle(self) -> bool: ...
|
||||
def isupper(self) -> bool: ...
|
||||
def join(self, iterable: Iterable[bytes]) -> bytes: ...
|
||||
def ljust(self, width: int, fillchar: bytes = None) -> bytes: ...
|
||||
def lower(self) -> bytes: ...
|
||||
def lstrip(self, chars: bytes = None) -> bytes: ...
|
||||
def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
|
||||
def replace(self, old: bytes, new: bytes, count: int = -1) -> bytes: ...
|
||||
def rfind(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
|
||||
def rindex(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
|
||||
def rjust(self, width: int, fillchar: bytes = None) -> bytes: ...
|
||||
def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
|
||||
def rsplit(self, sep: bytes = None, maxsplit: int = -1) -> List[bytes]: ...
|
||||
def rstrip(self, chars: bytes = None) -> bytes: ...
|
||||
def split(self, sep: bytes = None, maxsplit: int = -1) -> List[bytes]: ...
|
||||
def splitlines(self, keepends: bool = False) -> List[bytes]: ...
|
||||
def startswith(self, prefix: Union[bytes, Tuple[bytes, ...]]) -> bool: ...
|
||||
def strip(self, chars: bytes = None) -> bytes: ...
|
||||
def swapcase(self) -> bytes: ...
|
||||
def title(self) -> bytes: ...
|
||||
def translate(self, table: bytes) -> bytes: ...
|
||||
def upper(self) -> bytes: ...
|
||||
def zfill(self, width: int) -> bytes: ...
|
||||
# TODO fromhex
|
||||
# TODO maketrans
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> bytes: ...
|
||||
def __add__(self, s: bytes) -> bytes: ...
|
||||
def __mul__(self, n: int) -> bytes: ...
|
||||
def __rmul__(self, n: int) -> bytes: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: bytes) -> bool: ...
|
||||
def __le__(self, x: bytes) -> bool: ...
|
||||
def __gt__(self, x: bytes) -> bool: ...
|
||||
def __ge__(self, x: bytes) -> bool: ...
|
||||
|
||||
class bytearray(MutableSequence[int], ByteString):
|
||||
@overload
|
||||
def __init__(self, ints: Iterable[int]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, string: str, encoding: str, errors: str = 'strict') -> None: ...
|
||||
@overload
|
||||
def __init__(self, length: int) -> None: ...
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
def capitalize(self) -> bytearray: ...
|
||||
def center(self, width: int, fillchar: bytes = None) -> bytearray: ...
|
||||
def count(self, x: bytes) -> int: ...
|
||||
def decode(self, encoding: str = 'utf-8', errors: str = 'strict') -> str: ...
|
||||
def endswith(self, suffix: bytes) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = 8) -> bytearray: ...
|
||||
def find(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
|
||||
def index(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
|
||||
def insert(self, index: int, object: int) -> None: ...
|
||||
def isalnum(self) -> bool: ...
|
||||
def isalpha(self) -> bool: ...
|
||||
def isdigit(self) -> bool: ...
|
||||
def islower(self) -> bool: ...
|
||||
def isspace(self) -> bool: ...
|
||||
def istitle(self) -> bool: ...
|
||||
def isupper(self) -> bool: ...
|
||||
def join(self, iterable: Iterable[bytes]) -> bytearray: ...
|
||||
def ljust(self, width: int, fillchar: bytes = None) -> bytearray: ...
|
||||
def lower(self) -> bytearray: ...
|
||||
def lstrip(self, chars: bytes = None) -> bytearray: ...
|
||||
def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
|
||||
def replace(self, old: bytes, new: bytes, count: int = -1) -> bytearray: ...
|
||||
def rfind(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
|
||||
def rindex(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
|
||||
def rjust(self, width: int, fillchar: bytes = None) -> bytearray: ...
|
||||
def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
|
||||
def rsplit(self, sep: bytes = None, maxsplit: int = -1) -> List[bytearray]: ...
|
||||
def rstrip(self, chars: bytes = None) -> bytearray: ...
|
||||
def split(self, sep: bytes = None, maxsplit: int = -1) -> List[bytearray]: ...
|
||||
def splitlines(self, keepends: bool = False) -> List[bytearray]: ...
|
||||
def startswith(self, prefix: bytes) -> bool: ...
|
||||
def strip(self, chars: bytes = None) -> bytearray: ...
|
||||
def swapcase(self) -> bytearray: ...
|
||||
def title(self) -> bytearray: ...
|
||||
def translate(self, table: bytes) -> bytearray: ...
|
||||
def upper(self) -> bytearray: ...
|
||||
def zfill(self, width: int) -> bytearray: ...
|
||||
# TODO fromhex
|
||||
# TODO maketrans
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> bytearray: ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, x: int) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, s: slice, x: Sequence[int]) -> None: ...
|
||||
def __delitem__(self, i: Union[int, slice]) -> None: ...
|
||||
def __add__(self, s: bytes) -> bytearray: ...
|
||||
# TODO: Mypy complains about __add__ and __iadd__ having different signatures.
|
||||
def __iadd__(self, s: Iterable[int]) -> bytearray: ... # type: ignore
|
||||
def __mul__(self, n: int) -> bytearray: ...
|
||||
def __rmul__(self, n: int) -> bytearray: ...
|
||||
def __imul__(self, n: int) -> bytearray: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: bytes) -> bool: ...
|
||||
def __le__(self, x: bytes) -> bool: ...
|
||||
def __gt__(self, x: bytes) -> bool: ...
|
||||
def __ge__(self, x: bytes) -> bool: ...
|
||||
|
||||
class memoryview():
|
||||
# TODO arg can be any obj supporting the buffer protocol
|
||||
def __init__(self, bytearray) -> None: ...
|
||||
|
||||
class bool(int, SupportsInt, SupportsFloat):
|
||||
def __init__(self, o: object = False) -> None: ...
|
||||
|
||||
class slice:
|
||||
start = 0
|
||||
step = 0
|
||||
stop = 0
|
||||
def __init__(self, start: int, stop: int = 0, step: int = 0) -> None: ...
|
||||
|
||||
class tuple(Sequence[_T_co], Generic[_T_co]):
|
||||
def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, x: object) -> bool: ...
|
||||
@overload
|
||||
def __getitem__(self, x: int) -> _T_co: ...
|
||||
@overload
|
||||
def __getitem__(self, x: slice) -> Tuple[_T_co, ...]: ...
|
||||
def __iter__(self) -> Iterator[_T_co]: ...
|
||||
def __lt__(self, x: Tuple[_T_co, ...]) -> bool: ...
|
||||
def __le__(self, x: Tuple[_T_co, ...]) -> bool: ...
|
||||
def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ...
|
||||
def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ...
|
||||
def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ...
|
||||
def __mul__(self, n: int) -> Tuple[_T_co, ...]: ...
|
||||
def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ...
|
||||
def count(self, x: Any) -> int: ...
|
||||
def index(self, x: Any) -> int: ...
|
||||
|
||||
class function:
|
||||
# TODO not defined in builtins!
|
||||
__name__ = ... # type: str
|
||||
__qualname__ = ... # type: str
|
||||
__module__ = ... # type: str
|
||||
__code__ = ... # type: Any
|
||||
|
||||
class list(MutableSequence[_T], Generic[_T]):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, iterable: Iterable[_T]) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def copy(self) -> List[_T]: ...
|
||||
def append(self, object: _T) -> None: ...
|
||||
def extend(self, iterable: Iterable[_T]) -> None: ...
|
||||
def pop(self, index: int = -1) -> _T: ...
|
||||
def index(self, object: _T, start: int = 0, stop: int = ...) -> int: ...
|
||||
def count(self, object: _T) -> int: ...
|
||||
def insert(self, index: int, object: _T) -> None: ...
|
||||
def remove(self, object: _T) -> None: ...
|
||||
def reverse(self) -> None: ...
|
||||
def sort(self, *, key: Callable[[_T], Any] = None, reverse: bool = False) -> None: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> _T: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> List[_T]: ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, o: _T) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, s: slice, o: Sequence[_T]) -> None: ...
|
||||
def __delitem__(self, i: Union[int, slice]) -> None: ...
|
||||
def __add__(self, x: List[_T]) -> List[_T]: ...
|
||||
def __iadd__(self, x: Iterable[_T]) -> List[_T]: ...
|
||||
def __mul__(self, n: int) -> List[_T]: ...
|
||||
def __rmul__(self, n: int) -> List[_T]: ...
|
||||
def __imul__(self, n: int) -> List[_T]: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __reversed__(self) -> Iterator[_T]: ...
|
||||
def __gt__(self, x: List[_T]) -> bool: ...
|
||||
def __ge__(self, x: List[_T]) -> bool: ...
|
||||
def __lt__(self, x: List[_T]) -> bool: ...
|
||||
def __le__(self, x: List[_T]) -> bool: ...
|
||||
|
||||
class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, map: Mapping[_KT, _VT]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, iterable: Iterable[Tuple[_KT, _VT]]) -> None: ... # TODO keyword args
|
||||
def clear(self) -> None: ...
|
||||
def copy(self) -> Dict[_KT, _VT]: ...
|
||||
def get(self, k: _KT, default: _VT = None) -> _VT: ...
|
||||
def pop(self, k: _KT, default: _VT = None) -> _VT: ...
|
||||
def popitem(self) -> Tuple[_KT, _VT]: ...
|
||||
def setdefault(self, k: _KT, default: _VT = None) -> _VT: ...
|
||||
def update(self, m: Union[Mapping[_KT, _VT],
|
||||
Iterable[Tuple[_KT, _VT]]]) -> None: ...
|
||||
def keys(self) -> KeysView[_KT]: ...
|
||||
def values(self) -> ValuesView[_VT]: ...
|
||||
def items(self) -> ItemsView[_KT, _VT]: ...
|
||||
@staticmethod
|
||||
@overload
|
||||
def fromkeys(seq: Sequence[_T]) -> Dict[_T, Any]: ... # TODO: Actually a class method
|
||||
@staticmethod
|
||||
@overload
|
||||
def fromkeys(seq: Sequence[_T], value: _S) -> Dict[_T, _S]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, k: _KT) -> _VT: ...
|
||||
def __setitem__(self, k: _KT, v: _VT) -> None: ...
|
||||
def __delitem__(self, v: _KT) -> None: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def __str__(self) -> str: ...
|
||||
|
||||
class set(MutableSet[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T]=None) -> None: ...
|
||||
def add(self, element: _T) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def copy(self) -> set[_T]: ...
|
||||
def difference(self, s: Iterable[Any]) -> set[_T]: ...
|
||||
def difference_update(self, s: Iterable[Any]) -> None: ...
|
||||
def discard(self, element: _T) -> None: ...
|
||||
def intersection(self, s: Iterable[Any]) -> set[_T]: ...
|
||||
def intersection_update(self, s: Iterable[Any]) -> None: ...
|
||||
def isdisjoint(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def issubset(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def issuperset(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def pop(self) -> _T: ...
|
||||
def remove(self, element: _T) -> None: ...
|
||||
def symmetric_difference(self, s: Iterable[_T]) -> set[_T]: ...
|
||||
def symmetric_difference_update(self, s: Iterable[_T]) -> None: ...
|
||||
def union(self, s: Iterable[_T]) -> set[_T]: ...
|
||||
def update(self, s: Iterable[_T]) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __and__(self, s: AbstractSet[Any]) -> set[_T]: ...
|
||||
def __iand__(self, s: AbstractSet[Any]) -> set[_T]: ...
|
||||
def __or__(self, s: AbstractSet[_S]) -> set[Union[_T, _S]]: ...
|
||||
def __ior__(self, s: AbstractSet[_S]) -> set[Union[_T, _S]]: ...
|
||||
def __sub__(self, s: AbstractSet[Any]) -> set[_T]: ...
|
||||
def __isub__(self, s: AbstractSet[Any]) -> set[_T]: ...
|
||||
def __xor__(self, s: AbstractSet[_S]) -> set[Union[_T, _S]]: ...
|
||||
def __ixor__(self, s: AbstractSet[_S]) -> set[Union[_T, _S]]: ...
|
||||
def __le__(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def __lt__(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def __ge__(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def __gt__(self, s: AbstractSet[Any]) -> bool: ...
|
||||
# TODO more set operations
|
||||
|
||||
class frozenset(AbstractSet[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T]=None) -> None: ...
|
||||
def copy(self) -> frozenset[_T]: ...
|
||||
def difference(self, s: AbstractSet[Any]) -> frozenset[_T]: ...
|
||||
def intersection(self, s: AbstractSet[Any]) -> frozenset[_T]: ...
|
||||
def isdisjoint(self, s: AbstractSet[_T]) -> bool: ...
|
||||
def issubset(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def issuperset(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def symmetric_difference(self, s: AbstractSet[_T]) -> frozenset[_T]: ...
|
||||
def union(self, s: AbstractSet[_T]) -> frozenset[_T]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __and__(self, s: AbstractSet[_T]) -> frozenset[_T]: ...
|
||||
def __or__(self, s: AbstractSet[_S]) -> frozenset[Union[_T, _S]]: ...
|
||||
def __sub__(self, s: AbstractSet[_T]) -> frozenset[_T]: ...
|
||||
def __xor__(self, s: AbstractSet[_S]) -> frozenset[Union[_T, _S]]: ...
|
||||
def __le__(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def __lt__(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def __ge__(self, s: AbstractSet[Any]) -> bool: ...
|
||||
def __gt__(self, s: AbstractSet[Any]) -> bool: ...
|
||||
|
||||
class enumerate(Iterator[Tuple[int, _T]], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T], start: int = 0) -> None: ...
|
||||
def __iter__(self) -> Iterator[Tuple[int, _T]]: ...
|
||||
def __next__(self) -> Tuple[int, _T]: ...
|
||||
# TODO __getattribute__
|
||||
|
||||
class range(Sequence[int]):
|
||||
@overload
|
||||
def __init__(self, stop: int) -> None: ...
|
||||
@overload
|
||||
def __init__(self, start: int, stop: int, step: int = 1) -> None: ...
|
||||
def count(self, value: int) -> int: ...
|
||||
def index(self, value: int, start: int = 0, stop: int = None) -> int: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> range: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __reversed__(self) -> Iterator[int]: ...
|
||||
|
||||
class module:
|
||||
# TODO not defined in builtins!
|
||||
__name__ = ... # type: str
|
||||
__file__ = ... # type: str
|
||||
__dict__ = ... # type: Dict[str, Any]
|
||||
|
||||
True = ... # type: bool
|
||||
False = ... # type: bool
|
||||
__debug__ = False
|
||||
|
||||
NotImplemented = ... # type: Any
|
||||
|
||||
def abs(n: SupportsAbs[_T]) -> _T: ...
|
||||
def all(i: Iterable) -> bool: ...
|
||||
def any(i: Iterable) -> bool: ...
|
||||
def ascii(o: object) -> str: ...
|
||||
def bin(number: int) -> str: ...
|
||||
def callable(o: object) -> bool: ...
|
||||
def chr(code: int) -> str: ...
|
||||
def compile(source: Any, filename: Union[str, bytes], mode: str, flags: int = 0,
|
||||
dont_inherit: int = 0) -> Any: ...
|
||||
def copyright() -> None: ...
|
||||
def credits() -> None: ...
|
||||
def delattr(o: Any, name: str) -> None: ...
|
||||
def dir(o: object = None) -> List[str]: ...
|
||||
_N = TypeVar('_N', int, float)
|
||||
def divmod(a: _N, b: _N) -> Tuple[_N, _N]: ...
|
||||
def eval(source: str, globals: Dict[str, Any] = None,
|
||||
locals: Mapping[str, Any] = None) -> Any: ... # TODO code object as source
|
||||
def exec(object: str, globals: Dict[str, Any] = None,
|
||||
locals: Mapping[str, Any] = None) -> Any: ... # TODO code object as source
|
||||
def exit(code: int = None) -> None: ...
|
||||
def filter(function: Callable[[_T], Any], iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def format(o: object, format_spec: str = '') -> str: ...
|
||||
def getattr(o: Any, name: str, default: Any = None) -> Any: ...
|
||||
def globals() -> Dict[str, Any]: ...
|
||||
def hasattr(o: Any, name: str) -> bool: ...
|
||||
def hash(o: object) -> int: ...
|
||||
def help(*args: Any, **kwds: Any) -> None: ...
|
||||
def hex(i: int) -> str: ... # TODO __index__
|
||||
def id(o: object) -> int: ...
|
||||
def input(prompt: str = None) -> str: ...
|
||||
@overload
|
||||
def iter(iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def iter(function: Callable[[], _T], sentinel: _T) -> Iterator[_T]: ...
|
||||
def isinstance(o: object, t: Union[type, Tuple[type, ...]]) -> bool: ...
|
||||
def issubclass(cls: type, classinfo: type) -> bool: ...
|
||||
# TODO support this
|
||||
#def issubclass(type cld, classinfo: Sequence[type]) -> bool: ...
|
||||
def len(o: Sized) -> int: ...
|
||||
def license() -> None: ...
|
||||
def locals() -> Dict[str, Any]: ...
|
||||
@overload
|
||||
def map(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> Iterator[_S]: ...
|
||||
@overload
|
||||
def map(func: Callable[[_T1, _T2], _S], iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2]) -> Iterator[_S]: ... # TODO more than two iterables
|
||||
@overload
|
||||
def max(arg1: _T, arg2: _T, *args: _T) -> _T: ...
|
||||
@overload
|
||||
def max(iterable: Iterable[_T], key: Callable[[_T], Any] = None) -> _T: ...
|
||||
# TODO memoryview
|
||||
@overload
|
||||
def min(arg1: _T, arg2: _T, *args: _T) -> _T: ...
|
||||
@overload
|
||||
def min(iterable: Iterable[_T], key: Callable[[_T], Any] = None) -> _T: ...
|
||||
@overload
|
||||
def next(i: Iterator[_T]) -> _T: ...
|
||||
@overload
|
||||
def next(i: Iterator[_T], default: _T) -> _T: ...
|
||||
def oct(i: int) -> str: ... # TODO __index__
|
||||
def open(file: Union[str, bytes, int], mode: str = 'r', buffering: int = -1, encoding: str = None,
|
||||
errors: str = None, newline: str = None, closefd: bool = True) -> IO[Any]: ...
|
||||
def ord(c: Union[str, bytes, bytearray]) -> int: ...
|
||||
# TODO: in Python 3.2, print() does not support flush
|
||||
def print(*values: Any, sep: str = ' ', end: str = '\n', file: IO[str] = None, flush: bool = False) -> None: ...
|
||||
@overload
|
||||
def pow(x: int, y: int) -> Any: ... # The return type can be int or float, depending on y
|
||||
@overload
|
||||
def pow(x: int, y: int, z: int) -> Any: ...
|
||||
@overload
|
||||
def pow(x: float, y: float) -> float: ...
|
||||
@overload
|
||||
def pow(x: float, y: float, z: float) -> float: ...
|
||||
def quit(code: int = None) -> None: ...
|
||||
@overload
|
||||
def reversed(object: Reversible[_T]) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def reversed(object: Sequence[_T]) -> Iterator[_T]: ...
|
||||
def repr(o: object) -> str: ...
|
||||
@overload
|
||||
def round(number: float) -> int: ...
|
||||
@overload
|
||||
def round(number: float, ndigits: int) -> float: ... # Always return a float if given ndigits.
|
||||
@overload
|
||||
def round(number: SupportsRound[_T]) -> _T: ...
|
||||
@overload
|
||||
def round(number: SupportsRound[_T], ndigits: int) -> _T: ...
|
||||
def setattr(object: Any, name: str, value: Any) -> None: ...
|
||||
def sorted(iterable: Iterable[_T], *, key: Callable[[_T], Any] = None,
|
||||
reverse: bool = False) -> List[_T]: ...
|
||||
def sum(iterable: Iterable[_T], start: _T = None) -> _T: ...
|
||||
def vars(object: Any = None) -> Dict[str, Any]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1]) -> Iterator[Tuple[_T1]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2]) -> Iterator[Tuple[_T1, _T2]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3]) -> Iterator[Tuple[_T1, _T2, _T3]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4]) -> Iterator[Tuple[_T1, _T2,
|
||||
_T3, _T4]]: ... # TODO more than four iterables
|
||||
def __import__(name: str, globals: Dict[str, Any] = {}, locals: Dict[str, Any] = {},
|
||||
fromlist: List[str] = [], level: int = -1) -> Any: ...
|
||||
|
||||
# Ellipsis
|
||||
|
||||
# Actually the type of Ellipsis is <type 'ellipsis'>, but since it's
|
||||
# not exposed anywhere under that name, we make it private here.
|
||||
class ellipsis: ...
|
||||
Ellipsis = ... # type: ellipsis
|
||||
|
||||
# Exceptions
|
||||
|
||||
class BaseException:
|
||||
args = ... # type: Any
|
||||
def __init__(self, *args: Any) -> None: ...
|
||||
def with_traceback(self, tb: Any) -> BaseException: ...
|
||||
|
||||
class GeneratorExit(BaseException): ...
|
||||
class KeyboardInterrupt(BaseException): ...
|
||||
class SystemExit(BaseException):
|
||||
code = 0
|
||||
class Exception(BaseException): ...
|
||||
class ArithmeticError(Exception): ...
|
||||
class EnvironmentError(Exception):
|
||||
errno = 0
|
||||
strerror = ... # type: str
|
||||
# TODO can this be bytes?
|
||||
filename = ... # type: str
|
||||
class LookupError(Exception): ...
|
||||
class RuntimeError(Exception): ...
|
||||
class ValueError(Exception): ...
|
||||
class AssertionError(Exception): ...
|
||||
class AttributeError(Exception): ...
|
||||
class BufferError(Exception): ...
|
||||
class EOFError(Exception): ...
|
||||
class FloatingPointError(ArithmeticError): ...
|
||||
class IOError(EnvironmentError): ...
|
||||
class ImportError(Exception): ...
|
||||
class IndexError(LookupError): ...
|
||||
class KeyError(LookupError): ...
|
||||
class MemoryError(Exception): ...
|
||||
class NameError(Exception): ...
|
||||
class NotImplementedError(RuntimeError): ...
|
||||
class OSError(EnvironmentError): ...
|
||||
class BlockingIOError(OSError):
|
||||
characters_written = 0
|
||||
class ChildProcessError(OSError): ...
|
||||
class ConnectionError(OSError): ...
|
||||
class BrokenPipeError(ConnectionError): ...
|
||||
class ConnectionAbortedError(ConnectionError): ...
|
||||
class ConnectionRefusedError(ConnectionError): ...
|
||||
class ConnectionResetError(ConnectionError): ...
|
||||
class FileExistsError(OSError): ...
|
||||
class FileNotFoundError(OSError): ...
|
||||
class InterruptedError(OSError): ...
|
||||
class IsADirectoryError(OSError): ...
|
||||
class NotADirectoryError(OSError): ...
|
||||
class PermissionError(OSError): ...
|
||||
class ProcessLookupError(OSError): ...
|
||||
class TimeoutError(OSError): ...
|
||||
class WindowsError(OSError): ...
|
||||
class OverflowError(ArithmeticError): ...
|
||||
class ReferenceError(Exception): ...
|
||||
class StopIteration(Exception): ...
|
||||
class SyntaxError(Exception): ...
|
||||
class IndentationError(SyntaxError): ...
|
||||
class TabError(IndentationError): ...
|
||||
class SystemError(Exception): ...
|
||||
class TypeError(Exception): ...
|
||||
class UnboundLocalError(NameError): ...
|
||||
class UnicodeError(ValueError): ...
|
||||
class UnicodeDecodeError(UnicodeError):
|
||||
encoding = ... # type: str
|
||||
object = ... # type: bytes
|
||||
start = ... # type: int
|
||||
end = ... # type: int
|
||||
reason = ... # type: str
|
||||
def __init__(self, __encoding: str, __object: bytes, __start: int, __end: int,
|
||||
__reason: str) -> None: ...
|
||||
class UnicodeEncodeError(UnicodeError): ...
|
||||
class UnicodeTranslateError(UnicodeError): ...
|
||||
class ZeroDivisionError(ArithmeticError): ...
|
||||
|
||||
class Warning(Exception): ...
|
||||
class UserWarning(Warning): ...
|
||||
class DeprecationWarning(Warning): ...
|
||||
class SyntaxWarning(Warning): ...
|
||||
class RuntimeWarning(Warning): ...
|
||||
class FutureWarning(Warning): ...
|
||||
class PendingDeprecationWarning(Warning): ...
|
||||
class ImportWarning(Warning): ...
|
||||
class UnicodeWarning(Warning): ...
|
||||
class BytesWarning(Warning): ...
|
||||
class ResourceWarning(Warning): ...
|
||||
0
stdlib/3/bz2.pyi
Normal file
0
stdlib/3/bz2.pyi
Normal file
221
stdlib/3/datetime.pyi
Normal file
221
stdlib/3/datetime.pyi
Normal file
@@ -0,0 +1,221 @@
|
||||
# Stubs for datetime
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import Optional, SupportsAbs, Tuple, Union, overload
|
||||
|
||||
MINYEAR = 0
|
||||
MAXYEAR = 0
|
||||
|
||||
class tzinfo:
|
||||
def tzname(self, dt: Optional[datetime]) -> str: ...
|
||||
def utcoffset(self, dt: Optional[datetime]) -> int: ...
|
||||
def dst(self, dt: Optional[datetime]) -> int: ...
|
||||
def fromutc(self, dt: datetime) -> datetime: ...
|
||||
|
||||
class timezone(tzinfo):
|
||||
utc = ... # type: tzinfo
|
||||
min = ... # type: tzinfo
|
||||
max = ... # type: tzinfo
|
||||
|
||||
def __init__(self, offset: timedelta, name: str = ...) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
_tzinfo = tzinfo
|
||||
_timezone = timezone
|
||||
|
||||
class date:
|
||||
min = ... # type: date
|
||||
max = ... # type: date
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, year: int, month: int = ..., day: int = ...) -> None: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float) -> date: ...
|
||||
@classmethod
|
||||
def today(cls) -> date: ...
|
||||
@classmethod
|
||||
def fromordinal(cls, n: int) -> date: ...
|
||||
|
||||
@property
|
||||
def year(self) -> int: ...
|
||||
@property
|
||||
def month(self) -> int: ...
|
||||
@property
|
||||
def day(self) -> int: ...
|
||||
|
||||
def ctime(self) -> str: ...
|
||||
def strftime(self, fmt: str) -> str: ...
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
def isoformat(self) -> str: ...
|
||||
def timetuple(self) -> tuple: ... # TODO return type
|
||||
def toordinal(self) -> int: ...
|
||||
def replace(self, year: int = ..., month: int = ..., day: int = ...) -> date: ...
|
||||
def __le__(self, other: date) -> bool: ...
|
||||
def __lt__(self, other: date) -> bool: ...
|
||||
def __ge__(self, other: date) -> bool: ...
|
||||
def __gt__(self, other: date) -> bool: ...
|
||||
def __add__(self, other: timedelta) -> date: ...
|
||||
@overload
|
||||
def __sub__(self, other: timedelta) -> date: ...
|
||||
@overload
|
||||
def __sub__(self, other: date) -> timedelta: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def weekday(self) -> int: ...
|
||||
def isoweekday(self) -> int: ...
|
||||
def isocalendar(self) -> Tuple[int, int, int]: ...
|
||||
|
||||
class time:
|
||||
min = ... # type: time
|
||||
max = ... # type: time
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ...,
|
||||
tzinfo: tzinfo = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def hour(self) -> int: ...
|
||||
@property
|
||||
def minute(self) -> int: ...
|
||||
@property
|
||||
def second(self) -> int: ...
|
||||
@property
|
||||
def microsecond(self) -> int: ...
|
||||
@property
|
||||
def tzinfo(self) -> _tzinfo: ...
|
||||
|
||||
def __le__(self, other: time) -> bool: ...
|
||||
def __lt__(self, other: time) -> bool: ...
|
||||
def __ge__(self, other: time) -> bool: ...
|
||||
def __gt__(self, other: time) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def isoformat(self) -> str: ...
|
||||
def strftime(self, fmt: str) -> str: ...
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
def utcoffset(self) -> Optional[int]: ...
|
||||
def tzname(self) -> Optional[str]: ...
|
||||
def dst(self) -> Optional[int]: ...
|
||||
def replace(self, hour: int = ..., minute: int = ..., second: int = ...,
|
||||
microsecond: int = ..., tzinfo: Union[_tzinfo, bool] = ...) -> time: ...
|
||||
|
||||
_date = date
|
||||
_time = time
|
||||
|
||||
class timedelta(SupportsAbs[timedelta]):
|
||||
min = ... # type: timedelta
|
||||
max = ... # type: timedelta
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, days: int = ..., seconds: int = ..., microseconds: int = ...,
|
||||
milliseconds: int = ..., minutes: int = ..., hours: int = ...,
|
||||
weeks: int = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def days(self) -> int: ...
|
||||
@property
|
||||
def seconds(self) -> int: ...
|
||||
@property
|
||||
def microseconds(self) -> int: ...
|
||||
|
||||
def total_seconds(self) -> float: ...
|
||||
def __add__(self, other: timedelta) -> timedelta: ...
|
||||
def __radd__(self, other: timedelta) -> timedelta: ...
|
||||
def __sub__(self, other: timedelta) -> timedelta: ...
|
||||
def __rsub(self, other: timedelta) -> timedelta: ...
|
||||
def __neg__(self) -> timedelta: ...
|
||||
def __pos__(self) -> timedelta: ...
|
||||
def __abs__(self) -> timedelta: ...
|
||||
def __mul__(self, other: float) -> timedelta: ...
|
||||
def __rmul__(self, other: float) -> timedelta: ...
|
||||
@overload
|
||||
def __floordiv__(self, other: timedelta) -> int: ...
|
||||
@overload
|
||||
def __floordiv__(self, other: int) -> timedelta: ...
|
||||
@overload
|
||||
def __truediv__(self, other: timedelta) -> float: ...
|
||||
@overload
|
||||
def __truediv__(self, other: float) -> timedelta: ...
|
||||
def __mod__(self, other: timedelta) -> timedelta: ...
|
||||
def __divmod__(self, other: timedelta) -> Tuple[int, timedelta]: ...
|
||||
def __le__(self, other: timedelta) -> bool: ...
|
||||
def __lt__(self, other: timedelta) -> bool: ...
|
||||
def __ge__(self, other: timedelta) -> bool: ...
|
||||
def __gt__(self, other: timedelta) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
|
||||
class datetime:
|
||||
# TODO: Is a subclass of date, but this would make some types incompatible.
|
||||
min = ... # type: datetime
|
||||
max = ... # type: datetime
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, year: int, month: int = ..., day: int = ..., hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microsecond: int = ...,
|
||||
tzinfo: tzinfo = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def year(self) -> int: ...
|
||||
@property
|
||||
def month(self) -> int: ...
|
||||
@property
|
||||
def day(self) -> int: ...
|
||||
@property
|
||||
def hour(self) -> int: ...
|
||||
@property
|
||||
def minute(self) -> int: ...
|
||||
@property
|
||||
def second(self) -> int: ...
|
||||
@property
|
||||
def microsecond(self) -> int: ...
|
||||
@property
|
||||
def tzinfo(self) -> _tzinfo: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float, tz: timezone = ...) -> datetime: ...
|
||||
@classmethod
|
||||
def utcfromtimestamp(cls, t: float) -> datetime: ...
|
||||
@classmethod
|
||||
def today(cls) -> datetime: ...
|
||||
@classmethod
|
||||
def fromordinal(cls, n: int) -> datetime: ...
|
||||
@classmethod
|
||||
def now(cls, tz: timezone = ...) -> datetime: ...
|
||||
@classmethod
|
||||
def utcnow(cls) -> datetime: ...
|
||||
@classmethod
|
||||
def combine(cls, date: date, time: time) -> datetime: ...
|
||||
def strftime(self, fmt: str) -> str: ...
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
def toordinal(self) -> int: ...
|
||||
def timetuple(self) -> tuple: ... # TODO return type
|
||||
def timestamp(self) -> float: ...
|
||||
def utctimetuple(self) -> tuple: ... # TODO return type
|
||||
def date(self) -> _date: ...
|
||||
def time(self) -> _time: ...
|
||||
def timetz(self) -> _time: ...
|
||||
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
|
||||
Union[_tzinfo, bool] = ...) -> datetime: ...
|
||||
def astimezone(self, tz: timezone = ...) -> datetime: ...
|
||||
def ctime(self) -> str: ...
|
||||
def isoformat(self, sep: str = ...) -> str: ...
|
||||
@classmethod
|
||||
def strptime(cls, date_string: str, format: str) -> datetime: ...
|
||||
def utcoffset(self) -> Optional[int]: ...
|
||||
def tzname(self) -> Optional[str]: ...
|
||||
def dst(self) -> Optional[int]: ...
|
||||
def __le__(self, other: datetime) -> bool: ...
|
||||
def __lt__(self, other: datetime) -> bool: ...
|
||||
def __ge__(self, other: datetime) -> bool: ...
|
||||
def __gt__(self, other: datetime) -> bool: ...
|
||||
def __add__(self, other: timedelta) -> datetime: ...
|
||||
@overload
|
||||
def __sub__(self, other: datetime) -> timedelta: ...
|
||||
@overload
|
||||
def __sub__(self, other: timedelta) -> datetime: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def weekday(self) -> int: ...
|
||||
def isoweekday(self) -> int: ...
|
||||
def isocalendar(self) -> Tuple[int, int, int]: ...
|
||||
132
stdlib/3/errno.pyi
Normal file
132
stdlib/3/errno.pyi
Normal file
@@ -0,0 +1,132 @@
|
||||
# Stubs for errno
|
||||
|
||||
# Based on http://docs.python.org/3.2/library/errno.html
|
||||
|
||||
from typing import Dict
|
||||
|
||||
errorcode = ... # type: Dict[int, str]
|
||||
|
||||
# TODO some of the names below are platform specific
|
||||
|
||||
EPERM = 0
|
||||
ENOENT = 0
|
||||
ESRCH = 0
|
||||
EINTR = 0
|
||||
EIO = 0
|
||||
ENXIO = 0
|
||||
E2BIG = 0
|
||||
ENOEXEC = 0
|
||||
EBADF = 0
|
||||
ECHILD = 0
|
||||
EAGAIN = 0
|
||||
ENOMEM = 0
|
||||
EACCES = 0
|
||||
EFAULT = 0
|
||||
ENOTBLK = 0
|
||||
EBUSY = 0
|
||||
EEXIST = 0
|
||||
EXDEV = 0
|
||||
ENODEV = 0
|
||||
ENOTDIR = 0
|
||||
EISDIR = 0
|
||||
EINVAL = 0
|
||||
ENFILE = 0
|
||||
EMFILE = 0
|
||||
ENOTTY = 0
|
||||
ETXTBSY = 0
|
||||
EFBIG = 0
|
||||
ENOSPC = 0
|
||||
ESPIPE = 0
|
||||
EROFS = 0
|
||||
EMLINK = 0
|
||||
EPIPE = 0
|
||||
EDOM = 0
|
||||
ERANGE = 0
|
||||
EDEADLK = 0
|
||||
ENAMETOOLONG = 0
|
||||
ENOLCK = 0
|
||||
ENOSYS = 0
|
||||
ENOTEMPTY = 0
|
||||
ELOOP = 0
|
||||
EWOULDBLOCK = 0
|
||||
ENOMSG = 0
|
||||
EIDRM = 0
|
||||
ECHRNG = 0
|
||||
EL2NSYNC = 0
|
||||
EL3HLT = 0
|
||||
EL3RST = 0
|
||||
ELNRNG = 0
|
||||
EUNATCH = 0
|
||||
ENOCSI = 0
|
||||
EL2HLT = 0
|
||||
EBADE = 0
|
||||
EBADR = 0
|
||||
EXFULL = 0
|
||||
ENOANO = 0
|
||||
EBADRQC = 0
|
||||
EBADSLT = 0
|
||||
EDEADLOCK = 0
|
||||
EBFONT = 0
|
||||
ENOSTR = 0
|
||||
ENODATA = 0
|
||||
ETIME = 0
|
||||
ENOSR = 0
|
||||
ENONET = 0
|
||||
ENOPKG = 0
|
||||
EREMOTE = 0
|
||||
ENOLINK = 0
|
||||
EADV = 0
|
||||
ESRMNT = 0
|
||||
ECOMM = 0
|
||||
EPROTO = 0
|
||||
EMULTIHOP = 0
|
||||
EDOTDOT = 0
|
||||
EBADMSG = 0
|
||||
EOVERFLOW = 0
|
||||
ENOTUNIQ = 0
|
||||
EBADFD = 0
|
||||
EREMCHG = 0
|
||||
ELIBACC = 0
|
||||
ELIBBAD = 0
|
||||
ELIBSCN = 0
|
||||
ELIBMAX = 0
|
||||
ELIBEXEC = 0
|
||||
EILSEQ = 0
|
||||
ERESTART = 0
|
||||
ESTRPIPE = 0
|
||||
EUSERS = 0
|
||||
ENOTSOCK = 0
|
||||
EDESTADDRREQ = 0
|
||||
EMSGSIZE = 0
|
||||
EPROTOTYPE = 0
|
||||
ENOPROTOOPT = 0
|
||||
EPROTONOSUPPORT = 0
|
||||
ESOCKTNOSUPPORT = 0
|
||||
EOPNOTSUPP = 0
|
||||
EPFNOSUPPORT = 0
|
||||
EAFNOSUPPORT = 0
|
||||
EADDRINUSE = 0
|
||||
EADDRNOTAVAIL = 0
|
||||
ENETDOWN = 0
|
||||
ENETUNREACH = 0
|
||||
ENETRESET = 0
|
||||
ECONNABORTED = 0
|
||||
ECONNRESET = 0
|
||||
ENOBUFS = 0
|
||||
EISCONN = 0
|
||||
ENOTCONN = 0
|
||||
ESHUTDOWN = 0
|
||||
ETOOMANYREFS = 0
|
||||
ETIMEDOUT = 0
|
||||
ECONNREFUSED = 0
|
||||
EHOSTDOWN = 0
|
||||
EHOSTUNREACH = 0
|
||||
EALREADY = 0
|
||||
EINPROGRESS = 0
|
||||
ESTALE = 0
|
||||
EUCLEAN = 0
|
||||
ENOTNAM = 0
|
||||
ENAVAIL = 0
|
||||
EISNAM = 0
|
||||
EREMOTEIO = 0
|
||||
EDQUOT = 0
|
||||
11
stdlib/3/fcntl.pyi
Normal file
11
stdlib/3/fcntl.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
# Stubs for fcntl
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
import typing
|
||||
|
||||
FD_CLOEXEC = 0
|
||||
F_GETFD = 0
|
||||
F_SETFD = 0
|
||||
|
||||
def fcntl(fd: int, op: int, arg: int = ...) -> int: ...
|
||||
10
stdlib/3/gc.pyi
Normal file
10
stdlib/3/gc.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
# Stubs for gc
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
import typing
|
||||
|
||||
def collect(generation: int = ...) -> int: ...
|
||||
def disable() -> None: ...
|
||||
def enable() -> None: ...
|
||||
def isenabled() -> bool: ...
|
||||
13
stdlib/3/grp.pyi
Normal file
13
stdlib/3/grp.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from typing import List
|
||||
|
||||
# TODO group database entry object type
|
||||
|
||||
class struct_group:
|
||||
gr_name = ... # type: str
|
||||
gr_passwd = ... # type: str
|
||||
gr_gid = 0
|
||||
gr_mem = ... # type: List[str]
|
||||
|
||||
def getgrgid(gid: int) -> struct_group: ...
|
||||
def getgrnam(name: str) -> struct_group: ...
|
||||
def getgrall() -> List[struct_group]: ...
|
||||
10
stdlib/3/imp.pyi
Normal file
10
stdlib/3/imp.pyi
Normal file
@@ -0,0 +1,10 @@
|
||||
# Stubs for imp
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import TypeVar
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
def cache_from_source(path: str, debug_override: bool = ...) -> str: ...
|
||||
def reload(module: _T) -> _T: ... # TODO imprecise signature
|
||||
57
stdlib/3/itertools.pyi
Normal file
57
stdlib/3/itertools.pyi
Normal file
@@ -0,0 +1,57 @@
|
||||
# Stubs for itertools
|
||||
|
||||
# Based on http://docs.python.org/3.2/library/itertools.html
|
||||
|
||||
from typing import (Iterator, TypeVar, Iterable, overload, Any, Callable, Tuple,
|
||||
Union, Sequence)
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_S = TypeVar('_S')
|
||||
|
||||
def count(start: int = ...,
|
||||
step: int = ...) -> Iterator[int]: ... # more general types?
|
||||
def cycle(iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
|
||||
@overload
|
||||
def repeat(object: _T) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def repeat(object: _T, times: int) -> Iterator[_T]: ...
|
||||
|
||||
def accumulate(iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def chain(*iterables: Iterable[_T]) -> Iterator[_T]: ...
|
||||
# TODO chain.from_Iterable
|
||||
def compress(data: Iterable[_T], selectors: Iterable[Any]) -> Iterator[_T]: ...
|
||||
def dropwhile(predicate: Callable[[_T], Any],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def filterfalse(predicate: Callable[[_T], Any],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
|
||||
@overload
|
||||
def groupby(iterable: Iterable[_T]) -> Iterator[Tuple[_T, Iterator[_T]]]: ...
|
||||
@overload
|
||||
def groupby(iterable: Iterable[_T],
|
||||
key: Callable[[_T], _S]) -> Iterator[Tuple[_S, Iterator[_T]]]: ...
|
||||
|
||||
@overload
|
||||
def islice(iterable: Iterable[_T], stop: int) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def islice(iterable: Iterable[_T], start: int, stop: int,
|
||||
step: int = ...) -> Iterator[_T]: ...
|
||||
|
||||
def starmap(func: Any, iterable: Iterable[Any]) -> Iterator[Any]: ...
|
||||
def takewhile(predicate: Callable[[_T], Any],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def tee(iterable: Iterable[Any], n: int = ...) -> Iterator[Any]: ...
|
||||
def zip_longest(*p: Iterable[Any],
|
||||
fillvalue: Any = ...) -> Iterator[Any]: ...
|
||||
|
||||
# TODO: Return type should be Iterator[Tuple[..]], but unknown tuple shape.
|
||||
# Iterator[Sequence[_T]] loses this type information.
|
||||
def product(*p: Iterable[_T], repeat: int = ...) -> Iterator[Sequence[_T]]: ...
|
||||
|
||||
def permutations(iterable: Iterable[_T],
|
||||
r: Union[int, None] = ...) -> Iterator[Sequence[_T]]: ...
|
||||
def combinations(iterable: Iterable[_T],
|
||||
r: int) -> Iterable[Sequence[_T]]: ...
|
||||
def combinations_with_replacement(iterable: Iterable[_T],
|
||||
r: int) -> Iterable[Sequence[_T]]: ...
|
||||
7
stdlib/3/posix.pyi
Normal file
7
stdlib/3/posix.pyi
Normal file
@@ -0,0 +1,7 @@
|
||||
# Stubs for posix
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
import typing
|
||||
from os import stat_result
|
||||
|
||||
18
stdlib/3/pwd.pyi
Normal file
18
stdlib/3/pwd.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
# Stubs for pwd
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
import typing
|
||||
|
||||
class struct_passwd:
|
||||
# TODO use namedtuple
|
||||
pw_name = ... # type: str
|
||||
pw_passwd = ... # type: str
|
||||
pw_uid = 0
|
||||
pw_gid = 0
|
||||
pw_gecos = ... # type: str
|
||||
pw_dir = ... # type: str
|
||||
pw_shell = ... # type: str
|
||||
|
||||
def getpwuid(uid: int) -> struct_passwd: ...
|
||||
def getpwnam(name: str) -> struct_passwd: ...
|
||||
13
stdlib/3/resource.pyi
Normal file
13
stdlib/3/resource.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
# Stubs for resource
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import Tuple
|
||||
|
||||
RLIMIT_CORE = 0
|
||||
|
||||
def getrlimit(resource: int) -> Tuple[int, int]: ...
|
||||
def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ...
|
||||
|
||||
# NOTE: This is an alias of OSError in Python 3.3.
|
||||
class error(Exception): ...
|
||||
27
stdlib/3/select.pyi
Normal file
27
stdlib/3/select.pyi
Normal file
@@ -0,0 +1,27 @@
|
||||
# Stubs for select
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from typing import Any, Tuple, List, Sequence
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
POLLIN = 0
|
||||
POLLPRI = 0
|
||||
POLLOUT = 0
|
||||
POLLERR = 0
|
||||
POLLHUP = 0
|
||||
POLLNVAL = 0
|
||||
|
||||
class poll:
|
||||
def __init__(self) -> None: ...
|
||||
def register(self, fd: Any,
|
||||
eventmask: int = ...) -> None: ...
|
||||
def modify(self, fd: Any, eventmask: int) -> None: ...
|
||||
def unregister(self, fd: Any) -> None: ...
|
||||
def poll(self, timeout: int = ...) -> List[Tuple[int, int]]: ...
|
||||
|
||||
def select(rlist: Sequence, wlist: Sequence, xlist: Sequence,
|
||||
timeout: float = ...) -> Tuple[List[int],
|
||||
List[int],
|
||||
List[int]]: ...
|
||||
117
stdlib/3/signal.pyi
Normal file
117
stdlib/3/signal.pyi
Normal file
@@ -0,0 +1,117 @@
|
||||
"""Stub file for the 'signal' module."""
|
||||
|
||||
from typing import Any, Callable, List, Tuple, Dict, Generic, Union, Optional, Iterable, Set
|
||||
from types import FrameType
|
||||
|
||||
class ItimerError(IOError): ...
|
||||
|
||||
ITIMER_PROF = ... # type: int
|
||||
ITIMER_REAL = ... # type: int
|
||||
ITIMER_VIRTUAL = ... # type: int
|
||||
|
||||
NSIG = ... # type: int
|
||||
SIGABRT = ... # type: int
|
||||
SIGALRM = ... # type: int
|
||||
SIGBUS = ... # type: int
|
||||
SIGCHLD = ... # type: int
|
||||
SIGCLD = ... # type: int
|
||||
SIGCONT = ... # type: int
|
||||
SIGFPE = ... # type: int
|
||||
SIGHUP = ... # type: int
|
||||
SIGILL = ... # type: int
|
||||
SIGINT = ... # type: int
|
||||
SIGIO = ... # type: int
|
||||
SIGIOT = ... # type: int
|
||||
SIGKILL = ... # type: int
|
||||
SIGPIPE = ... # type: int
|
||||
SIGPOLL = ... # type: int
|
||||
SIGPROF = ... # type: int
|
||||
SIGPWR = ... # type: int
|
||||
SIGQUIT = ... # type: int
|
||||
SIGRTMAX = ... # type: int
|
||||
SIGRTMIN = ... # type: int
|
||||
SIGSEGV = ... # type: int
|
||||
SIGSTOP = ... # type: int
|
||||
SIGSYS = ... # type: int
|
||||
SIGTERM = ... # type: int
|
||||
SIGTRAP = ... # type: int
|
||||
SIGTSTP = ... # type: int
|
||||
SIGTTIN = ... # type: int
|
||||
SIGTTOU = ... # type: int
|
||||
SIGURG = ... # type: int
|
||||
SIGUSR1 = ... # type: int
|
||||
SIGUSR2 = ... # type: int
|
||||
SIGVTALRM = ... # type: int
|
||||
SIGWINCH = ... # type: int
|
||||
SIGXCPU = ... # type: int
|
||||
SIGXFSZ = ... # type: int
|
||||
|
||||
SIG_DFL = ... # type: int
|
||||
SIG_IGN = ... # type: int
|
||||
|
||||
CTRL_C_EVENT = 0 # Windows
|
||||
CTRL_BREAK_EVENT = 0 # Windows
|
||||
|
||||
SIG_BLOCK = ... # type: int
|
||||
SIG_UNBLOCK = ... # type: int
|
||||
SIG_SETMASK = ... # type: int
|
||||
|
||||
_HANDLER = Union[Callable[[int, FrameType], None], int, None]
|
||||
|
||||
class struct_siginfo(Tuple[int, int, int, int, int, int, int]):
|
||||
def __init__(self, sequence: Iterable[int]) -> None: ...
|
||||
@property
|
||||
def si_signo(self) -> int: ...
|
||||
@property
|
||||
def si_code(self) -> int: ...
|
||||
@property
|
||||
def si_errno(self) -> int: ...
|
||||
@property
|
||||
def si_pid(self) -> int: ...
|
||||
@property
|
||||
def si_uid(self) -> int: ...
|
||||
@property
|
||||
def si_status(self) -> int: ...
|
||||
@property
|
||||
def si_band(self) -> int: ...
|
||||
|
||||
def alarm(time: int) -> int: ...
|
||||
|
||||
def default_int_handler(signum: int, frame: FrameType) -> None:
|
||||
raise KeyboardInterrupt()
|
||||
|
||||
def getitimer(which: int) -> Tuple[float, float]: ...
|
||||
|
||||
def getsignal(signalnum: int) -> _HANDLER:
|
||||
raise ValueError()
|
||||
|
||||
def pause() -> None: ...
|
||||
|
||||
def pthread_kill(thread_id: int, signum: int) -> None:
|
||||
raise OSError()
|
||||
|
||||
def pthread_sigmask(how: int, mask: Iterable[int]) -> Set[int]:
|
||||
raise OSError()
|
||||
|
||||
def set_wakeup_fd(fd: int) -> int: ...
|
||||
|
||||
def setitimer(which: int, seconds: float, interval: float = ...) -> Tuple[float, float]: ...
|
||||
|
||||
def siginterrupt(signalnum: int, flag: bool) -> None:
|
||||
raise OSError()
|
||||
|
||||
def signal(signalnum: int, handler: _HANDLER) -> _HANDLER:
|
||||
raise OSError()
|
||||
|
||||
def sigpending() -> Any:
|
||||
raise OSError()
|
||||
|
||||
def sigtimedwait(sigset: Iterable[int], timeout: float) -> Optional[struct_siginfo]:
|
||||
raise OSError()
|
||||
raise ValueError()
|
||||
|
||||
def sigwait(sigset: Iterable[int]) -> int:
|
||||
raise OSError()
|
||||
|
||||
def sigwaitinfo(sigset: Iterable[int]) -> struct_siginfo:
|
||||
raise OSError()
|
||||
154
stdlib/3/sys.pyi
Normal file
154
stdlib/3/sys.pyi
Normal file
@@ -0,0 +1,154 @@
|
||||
# Stubs for sys
|
||||
# Ron Murawski <ron@horizonchess.com>
|
||||
|
||||
# based on http://docs.python.org/3.2/library/sys.html
|
||||
|
||||
from typing import (
|
||||
List, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, Union
|
||||
)
|
||||
from types import TracebackType
|
||||
|
||||
# ----- sys variables -----
|
||||
abiflags = ... # type: str
|
||||
argv = ... # type: List[str]
|
||||
byteorder = ... # type: str
|
||||
builtin_module_names = ... # type: Sequence[str] # actually a tuple of strings
|
||||
copyright = ... # type: str
|
||||
#dllhandle = 0 # Windows only
|
||||
dont_write_bytecode = False
|
||||
__displayhook__ = ... # type: Any # contains the original value of displayhook
|
||||
__excepthook__ = ... # type: Any # contains the original value of excepthook
|
||||
exec_prefix = ... # type: str
|
||||
executable = ... # type: str
|
||||
float_repr_style = ... # type: str
|
||||
hexversion = 0 # this is a 32-bit int
|
||||
last_type = ... # type: Any
|
||||
last_value = ... # type: Any
|
||||
last_traceback = ... # type: Any
|
||||
maxsize = 0
|
||||
maxunicode = 0
|
||||
meta_path = ... # type: List[Any]
|
||||
modules = ... # type: Dict[str, Any]
|
||||
path = ... # type: List[str]
|
||||
path_hooks = ... # type: List[Any] # TODO precise type; function, path to finder
|
||||
path_importer_cache = ... # type: Dict[str, Any] # TODO precise type
|
||||
platform = ... # type: str
|
||||
prefix = ... # type: str
|
||||
ps1 = ... # type: str
|
||||
ps2 = ... # type: str
|
||||
stdin = ... # type: TextIO
|
||||
stdout = ... # type: TextIO
|
||||
stderr = ... # type: TextIO
|
||||
__stdin__ = ... # type: TextIO
|
||||
__stdout__ = ... # type: TextIO
|
||||
__stderr__ = ... # type: TextIO
|
||||
# deprecated and removed in Python 3.3:
|
||||
subversion = ... # type: Tuple[str, str, str]
|
||||
tracebacklimit = 0
|
||||
version = ... # type: str
|
||||
api_version = 0
|
||||
warnoptions = ... # type: Any
|
||||
# Each entry is a tuple of the form (action, message, category, module,
|
||||
# lineno)
|
||||
#winver = '' # Windows only
|
||||
_xoptions = ... # type: Dict[Any, Any]
|
||||
|
||||
flags = ... # type: _flags
|
||||
class _flags:
|
||||
debug = 0
|
||||
division_warning = 0
|
||||
inspect = 0
|
||||
interactive = 0
|
||||
optimize = 0
|
||||
dont_write_bytecode = 0
|
||||
no_user_site = 0
|
||||
no_site = 0
|
||||
ignore_environment = 0
|
||||
verbose = 0
|
||||
bytes_warning = 0
|
||||
quiet = 0
|
||||
hash_randomization = 0
|
||||
|
||||
float_info = ... # type: _float_info
|
||||
class _float_info:
|
||||
epsilon = 0.0 # DBL_EPSILON
|
||||
dig = 0 # DBL_DIG
|
||||
mant_dig = 0 # DBL_MANT_DIG
|
||||
max = 0.0 # DBL_MAX
|
||||
max_exp = 0 # DBL_MAX_EXP
|
||||
max_10_exp = 0 # DBL_MAX_10_EXP
|
||||
min = 0.0 # DBL_MIN
|
||||
min_exp = 0 # DBL_MIN_EXP
|
||||
min_10_exp = 0 # DBL_MIN_10_EXP
|
||||
radix = 0 # FLT_RADIX
|
||||
rounds = 0 # FLT_ROUNDS
|
||||
|
||||
hash_info = ... # type: _hash_info
|
||||
class _hash_info:
|
||||
width = 0 # width in bits used for hash values
|
||||
modulus = 0 # prime modulus P used for numeric hash scheme
|
||||
inf = 0 # hash value returned for a positive infinity
|
||||
nan = 0 # hash value returned for a nan
|
||||
imag = 0 # multiplier used for the imaginary part of a complex number
|
||||
|
||||
int_info = ... # type: _int_info
|
||||
class _int_info:
|
||||
bits_per_digit = 0 # number of bits held in each digit. Python integers
|
||||
# are stored internally in
|
||||
# base 2**int_info.bits_per_digit
|
||||
sizeof_digit = 0 # size in bytes of C type used to represent a digit
|
||||
|
||||
class _version_info(Tuple[int, int, int, str, int]):
|
||||
major = 0
|
||||
minor = 0
|
||||
micro = 0
|
||||
releaselevel = ... # type: str
|
||||
serial = 0
|
||||
version_info = ... # type: _version_info
|
||||
|
||||
|
||||
# ----- sys function stubs -----
|
||||
def call_tracing(fn: Any, args: Any) -> object: ...
|
||||
def _clear_type_cache() -> None: ...
|
||||
def _current_frames() -> Dict[int, Any]: ...
|
||||
def displayhook(value: Optional[int]) -> None: ...
|
||||
def excepthook(type_: type, value: BaseException,
|
||||
traceback: TracebackType) -> None: ...
|
||||
def exc_info() -> Tuple[type, BaseException, TracebackType]: ...
|
||||
def exit(arg: Union[int, str] = ...) -> None: ...
|
||||
def getcheckinterval() -> int: ... # deprecated
|
||||
def getdefaultencoding() -> str: ...
|
||||
def getdlopenflags() -> int: ... # Unix only
|
||||
def getfilesystemencoding() -> str: ... # cannot return None
|
||||
def getrefcount(object) -> int: ...
|
||||
def getrecursionlimit() -> int: ...
|
||||
|
||||
@overload
|
||||
def getsizeof(obj: object) -> int: ...
|
||||
@overload
|
||||
def getsizeof(obj: object, default: int) -> int: ...
|
||||
|
||||
def getswitchinterval() -> float: ...
|
||||
|
||||
@overload
|
||||
def _getframe() -> Any: ...
|
||||
@overload
|
||||
def _getframe(depth: int) -> Any: ...
|
||||
|
||||
def getprofile() -> Any: ... # TODO return type
|
||||
def gettrace() -> Any: ... # TODO return
|
||||
def getwindowsversion() -> Any: ... # Windows only, TODO return type
|
||||
def intern(string: str) -> str: ...
|
||||
def setcheckinterval(interval: int) -> None: ... # deprecated
|
||||
def setdlopenflags(n: int) -> None: ... # Linux only
|
||||
def setprofile(profilefunc: Any) -> None: ... # TODO type
|
||||
def setrecursionlimit(limit: int) -> None: ...
|
||||
def setswitchinterval(interval: float) -> None: ...
|
||||
def settrace(tracefunc: Any) -> None: ... # TODO type
|
||||
# Trace functions should have three arguments: frame, event, and arg. frame
|
||||
# is the current stack frame. event is a string: 'call', 'line', 'return',
|
||||
# 'exception', 'c_call', 'c_return', or 'c_exception'. arg depends on the
|
||||
# event type.
|
||||
def settscdump(on_flag: bool) -> None: ...
|
||||
|
||||
def gettotalrefcount() -> int: ... # Debug builds only
|
||||
64
stdlib/3/time.pyi
Normal file
64
stdlib/3/time.pyi
Normal file
@@ -0,0 +1,64 @@
|
||||
# Stubs for time
|
||||
# Ron Murawski <ron@horizonchess.com>
|
||||
|
||||
# based on: http://docs.python.org/3.2/library/time.html#module-time
|
||||
# see: http://nullege.com/codes/search?cq=time
|
||||
|
||||
from typing import Tuple, Union
|
||||
|
||||
# ----- variables and constants -----
|
||||
accept2dyear = False
|
||||
altzone = 0
|
||||
daylight = 0
|
||||
timezone = 0
|
||||
tzname = ... # type: Tuple[str, str]
|
||||
|
||||
|
||||
# ----- classes/methods -----
|
||||
class struct_time:
|
||||
# this is supposed to be a namedtuple object
|
||||
# namedtuple is not yet implemented (see file: mypy/stubs/collections.py)
|
||||
# see: http://docs.python.org/3.2/library/time.html#time.struct_time
|
||||
# see: http://nullege.com/codes/search/time.struct_time
|
||||
# TODO: namedtuple() object problem
|
||||
#namedtuple __init__(self, int, int, int, int, int, int, int, int, int):
|
||||
# ...
|
||||
tm_year = 0
|
||||
tm_mon = 0
|
||||
tm_mday = 0
|
||||
tm_hour = 0
|
||||
tm_min = 0
|
||||
tm_sec = 0
|
||||
tm_wday = 0
|
||||
tm_yday = 0
|
||||
tm_isdst = 0
|
||||
|
||||
|
||||
# ----- functions -----
|
||||
def asctime(t: Union[Tuple[int, int, int, int, int, int, int, int, int],
|
||||
struct_time,
|
||||
None] = ...) -> str: ... # return current time
|
||||
|
||||
def clock() -> float: ...
|
||||
|
||||
def ctime(secs: Union[float, None] = ...) -> str: ... # return current time
|
||||
|
||||
def gmtime(secs: Union[float, None] = ...) -> struct_time: ... # return current time
|
||||
|
||||
def localtime(secs: Union[float, None] = ...) -> struct_time: ... # return current time
|
||||
|
||||
def mktime(t: Union[Tuple[int, int, int, int, int,
|
||||
int, int, int, int],
|
||||
struct_time]) -> float: ...
|
||||
|
||||
def sleep(secs: Union[int, float]) -> None: ...
|
||||
|
||||
def strftime(format: str, t: Union[Tuple[int, int, int, int, int,
|
||||
int, int, int, int],
|
||||
struct_time,
|
||||
None] = ...) -> str: ... # return current time
|
||||
|
||||
def strptime(string: str,
|
||||
format: str = ...) -> struct_time: ...
|
||||
def time() -> float: ...
|
||||
def tzset() -> None: ... # Unix only
|
||||
37
stdlib/3/unicodedata.pyi
Normal file
37
stdlib/3/unicodedata.pyi
Normal file
@@ -0,0 +1,37 @@
|
||||
# Stubs for unicodedata (Python 3.4)
|
||||
#
|
||||
# NOTE: This dynamically typed stub was automatically generated by stubgen.
|
||||
|
||||
from typing import Any
|
||||
|
||||
ucd_3_2_0 = ... # type: Any
|
||||
ucnhash_CAPI = ... # type: Any
|
||||
unidata_version = ... # type: str
|
||||
|
||||
def bidirectional(unichr): ...
|
||||
def category(unichr): ...
|
||||
def combining(unichr): ...
|
||||
def decimal(chr, default=...): ...
|
||||
def decomposition(unichr): ...
|
||||
def digit(chr, default=...): ...
|
||||
def east_asian_width(unichr): ...
|
||||
def lookup(name): ...
|
||||
def mirrored(unichr): ...
|
||||
def name(chr, default=...): ...
|
||||
def normalize(form, unistr): ...
|
||||
def numeric(chr, default=...): ...
|
||||
|
||||
class UCD:
|
||||
unidata_version = ... # type: Any
|
||||
def bidirectional(self, unichr): ...
|
||||
def category(self, unichr): ...
|
||||
def combining(self, unichr): ...
|
||||
def decimal(self, chr, default=...): ...
|
||||
def decomposition(self, unichr): ...
|
||||
def digit(self, chr, default=...): ...
|
||||
def east_asian_width(self, unichr): ...
|
||||
def lookup(self, name): ...
|
||||
def mirrored(self, unichr): ...
|
||||
def name(self, chr, default=...): ...
|
||||
def normalize(self, form, unistr): ...
|
||||
def numeric(self, chr, default=...): ...
|
||||
32
stdlib/3/zlib.pyi
Normal file
32
stdlib/3/zlib.pyi
Normal file
@@ -0,0 +1,32 @@
|
||||
# Stubs for zlib (Python 3.4)
|
||||
#
|
||||
# NOTE: This stub was automatically generated by stubgen.
|
||||
|
||||
# TODO: Compress and Decompress classes are not published by the module.
|
||||
|
||||
DEFLATED = ... # type: int
|
||||
DEF_BUF_SIZE = ... # type: int
|
||||
DEF_MEM_LEVEL = ... # type: int
|
||||
MAX_WBITS = ... # type: int
|
||||
ZLIB_RUNTIME_VERSION = ... # type: str
|
||||
ZLIB_VERSION = ... # type: str
|
||||
Z_BEST_COMPRESSION = ... # type: int
|
||||
Z_BEST_SPEED = ... # type: int
|
||||
Z_DEFAULT_COMPRESSION = ... # type: int
|
||||
Z_DEFAULT_STRATEGY = ... # type: int
|
||||
Z_FILTERED = ... # type: int
|
||||
Z_FINISH = ... # type: int
|
||||
Z_FULL_FLUSH = ... # type: int
|
||||
Z_HUFFMAN_ONLY = ... # type: int
|
||||
Z_NO_FLUSH = ... # type: int
|
||||
Z_SYNC_FLUSH = ... # type: int
|
||||
|
||||
def adler32(data, value=...) -> int: ...
|
||||
def compress(data, level: int = ...): ...
|
||||
def compressobj(level=..., method=..., wbits=..., memlevel=...,
|
||||
strategy=..., zdict=...): ...
|
||||
def crc32(data, value=...) -> int: ...
|
||||
def decompress(data, wbits=..., bufsize=...): ...
|
||||
def decompressobj(wbits=..., zdict=...): ...
|
||||
|
||||
class error(Exception): ...
|
||||
Reference in New Issue
Block a user