mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 13:02:22 +08:00
Move contents of builtins/* to stdlib/*. This simplifies finding stubs.
This commit is contained in:
826
stdlib/2.7/__builtin__.pyi
Normal file
826
stdlib/2.7/__builtin__.pyi
Normal file
@@ -0,0 +1,826 @@
|
||||
# Stubs for builtins (Python 2.7)
|
||||
|
||||
from typing import (
|
||||
TypeVar, Iterator, Iterable, overload,
|
||||
Sequence, Mapping, Tuple, List, Any, Dict, Callable, Generic, Set,
|
||||
AbstractSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs,
|
||||
SupportsRound, IO, BinaryIO, Union, AnyStr, MutableSequence, MutableMapping,
|
||||
MutableSet
|
||||
)
|
||||
from abc import abstractmethod, ABCMeta
|
||||
|
||||
_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() # Special, only valid as a decorator.
|
||||
classmethod = object() # Special, 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
|
||||
__module__ = ... # type: str
|
||||
__dict__ = ... # type: Dict[unicode, Any]
|
||||
|
||||
@overload
|
||||
def __init__(self, o: object) -> None: ...
|
||||
@overload
|
||||
def __init__(self, name: str, bases: Tuple[type, ...], dict: Dict[str, Any]) -> None: ...
|
||||
# TODO: __new__ may have to be special and not a static method.
|
||||
@staticmethod
|
||||
def __new__(cls, name: str, bases: Tuple[type, ...], namespace: Dict[str, Any]) -> type: ...
|
||||
|
||||
class int(SupportsInt, SupportsFloat, SupportsAbs[int]):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, x: SupportsInt) -> None: ...
|
||||
@overload
|
||||
def __init__(self, x: Union[str, unicode, bytearray], base: int = 10) -> None: ...
|
||||
def bit_length(self) -> int: ...
|
||||
|
||||
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 __div__(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 __rdiv__(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]):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, x: SupportsFloat) -> None: ...
|
||||
@overload
|
||||
def __init__(self, x: unicode) -> None: ...
|
||||
@overload
|
||||
def __init__(self, x: bytearray) -> 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 __div__(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 __rdiv__(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: return self
|
||||
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 __div__(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 __rdiv__(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 basestring(metaclass=ABCMeta): ...
|
||||
|
||||
class unicode(basestring, Sequence[unicode]):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, o: object) -> None: ...
|
||||
@overload
|
||||
def __init__(self, o: str, encoding: unicode = ..., errors: unicode = 'strict') -> None: ...
|
||||
def capitalize(self) -> unicode: ...
|
||||
def center(self, width: int, fillchar: unicode = u' ') -> unicode: ...
|
||||
def count(self, x: unicode) -> int: ...
|
||||
def decode(self, encoding: unicode = 'utf-8', errors: unicode = 'strict') -> unicode: ...
|
||||
def encode(self, encoding: unicode = 'utf-8', errors: unicode = 'strict') -> str: ...
|
||||
def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]], start: int = 0,
|
||||
end: int = ...) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = 8) -> unicode: ...
|
||||
def find(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
|
||||
def format(self, *args: Any, **kwargs: Any) -> unicode: ...
|
||||
def format_map(self, map: Mapping[unicode, Any]) -> unicode: ...
|
||||
def index(self, sub: unicode, 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[unicode]) -> unicode: ...
|
||||
def ljust(self, width: int, fillchar: unicode = u' ') -> unicode: ...
|
||||
def lower(self) -> unicode: ...
|
||||
def lstrip(self, chars: unicode = ...) -> unicode: ...
|
||||
def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
|
||||
def replace(self, old: unicode, new: unicode, count: int = ...) -> unicode: ...
|
||||
def rfind(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
|
||||
def rindex(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
|
||||
def rjust(self, width: int, fillchar: unicode = u' ') -> unicode: ...
|
||||
def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
|
||||
def rsplit(self, sep: unicode = ..., maxsplit: int = ...) -> List[unicode]: ...
|
||||
def rstrip(self, chars: unicode = ...) -> unicode: ...
|
||||
def split(self, sep: unicode = ..., maxsplit: int = ...) -> List[unicode]: ...
|
||||
def splitlines(self, keepends: bool = False) -> List[unicode]: ...
|
||||
def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]], start: int = 0,
|
||||
end: int = ...) -> bool: ...
|
||||
def strip(self, chars: unicode = ...) -> unicode: ...
|
||||
def swapcase(self) -> unicode: ...
|
||||
def title(self) -> unicode: ...
|
||||
def translate(self, table: Union[Dict[int, Any], unicode]) -> unicode: ...
|
||||
def upper(self) -> unicode: ...
|
||||
def zfill(self, width: int) -> unicode: ...
|
||||
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> unicode: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> unicode: ...
|
||||
def __getslice__(self, start: int, stop: int) -> unicode: ...
|
||||
def __add__(self, s: unicode) -> unicode: ...
|
||||
def __mul__(self, n: int) -> unicode: ...
|
||||
def __mod__(self, x: Any) -> unicode: ...
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: unicode) -> bool: ...
|
||||
def __le__(self, x: unicode) -> bool: ...
|
||||
def __gt__(self, x: unicode) -> bool: ...
|
||||
def __ge__(self, x: unicode) -> bool: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
def __contains__(self, s: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[unicode]: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class str(basestring, Sequence[str]):
|
||||
def __init__(self, object: object) -> None: ...
|
||||
def capitalize(self) -> str: ...
|
||||
def center(self, width: int, fillchar: str = ...) -> str: ...
|
||||
def count(self, x: unicode) -> int: ...
|
||||
def decode(self, encoding: unicode = 'utf-8', errors: unicode = 'strict') -> unicode: ...
|
||||
def encode(self, encoding: unicode = 'utf-8', errors: unicode = 'strict') -> str: ...
|
||||
def endswith(self, suffix: Union[unicode, Tuple[unicode, ...]]) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = 8) -> str: ...
|
||||
def find(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
|
||||
def format(self, *args: Any, **kwargs: Any) -> str: ...
|
||||
def index(self, sub: unicode, 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[AnyStr]) -> AnyStr: ...
|
||||
def ljust(self, width: int, fillchar: str = ...) -> str: ...
|
||||
def lower(self) -> str: ...
|
||||
@overload
|
||||
def lstrip(self, chars: str = ...) -> str: ...
|
||||
@overload
|
||||
def lstrip(self, chars: unicode) -> unicode: ...
|
||||
@overload
|
||||
def partition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ...
|
||||
@overload
|
||||
def partition(self, sep: str) -> Tuple[str, str, str]: ...
|
||||
@overload
|
||||
def partition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
|
||||
def replace(self, old: AnyStr, new: AnyStr, count: int = ...) -> AnyStr: ...
|
||||
def rfind(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
|
||||
def rindex(self, sub: unicode, start: int = 0, end: int = 0) -> int: ...
|
||||
def rjust(self, width: int, fillchar: str = ...) -> str: ...
|
||||
@overload
|
||||
def rpartition(self, sep: bytearray) -> Tuple[str, bytearray, str]: ...
|
||||
@overload
|
||||
def rpartition(self, sep: str) -> Tuple[str, str, str]: ...
|
||||
@overload
|
||||
def rpartition(self, sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
|
||||
@overload
|
||||
def rsplit(self, sep: str = ..., maxsplit: int = ...) -> List[str]: ...
|
||||
@overload
|
||||
def rsplit(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ...
|
||||
@overload
|
||||
def rstrip(self, chars: str = ...) -> str: ...
|
||||
@overload
|
||||
def rstrip(self, chars: unicode) -> unicode: ...
|
||||
@overload
|
||||
def split(self, sep: str = ..., maxsplit: int = ...) -> List[str]: ...
|
||||
@overload
|
||||
def split(self, sep: unicode, maxsplit: int = ...) -> List[unicode]: ...
|
||||
def splitlines(self, keepends: bool = False) -> List[str]: ...
|
||||
def startswith(self, prefix: Union[unicode, Tuple[unicode, ...]]) -> bool: ...
|
||||
@overload
|
||||
def strip(self, chars: str = ...) -> str: ...
|
||||
@overload
|
||||
def strip(self, chars: unicode) -> unicode: ...
|
||||
def swapcase(self) -> str: ...
|
||||
def title(self) -> str: ...
|
||||
def translate(self, table: AnyStr, deletechars: AnyStr = None) -> AnyStr: ...
|
||||
def upper(self) -> str: ...
|
||||
def zfill(self, width: int) -> str: ...
|
||||
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
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) -> str: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> str: ...
|
||||
def __getslice__(self, start: int, stop: int) -> str: ...
|
||||
def __add__(self, s: AnyStr) -> AnyStr: ...
|
||||
def __mul__(self, n: int) -> str: ...
|
||||
def __rmul__(self, n: int) -> str: ...
|
||||
def __contains__(self, o: object) -> bool: ...
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: unicode) -> bool: ...
|
||||
def __le__(self, x: unicode) -> bool: ...
|
||||
def __gt__(self, x: unicode) -> bool: ...
|
||||
def __ge__(self, x: unicode) -> bool: ...
|
||||
def __mod__(self, x: Any) -> str: ...
|
||||
|
||||
class bytearray(Sequence[int]):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, x: Union[Iterable[int], str]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, x: unicode, encoding: unicode,
|
||||
errors: unicode = 'strict') -> None: ...
|
||||
@overload
|
||||
def __init__(self, length: int) -> None: ...
|
||||
def capitalize(self) -> bytearray: ...
|
||||
def center(self, width: int, fillchar: str = ...) -> bytearray: ...
|
||||
def count(self, x: str) -> int: ...
|
||||
def decode(self, encoding: unicode = 'utf-8', errors: unicode = 'strict') -> str: ...
|
||||
def endswith(self, suffix: Union[str, Tuple[str, ...]]) -> bool: ...
|
||||
def expandtabs(self, tabsize: int = 8) -> bytearray: ...
|
||||
def find(self, sub: str, start: int = 0, end: int = ...) -> int: ...
|
||||
def index(self, sub: str, start: int = 0, end: int = ...) -> 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[str]) -> bytearray: ...
|
||||
def ljust(self, width: int, fillchar: str = ...) -> bytearray: ...
|
||||
def lower(self) -> bytearray: ...
|
||||
def lstrip(self, chars: str = ...) -> bytearray: ...
|
||||
def partition(self, sep: str) -> Tuple[bytearray, bytearray, bytearray]: ...
|
||||
def replace(self, old: str, new: str, count: int = ...) -> bytearray: ...
|
||||
def rfind(self, sub: str, start: int = 0, end: int = ...) -> int: ...
|
||||
def rindex(self, sub: str, start: int = 0, end: int = ...) -> int: ...
|
||||
def rjust(self, width: int, fillchar: str = ...) -> bytearray: ...
|
||||
def rpartition(self, sep: str) -> Tuple[bytearray, bytearray, bytearray]: ...
|
||||
def rsplit(self, sep: str = ..., maxsplit: int = ...) -> List[bytearray]: ...
|
||||
def rstrip(self, chars: str = ...) -> bytearray: ...
|
||||
def split(self, sep: str = ..., maxsplit: int = ...) -> List[bytearray]: ...
|
||||
def splitlines(self, keepends: bool = False) -> List[bytearray]: ...
|
||||
def startswith(self, prefix: Union[str, Tuple[str, ...]]) -> bool: ...
|
||||
def strip(self, chars: str = ...) -> bytearray: ...
|
||||
def swapcase(self) -> bytearray: ...
|
||||
def title(self) -> bytearray: ...
|
||||
def translate(self, table: str) -> bytearray: ...
|
||||
def upper(self) -> bytearray: ...
|
||||
def zfill(self, width: int) -> bytearray: ...
|
||||
@staticmethod
|
||||
def fromhex(self, x: str) -> bytearray: ...
|
||||
|
||||
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: ...
|
||||
def __getslice__(self, start: int, stop: int) -> bytearray: ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, x: int) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, s: slice, x: Union[Sequence[int], str]) -> None: ...
|
||||
def __setslice__(self, start: int, stop: int, x: Union[Sequence[int], str]) -> None: ...
|
||||
@overload
|
||||
def __delitem__(self, i: int) -> None: ...
|
||||
@overload
|
||||
def __delitem__(self, s: slice) -> None: ...
|
||||
def __delslice__(self, start: int, stop: int) -> None: ...
|
||||
def __add__(self, s: str) -> bytearray: ...
|
||||
def __mul__(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: str) -> bool: ...
|
||||
def __le__(self, x: str) -> bool: ...
|
||||
def __gt__(self, x: str) -> bool: ...
|
||||
def __ge__(self, x: str) -> bool: ...
|
||||
|
||||
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 name of the class (corresponds to Python 'function' class)
|
||||
__name__ = ... # type: str
|
||||
__module__ = ... # type: str
|
||||
|
||||
class list(MutableSequence[_T], Generic[_T]):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, iterable: Iterable[_T]) -> None: ...
|
||||
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] = ..., 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]: ...
|
||||
def __getslice__(self, start: int, stop: int) -> List[_T]: ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, o: _T) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, s: slice, o: Sequence[_T]) -> None: ...
|
||||
def __setslice__(self, start: int, stop: int, o: Sequence[_T]) -> None: ...
|
||||
def __delitem__(self, i: Union[int, slice]) -> None: ...
|
||||
def __delslice(self, start: int, stop: int) -> 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 __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 has_key(self, k: _KT) -> bool: ...
|
||||
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 = ...) -> _VT: ...
|
||||
def popitem(self) -> Tuple[_KT, _VT]: ...
|
||||
def setdefault(self, k: _KT, default: _VT = ...) -> _VT: ...
|
||||
def update(self, m: Union[Mapping[_KT, _VT],
|
||||
Iterable[Tuple[_KT, _VT]]]) -> None: ...
|
||||
def keys(self) -> List[_KT]: ...
|
||||
def values(self) -> List[_VT]: ...
|
||||
def items(self) -> List[Tuple[_KT, _VT]]: ...
|
||||
def iterkeys(self) -> Iterator[_KT]: ...
|
||||
def itervalues(self) -> Iterator[_VT]: ...
|
||||
def iteritems(self) -> Iterator[Tuple[_KT, _VT]]: ...
|
||||
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]):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, iterable: Iterable[_T]) -> None: ...
|
||||
def isdisjoint(self, s: AbstractSet[_T]) -> bool: ...
|
||||
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]]: ...
|
||||
# TODO more set operations
|
||||
|
||||
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 xrange(Sized, Iterable[int], Reversible[int]):
|
||||
@overload
|
||||
def __init__(self, stop: int) -> None: ...
|
||||
@overload
|
||||
def __init__(self, start: int, stop: int, step: int = 1) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __getitem__(self, i: int) -> int: ...
|
||||
def __reversed__(self) -> Iterator[int]: ...
|
||||
|
||||
class module:
|
||||
__name__ = ... # type: str
|
||||
__file__ = ... # type: str
|
||||
__dict__ = ... # type: Dict[unicode, Any]
|
||||
|
||||
True = ... # type: bool
|
||||
False = ... # type: bool
|
||||
__debug__ = False
|
||||
|
||||
long = int
|
||||
bytes = str
|
||||
|
||||
NotImplemented = ... # type: Any
|
||||
|
||||
def abs(n: SupportsAbs[_T]) -> _T: ...
|
||||
def all(i: Iterable) -> bool: ...
|
||||
def any(i: Iterable) -> bool: ...
|
||||
def bin(number: int) -> str: ...
|
||||
def callable(o: object) -> bool: ...
|
||||
def chr(code: int) -> str: ...
|
||||
def delattr(o: Any, name: unicode) -> None: ...
|
||||
def dir(o: object = ...) -> List[str]: ...
|
||||
@overload
|
||||
def divmod(a: int, b: int) -> Tuple[int, int]: ...
|
||||
@overload
|
||||
def divmod(a: float, b: float) -> Tuple[float, float]: ...
|
||||
def exit(code: int = ...) -> None: ...
|
||||
def filter(function: Callable[[_T], Any],
|
||||
iterable: Iterable[_T]) -> List[_T]: ...
|
||||
def format(o: object, format_spec: str = '') -> str: ... # TODO unicode
|
||||
def getattr(o: Any, name: unicode, default: Any = None) -> Any: ...
|
||||
def hasattr(o: Any, name: unicode) -> bool: ...
|
||||
def hash(o: object) -> int: ...
|
||||
def hex(i: int) -> str: ... # TODO __index__
|
||||
def id(o: object) -> int: ...
|
||||
def input(prompt: unicode = ...) -> Any: ...
|
||||
def intern(string: str) -> 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: ...
|
||||
@overload
|
||||
def map(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> List[_S]: ...
|
||||
@overload
|
||||
def map(func: Callable[[_T1, _T2], _S],
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2]) -> List[_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__
|
||||
@overload
|
||||
def open(file: str, mode: str = 'r', buffering: int = ...) -> BinaryIO: ...
|
||||
@overload
|
||||
def open(file: unicode, mode: str = 'r', buffering: int = ...) -> BinaryIO: ...
|
||||
@overload
|
||||
def open(file: int, mode: str = 'r', buffering: int = ...) -> BinaryIO: ...
|
||||
def ord(c: unicode) -> int: ...
|
||||
# This is only available after from __future__ import print_function.
|
||||
def print(*values: Any, sep: unicode = u' ', end: unicode = u'\n',
|
||||
file: IO[Any] = ...) -> 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: ...
|
||||
def range(x: int, y: int = 0, step: int = 1) -> List[int]: ...
|
||||
def raw_input(prompt: unicode = ...) -> str: ...
|
||||
|
||||
def reduce(function: Callable[[_T, _T], _T], iterable: Iterable[_T], initializer: _T = None) -> _T: ...
|
||||
|
||||
def reload(module: Any) -> Any: ...
|
||||
@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: unicode, value: Any) -> None: ...
|
||||
def sorted(iterable: Iterable[_T], *,
|
||||
cmp: Callable[[_T, _T], int] = ...,
|
||||
key: Callable[[_T], Any] = ...,
|
||||
reverse: bool = False) -> List[_T]: ...
|
||||
def sum(iterable: Iterable[_T], start: _T = ...) -> _T: ...
|
||||
def unichr(i: int) -> unicode: ...
|
||||
def vars(object: Any = ...) -> Dict[str, Any]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1]) -> List[Tuple[_T1]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ...
|
||||
@overload
|
||||
def zip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2,
|
||||
_T3, _T4]]: ... # TODO more than four iterables
|
||||
def __import__(name: unicode,
|
||||
globals: Dict[str, Any] = ...,
|
||||
locals: Dict[str, Any] = ...,
|
||||
fromlist: List[str] = ..., level: int = ...) -> Any: ...
|
||||
|
||||
def globals() -> Dict[str, Any]: ...
|
||||
def locals() -> Dict[str, Any]: ...
|
||||
|
||||
# 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
|
||||
|
||||
# TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check.
|
||||
AnyBuffer = TypeVar('AnyBuffer', str, unicode, bytearray, buffer)
|
||||
|
||||
class buffer(Sized):
|
||||
def __init__(self, object: AnyBuffer, offset: int = ..., size: int = ...) -> None: ...
|
||||
def __add__(self, other: AnyBuffer) -> str: ...
|
||||
def __cmp__(self, other: AnyBuffer) -> bool: ...
|
||||
def __getitem__(self, key: Union[int, slice]) -> str: ...
|
||||
def __getslice__(self, i: int, j: int) -> str: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __mul__(self, x: int) -> str: ...
|
||||
|
||||
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 StopIteration(Exception): ...
|
||||
class StandardError(Exception): ...
|
||||
class ArithmeticError(StandardError): ...
|
||||
class BufferError(StandardError): ...
|
||||
class EnvironmentError(StandardError):
|
||||
errno = 0
|
||||
strerror = ... # type: str
|
||||
# TODO can this be unicode?
|
||||
filename = ... # type: str
|
||||
class LookupError(StandardError): ...
|
||||
class RuntimeError(StandardError): ...
|
||||
class ValueError(StandardError): ...
|
||||
class AssertionError(StandardError): ...
|
||||
class AttributeError(StandardError): ...
|
||||
class EOFError(StandardError): ...
|
||||
class FloatingPointError(ArithmeticError): ...
|
||||
class IOError(EnvironmentError): ...
|
||||
class ImportError(StandardError): ...
|
||||
class IndexError(LookupError): ...
|
||||
class KeyError(LookupError): ...
|
||||
class MemoryError(StandardError): ...
|
||||
class NameError(StandardError): ...
|
||||
class NotImplementedError(RuntimeError): ...
|
||||
class OSError(EnvironmentError): ...
|
||||
class WindowsError(OSError): ...
|
||||
class OverflowError(ArithmeticError): ...
|
||||
class ReferenceError(StandardError): ...
|
||||
class SyntaxError(StandardError): ...
|
||||
class IndentationError(SyntaxError): ...
|
||||
class TabError(IndentationError): ...
|
||||
class SystemError(StandardError): ...
|
||||
class TypeError(StandardError): ...
|
||||
class UnboundLocalError(NameError): ...
|
||||
class UnicodeError(ValueError): ...
|
||||
class UnicodeDecodeError(UnicodeError): ...
|
||||
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): ...
|
||||
|
||||
def eval(s: str) -> Any: ...
|
||||
|
||||
def cmp(x: Any, y: Any) -> int: ...
|
||||
|
||||
def execfile(filename: str, globals: Dict[str, Any] = None, locals: Dict[str, Any] = None) -> None: ...
|
||||
|
||||
class file(BinaryIO): ...
|
||||
516
stdlib/2.7/_ast.pyi
Normal file
516
stdlib/2.7/_ast.pyi
Normal file
@@ -0,0 +1,516 @@
|
||||
from typing import Any
|
||||
from typing import Tuple as TypingTuple
|
||||
|
||||
__version__ = ... # type: int
|
||||
|
||||
PyCF_ONLY_AST = ... # type: int
|
||||
|
||||
class AST(object):
|
||||
_attributes = ... # type: TypingTuple[str]
|
||||
_fields = ... # type: TypingTuple[str]
|
||||
def __init__(self, *args, **kwargs) -> None: pass
|
||||
|
||||
class alias(AST):
|
||||
pass
|
||||
|
||||
class arguments(AST):
|
||||
pass
|
||||
|
||||
class boolop(AST):
|
||||
pass
|
||||
|
||||
class cmpop(AST):
|
||||
pass
|
||||
|
||||
class comprehension(AST):
|
||||
pass
|
||||
|
||||
class excepthandler(AST):
|
||||
pass
|
||||
|
||||
class expr(AST):
|
||||
pass
|
||||
|
||||
class expr_context(AST):
|
||||
pass
|
||||
|
||||
class keyword(AST):
|
||||
pass
|
||||
|
||||
class mod(AST):
|
||||
pass
|
||||
|
||||
class operator(AST):
|
||||
pass
|
||||
|
||||
class slice(AST):
|
||||
pass
|
||||
|
||||
class stmt(AST):
|
||||
pass
|
||||
|
||||
class unaryop(AST):
|
||||
pass
|
||||
|
||||
|
||||
class Add(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class And(boolop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Assert(stmt):
|
||||
test = ... # type: Any
|
||||
msg = ... # type: Any
|
||||
def __init__(self, test = ..., msg = ...) -> None:
|
||||
pass
|
||||
|
||||
class Assign(stmt):
|
||||
targets = ... # type: Any
|
||||
value = ... # type: Any
|
||||
def __init__(self, targets = ..., value = ...) -> None:
|
||||
pass
|
||||
|
||||
class Attribute(expr):
|
||||
value = ... # type: Any
|
||||
attr = ... # type: Any
|
||||
ctx = ... # type: Any
|
||||
def __init__(self, value = ..., attr = ..., ctx = ...) -> None:
|
||||
pass
|
||||
|
||||
class AugAssign(stmt):
|
||||
target = ... # type: Any
|
||||
op = ... # type: Any
|
||||
value = ... # type: Any
|
||||
def __init__(self, target = ..., op = ..., value = ...) -> None:
|
||||
pass
|
||||
|
||||
class AugLoad(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class AugStore(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class BinOp(expr):
|
||||
left = ... # type: Any
|
||||
op = ... # type: Any
|
||||
right = ... # type: Any
|
||||
def __init__(self, left = ..., op = ..., right = ...) -> None:
|
||||
pass
|
||||
|
||||
class BitAnd(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class BitOr(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class BitXor(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class BoolOp(expr):
|
||||
op = ... # type: Any
|
||||
values = ... # type: Any
|
||||
def __init__(self, op = ..., values = ...) -> None:
|
||||
pass
|
||||
|
||||
class Break(stmt):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Call(expr):
|
||||
func = ... # type: Any
|
||||
args = ... # type: Any
|
||||
keywords = ... # type: Any
|
||||
starargs = ... # type: Any
|
||||
kwargs = ... # type: Any
|
||||
def __init__(self, func = ..., args = ..., keywords = ..., starargs = ..., kwargs = ...) -> None:
|
||||
pass
|
||||
|
||||
class ClassDef(stmt):
|
||||
name = ... # type: Any
|
||||
bases = ... # type: Any
|
||||
body = ... # type: Any
|
||||
decorator_list = ... # type: Any
|
||||
def __init__(self, name = ..., bases = ..., body = ..., decorator_list = ...) -> None:
|
||||
pass
|
||||
|
||||
class Compare(expr):
|
||||
left = ... # type: Any
|
||||
ops = ... # type: Any
|
||||
comparators = ... # type: Any
|
||||
def __init__(self, left = ..., ops = ..., comparators = ...) -> None:
|
||||
pass
|
||||
|
||||
class Continue(stmt):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Del(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Delete(stmt):
|
||||
targets = ... # type: Any
|
||||
def __init__(self, targets = ...) -> None:
|
||||
pass
|
||||
|
||||
class Dict(expr):
|
||||
keys = ... # type: Any
|
||||
values = ... # type: Any
|
||||
def __init__(self, keys = ..., values = ...) -> None:
|
||||
pass
|
||||
|
||||
class DictComp(expr):
|
||||
key = ... # type: Any
|
||||
value = ... # type: Any
|
||||
generators = ... # type: Any
|
||||
def __init__(self, key = ..., value = ..., generators = ...) -> None:
|
||||
pass
|
||||
|
||||
class Div(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Ellipsis(slice):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Eq(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class ExceptHandler(excepthandler):
|
||||
type = ... # type: Any
|
||||
name = ... # type: Any
|
||||
body = ... # type: Any
|
||||
def __init__(self, type = ..., name = ..., body = ...) -> None:
|
||||
pass
|
||||
|
||||
class Exec(stmt):
|
||||
body = ... # type: Any
|
||||
globals = ... # type: Any
|
||||
locals = ... # type: Any
|
||||
def __init__(self, body = ..., globals = ..., locals = ...) -> None:
|
||||
pass
|
||||
|
||||
class Expr(stmt):
|
||||
value = ... # type: Any
|
||||
def __init__(self, value = ...) -> None:
|
||||
pass
|
||||
|
||||
class Expression(mod):
|
||||
body = ... # type: Any
|
||||
def __init__(self, body = ...) -> None:
|
||||
pass
|
||||
|
||||
class ExtSlice(slice):
|
||||
dims = ... # type: Any
|
||||
def __init__(self, dims = ...) -> None:
|
||||
pass
|
||||
|
||||
class FloorDiv(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class For(stmt):
|
||||
target = ... # type: Any
|
||||
iter = ... # type: Any
|
||||
body = ... # type: Any
|
||||
orelse = ... # type: Any
|
||||
def __init__(self, target = ..., iter = ..., body = ..., orelse = ...) -> None:
|
||||
pass
|
||||
|
||||
class FunctionDef(stmt):
|
||||
name = ... # type: Any
|
||||
args = ... # type: Any
|
||||
body = ... # type: Any
|
||||
decorator_list = ... # type: Any
|
||||
def __init__(self, name = ..., args = ..., body = ..., decorator_list = ...) -> None:
|
||||
pass
|
||||
|
||||
class GeneratorExp(expr):
|
||||
elt = ... # type: Any
|
||||
generators = ... # type: Any
|
||||
def __init__(self, elt = ..., generators = ...) -> None:
|
||||
pass
|
||||
|
||||
class Global(stmt):
|
||||
names = ... # type: Any
|
||||
def __init__(self, names = ...) -> None:
|
||||
pass
|
||||
|
||||
class Gt(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class GtE(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class If(stmt):
|
||||
test = ... # type: Any
|
||||
body = ... # type: Any
|
||||
orelse = ... # type: Any
|
||||
def __init__(self, test = ..., body = ..., orelse = ...) -> None:
|
||||
pass
|
||||
|
||||
class IfExp(expr):
|
||||
test = ... # type: Any
|
||||
body = ... # type: Any
|
||||
orelse = ... # type: Any
|
||||
def __init__(self, test = ..., body = ..., orelse = ...) -> None:
|
||||
pass
|
||||
|
||||
class Import(stmt):
|
||||
names = ... # type: Any
|
||||
def __init__(self, names = ...) -> None:
|
||||
pass
|
||||
|
||||
class ImportFrom(stmt):
|
||||
module = ... # type: Any
|
||||
names = ... # type: Any
|
||||
level = ... # type: Any
|
||||
def __init__(self, module = ..., names = ..., level = ...) -> None:
|
||||
pass
|
||||
|
||||
class In(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Index(slice):
|
||||
value = ... # type: Any
|
||||
def __init__(self, value = ...) -> None:
|
||||
pass
|
||||
|
||||
class Interactive(mod):
|
||||
body = ... # type: Any
|
||||
def __init__(self, body = ...) -> None:
|
||||
pass
|
||||
|
||||
class Invert(unaryop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Is(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class IsNot(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class LShift(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Lambda(expr):
|
||||
args = ... # type: Any
|
||||
body = ... # type: Any
|
||||
def __init__(self, args = ..., body = ...) -> None:
|
||||
pass
|
||||
|
||||
class List(expr):
|
||||
elts = ... # type: Any
|
||||
ctx = ... # type: Any
|
||||
def __init__(self, elts = ..., ctx = ...) -> None:
|
||||
pass
|
||||
|
||||
class ListComp(expr):
|
||||
elt = ... # type: Any
|
||||
generators = ... # type: Any
|
||||
def __init__(self, elt = ..., generators = ...) -> None:
|
||||
pass
|
||||
|
||||
class Load(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Lt(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class LtE(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Mod(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Module(mod):
|
||||
body = ... # type: Any
|
||||
def __init__(self, body = ...) -> None:
|
||||
pass
|
||||
|
||||
class Mult(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Name(expr):
|
||||
id = ... # type: Any
|
||||
ctx = ... # type: Any
|
||||
def __init__(self, id = ..., ctx = ...) -> None:
|
||||
pass
|
||||
|
||||
class Not(unaryop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class NotEq(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class NotIn(cmpop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Num(expr):
|
||||
n = ... # type: Any
|
||||
def __init__(self, n = ...) -> None:
|
||||
pass
|
||||
|
||||
class Or(boolop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Param(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Pass(stmt):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Pow(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Print(stmt):
|
||||
dest = ... # type: Any
|
||||
values = ... # type: Any
|
||||
nl = ... # type: Any
|
||||
def __init__(self, dest = ..., values = ..., nl = ...) -> None:
|
||||
pass
|
||||
|
||||
class RShift(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Raise(stmt):
|
||||
type = ... # type: Any
|
||||
inst = ... # type: Any
|
||||
tback = ... # type: Any
|
||||
def __init__(self, type = ..., inst = ..., tback = ...) -> None:
|
||||
pass
|
||||
|
||||
class Repr(expr):
|
||||
value = ... # type: Any
|
||||
def __init__(self, value = ...) -> None:
|
||||
pass
|
||||
|
||||
class Return(stmt):
|
||||
value = ... # type: Any
|
||||
def __init__(self, value = ...) -> None:
|
||||
pass
|
||||
|
||||
class Set(expr):
|
||||
elts = ... # type: Any
|
||||
def __init__(self, elts = ...) -> None:
|
||||
pass
|
||||
|
||||
class SetComp(expr):
|
||||
elt = ... # type: Any
|
||||
generators = ... # type: Any
|
||||
def __init__(self, elt = ..., generators = ...) -> None:
|
||||
pass
|
||||
|
||||
class Slice(slice):
|
||||
lower = ... # type: Any
|
||||
upper = ... # type: Any
|
||||
step = ... # type: Any
|
||||
def __init__(self, lower = ..., upper = ..., step = ...) -> None:
|
||||
pass
|
||||
|
||||
class Store(expr_context):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Str(expr):
|
||||
s = ... # type: Any
|
||||
def __init__(self, s = ...) -> None:
|
||||
pass
|
||||
|
||||
class Sub(operator):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class Subscript(expr):
|
||||
value = ... # type: Any
|
||||
slice = ... # type: Any
|
||||
ctx = ... # type: Any
|
||||
def __init__(self, value = ..., slice = ..., ctx = ...) -> None:
|
||||
pass
|
||||
|
||||
class Suite(mod):
|
||||
body = ... # type: Any
|
||||
def __init__(self, body = ...) -> None:
|
||||
pass
|
||||
|
||||
class TryExcept(stmt):
|
||||
body = ... # type: Any
|
||||
handlers = ... # type: Any
|
||||
orelse = ... # type: Any
|
||||
def __init__(self, body = ..., handlers = ..., orelse = ...) -> None:
|
||||
pass
|
||||
|
||||
class TryFinally(stmt):
|
||||
body = ... # type: Any
|
||||
finalbody = ... # type: Any
|
||||
def __init__(self, body = ..., finalbody = ...) -> None:
|
||||
pass
|
||||
|
||||
class Tuple(expr):
|
||||
elts = ... # type: Any
|
||||
ctx = ... # type: Any
|
||||
def __init__(self, elts = ..., ctx = ...) -> None:
|
||||
pass
|
||||
|
||||
class UAdd(unaryop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class USub(unaryop):
|
||||
def __init__(self) -> None:
|
||||
pass
|
||||
|
||||
class UnaryOp(expr):
|
||||
op = ... # type: Any
|
||||
operand = ... # type: Any
|
||||
def __init__(self, op = ..., operand = ...) -> None:
|
||||
pass
|
||||
|
||||
class While(stmt):
|
||||
test = ... # type: Any
|
||||
body = ... # type: Any
|
||||
orelse = ... # type: Any
|
||||
def __init__(self, test = ..., body = ..., orelse = ...) -> None:
|
||||
pass
|
||||
|
||||
class With(stmt):
|
||||
context_expr = ... # type: Any
|
||||
optional_vars = ... # type: Any
|
||||
body = ... # type: Any
|
||||
def __init__(self, context_expr = ..., optional_vars = ..., body = ...) -> None:
|
||||
pass
|
||||
|
||||
class Yield(expr):
|
||||
value = ... # type: Any
|
||||
def __init__(self, value = ...) -> None:
|
||||
pass
|
||||
55
stdlib/2.7/_codecs.pyi
Normal file
55
stdlib/2.7/_codecs.pyi
Normal file
@@ -0,0 +1,55 @@
|
||||
"""Stub file for the '_codecs' module."""
|
||||
|
||||
from typing import Any, AnyStr, Callable, Tuple, Optional
|
||||
|
||||
import codecs
|
||||
|
||||
# For convenience:
|
||||
_Handler = Callable[[Exception], Tuple[unicode, int]]
|
||||
|
||||
# Not exposed. In Python 2, this is defined in unicode.c:
|
||||
class _EncodingMap(object):
|
||||
def size(self) -> 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: unicode) -> _EncodingMap: ...
|
||||
|
||||
def ascii_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
|
||||
def ascii_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def charbuffer_encode(data: AnyStr, errors: str = ...) -> Tuple[str, int]: ...
|
||||
def charmap_decode(data: AnyStr, errors: str = ..., mapping: Optional[_EncodingMap] = ...) -> Tuple[unicode, int]: ...
|
||||
def charmap_encode(data: AnyStr, errors: str, mapping: Optional[_EncodingMap] = ...) -> Tuple[str, int]: ...
|
||||
def escape_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
|
||||
def escape_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def latin_1_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
|
||||
def latin_1_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def raw_unicode_escape_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
|
||||
def raw_unicode_escape_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def readbuffer_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def unicode_escape_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
|
||||
def unicode_escape_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def unicode_internal_decode(data: AnyStr, errors:str = ...) -> Tuple[unicode, int]: ...
|
||||
def unicode_internal_encode(data: AnyStr, errors:str = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_be_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
|
||||
def utf_16_be_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
|
||||
def utf_16_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_16_ex_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
|
||||
def utf_16_le_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
|
||||
def utf_16_le_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_be_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
|
||||
def utf_32_be_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
|
||||
def utf_32_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_32_ex_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
|
||||
def utf_32_le_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
|
||||
def utf_32_le_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_7_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
|
||||
def utf_7_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
def utf_8_decode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[unicode, int]: ...
|
||||
def utf_8_encode(data: AnyStr, errors:str = ..., final:int = ...) -> Tuple[str, int]: ...
|
||||
41
stdlib/2.7/_collections.pyi
Normal file
41
stdlib/2.7/_collections.pyi
Normal file
@@ -0,0 +1,41 @@
|
||||
"""Stub file for the '_collections' module."""
|
||||
|
||||
from typing import Any, Generic, Iterator, TypeVar, Optional, Union
|
||||
|
||||
class defaultdict(dict):
|
||||
default_factory = ... # type: None
|
||||
def __init__(self, default: Any = ..., init: Any = ...) -> None: ...
|
||||
def __missing__(self, key) -> Any:
|
||||
raise KeyError()
|
||||
def __copy__(self) -> "defaultdict": ...
|
||||
def copy(self) -> "defaultdict": ...
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_T2 = TypeVar('_T2')
|
||||
|
||||
class deque(Generic[_T]):
|
||||
maxlen = ... # type: Optional[int]
|
||||
def __init__(self, iterable: Iterator[_T] = ..., maxlen: int = ...) -> None: ...
|
||||
def append(self, x: _T) -> None: ...
|
||||
def appendleft(self, x: _T) -> None: ...
|
||||
def clear(self) -> None: ...
|
||||
def count(self, x: Any) -> int: ...
|
||||
def extend(self, iterable: Iterator[_T]) -> None: ...
|
||||
def extendleft(self, iterable: Iterator[_T]) -> None: ...
|
||||
def pop(self) -> _T:
|
||||
raise IndexError()
|
||||
def popleft(self) -> _T:
|
||||
raise IndexError()
|
||||
def remove(self, value: _T) -> None:
|
||||
raise IndexError()
|
||||
def reverse(self) -> None: ...
|
||||
def rotate(self, n: int = ...) -> None: ...
|
||||
def __contains__(self, o: Any) -> bool: ...
|
||||
def __copy__(self) -> "deque[_T]": ...
|
||||
def __getitem__(self, i: int) -> _T:
|
||||
raise IndexError()
|
||||
def __iadd__(self, other: "deque[_T2]") -> "deque[Union[_T, _T2]]": ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __reversed__(self) -> Iterator[_T]: ...
|
||||
def __setitem__(self, i: int, x: _T) -> None: ...
|
||||
19
stdlib/2.7/_functools.pyi
Normal file
19
stdlib/2.7/_functools.pyi
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Stub file for the '_functools' module."""
|
||||
|
||||
from typing import Any, Callable, Dict, Iterator, Optional, TypeVar, Tuple, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@overload
|
||||
def reduce(function: Callable[[_T, _T], _T],
|
||||
sequence: Iterator[_T]) -> _T: ...
|
||||
@overload
|
||||
def reduce(function: Callable[[_T, _T], _T],
|
||||
sequence: Iterator[_T], initial: _T) -> _T: ...
|
||||
|
||||
class partial(object):
|
||||
func = ... # type: Callable[..., Any]
|
||||
args = ... # type: Tuple[Any, ...]
|
||||
keywords = ... # type: Dict[str, Any]
|
||||
def __init__(self, func: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
34
stdlib/2.7/_hotshot.pyi
Normal file
34
stdlib/2.7/_hotshot.pyi
Normal file
@@ -0,0 +1,34 @@
|
||||
"""Stub file for the '_hotshot' module."""
|
||||
# This is an autogenerated file. It serves as a starting point
|
||||
# for a more precise manual annotation of this module.
|
||||
# Feel free to edit the source below, but remove this header when you do.
|
||||
|
||||
from typing import Any, List, Tuple, Dict, Generic
|
||||
|
||||
def coverage(a: str) -> Any: ...
|
||||
|
||||
def logreader(a: str) -> LogReaderType:
|
||||
raise IOError()
|
||||
raise RuntimeError()
|
||||
|
||||
def profiler(a: str, *args, **kwargs) -> Any:
|
||||
raise IOError()
|
||||
|
||||
def resolution() -> tuple: ...
|
||||
|
||||
|
||||
class LogReaderType(object):
|
||||
def close(self) -> None: ...
|
||||
def fileno(self) -> int:
|
||||
raise ValueError()
|
||||
|
||||
class ProfilerType(object):
|
||||
def addinfo(self, a: str, b: str) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def fileno(self) -> int:
|
||||
raise ValueError()
|
||||
def runcall(self, *args, **kwargs) -> Any: ...
|
||||
def runcode(self, a, b, *args, **kwargs) -> Any:
|
||||
raise TypeError()
|
||||
def start(self) -> None: ...
|
||||
def stop(self) -> None: ...
|
||||
107
stdlib/2.7/_io.pyi
Normal file
107
stdlib/2.7/_io.pyi
Normal file
@@ -0,0 +1,107 @@
|
||||
from typing import Any, Optional, Iterable, Tuple, List, Union
|
||||
|
||||
DEFAULT_BUFFER_SIZE = ... # type: int
|
||||
|
||||
|
||||
class BlockingIOError(IOError):
|
||||
characters_written = ... # type: int
|
||||
|
||||
class UnsupportedOperation(ValueError, IOError): ...
|
||||
|
||||
|
||||
class _IOBase(object):
|
||||
closed = ... # type: bool
|
||||
def __enter__(self) -> "_IOBase": ...
|
||||
def __exit__(self, type, value, traceback) -> bool: ...
|
||||
def __iter__(self) -> "_IOBase": ...
|
||||
def _checkClosed(self) -> None: ...
|
||||
def _checkReadable(self) -> None: ...
|
||||
def _checkSeekable(self) -> None: ...
|
||||
def _checkWritable(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def next(self) -> str: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, limit: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = ...) -> int: ...
|
||||
def writable(self) -> bool: ...
|
||||
def writelines(self, lines: Iterable[str]) -> None: ...
|
||||
|
||||
class _BufferedIOBase(_IOBase):
|
||||
def read1(self, n: int) -> str: ...
|
||||
def read(self, n: int = ...) -> str: ...
|
||||
def readinto(self, buffer: bytearray) -> int: ...
|
||||
def write(self, s: str) -> int: ...
|
||||
def detach(self) -> "_BufferedIOBase": ...
|
||||
|
||||
class BufferedRWPair(_BufferedIOBase):
|
||||
def peek(self, n: int = ...) -> str: ...
|
||||
|
||||
class BufferedRandom(_BufferedIOBase):
|
||||
name = ... # type: str
|
||||
raw = ... # type: _IOBase
|
||||
mode = ... # type: str
|
||||
def peek(self, n: int = ...) -> str: ...
|
||||
|
||||
class BufferedReader(_BufferedIOBase):
|
||||
name = ... # type: str
|
||||
raw = ... # type: _IOBase
|
||||
mode = ... # type: str
|
||||
def peek(self, n: int = ...) -> str: ...
|
||||
|
||||
class BufferedWriter(_BufferedIOBase):
|
||||
name = ... # type: str
|
||||
raw = ... # type: _IOBase
|
||||
mode = ... # type: str
|
||||
|
||||
class BytesIO(_BufferedIOBase):
|
||||
def __setstate__(self, tuple) -> None: ...
|
||||
def __getstate__(self) -> tuple: ...
|
||||
def getvalue(self) -> str: ...
|
||||
|
||||
class _RawIOBase(_IOBase):
|
||||
def readall(self) -> str: ...
|
||||
def read(self, n: int = ...) -> str: ...
|
||||
|
||||
class FileIO(_RawIOBase):
|
||||
mode = ... # type: str
|
||||
closefd = ... # type: bool
|
||||
def readinto(self, buffer: bytearray)-> int: ...
|
||||
def write(self, pbuf: str) -> int: ...
|
||||
|
||||
class IncrementalNewlineDecoder(object):
|
||||
newlines = ... # type: Union[str, unicode]
|
||||
def decode(self, input, final) -> Any: ...
|
||||
def getstate(self) -> Tuple[Any, int]: ...
|
||||
def setstate(self, state: Tuple[Any, int]) -> None: ...
|
||||
def reset(self) -> None: ...
|
||||
|
||||
class _TextIOBase(_IOBase):
|
||||
errors = ... # type: Optional[str]
|
||||
newlines = ... # type: Union[str, unicode]
|
||||
encoding = ... # type: Optional[str]
|
||||
def read(self, n: int = ...) -> str: ...
|
||||
def write(self) -> None:
|
||||
raise UnsupportedOperation
|
||||
def detach(self) -> None:
|
||||
raise UnsupportedOperation
|
||||
|
||||
class StringIO(_TextIOBase):
|
||||
line_buffering = ... # type: bool
|
||||
def getvalue(self) -> str: ...
|
||||
def __setstate__(self, state: tuple) -> None: ...
|
||||
def __getstate__(self) -> tuple: ...
|
||||
|
||||
class TextIOWrapper(_TextIOBase):
|
||||
name = ... # type: str
|
||||
line_buffering = ... # type: bool
|
||||
buffer = ... # type: str
|
||||
_CHUNK_SIZE = ... # type: int
|
||||
|
||||
def open(file: Union[int, str], mode: str = ...) -> _IOBase: ...
|
||||
19
stdlib/2.7/_json.pyi
Normal file
19
stdlib/2.7/_json.pyi
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Stub file for the '_json' module."""
|
||||
# This is an autogenerated file. It serves as a starting point
|
||||
# for a more precise manual annotation of this module.
|
||||
# Feel free to edit the source below, but remove this header when you do.
|
||||
|
||||
from typing import Any, List, Tuple, Dict, Generic
|
||||
|
||||
def encode_basestring_ascii(*args, **kwargs) -> str:
|
||||
raise TypeError()
|
||||
|
||||
def scanstring(a, b, *args, **kwargs) -> tuple:
|
||||
raise TypeError()
|
||||
|
||||
|
||||
class Encoder(object):
|
||||
pass
|
||||
|
||||
class Scanner(object):
|
||||
pass
|
||||
81
stdlib/2.7/_locale.pyi
Normal file
81
stdlib/2.7/_locale.pyi
Normal file
@@ -0,0 +1,81 @@
|
||||
from typing import Optional, Dict, Any
|
||||
|
||||
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
|
||||
|
||||
class Error(Exception):
|
||||
pass
|
||||
|
||||
def bind_textdomain_codeset(domain: Optional[str], codeset: Optional[str]) -> Optional[str]: pass
|
||||
def bindtextdomain(domain: Optional[str], dir: Optional[str]) -> str: pass
|
||||
def dcgettext(domain: Optional[str], msg: str, category: int) -> str: pass
|
||||
def dgettext(domain: Optional[str], msg: str) -> str: pass
|
||||
def gettext(msg: str) -> str: pass
|
||||
def localeconv() -> Dict[str, Any]: pass
|
||||
def nl_langinfo(key: int) -> str: pass
|
||||
def setlocale(i: int, s: str) -> str: pass
|
||||
def strcoll(left: str, right: str) -> int: pass
|
||||
def strxfrm(s: str) -> str: pass
|
||||
def textdomain(domain: Optional[str]) -> str: pass
|
||||
13
stdlib/2.7/_md5.pyi
Normal file
13
stdlib/2.7/_md5.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
blocksize = ... # type: int
|
||||
digest_size = ... # type: int
|
||||
|
||||
class MD5Type(object):
|
||||
name = ... # type: str
|
||||
block_size = ... # type: int
|
||||
digest_size = ... # type: int
|
||||
def copy(self) -> "MD5Type": ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
|
||||
def new(arg: str = ...) -> MD5Type: ...
|
||||
13
stdlib/2.7/_random.pyi
Normal file
13
stdlib/2.7/_random.pyi
Normal file
@@ -0,0 +1,13 @@
|
||||
from typing import Tuple
|
||||
|
||||
# Actually Tuple[(int,) * 625]
|
||||
_State = Tuple[int, ...]
|
||||
|
||||
class Random(object):
|
||||
def __init__(self, seed: object = ...) -> None: ...
|
||||
def seed(self, x: object = ...) -> None: ...
|
||||
def getstate(self) -> _State: ...
|
||||
def setstate(self, state: _State) -> None: ...
|
||||
def random(self) -> float: ...
|
||||
def getrandbits(self, k: int) -> int: ...
|
||||
def jumpahead(self, i: int) -> None: ...
|
||||
15
stdlib/2.7/_sha.pyi
Normal file
15
stdlib/2.7/_sha.pyi
Normal file
@@ -0,0 +1,15 @@
|
||||
blocksize = ... # type: int
|
||||
block_size = ... # type: int
|
||||
digest_size = ... # type: int
|
||||
|
||||
class sha(object): # not actually exposed
|
||||
name = ... # type: str
|
||||
block_size = ... # type: int
|
||||
digest_size = ... # type: int
|
||||
digestsize = ... # type: int
|
||||
def copy(self) -> "sha": ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
|
||||
def new(arg: str = ...) -> sha: ...
|
||||
23
stdlib/2.7/_sha256.pyi
Normal file
23
stdlib/2.7/_sha256.pyi
Normal file
@@ -0,0 +1,23 @@
|
||||
from typing import Optional
|
||||
|
||||
class sha224(object):
|
||||
name = ... # type: str
|
||||
block_size = ... # type: int
|
||||
digest_size = ... # type: int
|
||||
digestsize = ... # type: int
|
||||
def __init__(self, init: Optional[str]) -> None: ...
|
||||
def copy(self) -> "sha224": ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
|
||||
class sha256(object):
|
||||
name = ... # type: str
|
||||
block_size = ... # type: int
|
||||
digest_size = ... # type: int
|
||||
digestsize = ... # type: int
|
||||
def __init__(self, init: Optional[str]) -> None: ...
|
||||
def copy(self) -> "sha256": ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
23
stdlib/2.7/_sha512.pyi
Normal file
23
stdlib/2.7/_sha512.pyi
Normal file
@@ -0,0 +1,23 @@
|
||||
from typing import Optional
|
||||
|
||||
class sha384(object):
|
||||
name = ... # type: str
|
||||
block_size = ... # type: int
|
||||
digest_size = ... # type: int
|
||||
digestsize = ... # type: int
|
||||
def __init__(self, init: Optional[str]) -> None: ...
|
||||
def copy(self) -> "sha384": ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
|
||||
class sha512(object):
|
||||
name = ... # type: str
|
||||
block_size = ... # type: int
|
||||
digest_size = ... # type: int
|
||||
digestsize = ... # type: int
|
||||
def __init__(self, init: Optional[str]) -> None: ...
|
||||
def copy(self) -> "sha512": ...
|
||||
def digest(self) -> str: ...
|
||||
def hexdigest(self) -> str: ...
|
||||
def update(self, arg: str) -> None: ...
|
||||
287
stdlib/2.7/_socket.pyi
Normal file
287
stdlib/2.7/_socket.pyi
Normal file
@@ -0,0 +1,287 @@
|
||||
from typing import Tuple, Union, IO, Any, Optional, overload
|
||||
|
||||
AF_APPLETALK = ... # type: int
|
||||
AF_ASH = ... # type: int
|
||||
AF_ATMPVC = ... # type: int
|
||||
AF_ATMSVC = ... # type: int
|
||||
AF_AX25 = ... # type: int
|
||||
AF_BLUETOOTH = ... # type: int
|
||||
AF_BRIDGE = ... # type: int
|
||||
AF_DECnet = ... # type: int
|
||||
AF_ECONET = ... # type: int
|
||||
AF_INET = ... # type: int
|
||||
AF_INET6 = ... # type: int
|
||||
AF_IPX = ... # type: int
|
||||
AF_IRDA = ... # type: int
|
||||
AF_KEY = ... # type: int
|
||||
AF_LLC = ... # type: int
|
||||
AF_NETBEUI = ... # type: int
|
||||
AF_NETLINK = ... # type: int
|
||||
AF_NETROM = ... # type: int
|
||||
AF_PACKET = ... # type: int
|
||||
AF_PPPOX = ... # type: int
|
||||
AF_ROSE = ... # type: int
|
||||
AF_ROUTE = ... # type: int
|
||||
AF_SECURITY = ... # type: int
|
||||
AF_SNA = ... # type: int
|
||||
AF_TIPC = ... # type: int
|
||||
AF_UNIX = ... # type: int
|
||||
AF_UNSPEC = ... # type: int
|
||||
AF_WANPIPE = ... # type: int
|
||||
AF_X25 = ... # type: int
|
||||
AI_ADDRCONFIG = ... # type: int
|
||||
AI_ALL = ... # type: int
|
||||
AI_CANONNAME = ... # type: int
|
||||
AI_NUMERICHOST = ... # type: int
|
||||
AI_NUMERICSERV = ... # type: int
|
||||
AI_PASSIVE = ... # type: int
|
||||
AI_V4MAPPED = ... # type: int
|
||||
BDADDR_ANY = ... # type: str
|
||||
BDADDR_LOCAL = ... # type: str
|
||||
BTPROTO_HCI = ... # type: int
|
||||
BTPROTO_L2CAP = ... # type: int
|
||||
BTPROTO_RFCOMM = ... # type: int
|
||||
BTPROTO_SCO = ... # type: int
|
||||
EAI_ADDRFAMILY = ... # type: int
|
||||
EAI_AGAIN = ... # type: int
|
||||
EAI_BADFLAGS = ... # type: int
|
||||
EAI_FAIL = ... # type: int
|
||||
EAI_FAMILY = ... # type: int
|
||||
EAI_MEMORY = ... # type: int
|
||||
EAI_NODATA = ... # type: int
|
||||
EAI_NONAME = ... # type: int
|
||||
EAI_OVERFLOW = ... # type: int
|
||||
EAI_SERVICE = ... # type: int
|
||||
EAI_SOCKTYPE = ... # type: int
|
||||
EAI_SYSTEM = ... # type: int
|
||||
EBADF = ... # type: int
|
||||
EINTR = ... # type: int
|
||||
HCI_DATA_DIR = ... # type: int
|
||||
HCI_FILTER = ... # type: int
|
||||
HCI_TIME_STAMP = ... # type: int
|
||||
INADDR_ALLHOSTS_GROUP = ... # type: int
|
||||
INADDR_ANY = ... # type: int
|
||||
INADDR_BROADCAST = ... # type: int
|
||||
INADDR_LOOPBACK = ... # type: int
|
||||
INADDR_MAX_LOCAL_GROUP = ... # type: int
|
||||
INADDR_NONE = ... # type: int
|
||||
INADDR_UNSPEC_GROUP = ... # type: int
|
||||
IPPORT_RESERVED = ... # type: int
|
||||
IPPORT_USERRESERVED = ... # type: int
|
||||
IPPROTO_AH = ... # type: int
|
||||
IPPROTO_DSTOPTS = ... # type: int
|
||||
IPPROTO_EGP = ... # type: int
|
||||
IPPROTO_ESP = ... # type: int
|
||||
IPPROTO_FRAGMENT = ... # type: int
|
||||
IPPROTO_GRE = ... # type: int
|
||||
IPPROTO_HOPOPTS = ... # type: int
|
||||
IPPROTO_ICMP = ... # type: int
|
||||
IPPROTO_ICMPV6 = ... # type: int
|
||||
IPPROTO_IDP = ... # type: int
|
||||
IPPROTO_IGMP = ... # type: int
|
||||
IPPROTO_IP = ... # type: int
|
||||
IPPROTO_IPIP = ... # type: int
|
||||
IPPROTO_IPV6 = ... # type: int
|
||||
IPPROTO_NONE = ... # type: int
|
||||
IPPROTO_PIM = ... # type: int
|
||||
IPPROTO_PUP = ... # type: int
|
||||
IPPROTO_RAW = ... # type: int
|
||||
IPPROTO_ROUTING = ... # type: int
|
||||
IPPROTO_RSVP = ... # type: int
|
||||
IPPROTO_TCP = ... # type: int
|
||||
IPPROTO_TP = ... # type: int
|
||||
IPPROTO_UDP = ... # type: int
|
||||
IPV6_CHECKSUM = ... # type: int
|
||||
IPV6_DSTOPTS = ... # type: int
|
||||
IPV6_HOPLIMIT = ... # type: int
|
||||
IPV6_HOPOPTS = ... # type: int
|
||||
IPV6_JOIN_GROUP = ... # type: int
|
||||
IPV6_LEAVE_GROUP = ... # type: int
|
||||
IPV6_MULTICAST_HOPS = ... # type: int
|
||||
IPV6_MULTICAST_IF = ... # type: int
|
||||
IPV6_MULTICAST_LOOP = ... # type: int
|
||||
IPV6_NEXTHOP = ... # type: int
|
||||
IPV6_PKTINFO = ... # type: int
|
||||
IPV6_RECVDSTOPTS = ... # type: int
|
||||
IPV6_RECVHOPLIMIT = ... # type: int
|
||||
IPV6_RECVHOPOPTS = ... # type: int
|
||||
IPV6_RECVPKTINFO = ... # type: int
|
||||
IPV6_RECVRTHDR = ... # type: int
|
||||
IPV6_RECVTCLASS = ... # type: int
|
||||
IPV6_RTHDR = ... # type: int
|
||||
IPV6_RTHDRDSTOPTS = ... # type: int
|
||||
IPV6_RTHDR_TYPE_0 = ... # type: int
|
||||
IPV6_TCLASS = ... # type: int
|
||||
IPV6_UNICAST_HOPS = ... # type: int
|
||||
IPV6_V6ONLY = ... # type: int
|
||||
IP_ADD_MEMBERSHIP = ... # type: int
|
||||
IP_DEFAULT_MULTICAST_LOOP = ... # type: int
|
||||
IP_DEFAULT_MULTICAST_TTL = ... # type: int
|
||||
IP_DROP_MEMBERSHIP = ... # type: int
|
||||
IP_HDRINCL = ... # type: int
|
||||
IP_MAX_MEMBERSHIPS = ... # type: int
|
||||
IP_MULTICAST_IF = ... # type: int
|
||||
IP_MULTICAST_LOOP = ... # type: int
|
||||
IP_MULTICAST_TTL = ... # type: int
|
||||
IP_OPTIONS = ... # type: int
|
||||
IP_RECVOPTS = ... # type: int
|
||||
IP_RECVRETOPTS = ... # type: int
|
||||
IP_RETOPTS = ... # type: int
|
||||
IP_TOS = ... # type: int
|
||||
IP_TTL = ... # type: int
|
||||
MSG_CTRUNC = ... # type: int
|
||||
MSG_DONTROUTE = ... # type: int
|
||||
MSG_DONTWAIT = ... # type: int
|
||||
MSG_EOR = ... # type: int
|
||||
MSG_OOB = ... # type: int
|
||||
MSG_PEEK = ... # type: int
|
||||
MSG_TRUNC = ... # type: int
|
||||
MSG_WAITALL = ... # type: int
|
||||
MethodType = ... # type: type
|
||||
NETLINK_DNRTMSG = ... # type: int
|
||||
NETLINK_FIREWALL = ... # type: int
|
||||
NETLINK_IP6_FW = ... # type: int
|
||||
NETLINK_NFLOG = ... # type: int
|
||||
NETLINK_ROUTE = ... # type: int
|
||||
NETLINK_USERSOCK = ... # type: int
|
||||
NETLINK_XFRM = ... # type: int
|
||||
NI_DGRAM = ... # type: int
|
||||
NI_MAXHOST = ... # type: int
|
||||
NI_MAXSERV = ... # type: int
|
||||
NI_NAMEREQD = ... # type: int
|
||||
NI_NOFQDN = ... # type: int
|
||||
NI_NUMERICHOST = ... # type: int
|
||||
NI_NUMERICSERV = ... # type: int
|
||||
PACKET_BROADCAST = ... # type: int
|
||||
PACKET_FASTROUTE = ... # type: int
|
||||
PACKET_HOST = ... # type: int
|
||||
PACKET_LOOPBACK = ... # type: int
|
||||
PACKET_MULTICAST = ... # type: int
|
||||
PACKET_OTHERHOST = ... # type: int
|
||||
PACKET_OUTGOING = ... # type: int
|
||||
PF_PACKET = ... # type: int
|
||||
SHUT_RD = ... # type: int
|
||||
SHUT_RDWR = ... # type: int
|
||||
SHUT_WR = ... # type: int
|
||||
SOCK_DGRAM = ... # type: int
|
||||
SOCK_RAW = ... # type: int
|
||||
SOCK_RDM = ... # type: int
|
||||
SOCK_SEQPACKET = ... # type: int
|
||||
SOCK_STREAM = ... # type: int
|
||||
SOL_HCI = ... # type: int
|
||||
SOL_IP = ... # type: int
|
||||
SOL_SOCKET = ... # type: int
|
||||
SOL_TCP = ... # type: int
|
||||
SOL_TIPC = ... # type: int
|
||||
SOL_UDP = ... # type: int
|
||||
SOMAXCONN = ... # type: int
|
||||
SO_ACCEPTCONN = ... # type: int
|
||||
SO_BROADCAST = ... # type: int
|
||||
SO_DEBUG = ... # type: int
|
||||
SO_DONTROUTE = ... # type: int
|
||||
SO_ERROR = ... # type: int
|
||||
SO_KEEPALIVE = ... # type: int
|
||||
SO_LINGER = ... # type: int
|
||||
SO_OOBINLINE = ... # type: int
|
||||
SO_RCVBUF = ... # type: int
|
||||
SO_RCVLOWAT = ... # type: int
|
||||
SO_RCVTIMEO = ... # type: int
|
||||
SO_REUSEADDR = ... # type: int
|
||||
SO_REUSEPORT = ... # type: int
|
||||
SO_SNDBUF = ... # type: int
|
||||
SO_SNDLOWAT = ... # type: int
|
||||
SO_SNDTIMEO = ... # type: int
|
||||
SO_TYPE = ... # type: int
|
||||
SSL_ERROR_EOF = ... # type: int
|
||||
SSL_ERROR_INVALID_ERROR_CODE = ... # type: int
|
||||
SSL_ERROR_SSL = ... # type: int
|
||||
SSL_ERROR_SYSCALL = ... # type: int
|
||||
SSL_ERROR_WANT_CONNECT = ... # type: int
|
||||
SSL_ERROR_WANT_READ = ... # type: int
|
||||
SSL_ERROR_WANT_WRITE = ... # type: int
|
||||
SSL_ERROR_WANT_X509_LOOKUP = ... # type: int
|
||||
SSL_ERROR_ZERO_RETURN = ... # type: int
|
||||
TCP_CORK = ... # type: int
|
||||
TCP_DEFER_ACCEPT = ... # type: int
|
||||
TCP_INFO = ... # type: int
|
||||
TCP_KEEPCNT = ... # type: int
|
||||
TCP_KEEPIDLE = ... # type: int
|
||||
TCP_KEEPINTVL = ... # type: int
|
||||
TCP_LINGER2 = ... # type: int
|
||||
TCP_MAXSEG = ... # type: int
|
||||
TCP_NODELAY = ... # type: int
|
||||
TCP_QUICKACK = ... # type: int
|
||||
TCP_SYNCNT = ... # type: int
|
||||
TCP_WINDOW_CLAMP = ... # type: int
|
||||
TIPC_ADDR_ID = ... # type: int
|
||||
TIPC_ADDR_NAME = ... # type: int
|
||||
TIPC_ADDR_NAMESEQ = ... # type: int
|
||||
TIPC_CFG_SRV = ... # type: int
|
||||
TIPC_CLUSTER_SCOPE = ... # type: int
|
||||
TIPC_CONN_TIMEOUT = ... # type: int
|
||||
TIPC_CRITICAL_IMPORTANCE = ... # type: int
|
||||
TIPC_DEST_DROPPABLE = ... # type: int
|
||||
TIPC_HIGH_IMPORTANCE = ... # type: int
|
||||
TIPC_IMPORTANCE = ... # type: int
|
||||
TIPC_LOW_IMPORTANCE = ... # type: int
|
||||
TIPC_MEDIUM_IMPORTANCE = ... # type: int
|
||||
TIPC_NODE_SCOPE = ... # type: int
|
||||
TIPC_PUBLISHED = ... # type: int
|
||||
TIPC_SRC_DROPPABLE = ... # type: int
|
||||
TIPC_SUBSCR_TIMEOUT = ... # type: int
|
||||
TIPC_SUB_CANCEL = ... # type: int
|
||||
TIPC_SUB_PORTS = ... # type: int
|
||||
TIPC_SUB_SERVICE = ... # type: int
|
||||
TIPC_TOP_SRV = ... # type: int
|
||||
TIPC_WAIT_FOREVER = ... # type: int
|
||||
TIPC_WITHDRAWN = ... # type: int
|
||||
TIPC_ZONE_SCOPE = ... # type: int
|
||||
|
||||
# PyCapsule
|
||||
CAPI = ... # type: Any
|
||||
|
||||
has_ipv6 = ... # type: bool
|
||||
|
||||
class error(IOError): ...
|
||||
class gaierror(error): ...
|
||||
class timeout(error): ...
|
||||
|
||||
class SocketType(object):
|
||||
family = ... # type: int
|
||||
type = ... # type: int
|
||||
proto = ... # type: int
|
||||
timeout = ... # type: float
|
||||
|
||||
def __init__(self, family: int = ..., type: int = ..., proto: int = ...) -> None: ...
|
||||
def accept(self) -> Tuple['SocketType', tuple]: ...
|
||||
def bind(self, address: tuple) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def connect(self, address: tuple) -> None:
|
||||
raise gaierror
|
||||
raise timeout
|
||||
def connect_ex(self, address: tuple) -> int: ...
|
||||
def dup(self) -> "SocketType": ...
|
||||
def fileno(self) -> int: ...
|
||||
def getpeername(self) -> tuple: ...
|
||||
def getsockname(self) -> tuple: ...
|
||||
def getsockopt(self, level: int, option: str, buffersize: int = ...) -> str: ...
|
||||
def gettimeout(self) -> float: ...
|
||||
def listen(self, backlog: int) -> None:
|
||||
raise error
|
||||
def makefile(self, mode: str = ..., buffersize: int = ...) -> IO[Any]: ...
|
||||
def recv(self, buffersize: int, flags: int = ...) -> str: ...
|
||||
def recv_into(self, buffer: bytearray, nbytes: int = ..., flags: int = ...) -> int: ...
|
||||
def recvfrom(self, buffersize: int, flags: int = ...) -> tuple:
|
||||
raise error
|
||||
def recvfrom_into(self, buffer: bytearray, nbytes: int = ...,
|
||||
flags: int = ...) -> int: ...
|
||||
def send(self, data: str, flags: int =...) -> int: ...
|
||||
def sendall(self, data: str, flags: int = ...) -> None: ...
|
||||
@overload
|
||||
def sendto(self, data: str, address: tuple) -> int: ...
|
||||
@overload
|
||||
def sendto(self, data: str, flags: int, address: tuple) -> int: ...
|
||||
def setblocking(self, flag: bool) -> None: ...
|
||||
def setsockopt(self, level: int, option: int, value: Union[int, str]) -> None: ...
|
||||
def settimeout(self, value: Optional[float]) -> None: ...
|
||||
def shutdown(self, flag: int) -> None: ...
|
||||
53
stdlib/2.7/_sre.pyi
Normal file
53
stdlib/2.7/_sre.pyi
Normal file
@@ -0,0 +1,53 @@
|
||||
"""Stub file for the '_sre' module."""
|
||||
|
||||
from typing import Any, Union, Iterable, Optional, Mapping, Sequence, Dict, List, Tuple, overload
|
||||
|
||||
CODESIZE = ... # type: int
|
||||
MAGIC = ... # type: int
|
||||
MAXREPEAT = ... # type: long
|
||||
copyright = ... # type: str
|
||||
|
||||
class SRE_Match(object):
|
||||
def start(self, group: int = ...) -> int:
|
||||
raise IndexError()
|
||||
def end(self, group: int = ...) -> int:
|
||||
raise IndexError()
|
||||
def expand(self, s: str) -> Any: ...
|
||||
@overload
|
||||
def group(self) -> str: ...
|
||||
@overload
|
||||
def group(self, group:int = ...) -> Optional[str]: ...
|
||||
def groupdict(self) -> Dict[int, Optional[str]]: ...
|
||||
def groups(self) -> Tuple[Optional[str]]: ...
|
||||
def span(self) -> Tuple[int, int]:
|
||||
raise IndexError()
|
||||
|
||||
class SRE_Scanner(object):
|
||||
pattern = ... # type: str
|
||||
def match(self) -> SRE_Match: ...
|
||||
def search(self) -> SRE_Match: ...
|
||||
|
||||
class SRE_Pattern(object):
|
||||
pattern = ... # type: str
|
||||
flags = ... # type: int
|
||||
groups = ... # type: int
|
||||
groupindex = ... # type: Mapping[int, int]
|
||||
indexgroup = ... # type: Sequence[int]
|
||||
def findall(self, source: str, pos:int = ..., endpos:int = ...) -> List[Union[tuple, str]]: ...
|
||||
def finditer(self, source: str, pos: int = ..., endpos:int = ...) -> Iterable[Union[tuple, str]]: ...
|
||||
def match(self, pattern, pos: int = ..., endpos:int = ...) -> SRE_Match: ...
|
||||
def scanner(self, s: str, start: int = ..., end: int = ...) -> SRE_Scanner: ...
|
||||
def search(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ...
|
||||
def split(self, source: str, maxsplit:int = ...) -> List[Optional[str]]: ...
|
||||
def sub(self, repl: str, string: str, count:int = ...) -> tuple: ...
|
||||
def subn(self, repl: str, string: str, count:int = ...) -> tuple: ...
|
||||
|
||||
def compile(pattern: str, flags: int, code: List[int],
|
||||
groups:int = ...,
|
||||
groupindex: Mapping[int, int] = ...,
|
||||
indexgroup: Sequence[int] = ...) -> SRE_Pattern:
|
||||
raise OverflowError()
|
||||
|
||||
def getcodesize() -> int: ...
|
||||
|
||||
def getlower(a: int, b: int) -> int: ...
|
||||
22
stdlib/2.7/_struct.pyi
Normal file
22
stdlib/2.7/_struct.pyi
Normal file
@@ -0,0 +1,22 @@
|
||||
"""Stub file for the '_struct' module."""
|
||||
|
||||
from typing import Any, AnyStr, Tuple
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
class Struct(object):
|
||||
size = ... # type: int
|
||||
format = ... # type: str
|
||||
|
||||
def __init__(self, fmt: str) -> None: ...
|
||||
def pack_into(buffer: bytearray, offset: int, obj: Any) -> None: ...
|
||||
def pack(self, *args) -> str: ...
|
||||
def unpack(self, s:str) -> Tuple[Any]: ...
|
||||
def unpack_from(self, buffer: bytearray, offset:int = ...) -> Tuple[Any]: ...
|
||||
|
||||
def _clearcache() -> None: ...
|
||||
def calcsize(fmt: str) -> int: ...
|
||||
def pack(fmt: AnyStr, obj: Any) -> str: ...
|
||||
def pack_into(fmt: AnyStr, buffer: bytearray, offset: int, obj: Any) -> None: ...
|
||||
def unpack(fmt: AnyStr, data: str) -> Tuple[Any]: ...
|
||||
def unpack_from(fmt: AnyStr, buffer: bytearray, offset: int = ...) -> Tuple[Any]: ...
|
||||
41
stdlib/2.7/_symtable.pyi
Normal file
41
stdlib/2.7/_symtable.pyi
Normal file
@@ -0,0 +1,41 @@
|
||||
from typing import List, Dict
|
||||
|
||||
CELL = ... # type: int
|
||||
DEF_BOUND = ... # type: int
|
||||
DEF_FREE = ... # type: int
|
||||
DEF_FREE_CLASS = ... # type: int
|
||||
DEF_GLOBAL = ... # type: int
|
||||
DEF_IMPORT = ... # type: int
|
||||
DEF_LOCAL = ... # type: int
|
||||
DEF_PARAM = ... # type: int
|
||||
FREE = ... # type: int
|
||||
GLOBAL_EXPLICIT = ... # type: int
|
||||
GLOBAL_IMPLICIT = ... # type: int
|
||||
LOCAL = ... # type: int
|
||||
OPT_BARE_EXEC = ... # type: int
|
||||
OPT_EXEC = ... # type: int
|
||||
OPT_IMPORT_STAR = ... # type: int
|
||||
SCOPE_MASK = ... # type: int
|
||||
SCOPE_OFF = ... # type: int
|
||||
TYPE_CLASS = ... # type: int
|
||||
TYPE_FUNCTION = ... # type: int
|
||||
TYPE_MODULE = ... # type: int
|
||||
USE = ... # type: int
|
||||
|
||||
class _symtable_entry(object):
|
||||
...
|
||||
|
||||
class symtable(object):
|
||||
children = ... # type: List[_symtable_entry]
|
||||
id = ... # type: int
|
||||
lineno = ... # type: int
|
||||
name = ... # type: str
|
||||
nested = ... # type: int
|
||||
optimized = ... # type: int
|
||||
symbols = ... # type: Dict[str, int]
|
||||
type = ... # type: int
|
||||
varnames = ... # type: List[str]
|
||||
|
||||
def __init__(src: str, filename: str, startstr: str) -> None: ...
|
||||
|
||||
|
||||
11
stdlib/2.7/_warnings.pyi
Normal file
11
stdlib/2.7/_warnings.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Any, List
|
||||
|
||||
default_action = ... # type: str
|
||||
filters = ... # type: List[tuple]
|
||||
once_registry = ... # type: dict
|
||||
|
||||
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: ...
|
||||
16
stdlib/2.7/_weakref.pyi
Normal file
16
stdlib/2.7/_weakref.pyi
Normal file
@@ -0,0 +1,16 @@
|
||||
from typing import Any, Callable
|
||||
|
||||
class CallableProxyType(object): # "weakcallableproxy"
|
||||
pass
|
||||
|
||||
class ProxyType(object): # "weakproxy"
|
||||
pass
|
||||
|
||||
class ReferenceType(object): # "weakref"
|
||||
pass
|
||||
|
||||
ref = ReferenceType
|
||||
|
||||
def getweakrefcount(object: Any) -> int: ...
|
||||
def getweakrefs(object: Any) -> int: ...
|
||||
def proxy(object: Any, callback: Callable[[Any], Any] = ...) -> None: ...
|
||||
5
stdlib/2.7/_weakrefset.pyi
Normal file
5
stdlib/2.7/_weakrefset.pyi
Normal file
@@ -0,0 +1,5 @@
|
||||
from typing import Iterator, Any
|
||||
|
||||
class WeakSet:
|
||||
def __iter__(self) -> Iterator[Any]: ...
|
||||
def add(self, *args, **kwargs) -> Any: ...
|
||||
56
stdlib/2.7/array.pyi
Normal file
56
stdlib/2.7/array.pyi
Normal file
@@ -0,0 +1,56 @@
|
||||
"""Stub file for the 'array' module."""
|
||||
|
||||
from typing import (Any, Generic, IO, Iterable, Sequence, TypeVar,
|
||||
Union, overload, Iterator, Tuple, BinaryIO, List)
|
||||
|
||||
T = TypeVar('T')
|
||||
|
||||
class array(Generic[T]):
|
||||
def __init__(self, typecode: str, init: Iterable[T] = ...) -> None: ...
|
||||
def __add__(self, y: "array[T]") -> "array[T]": ...
|
||||
def __contains__(self, y: Any) -> bool: ...
|
||||
def __copy__(self) -> "array[T]": ...
|
||||
def __deepcopy__(self) -> "array": ...
|
||||
def __delitem__(self, y: Union[slice, int]) -> None: ...
|
||||
def __delslice__(self, i: int, j: int) -> None: ...
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> Any: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> "array": ...
|
||||
def __iadd__(self, y: "array[T]") -> "array[T]": ...
|
||||
def __imul__(self, y: int) -> "array[T]": ...
|
||||
def __iter__(self) -> Iterator[T]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __mul__(self, n: int) -> "array[T]": ...
|
||||
def __rmul__(self, n: int) -> "array[T]": ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, y: T) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, i: slice, y: "array[T]") -> None: ...
|
||||
|
||||
def append(self, x: T) -> None: ...
|
||||
def buffer_info(self) -> Tuple[int, int]: ...
|
||||
def byteswap(self) -> None:
|
||||
raise RuntimeError()
|
||||
def count(self) -> int: ...
|
||||
def extend(self, x: Sequence[T]) -> None: ...
|
||||
def fromlist(self, list: List[T]) -> None:
|
||||
raise EOFError()
|
||||
raise IOError()
|
||||
def fromfile(self, f: BinaryIO, n: int) -> None: ...
|
||||
def fromstring(self, s: str) -> None: ...
|
||||
def fromunicode(self, u: unicode) -> None: ...
|
||||
def index(self, x: T) -> int: ...
|
||||
def insert(self, i: int, x: T) -> None: ...
|
||||
def pop(self, i: int = ...) -> T: ...
|
||||
def read(self, f: IO[str], n: int) -> None:
|
||||
raise DeprecationWarning()
|
||||
def remove(self, x: T) -> None: ...
|
||||
def reverse(self) -> None: ...
|
||||
def tofile(self, f: BinaryIO) -> None:
|
||||
raise IOError()
|
||||
def tolist(self) -> List[T]: ...
|
||||
def tostring(self) -> str: ...
|
||||
def tounicode(self) -> unicode: ...
|
||||
def write(self, f: IO[str]) -> None:
|
||||
raise DeprecationWarning()
|
||||
23
stdlib/2.7/binascii.pyi
Normal file
23
stdlib/2.7/binascii.pyi
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Stubs for the binascii module."""
|
||||
|
||||
from typing import Optional
|
||||
|
||||
def a2b_base64(string: str) -> str: ...
|
||||
def a2b_hex(hexstr: str) -> str: ...
|
||||
def a2b_hqx(string: str) -> str: ...
|
||||
def a2b_qp(string: str, header: bool = ...) -> str: ...
|
||||
def a2b_uu(string: str) -> str: ...
|
||||
def b2a_base64(data: str) -> str: ...
|
||||
def b2a_hex(data: str) -> str: ...
|
||||
def b2a_hqx(data: str) -> str: ...
|
||||
def b2a_qp(data: str, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> str: ...
|
||||
def b2a_uu(data: str) -> str: ...
|
||||
def crc32(data: str, crc: Optional[int]) -> int: ...
|
||||
def crc_hqx(data: str, oldcrc: int) -> int: ...
|
||||
def hexlify(data: str) -> str: ...
|
||||
def rlecode_hqx(data: str) -> str: ...
|
||||
def rledecode_hqx(data: str) -> str: ...
|
||||
def unhexlify(hexstr: str) -> str: ...
|
||||
|
||||
class Error(Exception): ...
|
||||
class Incomplete(Exception): ...
|
||||
1
stdlib/2.7/builtins.pyi
Symbolic link
1
stdlib/2.7/builtins.pyi
Symbolic link
@@ -0,0 +1 @@
|
||||
__builtin__.pyi
|
||||
19
stdlib/2.7/cPickle.pyi
Normal file
19
stdlib/2.7/cPickle.pyi
Normal file
@@ -0,0 +1,19 @@
|
||||
from typing import Any, IO, List
|
||||
|
||||
HIGHEST_PROTOCOL = ... # type: int
|
||||
compatible_formats = ... # type: List[str]
|
||||
format_version = ... # type: str
|
||||
|
||||
class Pickler: ...
|
||||
class Unpickler: ...
|
||||
|
||||
def dump(obj: Any, file: IO[str], protocol: int = ...) -> None: ...
|
||||
def dumps(obj: Any, protocol: int = ...) -> str: ...
|
||||
def load(file: IO[str]) -> Any: ...
|
||||
def loads(str: str) -> Any: ...
|
||||
|
||||
class PickleError(Exception): ...
|
||||
class UnpicklingError(PickleError): ...
|
||||
class BadPickleGet(UnpicklingError): ...
|
||||
class PicklingError(PickleError): ...
|
||||
class UnpickleableError(PicklingError): ...
|
||||
50
stdlib/2.7/cStringIO.pyi
Normal file
50
stdlib/2.7/cStringIO.pyi
Normal file
@@ -0,0 +1,50 @@
|
||||
# Stubs for cStringIO (Python 2.7)
|
||||
# See https://docs.python.org/2/library/stringio.html
|
||||
|
||||
from typing import overload, IO, List, Iterable, Iterator, Optional, Union
|
||||
from types import TracebackType
|
||||
|
||||
# TODO the typing.IO[] generics should be split into input and output.
|
||||
|
||||
class InputType(IO[str], Iterator[str]):
|
||||
def getvalue(self) -> str: ...
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
def closed(self) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, size: int = ...) -> str: ...
|
||||
def readline(self, size: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = ...) -> Optional[int]: ...
|
||||
def __iter__(self) -> 'InputType': ...
|
||||
def next(self) -> str: ...
|
||||
def reset(self) -> None: ...
|
||||
|
||||
class OutputType(IO[str], Iterator[str]):
|
||||
@property
|
||||
def softspace(self) -> int: ...
|
||||
def getvalue(self) -> str: ...
|
||||
def close(self) -> None: ...
|
||||
@property
|
||||
def closed(self) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def read(self, size: int = ...) -> str: ...
|
||||
def readline(self, size: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: int = ...) -> Optional[int]: ...
|
||||
def __iter__(self) -> 'OutputType': ...
|
||||
def next(self) -> str: ...
|
||||
def reset(self) -> None: ...
|
||||
def write(self, b: Union[str, unicode]) -> None: ...
|
||||
def writelines(self, lines: Iterable[Union[str, unicode]]) -> None: ...
|
||||
|
||||
@overload
|
||||
def StringIO() -> OutputType: ...
|
||||
@overload
|
||||
def StringIO(s: str) -> InputType: ...
|
||||
221
stdlib/2.7/datetime.pyi
Normal file
221
stdlib/2.7/datetime.pyi
Normal file
@@ -0,0 +1,221 @@
|
||||
# Stubs for datetime
|
||||
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from time import struct_time
|
||||
from typing import Optional, SupportsAbs, Tuple, Union, overload
|
||||
|
||||
MINYEAR = 0
|
||||
MAXYEAR = 0
|
||||
|
||||
class tzinfo(object):
|
||||
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(object):
|
||||
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: Union[str, unicode]) -> str: ...
|
||||
def isoformat(self) -> str: ...
|
||||
def timetuple(self) -> struct_time: ...
|
||||
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(object):
|
||||
# TODO: is actually subclass of date, but __le__, __lt__, __ge__, __gt__ don't work with date.
|
||||
min = ... # type: datetime
|
||||
max = ... # type: datetime
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, year: int, month: int = ..., day: int = ..., hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microseconds: 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) -> struct_time: ...
|
||||
def timestamp(self) -> float: ...
|
||||
def utctimetuple(self) -> struct_time: ...
|
||||
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]: ...
|
||||
129
stdlib/2.7/errno.pyi
Normal file
129
stdlib/2.7/errno.pyi
Normal file
@@ -0,0 +1,129 @@
|
||||
"""Stubs for the 'errno' module."""
|
||||
|
||||
from typing import Dict
|
||||
|
||||
errorcode = ... # type: Dict[int, str]
|
||||
|
||||
E2BIG = ... # type: int
|
||||
EACCES = ... # type: int
|
||||
EADDRINUSE = ... # type: int
|
||||
EADDRNOTAVAIL = ... # type: int
|
||||
EADV = ... # type: int
|
||||
EAFNOSUPPORT = ... # type: int
|
||||
EAGAIN = ... # type: int
|
||||
EALREADY = ... # type: int
|
||||
EBADE = ... # type: int
|
||||
EBADF = ... # type: int
|
||||
EBADFD = ... # type: int
|
||||
EBADMSG = ... # type: int
|
||||
EBADR = ... # type: int
|
||||
EBADRQC = ... # type: int
|
||||
EBADSLT = ... # type: int
|
||||
EBFONT = ... # type: int
|
||||
EBUSY = ... # type: int
|
||||
ECHILD = ... # type: int
|
||||
ECHRNG = ... # type: int
|
||||
ECOMM = ... # type: int
|
||||
ECONNABORTED = ... # type: int
|
||||
ECONNREFUSED = ... # type: int
|
||||
ECONNRESET = ... # type: int
|
||||
EDEADLK = ... # type: int
|
||||
EDEADLOCK = ... # type: int
|
||||
EDESTADDRREQ = ... # type: int
|
||||
EDOM = ... # type: int
|
||||
EDOTDOT = ... # type: int
|
||||
EDQUOT = ... # type: int
|
||||
EEXIST = ... # type: int
|
||||
EFAULT = ... # type: int
|
||||
EFBIG = ... # type: int
|
||||
EHOSTDOWN = ... # type: int
|
||||
EHOSTUNREACH = ... # type: int
|
||||
EIDRM = ... # type: int
|
||||
EILSEQ = ... # type: int
|
||||
EINPROGRESS = ... # type: int
|
||||
EINTR = ... # type: int
|
||||
EINVAL = ... # type: int
|
||||
EIO = ... # type: int
|
||||
EISCONN = ... # type: int
|
||||
EISDIR = ... # type: int
|
||||
EISNAM = ... # type: int
|
||||
EL2HLT = ... # type: int
|
||||
EL2NSYNC = ... # type: int
|
||||
EL3HLT = ... # type: int
|
||||
EL3RST = ... # type: int
|
||||
ELIBACC = ... # type: int
|
||||
ELIBBAD = ... # type: int
|
||||
ELIBEXEC = ... # type: int
|
||||
ELIBMAX = ... # type: int
|
||||
ELIBSCN = ... # type: int
|
||||
ELNRNG = ... # type: int
|
||||
ELOOP = ... # type: int
|
||||
EMFILE = ... # type: int
|
||||
EMLINK = ... # type: int
|
||||
EMSGSIZE = ... # type: int
|
||||
EMULTIHOP = ... # type: int
|
||||
ENAMETOOLONG = ... # type: int
|
||||
ENAVAIL = ... # type: int
|
||||
ENETDOWN = ... # type: int
|
||||
ENETRESET = ... # type: int
|
||||
ENETUNREACH = ... # type: int
|
||||
ENFILE = ... # type: int
|
||||
ENOANO = ... # type: int
|
||||
ENOBUFS = ... # type: int
|
||||
ENOCSI = ... # type: int
|
||||
ENODATA = ... # type: int
|
||||
ENODEV = ... # type: int
|
||||
ENOENT = ... # type: int
|
||||
ENOEXEC = ... # type: int
|
||||
ENOLCK = ... # type: int
|
||||
ENOLINK = ... # type: int
|
||||
ENOMEM = ... # type: int
|
||||
ENOMSG = ... # type: int
|
||||
ENONET = ... # type: int
|
||||
ENOPKG = ... # type: int
|
||||
ENOPROTOOPT = ... # type: int
|
||||
ENOSPC = ... # type: int
|
||||
ENOSR = ... # type: int
|
||||
ENOSTR = ... # type: int
|
||||
ENOSYS = ... # type: int
|
||||
ENOTBLK = ... # type: int
|
||||
ENOTCONN = ... # type: int
|
||||
ENOTDIR = ... # type: int
|
||||
ENOTEMPTY = ... # type: int
|
||||
ENOTNAM = ... # type: int
|
||||
ENOTSOCK = ... # type: int
|
||||
ENOTSUP = ... # type: int
|
||||
ENOTTY = ... # type: int
|
||||
ENOTUNIQ = ... # type: int
|
||||
ENXIO = ... # type: int
|
||||
EOPNOTSUPP = ... # type: int
|
||||
EOVERFLOW = ... # type: int
|
||||
EPERM = ... # type: int
|
||||
EPFNOSUPPORT = ... # type: int
|
||||
EPIPE = ... # type: int
|
||||
EPROTO = ... # type: int
|
||||
EPROTONOSUPPORT = ... # type: int
|
||||
EPROTOTYPE = ... # type: int
|
||||
ERANGE = ... # type: int
|
||||
EREMCHG = ... # type: int
|
||||
EREMOTE = ... # type: int
|
||||
EREMOTEIO = ... # type: int
|
||||
ERESTART = ... # type: int
|
||||
EROFS = ... # type: int
|
||||
ESHUTDOWN = ... # type: int
|
||||
ESOCKTNOSUPPORT = ... # type: int
|
||||
ESPIPE = ... # type: int
|
||||
ESRCH = ... # type: int
|
||||
ESRMNT = ... # type: int
|
||||
ESTALE = ... # type: int
|
||||
ESTRPIPE = ... # type: int
|
||||
ETIME = ... # type: int
|
||||
ETIMEDOUT = ... # type: int
|
||||
ETOOMANYREFS = ... # type: int
|
||||
ETXTBSY = ... # type: int
|
||||
EUCLEAN = ... # type: int
|
||||
EUNATCH = ... # type: int
|
||||
EUSERS = ... # type: int
|
||||
EWOULDBLOCK = ... # type: int
|
||||
EXDEV = ... # type: int
|
||||
EXFULL = ... # type: int
|
||||
80
stdlib/2.7/exceptions.pyi
Normal file
80
stdlib/2.7/exceptions.pyi
Normal file
@@ -0,0 +1,80 @@
|
||||
from typing import Any, List, Optional
|
||||
|
||||
class StandardError(Exception): ...
|
||||
class ArithmeticError(StandardError): ...
|
||||
class AssertionError(StandardError): ...
|
||||
class AttributeError(StandardError): ...
|
||||
class BaseException(object):
|
||||
args = ... # type: List[Any]
|
||||
message = ... # type: str
|
||||
def __getslice__(self, start, end) -> Any: ...
|
||||
def __getitem__(self, start, end) -> Any: ...
|
||||
def __unicode__(self) -> unicode: ...
|
||||
class BufferError(StandardError): ...
|
||||
class BytesWarning(Warning): ...
|
||||
class DeprecationWarning(Warning): ...
|
||||
class EOFError(StandardError): ...
|
||||
class EnvironmentError(StandardError):
|
||||
errno = ... # type: int
|
||||
strerror = ... # type: str
|
||||
filename = ... # type: str
|
||||
class Exception(BaseException): ...
|
||||
class FloatingPointError(ArithmeticError): ...
|
||||
class FutureWarning(Warning): ...
|
||||
class GeneratorExit(BaseException): ...
|
||||
class IOError(EnvironmentError): ...
|
||||
class ImportError(StandardError): ...
|
||||
class ImportWarning(Warning): ...
|
||||
class IndentationError(SyntaxError): ...
|
||||
class IndexError(LookupError): ...
|
||||
class KeyError(LookupError): ...
|
||||
class KeyboardInterrupt(BaseException): ...
|
||||
class LookupError(StandardError): ...
|
||||
class MemoryError(StandardError): ...
|
||||
class NameError(StandardError): ...
|
||||
class NotImplementedError(RuntimeError): ...
|
||||
class OSError(EnvironmentError): ...
|
||||
class OverflowError(ArithmeticError): ...
|
||||
class PendingDeprecationWarning(Warning): ...
|
||||
class ReferenceError(StandardError): ...
|
||||
class RuntimeError(StandardError): ...
|
||||
class RuntimeWarning(Warning): ...
|
||||
class StopIteration(Exception): ...
|
||||
class SyntaxError(StandardError):
|
||||
text = ... # type: str
|
||||
print_file_and_line = ... # type: Optional[str]
|
||||
filename = ... # type: str
|
||||
lineno = ... # type: int
|
||||
offset = ... # type: int
|
||||
msg = ... # type: str
|
||||
class SyntaxWarning(Warning): ...
|
||||
class SystemError(StandardError): ...
|
||||
class SystemExit(BaseException):
|
||||
code = ... # type: int
|
||||
class TabError(IndentationError): ...
|
||||
class TypeError(StandardError): ...
|
||||
class UnboundLocalError(NameError): ...
|
||||
class UnicodeError(ValueError): ...
|
||||
class UnicodeDecodeError(UnicodeError):
|
||||
start = ... # type: int
|
||||
reason = ... # type: str
|
||||
object = ... # type: str
|
||||
end = ... # type: int
|
||||
encoding = ... # type: str
|
||||
class UnicodeEncodeError(UnicodeError):
|
||||
start = ... # type: int
|
||||
reason = ... # type: str
|
||||
object = ... # type: unicode
|
||||
end = ... # type: int
|
||||
encoding = ... # type: str
|
||||
class UnicodeTranslateError(UnicodeError):
|
||||
start = ... # type: int
|
||||
reason = ... # type: str
|
||||
object = ... # type: Any
|
||||
end = ... # type: int
|
||||
encoding = ... # type: str
|
||||
class UnicodeWarning(Warning): ...
|
||||
class UserWarning(Warning): ...
|
||||
class ValueError(StandardError): ...
|
||||
class Warning(Exception): ...
|
||||
class ZeroDivisionError(ArithmeticError): ...
|
||||
85
stdlib/2.7/fcntl.pyi
Normal file
85
stdlib/2.7/fcntl.pyi
Normal file
@@ -0,0 +1,85 @@
|
||||
from typing import Union
|
||||
import io
|
||||
|
||||
FASYNC = ... # type: int
|
||||
FD_CLOEXEC = ... # type: int
|
||||
|
||||
DN_ACCESS = ... # type: int
|
||||
DN_ATTRIB = ... # type: int
|
||||
DN_CREATE = ... # type: int
|
||||
DN_DELETE = ... # type: int
|
||||
DN_MODIFY = ... # type: int
|
||||
DN_MULTISHOT = ... # type: int
|
||||
DN_RENAME = ... # type: int
|
||||
F_DUPFD = ... # type: int
|
||||
F_EXLCK = ... # type: int
|
||||
F_GETFD = ... # type: int
|
||||
F_GETFL = ... # type: int
|
||||
F_GETLEASE = ... # type: int
|
||||
F_GETLK = ... # type: int
|
||||
F_GETLK64 = ... # type: int
|
||||
F_GETOWN = ... # type: int
|
||||
F_GETSIG = ... # type: int
|
||||
F_NOTIFY = ... # type: int
|
||||
F_RDLCK = ... # type: int
|
||||
F_SETFD = ... # type: int
|
||||
F_SETFL = ... # type: int
|
||||
F_SETLEASE = ... # type: int
|
||||
F_SETLK = ... # type: int
|
||||
F_SETLK64 = ... # type: int
|
||||
F_SETLKW = ... # type: int
|
||||
F_SETLKW64 = ... # type: int
|
||||
F_SETOWN = ... # type: int
|
||||
F_SETSIG = ... # type: int
|
||||
F_SHLCK = ... # type: int
|
||||
F_UNLCK = ... # type: int
|
||||
F_WRLCK = ... # type: int
|
||||
I_ATMARK = ... # type: int
|
||||
I_CANPUT = ... # type: int
|
||||
I_CKBAND = ... # type: int
|
||||
I_FDINSERT = ... # type: int
|
||||
I_FIND = ... # type: int
|
||||
I_FLUSH = ... # type: int
|
||||
I_FLUSHBAND = ... # type: int
|
||||
I_GETBAND = ... # type: int
|
||||
I_GETCLTIME = ... # type: int
|
||||
I_GETSIG = ... # type: int
|
||||
I_GRDOPT = ... # type: int
|
||||
I_GWROPT = ... # type: int
|
||||
I_LINK = ... # type: int
|
||||
I_LIST = ... # type: int
|
||||
I_LOOK = ... # type: int
|
||||
I_NREAD = ... # type: int
|
||||
I_PEEK = ... # type: int
|
||||
I_PLINK = ... # type: int
|
||||
I_POP = ... # type: int
|
||||
I_PUNLINK = ... # type: int
|
||||
I_PUSH = ... # type: int
|
||||
I_RECVFD = ... # type: int
|
||||
I_SENDFD = ... # type: int
|
||||
I_SETCLTIME = ... # type: int
|
||||
I_SETSIG = ... # type: int
|
||||
I_SRDOPT = ... # type: int
|
||||
I_STR = ... # type: int
|
||||
I_SWROPT = ... # type: int
|
||||
I_UNLINK = ... # type: int
|
||||
LOCK_EX = ... # type: int
|
||||
LOCK_MAND = ... # type: int
|
||||
LOCK_NB = ... # type: int
|
||||
LOCK_READ = ... # type: int
|
||||
LOCK_RW = ... # type: int
|
||||
LOCK_SH = ... # type: int
|
||||
LOCK_UN = ... # type: int
|
||||
LOCK_WRITE = ... # type: int
|
||||
|
||||
_ANYFILE = Union[int, io.IOBase]
|
||||
|
||||
def fcntl(fd: _ANYFILE, op: int, arg: Union[int, str] = ...) -> Union[int, str]: ...
|
||||
|
||||
# TODO: arg: int or read-only buffer interface or read-write buffer interface
|
||||
def ioctl(fd: _ANYFILE, op: int, arg: Union[int, str] = ...,
|
||||
mutate_flag: bool = ...) -> Union[int, str]: ...
|
||||
|
||||
def flock(fd: _ANYFILE, op: int) -> None: ...
|
||||
def lockf(fd: _ANYFILE, op: int, length: int = ..., start: int = ...,
|
||||
whence: int = ...) -> Union[int, str]: ...
|
||||
27
stdlib/2.7/gc.pyi
Normal file
27
stdlib/2.7/gc.pyi
Normal file
@@ -0,0 +1,27 @@
|
||||
"""Stubs for the 'gc' module."""
|
||||
|
||||
from typing import List, Any, Tuple
|
||||
|
||||
def enable() -> None: ...
|
||||
def disable() -> None: ...
|
||||
def isenabled() -> bool: ...
|
||||
def collect(generation: int = ...) -> int: ...
|
||||
def set_debug(flags: int) -> None: ...
|
||||
def get_debug() -> int: ...
|
||||
def get_objects() -> List[Any]: ...
|
||||
def set_threshold(threshold0: int, threshold1: int = ..., threshold2: int = ...) -> None: ...
|
||||
def get_count() -> Tuple[int, int, int]: ...
|
||||
def get_threshold() -> Tuple[int, int, int]: ...
|
||||
def get_referrers(*objs: Any) -> List[Any]: ...
|
||||
def get_referents(*objs: Any) -> List[Any]: ...
|
||||
def is_tracked(obj: Any) -> bool: ...
|
||||
|
||||
garbage = ... # type: List[Any]
|
||||
|
||||
DEBUG_STATS = ... # type: Any
|
||||
DEBUG_COLLECTABLE = ... # type: Any
|
||||
DEBUG_UNCOLLECTABLE = ... # type: Any
|
||||
DEBUG_INSTANCES = ... # type: Any
|
||||
DEBUG_OBJECTS = ... # type: Any
|
||||
DEBUG_SAVEALL = ... # type: Any
|
||||
DEBUG_LEAK = ... # type: Any
|
||||
11
stdlib/2.7/grp.pyi
Normal file
11
stdlib/2.7/grp.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
from typing import Optional, List
|
||||
|
||||
class struct_group(object):
|
||||
gr_name = ... # type: Optional[str]
|
||||
gr_passwd = ... # type: Optional[str]
|
||||
gr_gid = ... # type: int
|
||||
gr_mem = ... # type: List[str]
|
||||
|
||||
def getgrall() -> List[struct_group]: ...
|
||||
def getgrgid(id: int) -> struct_group: ...
|
||||
def getgrnam(name: str) -> struct_group: ...
|
||||
35
stdlib/2.7/imp.pyi
Normal file
35
stdlib/2.7/imp.pyi
Normal file
@@ -0,0 +1,35 @@
|
||||
"""Stubs for the 'imp' module."""
|
||||
|
||||
from typing import List, Optional, Tuple, Iterable, IO, Any
|
||||
import types
|
||||
|
||||
C_BUILTIN = ... # type: int
|
||||
C_EXTENSION = ... # type: int
|
||||
IMP_HOOK = ... # type: int
|
||||
PKG_DIRECTORY = ... # type: int
|
||||
PY_CODERESOURCE = ... # type: int
|
||||
PY_COMPILED = ... # type: int
|
||||
PY_FROZEN = ... # type: int
|
||||
PY_RESOURCE = ... # type: int
|
||||
PY_SOURCE = ... # type: int
|
||||
SEARCH_ERROR = ... # type: int
|
||||
|
||||
def acquire_lock() -> None: ...
|
||||
def find_module(name: str, path: Iterable[str] = ...) -> Optional[Tuple[str, str, Tuple[str, str, int]]]: ...
|
||||
def get_magic() -> str: ...
|
||||
def get_suffixes() -> List[Tuple[str, str, int]]: ...
|
||||
def init_builtin(name: str) -> types.ModuleType: ...
|
||||
def init_frozen(name: str) -> types.ModuleType: ...
|
||||
def is_builtin(name: str) -> int: ...
|
||||
def is_frozen(name: str) -> bool: ...
|
||||
def load_compiled(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ...
|
||||
def load_dynamic(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ...
|
||||
def load_module(name: str, file: str, pathname: str, description: Tuple[str, str, int]) -> types.ModuleType: ...
|
||||
def load_source(name: str, pathname: str, file: IO[Any] = ...) -> types.ModuleType: ...
|
||||
def lock_held() -> bool: ...
|
||||
def new_module(name: str) -> types.ModuleType: ...
|
||||
def release_lock() -> None: ...
|
||||
|
||||
class NullImporter:
|
||||
def __init__(self, path_string: str) -> None: ...
|
||||
def find_module(fullname: str, path: str = ...) -> None: ...
|
||||
81
stdlib/2.7/itertools.pyi
Normal file
81
stdlib/2.7/itertools.pyi
Normal file
@@ -0,0 +1,81 @@
|
||||
# Stubs for itertools
|
||||
|
||||
# Based on https://docs.python.org/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]: ...
|
||||
|
||||
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 ifilter(predicate: Callable[[_T], Any],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def ifilterfalse(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]: ...
|
||||
|
||||
_T1 = TypeVar('_T1')
|
||||
_T2 = TypeVar('_T2')
|
||||
_T3 = TypeVar('_T3')
|
||||
_T4 = TypeVar('_T4')
|
||||
|
||||
@overload
|
||||
def imap(func: Callable[[_T1], _S], iter1: Iterable[_T1]) -> Iterable[_S]: ...
|
||||
@overload
|
||||
def imap(func: Callable[[_T1, _T2], _S],
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2]) -> Iterable[_S]: ... # TODO more than two iterables
|
||||
|
||||
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]: ...
|
||||
|
||||
@overload
|
||||
def izip(iter1: Iterable[_T1]) -> Iterable[Tuple[_T1]]: ...
|
||||
@overload
|
||||
def izip(iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2]) -> Iterable[Tuple[_T1, _T2]]: ...
|
||||
@overload
|
||||
def izip(iter1: Iterable[_T1], iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3]) -> Iterable[Tuple[_T1, _T2, _T3]]: ...
|
||||
@overload
|
||||
def izip(iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4]) -> Iterable[Tuple[_T1, _T2,
|
||||
_T3, _T4]]: ... # TODO more than four iterables
|
||||
def izip_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: int = ...) -> 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]]: ...
|
||||
206
stdlib/2.7/posix.pyi
Normal file
206
stdlib/2.7/posix.pyi
Normal file
@@ -0,0 +1,206 @@
|
||||
from typing import List, Mapping, Tuple, Union, Sequence, IO, Optional, TypeVar
|
||||
|
||||
error = OSError
|
||||
|
||||
confstr_names = ... # type: Dict[str, int]
|
||||
environ = ... # type: Dict[str, str]
|
||||
pathconf_names = ... # type: Dict[str, int]
|
||||
sysconf_names = ... # type: Dict[str, int]
|
||||
|
||||
EX_CANTCREAT= ... # type: int
|
||||
EX_CONFIG= ... # type: int
|
||||
EX_DATAERR= ... # type: int
|
||||
EX_IOERR= ... # type: int
|
||||
EX_NOHOST= ... # type: int
|
||||
EX_NOINPUT= ... # type: int
|
||||
EX_NOPERM= ... # type: int
|
||||
EX_NOUSER= ... # type: int
|
||||
EX_OK= ... # type: int
|
||||
EX_OSERR= ... # type: int
|
||||
EX_OSFILE= ... # type: int
|
||||
EX_PROTOCOL= ... # type: int
|
||||
EX_SOFTWARE= ... # type: int
|
||||
EX_TEMPFAIL= ... # type: int
|
||||
EX_UNAVAILABLE= ... # type: int
|
||||
EX_USAGE= ... # type: int
|
||||
F_OK= ... # type: int
|
||||
NGROUPS_MAX= ... # type: int
|
||||
O_APPEND= ... # type: int
|
||||
O_ASYNC= ... # type: int
|
||||
O_CREAT= ... # type: int
|
||||
O_DIRECT= ... # type: int
|
||||
O_DIRECTORY= ... # type: int
|
||||
O_DSYNC= ... # type: int
|
||||
O_EXCL= ... # type: int
|
||||
O_LARGEFILE= ... # type: int
|
||||
O_NDELAY= ... # type: int
|
||||
O_NOATIME= ... # type: int
|
||||
O_NOCTTY= ... # type: int
|
||||
O_NOFOLLOW= ... # type: int
|
||||
O_NONBLOCK= ... # type: int
|
||||
O_RDONLY= ... # type: int
|
||||
O_RDWR= ... # type: int
|
||||
O_RSYNC= ... # type: int
|
||||
O_SYNC= ... # type: int
|
||||
O_TRUNC= ... # type: int
|
||||
O_WRONLY= ... # type: int
|
||||
R_OK= ... # type: int
|
||||
TMP_MAX= ... # type: int
|
||||
WCONTINUED= ... # type: int
|
||||
WNOHANG= ... # type: int
|
||||
WUNTRACED= ... # type: int
|
||||
W_OK= ... # type: int
|
||||
X_OK= ... # type: int
|
||||
|
||||
def WCOREDUMP(status: int) -> bool: ...
|
||||
def WEXITSTATUS(status: int) -> bool: ...
|
||||
def WIFCONTINUED(status: int) -> bool: ...
|
||||
def WIFEXITED(status: int) -> bool: ...
|
||||
def WIFSIGNALED(status: int) -> bool: ...
|
||||
def WIFSTOPPED(status: int) -> bool: ...
|
||||
def WSTOPSIG(status: int) -> bool: ...
|
||||
def WTERMSIG(status: int) -> bool: ...
|
||||
|
||||
class stat_result(object):
|
||||
n_fields = ... # type: int
|
||||
n_sequence_fields = ... # type: int
|
||||
n_unnamed_fields = ... # type: int
|
||||
st_mode = ... # type: int
|
||||
st_ino = ... # type: int
|
||||
st_dev = ... # type: int
|
||||
st_nlink = ... # type: int
|
||||
st_uid = ... # type: int
|
||||
st_gid = ... # type: int
|
||||
st_size = ... # type: int
|
||||
st_atime = ... # type: int
|
||||
st_mtime = ... # type: int
|
||||
st_ctime = ... # type: int
|
||||
|
||||
class statvfs_result(object):
|
||||
n_fields = ... # type: int
|
||||
n_sequence_fields = ... # type: int
|
||||
n_unnamed_fields = ... # type: int
|
||||
f_bsize = ... # type: int
|
||||
f_frsize = ... # type: int
|
||||
f_blocks = ... # type: int
|
||||
f_bfree = ... # type: int
|
||||
f_bavail = ... # type: int
|
||||
f_files = ... # type: int
|
||||
f_ffree = ... # type: int
|
||||
f_favail = ... # type: int
|
||||
f_flag = ... # type: int
|
||||
f_namemax = ... # type: int
|
||||
|
||||
def _exit(status: int) -> None: ...
|
||||
def abort() -> None: ...
|
||||
def access(path: unicode, mode: int) -> bool: ...
|
||||
def chdir(path: unicode) -> None: ...
|
||||
def chmod(path: unicode, mode: int) -> None: ...
|
||||
def chown(path: unicode, uid: int, gid: int) -> None: ...
|
||||
def chroot(path: unicode) -> None: ...
|
||||
def close(fd: int) -> None: ...
|
||||
def closerange(fd_low: int, fd_high: int) -> None: ...
|
||||
def confstr(name: Union[str, int]) -> str: ...
|
||||
def ctermid() -> str: ...
|
||||
def dup(fd: int) -> int: ...
|
||||
def dup2(fd: int, fd2: int) -> None: ...
|
||||
def execv(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ...
|
||||
def execve(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ...
|
||||
def fchdir(fd: int) -> None: ...
|
||||
def fchmod(fd: int, mode: int) -> None: ...
|
||||
def fchown(fd: int, uid: int, gid: int) -> None: ...
|
||||
def fdatasync(fd: int) -> None: ...
|
||||
def fdopen(fd: int, mode: str = ..., bufsize: int = ...) -> IO[str]: ...
|
||||
def fork() -> int:
|
||||
raise OSError()
|
||||
def forkpty() -> Tuple[int, int]:
|
||||
raise OSError()
|
||||
def fpathconf(fd: int, name: str) -> None: ...
|
||||
def fstat(fd: int) -> stat_result: ...
|
||||
def fstatvfs(fd: int) -> statvfs_result: ...
|
||||
def fsync(fd: int) -> None: ...
|
||||
def ftruncate(fd: int, length: int) -> None: ...
|
||||
def getcwd() -> str: ...
|
||||
def getcwdu() -> unicode: ...
|
||||
def getegid() -> int: ...
|
||||
def geteuid() -> int: ...
|
||||
def getgid() -> int: ...
|
||||
def getgroups() -> List[int]: ...
|
||||
def getloadavg() -> Tuple[float, float, float]:
|
||||
raise OSError()
|
||||
def getlogin() -> str: ...
|
||||
def getpgid(pid: int) -> int: ...
|
||||
def getpgrp() -> int: ...
|
||||
def getpid() -> int: ...
|
||||
def getppid() -> int: ...
|
||||
def getresgid() -> Tuple[int, int, int]: ...
|
||||
def getresuid() -> Tuple[int, int, int]: ...
|
||||
def getsid(pid: int) -> int: ...
|
||||
def getuid() -> int: ...
|
||||
def initgroups(username: str, gid: int) -> None: ...
|
||||
def isatty(fd: int) -> bool: ...
|
||||
def kill(pid: int, sig: int) -> None: ...
|
||||
def killpg(pgid: int, sig: int) -> None: ...
|
||||
def lchown(path: unicode, uid: int, gid: int) -> None: ...
|
||||
def link(source: unicode, link_name: str) -> None: ...
|
||||
_T = TypeVar("_T")
|
||||
def listdir(path: _T) -> List[_T]: ...
|
||||
def lseek(fd: int, pos: int, how: int) -> None: ...
|
||||
def lstat(path: unicode) -> stat_result: ...
|
||||
def major(device: int) -> int: ...
|
||||
def makedev(major: int, minor: int) -> int: ...
|
||||
def minor(device: int) -> int: ...
|
||||
def mkdir(path: unicode, mode: int = ...) -> None: ...
|
||||
def mkfifo(path: unicode, mode: int = ...) -> None: ...
|
||||
def mknod(filename: unicode, mode: int = ..., device: int = ...) -> None: ...
|
||||
def nice(increment: int) -> int: ...
|
||||
def open(file: unicode, flags: int, mode: int = ...) -> int: ...
|
||||
def openpty() -> Tuple[int, int]: ...
|
||||
def pathconf(path: unicode, name: str) -> str: ...
|
||||
def pipe() -> Tuple[int, int]: ...
|
||||
def popen(command: str, mode: str = ..., bufsize: int = ...) -> IO[str]: ...
|
||||
def putenv(varname: str, value: str) -> None: ...
|
||||
def read(fd: int, n: int) -> str: ...
|
||||
def readlink(path: _T) -> _T: ...
|
||||
def remove(path: unicode) -> None: ...
|
||||
def rename(src: unicode, dst: unicode) -> None: ...
|
||||
def rmdir(path: unicode) -> None: ...
|
||||
def setegid(egid: int) -> None: ...
|
||||
def seteuid(euid: int) -> None: ...
|
||||
def setgid(gid: int) -> None: ...
|
||||
def setgroups(groups: Sequence[int]) -> None: ...
|
||||
def setpgid(pid: int, pgrp: int) -> None: ...
|
||||
def setpgrp() -> None: ...
|
||||
def setregid(rgid: int, egid: int) -> None: ...
|
||||
def setresgid(rgid: int, egid: int, sgid: int) -> None: ...
|
||||
def setresuid(ruid: int, euid: int, suid: int) -> None: ...
|
||||
def setreuid(ruid: int, euid: int) -> None: ...
|
||||
def setsid() -> None: ...
|
||||
def setuid(pid: int) -> None: ...
|
||||
def stat(path: unicode) -> stat_result: ...
|
||||
def statvfs(path: unicode) -> statvfs_result: ...
|
||||
def stat_float_times(fd: int) -> None: ...
|
||||
def strerror(code: int) -> str: ...
|
||||
def symlink(source: unicode, link_name: unicode) -> None: ...
|
||||
def sysconf(name: Union[str, int]) -> int: ...
|
||||
def system(command: unicode) -> int: ...
|
||||
def tcgetpgrp(fd: int) -> int: ...
|
||||
def tcsetpgrp(fd: int, pg: int) -> None: ...
|
||||
def times() -> Tuple[float, float, float, float, float]: ...
|
||||
def tmpfile() -> IO[str]: ...
|
||||
def ttyname(fd: int) -> str: ...
|
||||
def umask(mask: int) -> int: ...
|
||||
def uname() -> Tuple[str, str, str, str, str]: ...
|
||||
def unlink(path: unicode) -> None: ...
|
||||
def unsetenv(varname: str) -> None: ...
|
||||
def urandom(n: int) -> str: ...
|
||||
def utime(path: unicode, times: Optional[Tuple[int, int]]) -> None:
|
||||
raise OSError
|
||||
def wait() -> int: ...
|
||||
_r = Tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int]
|
||||
def wait3(options: int) -> Tuple[int, int, _r]: ...
|
||||
def wait4(pid: int, options: int) -> Tuple[int, int, _r]: ...
|
||||
def waitpid(pid: int, options: int) -> int:
|
||||
raise OSError()
|
||||
def write(fd: int, str: str) -> int: ...
|
||||
|
||||
18
stdlib/2.7/pwd.pyi
Normal file
18
stdlib/2.7/pwd.pyi
Normal file
@@ -0,0 +1,18 @@
|
||||
from typing import List
|
||||
|
||||
class struct_passwd(tuple):
|
||||
n_fields = ... # type: int
|
||||
n_sequence_fields = ... # type: int
|
||||
n_unnamed_fields = ... # type: int
|
||||
pw_dir = ... # type: str
|
||||
pw_name = ... # type: str
|
||||
pw_passwd = ... # type: str
|
||||
pw_shell = ... # type: str
|
||||
pw_gecos = ... # type: str
|
||||
pw_gid = ... # type: int
|
||||
pw_uid = ... # type: int
|
||||
|
||||
def getpwall() -> List[struct_passwd]: ...
|
||||
def getpwnam(name:str) -> struct_passwd: ...
|
||||
def getpwuid(uid:int) -> struct_passwd: ...
|
||||
|
||||
33
stdlib/2.7/resource.pyi
Normal file
33
stdlib/2.7/resource.pyi
Normal file
@@ -0,0 +1,33 @@
|
||||
from typing import Tuple, NamedTuple
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
RLIM_INFINITY = ... # type: int
|
||||
def getrlimit(resource: int) -> Tuple[int, int]: ...
|
||||
def setrlimit(resource: int, limits: Tuple[int, int]) -> None: ...
|
||||
|
||||
RLIMIT_CORE = ... # type: int
|
||||
RLIMIT_CPU = ... # type: int
|
||||
RLIMIT_FSIZE = ... # type: int
|
||||
RLIMIT_DATA = ... # type: int
|
||||
RLIMIT_STACK = ... # type: int
|
||||
RLIMIT_RSS = ... # type: int
|
||||
RLIMIT_NPROC = ... # type: int
|
||||
RLIMIT_NOFILE = ... # type: int
|
||||
RLIMIT_OFILE= ... # type: int
|
||||
RLIMIT_MEMLOCK = ... # type: int
|
||||
RLIMIT_VMEM = ... # type: int
|
||||
RLIMIT_AS = ... # type: int
|
||||
|
||||
_RUsage = NamedTuple('_RUsage', [('ru_utime', float), ('ru_stime', float), ('ru_maxrss', int),
|
||||
('ru_ixrss', int), ('ru_idrss', int), ('ru_isrss', int),
|
||||
('ru_minflt', int), ('ru_majflt', int), ('ru_nswap', int),
|
||||
('ru_inblock', int), ('ru_oublock', int), ('ru_msgsnd', int),
|
||||
('ru_msgrcv', int), ('ru_nsignals', int), ('ru_nvcsw', int),
|
||||
('ru_nivcsw', int)])
|
||||
def getrusage(who: int) -> _RUsage: ...
|
||||
def getpagesize() -> int: ...
|
||||
|
||||
RUSAGE_SELF = ... # type: int
|
||||
RUSAGE_CHILDREN = ... # type: int
|
||||
RUSAGE_BOTH = ... # type: int
|
||||
100
stdlib/2.7/select.pyi
Normal file
100
stdlib/2.7/select.pyi
Normal file
@@ -0,0 +1,100 @@
|
||||
"""Stubs for the 'select' module."""
|
||||
|
||||
from typing import Any, Optional, Tuple, Iterable, List
|
||||
|
||||
EPOLLERR = ... # type: int
|
||||
EPOLLET = ... # type: int
|
||||
EPOLLHUP = ... # type: int
|
||||
EPOLLIN = ... # type: int
|
||||
EPOLLMSG = ... # type: int
|
||||
EPOLLONESHOT = ... # type: int
|
||||
EPOLLOUT = ... # type: int
|
||||
EPOLLPRI = ... # type: int
|
||||
EPOLLRDBAND = ... # type: int
|
||||
EPOLLRDNORM = ... # type: int
|
||||
EPOLLWRBAND = ... # type: int
|
||||
EPOLLWRNORM = ... # type: int
|
||||
EPOLL_RDHUP = ... # type: int
|
||||
KQ_EV_ADD = ... # type: int
|
||||
KQ_EV_CLEAR = ... # type: int
|
||||
KQ_EV_DELETE = ... # type: int
|
||||
KQ_EV_DISABLE = ... # type: int
|
||||
KQ_EV_ENABLE = ... # type: int
|
||||
KQ_EV_EOF = ... # type: int
|
||||
KQ_EV_ERROR = ... # type: int
|
||||
KQ_EV_FLAG1 = ... # type: int
|
||||
KQ_EV_ONESHOT = ... # type: int
|
||||
KQ_EV_SYSFLAGS = ... # type: int
|
||||
KQ_FILTER_AIO = ... # type: int
|
||||
KQ_FILTER_NETDEV = ... # type: int
|
||||
KQ_FILTER_PROC = ... # type: int
|
||||
KQ_FILTER_READ = ... # type: int
|
||||
KQ_FILTER_SIGNAL = ... # type: int
|
||||
KQ_FILTER_TIMER = ... # type: int
|
||||
KQ_FILTER_VNODE = ... # type: int
|
||||
KQ_FILTER_WRITE = ... # type: int
|
||||
KQ_NOTE_ATTRIB = ... # type: int
|
||||
KQ_NOTE_CHILD = ... # type: int
|
||||
KQ_NOTE_DELETE = ... # type: int
|
||||
KQ_NOTE_EXEC = ... # type: int
|
||||
KQ_NOTE_EXIT = ... # type: int
|
||||
KQ_NOTE_EXTEND = ... # type: int
|
||||
KQ_NOTE_FORK = ... # type: int
|
||||
KQ_NOTE_LINK = ... # type: int
|
||||
KQ_NOTE_LINKDOWN = ... # type: int
|
||||
KQ_NOTE_LINKINV = ... # type: int
|
||||
KQ_NOTE_LINKUP = ... # type: int
|
||||
KQ_NOTE_LOWAT = ... # type: int
|
||||
KQ_NOTE_PCTRLMASK = ... # type: int
|
||||
KQ_NOTE_PDATAMASK = ... # type: int
|
||||
KQ_NOTE_RENAME = ... # type: int
|
||||
KQ_NOTE_REVOKE = ... # type: int
|
||||
KQ_NOTE_TRACK = ... # type: int
|
||||
KQ_NOTE_TRACKERR = ... # type: int
|
||||
KQ_NOTE_WRITE = ... # type: int
|
||||
PIPE_BUF = ... # type: int
|
||||
POLLERR = ... # type: int
|
||||
POLLHUP = ... # type: int
|
||||
POLLIN = ... # type: int
|
||||
POLLMSG = ... # type: int
|
||||
POLLNVAL = ... # type: int
|
||||
POLLOUT = ... # type: int
|
||||
POLLPRI = ... # type: int
|
||||
POLLRDBAND = ... # type: int
|
||||
POLLRDNORM = ... # type: int
|
||||
POLLWRBAND = ... # type: int
|
||||
POLLWRNORM = ... # type: int
|
||||
|
||||
def poll() -> epoll: ...
|
||||
def select(rlist, wlist, xlist, timeout: Optional[int]) -> Tuple[List, List, List]: ...
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
class kevent(object):
|
||||
data = ... # type: Any
|
||||
fflags = ... # type: int
|
||||
filter = ... # type: int
|
||||
flags = ... # type: int
|
||||
ident = ... # type: Any
|
||||
udata = ... # type: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
|
||||
class kqueue(object):
|
||||
closed = ... # type: bool
|
||||
def __init__(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def control(self, changelist: Optional[Iterable[kevent]], max_events: int, timeout: int = ...) -> List[kevent]: ...
|
||||
def fileno(self) -> int: ...
|
||||
@classmethod
|
||||
def fromfd(cls, fd: int) -> kqueue: ...
|
||||
|
||||
class epoll(object):
|
||||
def __init__(self, sizehint: int = ...) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def fileno(self) -> int: ...
|
||||
def register(self, fd: int, eventmask: int = ...) -> None: ...
|
||||
def modify(self, fd: int, eventmask: int) -> None: ...
|
||||
def unregister(fd: int) -> None: ...
|
||||
def poll(timeout: float = ..., maxevents: int = ...) -> Any: ...
|
||||
@classmethod
|
||||
def fromfd(self, fd: int) -> epoll: ...
|
||||
62
stdlib/2.7/signal.pyi
Normal file
62
stdlib/2.7/signal.pyi
Normal file
@@ -0,0 +1,62 @@
|
||||
from typing import Callable, Any, Tuple, Union
|
||||
from types import FrameType
|
||||
|
||||
SIG_DFL = ... # type: int
|
||||
SIG_IGN = ... # type: int
|
||||
ITIMER_REAL = ... # type: int
|
||||
ITIMER_VIRTUAL = ... # type: int
|
||||
ITIMER_PROF = ... # 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
|
||||
NSIG = ... # type: int
|
||||
|
||||
class ItimerError(IOError): ...
|
||||
|
||||
_HANDLER = Union[Callable[[int, FrameType], None], int, None]
|
||||
|
||||
def alarm(time: int) -> int: ...
|
||||
def getsignal(signalnum: int) -> _HANDLER: ...
|
||||
def pause() -> None: ...
|
||||
def setitimer(which: int, seconds: float, interval: float = ...) -> Tuple[float, float]: ...
|
||||
def getitimer(which: int) -> Tuple[float, float]: ...
|
||||
def set_wakeup_fd(fd: int) -> int: ...
|
||||
def siginterrupt(signalnum: int, flag: bool) -> None:
|
||||
raise RuntimeError()
|
||||
def signal(signalnum: int, handler: _HANDLER) -> _HANDLER:
|
||||
raise RuntimeError()
|
||||
def default_int_handler(signum: int, frame: FrameType) -> None:
|
||||
raise KeyboardInterrupt()
|
||||
15
stdlib/2.7/spwd.pyi
Normal file
15
stdlib/2.7/spwd.pyi
Normal file
@@ -0,0 +1,15 @@
|
||||
from typing import List
|
||||
|
||||
class struct_spwd(object):
|
||||
sp_nam = ... # type: str
|
||||
sp_pwd = ... # type: str
|
||||
sp_lstchg = ... # type: int
|
||||
sp_min = ... # type: int
|
||||
sp_max = ... # type: int
|
||||
sp_warn = ... # type: int
|
||||
sp_inact = ... # type: int
|
||||
sp_expire = ... # type: int
|
||||
sp_flag = ... # type: int
|
||||
|
||||
def getspall() -> List[struct_spwd]: pass
|
||||
def getspnam() -> struct_spwd: pass
|
||||
73
stdlib/2.7/strop.pyi
Normal file
73
stdlib/2.7/strop.pyi
Normal file
@@ -0,0 +1,73 @@
|
||||
"""Stub file for the 'strop' module."""
|
||||
|
||||
from typing import List, Sequence
|
||||
|
||||
lowercase = ... # type: str
|
||||
uppercase = ... # type: str
|
||||
whitespace = ... # type: str
|
||||
|
||||
def atof(a: str) -> float:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def atoi(a: str, base:int = ...) -> int:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def atol(a: str, base:int = ...) -> long:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def capitalize(s: str) -> str:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def count(s: str, sub: str, start: int = ..., end: int = ...) -> int:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def expandtabs(string:str, tabsize:int = ...) -> str:
|
||||
raise DeprecationWarning()
|
||||
raise OverflowError()
|
||||
|
||||
def find(s: str, sub: str, start: int = ..., end: int = ...) -> int:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def join(list: Sequence[str], sep:str = ...) -> str:
|
||||
raise DeprecationWarning()
|
||||
raise OverflowError()
|
||||
|
||||
def joinfields(list: Sequence[str], sep:str = ...) -> str:
|
||||
raise DeprecationWarning()
|
||||
raise OverflowError()
|
||||
|
||||
def lower(s: str) -> str:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def lstrip(s: str) -> str:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def maketrans(frm: str, to: str) -> str: ...
|
||||
|
||||
def replace(s: str, old: str, new: str, maxsplit:int = ...) -> str:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def rfind(s: str, sub: str, start: int = ..., end: int = ...) -> int:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def rstrip(s: str) -> str:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def split(s: str, sep: str, maxsplit: int = ...) -> List[str]:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def splitfields(s: str, sep: str, maxsplit: int = ...) -> List[str]:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def strip(s: str) -> str:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def swapcase(s: str) -> str:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def translate(s: str, table: str, deletechars: str = ...) -> str:
|
||||
raise DeprecationWarning()
|
||||
|
||||
def upper(s: str) -> str:
|
||||
raise DeprecationWarning()
|
||||
|
||||
127
stdlib/2.7/sys.pyi
Normal file
127
stdlib/2.7/sys.pyi
Normal file
@@ -0,0 +1,127 @@
|
||||
"""Stubs for the 'sys' module."""
|
||||
|
||||
from typing import (
|
||||
IO, Union, List, Sequence, Any, Dict, Tuple, BinaryIO, Optional, Callable, overload
|
||||
)
|
||||
from types import FrameType, ModuleType, TracebackType
|
||||
|
||||
class _flags:
|
||||
bytes_warning = ... # type: int
|
||||
debug = ... # type: int
|
||||
division_new = ... # type: int
|
||||
division_warning = ... # type: int
|
||||
dont_write_bytecode = ... # type: int
|
||||
hash_randomization = ... # type: int
|
||||
ignore_environment = ... # type: int
|
||||
inspect = ... # type: int
|
||||
interactive = ... # type: int
|
||||
no_site = ... # type: int
|
||||
no_user_site = ... # type: int
|
||||
optimize = ... # type: int
|
||||
py3k_warning = ... # type: int
|
||||
tabcheck = ... # type: int
|
||||
unicode = ... # type: int
|
||||
verbose = ... # type: int
|
||||
|
||||
class _float_info:
|
||||
max = ... # type: float
|
||||
max_exp = ... # type: int
|
||||
max_10_exp = ... # type: int
|
||||
min = ... # type: float
|
||||
min_exp = ... # type: int
|
||||
min_10_exp = ... # type: int
|
||||
dig = ... # type: int
|
||||
mant_dig = ... # type: int
|
||||
epsilon = ... # type: float
|
||||
radix = ... # type: int
|
||||
rounds = ... # type: int
|
||||
|
||||
class _version_info(Tuple[int, int, int, str, int]):
|
||||
major = 0
|
||||
minor = 0
|
||||
micro = 0
|
||||
releaselevel = ... # type: str
|
||||
serial = 0
|
||||
|
||||
_mercurial = ... # type: Tuple[str, str, str]
|
||||
api_version = ... # type: int
|
||||
argv = ... # type: List[str]
|
||||
builtin_module_names = ... # type: Tuple[str, ...]
|
||||
byteorder = ... # type: str
|
||||
copyright = ... # type: str
|
||||
dont_write_bytecode = ... # type: bool
|
||||
exec_prefix = ... # type: str
|
||||
executable = ... # type: str
|
||||
flags = ... # type: _flags
|
||||
float_repr_style = ... # type: str
|
||||
hexversion = ... # type: int
|
||||
long_info = ... # type: object
|
||||
maxint = ... # type: int
|
||||
maxsize = ... # type: int
|
||||
maxunicode = ... # type: int
|
||||
modules = ... # type: Dict[str, ModuleType]
|
||||
path = ... # type: List[str]
|
||||
platform = ... # type: str
|
||||
prefix = ... # type: str
|
||||
py3kwarning = ... # type: bool
|
||||
__stderr__ = ... # type: IO[str]
|
||||
__stdin__ = ... # type: IO[str]
|
||||
__stdout__ = ... # type: IO[str]
|
||||
stderr = ... # type: IO[str]
|
||||
stdin = ... # type: IO[str]
|
||||
stdout = ... # type: IO[str]
|
||||
subversion = ... # type: Tuple[str, str, str]
|
||||
version = ... # type: str
|
||||
warnoptions = ... # type: object
|
||||
float_info = ... # type: _float_info
|
||||
version_info = ... # type: _version_info
|
||||
ps1 = ... # type: str
|
||||
ps2 = ... # type: str
|
||||
last_type = ... # type: type
|
||||
last_value = ... # type: BaseException
|
||||
last_traceback = ... # type: TracebackType
|
||||
# TODO precise types
|
||||
meta_path = ... # type: List[Any]
|
||||
path_hooks = ... # type: List[Any]
|
||||
path_importer_cache = ... # type: Dict[str, Any]
|
||||
displayhook = ... # type: Optional[Callable[[int], None]]
|
||||
excepthook = ... # type: Optional[Callable[[type, BaseException, TracebackType], None]]
|
||||
|
||||
class _WindowsVersionType:
|
||||
major = ... # type: Any
|
||||
minor = ... # type: Any
|
||||
build = ... # type: Any
|
||||
platform = ... # type: Any
|
||||
service_pack = ... # type: Any
|
||||
service_pack_major = ... # type: Any
|
||||
service_pack_minor = ... # type: Any
|
||||
suite_mask = ... # type: Any
|
||||
product_type = ... # type: Any
|
||||
|
||||
def getwindowsversion() -> _WindowsVersionType: ...
|
||||
|
||||
def _clear_type_cache() -> None: ...
|
||||
def _current_frames() -> Dict[int, FrameType]: ...
|
||||
def _getframe(depth: int = ...) -> FrameType: ...
|
||||
def call_tracing(fn: Any, args: Any) -> Any: ...
|
||||
def __displayhook__(value: int) -> None: ...
|
||||
def __excepthook__(type_: type, value: BaseException, traceback: TracebackType) -> None: ...
|
||||
def exc_clear() -> None:
|
||||
raise DeprecationWarning()
|
||||
def exc_info() -> Tuple[type, BaseException, TracebackType]: ...
|
||||
def exit(arg: int = ...) -> None:
|
||||
raise SystemExit()
|
||||
def getcheckinterval() -> int: ... # deprecated
|
||||
def getdefaultencoding() -> str: ...
|
||||
def getdlopenflags() -> int: ...
|
||||
def getfilesystemencoding() -> Union[str, None]: ...
|
||||
def getrefcount(object) -> int: ...
|
||||
def getrecursionlimit() -> int: ...
|
||||
def getsizeof(obj: object, default: int = ...) -> int: ...
|
||||
def getprofile() -> None: ...
|
||||
def gettrace() -> None: ...
|
||||
def setcheckinterval(interval: int) -> None: ... # deprecated
|
||||
def setdlopenflags(n: int) -> None: ...
|
||||
def setprofile(profilefunc: Any) -> None: ... # TODO type
|
||||
def setrecursionlimit(limit: int) -> None: ...
|
||||
def settrace(tracefunc: Any) -> None: ... # TODO type
|
||||
38
stdlib/2.7/syslog.pyi
Normal file
38
stdlib/2.7/syslog.pyi
Normal file
@@ -0,0 +1,38 @@
|
||||
LOG_ALERT = ... # type: int
|
||||
LOG_AUTH = ... # type: int
|
||||
LOG_CONS = ... # type: int
|
||||
LOG_CRIT = ... # type: int
|
||||
LOG_CRON = ... # type: int
|
||||
LOG_DAEMON = ... # type: int
|
||||
LOG_DEBUG = ... # type: int
|
||||
LOG_EMERG = ... # type: int
|
||||
LOG_ERR = ... # type: int
|
||||
LOG_INFO = ... # type: int
|
||||
LOG_KERN = ... # type: int
|
||||
LOG_LOCAL0 = ... # type: int
|
||||
LOG_LOCAL1 = ... # type: int
|
||||
LOG_LOCAL2 = ... # type: int
|
||||
LOG_LOCAL3 = ... # type: int
|
||||
LOG_LOCAL4 = ... # type: int
|
||||
LOG_LOCAL5 = ... # type: int
|
||||
LOG_LOCAL6 = ... # type: int
|
||||
LOG_LOCAL7 = ... # type: int
|
||||
LOG_LPR = ... # type: int
|
||||
LOG_MAIL = ... # type: int
|
||||
LOG_NDELAY = ... # type: int
|
||||
LOG_NEWS = ... # type: int
|
||||
LOG_NOTICE = ... # type: int
|
||||
LOG_NOWAIT = ... # type: int
|
||||
LOG_PERROR = ... # type: int
|
||||
LOG_PID = ... # type: int
|
||||
LOG_SYSLOG = ... # type: int
|
||||
LOG_USER = ... # type: int
|
||||
LOG_UUCP = ... # type: int
|
||||
LOG_WARNING = ... # type: int
|
||||
|
||||
def LOG_MASK(a: int) -> int: ...
|
||||
def LOG_UPTO(a: int) -> int: ...
|
||||
def closelog() -> None: ...
|
||||
def openlog(ident: str = ..., logoption: int = ..., facility: int = ...) -> None: ...
|
||||
def setlogmask(x: int) -> int: ...
|
||||
def syslog(priority: int, message: str) -> None: ...
|
||||
33
stdlib/2.7/thread.pyi
Normal file
33
stdlib/2.7/thread.pyi
Normal file
@@ -0,0 +1,33 @@
|
||||
"""Stubs for the "thread" module."""
|
||||
from typing import Callable, Any
|
||||
|
||||
def _count() -> int: ...
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
class LockType:
|
||||
def acquire(self, waitflag: int = ...) -> bool: ...
|
||||
def acquire_lock(self, waitflag: int = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def release_lock(self) -> None: ...
|
||||
def locked(self) -> bool: ...
|
||||
def locked_lock(self) -> bool: ...
|
||||
def __enter__(self) -> LockType: ...
|
||||
def __exit__(self, value: Any, traceback: Any) -> None: ...
|
||||
|
||||
class _local(object):
|
||||
pass
|
||||
|
||||
class _localdummy(object):
|
||||
pass
|
||||
|
||||
def start_new(function: Callable[..., Any], args: Any, kwargs: Any = ...) -> int: ...
|
||||
def start_new_thread(function: Callable[..., Any], args: Any, kwargs: Any = ...) -> int: ...
|
||||
def interrupt_main() -> None: ...
|
||||
def exit() -> None:
|
||||
raise SystemExit()
|
||||
def exit_thread() -> Any:
|
||||
raise SystemExit()
|
||||
def allocate_lock() -> LockType: ...
|
||||
def get_ident() -> int: ...
|
||||
def stack_size(size: int = ...) -> int: ...
|
||||
48
stdlib/2.7/time.pyi
Normal file
48
stdlib/2.7/time.pyi
Normal file
@@ -0,0 +1,48 @@
|
||||
"""Stub file for the 'time' module."""
|
||||
# See https://docs.python.org/2/library/time.html
|
||||
|
||||
from typing import NamedTuple, Tuple, Union
|
||||
|
||||
# ----- variables and constants -----
|
||||
accept2dyear = False
|
||||
altzone = 0
|
||||
daylight = 0
|
||||
timezone = 0
|
||||
tzname = ... # type: Tuple[str, str]
|
||||
|
||||
struct_time = NamedTuple('struct_time',
|
||||
[('tm_year', int), ('tm_mon', int), ('tm_mday', int),
|
||||
('tm_hour', int), ('tm_min', int), ('tm_sec', int),
|
||||
('tm_wday', int), ('tm_yday', int), ('tm_isdst', int)])
|
||||
|
||||
_TIME_TUPLE = Tuple[int, int, int, int, int, int, int, int, int]
|
||||
|
||||
def asctime(t: struct_time = ...) -> str:
|
||||
raise ValueError()
|
||||
|
||||
def clock() -> float: ...
|
||||
|
||||
def ctime(secs: float = ...) -> str:
|
||||
raise ValueError()
|
||||
|
||||
def gmtime(secs: float = ...) -> struct_time: ...
|
||||
|
||||
def localtime(secs: float = ...) -> struct_time: ...
|
||||
|
||||
def mktime(t: struct_time) -> float:
|
||||
raise OverflowError()
|
||||
raise ValueError()
|
||||
|
||||
def sleep(secs: float) -> None: ...
|
||||
|
||||
def strftime(format: str, t: struct_time = ...) -> str:
|
||||
raise MemoryError()
|
||||
raise ValueError()
|
||||
|
||||
def strptime(string: str, format: str = ...) -> struct_time:
|
||||
raise ValueError()
|
||||
|
||||
def time() -> float:
|
||||
raise IOError()
|
||||
|
||||
def tzset() -> None: ...
|
||||
40
stdlib/2.7/unicodedata.pyi
Normal file
40
stdlib/2.7/unicodedata.pyi
Normal file
@@ -0,0 +1,40 @@
|
||||
"""Stubs for the 'unicodedata' module."""
|
||||
|
||||
from typing import Any, TypeVar, Union
|
||||
|
||||
ucd_3_2_0 = ... # type: UCD
|
||||
unidata_version = ... # type: str
|
||||
# PyCapsule
|
||||
ucnhash_CAPI = ... # type: Any
|
||||
|
||||
_default = TypeVar("_default")
|
||||
|
||||
def bidirectional(unichr: unicode) -> str: ...
|
||||
def category(unichr: unicode) -> str: ...
|
||||
def combining(unichr: unicode) -> int: ...
|
||||
def decimal(chr: unicode, default: _default = ...) -> Union[int, _default]: ...
|
||||
def decomposition(unichr: unicode) -> str: ...
|
||||
def digit(chr: unicode, default: _default = ...) -> Union[int, _default]: ...
|
||||
def east_asian_width(unichr: unicode) -> str: ...
|
||||
def lookup(name: str) -> unicode: ...
|
||||
def mirrored(unichr: unicode) -> int: ...
|
||||
def name(chr: unicode, default: _default = ...) -> Union[str, _default]: ...
|
||||
def normalize(form: str, unistr: unicode) -> unicode: ...
|
||||
def numeric(chr, default: _default = ...) -> Union[float, _default]: ...
|
||||
|
||||
class UCD(object):
|
||||
unidata_version = ... # type: str
|
||||
# The methods below are constructed from the same array in C
|
||||
# (unicodedata_functions) and hence identical to the methods above.
|
||||
def bidirectional(self, unichr: unicode) -> str: ...
|
||||
def category(self, unichr: unicode) -> str: ...
|
||||
def combining(self, unichr: unicode) -> int: ...
|
||||
def decimal(self, chr: unicode, default: _default = ...) -> Union[int, _default]: ...
|
||||
def decomposition(self, unichr: unicode) -> str: ...
|
||||
def digit(self, chr: unicode, default: _default = ...) -> Union[int, _default]: ...
|
||||
def east_asian_width(self, unichr: unicode) -> str: ...
|
||||
def lookup(self, name: str) -> unicode: ...
|
||||
def mirrored(self, unichr: unicode) -> int: ...
|
||||
def name(self, chr: unicode, default: _default = ...) -> Union[str, _default]: ...
|
||||
def normalize(self, form: str, unistr: unicode) -> unicode: ...
|
||||
def numeric(self, chr: unicode, default: _default = ...) -> Union[float, _default]: ...
|
||||
17
stdlib/2.7/xxsubtype.pyi
Normal file
17
stdlib/2.7/xxsubtype.pyi
Normal file
@@ -0,0 +1,17 @@
|
||||
"""Stub file for the 'xxsubtype' module."""
|
||||
|
||||
from typing import Any
|
||||
|
||||
def bench(obj: Any, name: str, n:int = ...) -> float: ...
|
||||
|
||||
class spamdict(dict):
|
||||
state = ... # type: int
|
||||
def getstate(self) -> int: ...
|
||||
def setstate(self, a: int) -> None: ...
|
||||
|
||||
class spamlist(list):
|
||||
state = ... # type: int
|
||||
def getstate(self) -> int: ...
|
||||
def setstate(self, a: int) -> None: ...
|
||||
def classmeth(self, *args, **kwargs) -> tuple: ...
|
||||
def staticmeth(self, *args, **kwargs) -> tuple: ...
|
||||
25
stdlib/2.7/zipimport.pyi
Normal file
25
stdlib/2.7/zipimport.pyi
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Stub file for the 'zipimport' module."""
|
||||
|
||||
from typing import Dict, Optional
|
||||
from types import CodeType, ModuleType
|
||||
|
||||
class ZipImportError(ImportError):
|
||||
pass
|
||||
|
||||
_zip_directory_cache = ... # type: Dict[str, dict]
|
||||
|
||||
class zipimporter(object):
|
||||
archive = ... # type: str
|
||||
prefix = ... # type: str
|
||||
_files = ... # type: Dict[str, tuple]
|
||||
def __init__(self, path: str) -> None:
|
||||
raise ZipImportError
|
||||
def find_module(self, fullname: str, path: str = ...) -> Optional['zipimporter']: ...
|
||||
def get_code(self, fullname: str) -> CodeType: ...
|
||||
def get_data(self, fullname: str) -> str:
|
||||
raise IOError
|
||||
def get_filename(self, fullname: str) -> str: ...
|
||||
def get_source(self, fullname: str) -> str: ...
|
||||
def is_package(self, fullname: str) -> bool: ...
|
||||
def load_module(self, fullname: str) -> ModuleType: ...
|
||||
|
||||
36
stdlib/2.7/zlib.pyi
Normal file
36
stdlib/2.7/zlib.pyi
Normal file
@@ -0,0 +1,36 @@
|
||||
# Stubs for zlib (Python 2.7)
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
DEFLATED = ... # type: int
|
||||
DEF_MEM_LEVEL = ... # type: int
|
||||
MAX_WBITS = ... # type: int
|
||||
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: str, value: int = ...) -> int: ...
|
||||
def compress(data: str, level: int = ...) -> str: ...
|
||||
def crc32(data: str, value: int = ...) -> int: ...
|
||||
def decompress(data: str, wbits: int = ..., bufsize: int = ...) -> str: ...
|
||||
|
||||
class compressobj:
|
||||
def __init__(level: int = ..., method: int = ..., wbits: int = ..., memlevel: int = ...,
|
||||
strategy: int = ...) -> None: ...
|
||||
def copy(self) -> "compressobj": ...
|
||||
def compress(self, data: str) -> str: ...
|
||||
def flush(self) -> None: ...
|
||||
|
||||
class decompressobj:
|
||||
def __init__(wbits: int = ...) -> None: ...
|
||||
def copy(self) -> "decompressobj": ...
|
||||
def decompress(self, data: str) -> str: ...
|
||||
def flush(self) -> None: ...
|
||||
11
stdlib/2and3/_bisect.pyi
Normal file
11
stdlib/2and3/_bisect.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
"""Stub file for the '_bisect' module."""
|
||||
|
||||
from typing import Any, Sequence, TypeVar
|
||||
|
||||
T = TypeVar('T')
|
||||
def bisect(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect_left(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect_right(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def insort(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
def insort_left(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
def insort_right(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
15
stdlib/2and3/_heapq.pyi
Normal file
15
stdlib/2and3/_heapq.pyi
Normal file
@@ -0,0 +1,15 @@
|
||||
"""Stub file for the '_heapq' module."""
|
||||
|
||||
from typing import TypeVar, List
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
def heapify(heap: List[_T]) -> None: ...
|
||||
def heappop(heap: List[_T]) -> _T:
|
||||
raise IndexError() # if list is empty
|
||||
def heappush(heap: List[_T], item: _T) -> None: ...
|
||||
def heappushpop(heap: List[_T], item: _T) -> _T: ...
|
||||
def heapreplace(heap: List[_T], item: _T) -> _T:
|
||||
raise IndexError() # if list is empty
|
||||
def nlargest(a: int, b: List[_T]) -> List[_T]: ...
|
||||
def nsmallest(a: int, b: List[_T]) -> List[_T]: ...
|
||||
34
stdlib/2and3/cmath.pyi
Normal file
34
stdlib/2and3/cmath.pyi
Normal file
@@ -0,0 +1,34 @@
|
||||
"""Stub file for the 'cmath' module."""
|
||||
|
||||
import sys
|
||||
from typing import Union, Tuple
|
||||
|
||||
e = ... # type: float
|
||||
pi = ... # type: float
|
||||
|
||||
_C = Union[float, complex]
|
||||
|
||||
def acos(x:_C) -> complex: ...
|
||||
def acosh(x:_C) -> complex: ...
|
||||
def asin(x:_C) -> complex: ...
|
||||
def asinh(x:_C) -> complex: ...
|
||||
def atan(x:_C) -> complex: ...
|
||||
def atanh(x:_C) -> complex: ...
|
||||
def cos(x:_C) -> complex: ...
|
||||
def cosh(x:_C) -> complex: ...
|
||||
def exp(x:_C) -> complex: ...
|
||||
def isinf(z:_C) -> bool: ...
|
||||
def isnan(z:_C) -> bool: ...
|
||||
def log(x:_C, base:_C = ...) -> complex: ...
|
||||
def log10(x:_C) -> complex: ...
|
||||
def phase(z:_C) -> float: ...
|
||||
def polar(z:_C) -> Tuple[float, float]: ...
|
||||
def rect(r:float, phi:float) -> complex: ...
|
||||
def sin(x:_C) -> complex: ...
|
||||
def sinh(x:_C) -> complex: ...
|
||||
def sqrt(x:_C) -> complex: ...
|
||||
def tan(x:_C) -> complex: ...
|
||||
def tanh(x:_C) -> complex: ...
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
def isfinite(z:_C) -> bool: ...
|
||||
8
stdlib/2and3/marshal.pyi
Normal file
8
stdlib/2and3/marshal.pyi
Normal file
@@ -0,0 +1,8 @@
|
||||
from typing import Any, IO
|
||||
|
||||
version = ... # type: int
|
||||
|
||||
def dump(value: Any, file: IO[Any], version: int = ...) -> None: ...
|
||||
def load(file: IO[Any]) -> Any: ...
|
||||
def dumps(value: Any, version: int = ...) -> str: ...
|
||||
def loads(string: str) -> Any: ...
|
||||
52
stdlib/2and3/math.pyi
Normal file
52
stdlib/2and3/math.pyi
Normal file
@@ -0,0 +1,52 @@
|
||||
# Stubs for math
|
||||
# See: http://docs.python.org/2/library/math.html
|
||||
|
||||
from typing import Tuple, Iterable, Optional
|
||||
|
||||
import sys
|
||||
|
||||
e = ... # type: float
|
||||
pi = ... # type: float
|
||||
|
||||
def acos(x: float) -> float: ...
|
||||
def acosh(x: float) -> float: ...
|
||||
def asin(x: float) -> float: ...
|
||||
def asinh(x: float) -> float: ...
|
||||
def atan(x: float) -> float: ...
|
||||
def atan2(y: float, x: float) -> float: ...
|
||||
def atanh(x: float) -> float: ...
|
||||
def ceil(x: float) -> int: ...
|
||||
def copysign(x: float, y: float) -> float: ...
|
||||
def cos(x: float) -> float: ...
|
||||
def cosh(x: float) -> float: ...
|
||||
def degrees(x: float) -> float: ...
|
||||
def erf(x: float) -> float: ...
|
||||
def erfc(x: float) -> float: ...
|
||||
def exp(x: float) -> float: ...
|
||||
def expm1(x: float) -> float: ...
|
||||
def fabs(x: float) -> float: ...
|
||||
def factorial(x: int) -> int: ...
|
||||
def floor(x: float) -> float: ...
|
||||
def fmod(x: float, y: float) -> float: ...
|
||||
def frexp(x: float) -> Tuple[float, int]: ...
|
||||
def fsum(iterable: Iterable) -> float: ...
|
||||
def gamma(x: float) -> float: ...
|
||||
def hypot(x: float, y: float) -> float: ...
|
||||
def isinf(x: float) -> bool: ...
|
||||
if sys.version_info[0] >= 3:
|
||||
def isfinite(x: float) -> bool: ...
|
||||
def isnan(x: float) -> bool: ...
|
||||
def ldexp(x: float, i: int) -> float: ...
|
||||
def lgamma(x: float) -> float: ...
|
||||
def log(x: float, base: float = ...) -> float: ...
|
||||
def log10(x: float) -> float: ...
|
||||
def log1p(x: float) -> float: ...
|
||||
def modf(x: float) -> Tuple[float, float]: ...
|
||||
def pow(x: float, y: float) -> float: ...
|
||||
def radians(x: float) -> float: ...
|
||||
def sin(x: float) -> float: ...
|
||||
def sinh(x: float) -> float: ...
|
||||
def sqrt(x: float) -> float: ...
|
||||
def tan(x: float) -> float: ...
|
||||
def tanh(x: float) -> float: ...
|
||||
def trunc(x: float) -> int: ...
|
||||
127
stdlib/2and3/operator.pyi
Normal file
127
stdlib/2and3/operator.pyi
Normal file
@@ -0,0 +1,127 @@
|
||||
# Stubs for operator
|
||||
|
||||
from typing import Any, Callable
|
||||
|
||||
def __abs__(a: Any) -> Any: ...
|
||||
def __add__(a: Any, b: Any) -> Any: ...
|
||||
def __and__(a: Any, b: Any) -> Any: ...
|
||||
def __concat__(a: Any, b: Any) -> Any: ...
|
||||
def __contains__(container: Any, item: Any) -> bool: ...
|
||||
def __delitem__(container: Any, item: Any) -> None: ...
|
||||
def __delslice__(container: Any, b: int, c: int) -> None: ...
|
||||
def __div__(a: Any, b: Any) -> Any: ...
|
||||
def __eq__(a: Any, b: Any) -> Any: ...
|
||||
def __floordiv__(a: Any, b: Any) -> Any: ...
|
||||
def __ge__(a: Any, b: Any) -> Any: ...
|
||||
def __getitem__(container: Any, key: Any) -> Any: ...
|
||||
def __getslice__(container, b: int, c: int) -> Any: ...
|
||||
def __gt__(a: Any, b: Any) -> Any: ...
|
||||
def __iadd__(a: Any, b: Any) -> Any: ...
|
||||
def __iand__(a: Any, b: Any) -> Any: ...
|
||||
def __iconcat__(a: Any, b: Any) -> Any: ...
|
||||
def __idiv__(a: Any, b: Any) -> Any: ...
|
||||
def __ifloordiv__(a: Any, b: Any) -> Any: ...
|
||||
def __ilshift__(a: Any, b: Any) -> Any: ...
|
||||
def __imod__(a: Any, b: Any) -> Any: ...
|
||||
def __imul__(a: Any, b: Any) -> Any: ...
|
||||
def __index__(x: Any) -> Any: ...
|
||||
def __inv__(x: Any) -> Any: ...
|
||||
def __invert__(x: Any) -> Any: ...
|
||||
def __ior__(a: Any, b: Any) -> Any: ...
|
||||
def __ipow__(a: Any, b: Any) -> Any: ...
|
||||
def __irepeat__(a: Any, b: int) -> Any: ...
|
||||
def __irshift__(a: Any, b: Any) -> Any: ...
|
||||
def __isub__(a: Any, b: Any) -> Any: ...
|
||||
def __itruediv__(a: Any, b: Any) -> Any: ...
|
||||
def __ixor__(a: Any, b: Any) -> Any: ...
|
||||
def __le__(a: Any, b: Any) -> Any: ...
|
||||
def __lshift__(a: Any, b: Any) -> Any: ...
|
||||
def __lt__(a: Any, b: Any) -> Any: ...
|
||||
def __mod__(a: Any, b: Any) -> Any: ...
|
||||
def __mul__(a: Any, b: Any) -> Any: ...
|
||||
def __ne__(a: Any, b: Any) -> Any: ...
|
||||
def __neg__(x: Any) -> Any: ...
|
||||
def __not__(x: Any) -> bool: ...
|
||||
def __or__(a: Any, b: Any) -> Any: ...
|
||||
def __pos__(x: Any) -> Any: ...
|
||||
def __pow__(a: Any, b: Any) -> Any: ...
|
||||
def __repeat__(a, b: int) -> Any: ...
|
||||
def __rshift__(a: Any, b: Any) -> Any: ...
|
||||
def __setitem__(container: Any, b: Any) -> None: ...
|
||||
def __setslice__(container: Any, b: int, c: int, item: Any) -> None: ...
|
||||
def __sub__(a: Any, b: Any) -> Any: ...
|
||||
def __truediv__(a: Any, b: Any) -> Any: ...
|
||||
def __xor__(a: Any, b: Any) -> Any: ...
|
||||
|
||||
def abs(x: Any) -> Any: ...
|
||||
def add(a: Any, b: Any) -> Any: ...
|
||||
def and_(a: Any, b: Any) -> Any: ...
|
||||
def concat(a: Any, b: Any) -> Any: ...
|
||||
def contains(container: Any, item: Any) -> bool: ...
|
||||
def countOf(container: Any, item: Any) -> int: ...
|
||||
def delitem(container: Any, item: Any) -> None: ...
|
||||
def delslice(container: Any, b: int, c: int) -> None: ...
|
||||
def div(a: Any, b: Any) -> Any: ...
|
||||
def eq(a: Any, b: Any) -> Any: ...
|
||||
def floordiv(a: Any, b: Any) -> Any: ...
|
||||
def ge(a: Any, b: Any) -> Any: ...
|
||||
def getitem(a: Any, b: Any) -> Any: ...
|
||||
def getslice(container: Any, b: int, c: int) -> Any: ...
|
||||
def gt(a: Any, b: Any) -> Any: ...
|
||||
def iadd(a: Any, b: Any) -> Any: ...
|
||||
def iand(a: Any, b: Any) -> Any: ...
|
||||
def iconcat(a: Any, b: Any) -> Any: ...
|
||||
def idiv(a: Any, b: Any) -> Any: ...
|
||||
def ifloordiv(a: Any, b: Any) -> Any: ...
|
||||
def ilshift(a: Any, b: Any) -> Any: ...
|
||||
def imod(a: Any, b: Any) -> Any: ...
|
||||
def imul(a: Any, b: Any) -> Any: ...
|
||||
def index(x: Any) -> Any: ...
|
||||
def indexOf(container: Any, item: Any) -> int: ...
|
||||
def inv(x: Any) -> Any: ...
|
||||
def invert(x: Any) -> Any: ...
|
||||
def ior(a: Any, b: Any) -> Any: ...
|
||||
def ipow(a: Any, b: Any) -> Any: ...
|
||||
def irepeat(a, b: int) -> Any: ...
|
||||
def irshift(a: Any, b: Any) -> Any: ...
|
||||
def isCallable(x: Any) -> bool: ...
|
||||
def isMappingType(x: Any) -> bool: ...
|
||||
def isNumberType(x: Any) -> bool: ...
|
||||
def isSequenceType(x: Any) -> bool: ...
|
||||
def is_(a: Any, b: Any) -> bool: ...
|
||||
def is_not(a: Any, b: Any) -> bool: ...
|
||||
def isub(a: Any, b: Any) -> Any: ...
|
||||
def itruediv(a: Any, b: Any) -> Any: ...
|
||||
def ixor(a: Any, b: Any) -> Any: ...
|
||||
def le(a: Any, b: Any) -> Any: ...
|
||||
def lshift(a: Any, b: Any) -> Any: ...
|
||||
def lt(a: Any, b: Any) -> Any: ...
|
||||
def mod(a: Any, b: Any) -> Any: ...
|
||||
def mul(a: Any, b: Any) -> Any: ...
|
||||
def ne(a: Any, b: Any) -> Any: ...
|
||||
def neg(x: Any) -> Any: ...
|
||||
def not_(x: Any) -> bool: ...
|
||||
def or_(a: Any, b: Any) -> Any: ...
|
||||
def pos(x: Any) -> Any: ...
|
||||
def pow(a: Any, b: Any) -> Any: ...
|
||||
def repeat(a, b: int) -> Any: ...
|
||||
def rshift(a: Any, b: Any) -> Any: ...
|
||||
def sequenceIncludes(seq1: Any, seq2: Any) -> bool: ...
|
||||
def setitem(container: Any, key: Any, item: Any) -> None: ...
|
||||
def setslice(container: Any, b: int, c: int, slice: Any) -> None: ...
|
||||
def sub(a: Any, b: Any) -> Any: ...
|
||||
def truediv(a: Any, b: Any) -> Any: ...
|
||||
def truth(x: Any) -> bool: ...
|
||||
def xor(a: Any, b: Any) -> Any: ...
|
||||
|
||||
# Unsupported feature: "If more than one attribute is requested,
|
||||
# returns a tuple of attributes."
|
||||
# Unsupported: on Python 2 the parameter type should be `basestring`.
|
||||
def attrgetter(attr: str) -> Callable[[Any], Any]: ...
|
||||
|
||||
# Unsupported feature: "If multiple items are specified, returns a
|
||||
# tuple of lookup values."
|
||||
def itemgetter(item: Any) -> Callable[[Any], Any]: ...
|
||||
|
||||
# Unsupported: on Python 2 the parameter type should be `basestring`.
|
||||
def methodcaller(name: str, *args, **kwargs) -> Callable[[Any], Any]: ...
|
||||
108
stdlib/3.4/_operator.pyi
Normal file
108
stdlib/3.4/_operator.pyi
Normal file
@@ -0,0 +1,108 @@
|
||||
"""Stub file for the '_operator' module."""
|
||||
# This is an autogenerated file. It serves as a starting point
|
||||
# for a more precise manual annotation of this module.
|
||||
# Feel free to edit the source below, but remove this header when you do.
|
||||
|
||||
from typing import Any, List, Tuple, Dict, Generic
|
||||
|
||||
def _compare_digest(a, b) -> bool:
|
||||
raise BufferError()
|
||||
raise TypeError()
|
||||
|
||||
def abs(*args, **kwargs) -> Any: ...
|
||||
|
||||
def add(*args, **kwargs) -> Any: ...
|
||||
|
||||
def and_(*args, **kwargs) -> Any: ...
|
||||
|
||||
def concat(*args, **kwargs) -> Any: ...
|
||||
|
||||
def contains(*args, **kwargs) -> bool: ...
|
||||
|
||||
def countOf(*args, **kwargs) -> int: ...
|
||||
|
||||
def delitem(*args, **kwargs) -> None: ...
|
||||
|
||||
def eq(*args, **kwargs) -> Any: ...
|
||||
|
||||
def floordiv(*args, **kwargs) -> Any: ...
|
||||
|
||||
def ge(*args, **kwargs) -> Any: ...
|
||||
|
||||
def getitem(*args, **kwargs) -> Any: ...
|
||||
|
||||
def gt(*args, **kwargs) -> Any: ...
|
||||
|
||||
def iadd(*args, **kwargs) -> Any: ...
|
||||
|
||||
def iand(*args, **kwargs) -> Any: ...
|
||||
|
||||
def iconcat(*args, **kwargs) -> Any: ...
|
||||
|
||||
def ifloordiv(*args, **kwargs) -> Any: ...
|
||||
|
||||
def ilshift(*args, **kwargs) -> Any: ...
|
||||
|
||||
def imod(*args, **kwargs) -> Any: ...
|
||||
|
||||
def imul(*args, **kwargs) -> Any: ...
|
||||
|
||||
def index(*args, **kwargs) -> Any: ...
|
||||
|
||||
def indexOf(*args, **kwargs) -> int: ...
|
||||
|
||||
def inv(*args, **kwargs) -> Any: ...
|
||||
|
||||
def invert(*args, **kwargs) -> Any: ...
|
||||
|
||||
def ior(*args, **kwargs) -> Any: ...
|
||||
|
||||
def ipow(*args, **kwargs) -> Any: ...
|
||||
|
||||
def irshift(*args, **kwargs) -> Any: ...
|
||||
|
||||
def is_(*args, **kwargs) -> bool: ...
|
||||
|
||||
def is_not(*args, **kwargs) -> bool: ...
|
||||
|
||||
def isub(*args, **kwargs) -> Any: ...
|
||||
|
||||
def itruediv(*args, **kwargs) -> Any: ...
|
||||
|
||||
def ixor(*args, **kwargs) -> Any: ...
|
||||
|
||||
def le(*args, **kwargs) -> Any: ...
|
||||
|
||||
def length_hint(a, *args, **kwargs) -> int: ...
|
||||
|
||||
def lshift(*args, **kwargs) -> Any: ...
|
||||
|
||||
def lt(*args, **kwargs) -> Any: ...
|
||||
|
||||
def mod(*args, **kwargs) -> Any: ...
|
||||
|
||||
def mul(*args, **kwargs) -> Any: ...
|
||||
|
||||
def ne(*args, **kwargs) -> Any: ...
|
||||
|
||||
def neg(*args, **kwargs) -> Any: ...
|
||||
|
||||
def not_(*args, **kwargs) -> bool: ...
|
||||
|
||||
def or_(*args, **kwargs) -> Any: ...
|
||||
|
||||
def pos(*args, **kwargs) -> Any: ...
|
||||
|
||||
def pow(*args, **kwargs) -> Any: ...
|
||||
|
||||
def rshift(*args, **kwargs) -> Any: ...
|
||||
|
||||
def setitem(*args, **kwargs) -> None: ...
|
||||
|
||||
def sub(*args, **kwargs) -> Any: ...
|
||||
|
||||
def truediv(*args, **kwargs) -> Any: ...
|
||||
|
||||
def truth(*args, **kwargs) -> bool: ...
|
||||
|
||||
def xor(*args, **kwargs) -> Any: ...
|
||||
69
stdlib/3.4/_stat.pyi
Normal file
69
stdlib/3.4/_stat.pyi
Normal file
@@ -0,0 +1,69 @@
|
||||
"""Stub file for the '_stat' module."""
|
||||
|
||||
SF_APPEND = ... # type: int
|
||||
SF_ARCHIVED = ... # type: int
|
||||
SF_IMMUTABLE = ... # type: int
|
||||
SF_NOUNLINK = ... # type: int
|
||||
SF_SNAPSHOT = ... # type: int
|
||||
ST_ATIME = ... # type: int
|
||||
ST_CTIME = ... # type: int
|
||||
ST_DEV = ... # type: int
|
||||
ST_GID = ... # type: int
|
||||
ST_INO = ... # type: int
|
||||
ST_MODE = ... # type: int
|
||||
ST_MTIME = ... # type: int
|
||||
ST_NLINK = ... # type: int
|
||||
ST_SIZE = ... # type: int
|
||||
ST_UID = ... # type: int
|
||||
S_ENFMT = ... # type: int
|
||||
S_IEXEC = ... # type: int
|
||||
S_IFBLK = ... # type: int
|
||||
S_IFCHR = ... # type: int
|
||||
S_IFDIR = ... # type: int
|
||||
S_IFDOOR = ... # type: int
|
||||
S_IFIFO = ... # type: int
|
||||
S_IFLNK = ... # type: int
|
||||
S_IFPORT = ... # type: int
|
||||
S_IFREG = ... # type: int
|
||||
S_IFSOCK = ... # type: int
|
||||
S_IFWHT = ... # type: int
|
||||
S_IREAD = ... # type: int
|
||||
S_IRGRP = ... # type: int
|
||||
S_IROTH = ... # type: int
|
||||
S_IRUSR = ... # type: int
|
||||
S_IRWXG = ... # type: int
|
||||
S_IRWXO = ... # type: int
|
||||
S_IRWXU = ... # type: int
|
||||
S_ISGID = ... # type: int
|
||||
S_ISUID = ... # type: int
|
||||
S_ISVTX = ... # type: int
|
||||
S_IWGRP = ... # type: int
|
||||
S_IWOTH = ... # type: int
|
||||
S_IWRITE = ... # type: int
|
||||
S_IWUSR = ... # type: int
|
||||
S_IXGRP = ... # type: int
|
||||
S_IXOTH = ... # type: int
|
||||
S_IXUSR = ... # type: int
|
||||
UF_APPEND = ... # type: int
|
||||
UF_COMPRESSED = ... # type: int
|
||||
UF_HIDDEN = ... # type: int
|
||||
UF_IMMUTABLE = ... # type: int
|
||||
UF_NODUMP = ... # type: int
|
||||
UF_NOUNLINK = ... # type: int
|
||||
UF_OPAQUE = ... # type: int
|
||||
|
||||
def S_IMODE(mode: int) -> int: ...
|
||||
def S_IFMT(mode: int) -> int: ...
|
||||
|
||||
def S_ISBLK(mode: int) -> bool: ...
|
||||
def S_ISCHR(mode: int) -> bool: ...
|
||||
def S_ISDIR(mode: int) -> bool: ...
|
||||
def S_ISDOOR(mode: int) -> bool: ...
|
||||
def S_ISFIFO(mode: int ) -> bool: ...
|
||||
def S_ISLNK(mode: int) -> bool: ...
|
||||
def S_ISPORT(mode: int) -> bool: ...
|
||||
def S_ISREG(mode: int) -> bool: ...
|
||||
def S_ISSOCK(mode: int) -> bool: ...
|
||||
def S_ISWHT(mode: int) -> bool: ...
|
||||
|
||||
def filemode(mode: int) -> str: ...
|
||||
26
stdlib/3.4/_tracemalloc.pyi
Normal file
26
stdlib/3.4/_tracemalloc.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
"""Stub file for the '_tracemalloc' module."""
|
||||
# This is an autogenerated file. It serves as a starting point
|
||||
# for a more precise manual annotation of this module.
|
||||
# Feel free to edit the source below, but remove this header when you do.
|
||||
|
||||
from typing import Any, List, Tuple, Dict, Generic
|
||||
|
||||
def _get_object_traceback(*args, **kwargs) -> Any: ...
|
||||
|
||||
def _get_traces() -> Any:
|
||||
raise MemoryError()
|
||||
|
||||
def clear_traces() -> None: ...
|
||||
|
||||
def get_traceback_limit() -> int: ...
|
||||
|
||||
def get_traced_memory() -> tuple: ...
|
||||
|
||||
def get_tracemalloc_memory() -> Any: ...
|
||||
|
||||
def is_tracing() -> bool: ...
|
||||
|
||||
def start(*args, **kwargs) -> None:
|
||||
raise ValueError()
|
||||
|
||||
def stop() -> None: ...
|
||||
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