mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Sync with typeshed @ ac70fdc614feb07fb96e0524a06263c357f51647
This commit is contained in:
@@ -82,6 +82,7 @@ At present the core developers are (alphabetically):
|
||||
* David Fisher (@ddfisher)
|
||||
* Łukasz Langa (@ambv)
|
||||
* Jukka Lehtosalo (@JukkaL)
|
||||
* Ivan Levkivskyi (@ilevkivskyi)
|
||||
* Matthias Kramm (@matthiaskramm)
|
||||
* Greg Price (@gnprice)
|
||||
* Guido van Rossum (@gvanrossum)
|
||||
@@ -133,6 +134,15 @@ included in ``__all__`` (if present), and whose names do not start with an
|
||||
underscore are more likely to merit inclusion in a stub. If in doubt, err
|
||||
on the side of including more objects.
|
||||
|
||||
**NEW:** Sometimes it makes sense to include non-public objects
|
||||
in a stub. Mark these with a comment of the form ``# undocumented``.
|
||||
See the [motivation](https://github.com/python/typeshed/issues/1902).
|
||||
Example:
|
||||
|
||||
```python
|
||||
def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented
|
||||
```
|
||||
|
||||
### Using stubgen
|
||||
|
||||
Mypy includes a tool called [stubgen](https://github.com/python/mypy/blob/master/mypy/stubgen.py)
|
||||
@@ -303,8 +313,6 @@ missing, incomplete or incorrect) and we won't add noise to the
|
||||
tracker by labeling all of them. Here's what our labels mean. (We
|
||||
also apply these to pull requests.)
|
||||
|
||||
* **blocked**: This issue is waiting for the resolution of some issue
|
||||
external to typeshed.
|
||||
* **bug**: It's a bug in a stub.
|
||||
* **bytes-unicode**: It's related to bytes vs. unicode, usually Python 2.
|
||||
* **feature**: It's a new typeshed feature.
|
||||
@@ -316,6 +324,11 @@ also apply these to pull requests.)
|
||||
* **size-medium**: An issue of average complexity.
|
||||
* **size-small**: An issue that will take only little effort to fix.
|
||||
|
||||
Sometimes a PR can't make progress until some external issue is
|
||||
addressed. We indicate this by editing the subject to add a ``[WIP]``
|
||||
prefix. (This should be removed before committing the issue once
|
||||
unblocked!)
|
||||
|
||||
### Core developer guidelines
|
||||
|
||||
Core developers should follow these rules when processing pull requests:
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
# Python 3, and stub files conform to Python 3 syntax.
|
||||
|
||||
from typing import (
|
||||
TypeVar, Iterator, Iterable, overload,
|
||||
TypeVar, Iterator, Iterable, NoReturn, overload,
|
||||
Sequence, Mapping, Tuple, List, Any, Dict, Callable, Generic, Set,
|
||||
AbstractSet, FrozenSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs,
|
||||
SupportsRound, IO, BinaryIO, Union, AnyStr, MutableSequence, MutableMapping,
|
||||
MutableSet, ItemsView, KeysView, ValuesView, Optional, Container, Type
|
||||
)
|
||||
from abc import abstractmethod, ABCMeta
|
||||
from mypy_extensions import NoReturn
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_T_co = TypeVar('_T_co', covariant=True)
|
||||
@@ -101,6 +100,7 @@ class int:
|
||||
def __div__(self, x: int) -> int: ...
|
||||
def __truediv__(self, x: int) -> float: ...
|
||||
def __mod__(self, x: int) -> int: ...
|
||||
def __divmod__(self, x: int) -> Tuple[int, int]: ...
|
||||
def __radd__(self, x: int) -> int: ...
|
||||
def __rsub__(self, x: int) -> int: ...
|
||||
def __rmul__(self, x: int) -> int: ...
|
||||
@@ -108,6 +108,7 @@ class int:
|
||||
def __rdiv__(self, x: int) -> int: ...
|
||||
def __rtruediv__(self, x: int) -> float: ...
|
||||
def __rmod__(self, x: int) -> int: ...
|
||||
def __rdivmod__(self, x: int) -> Tuple[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: ...
|
||||
@@ -153,6 +154,7 @@ class float:
|
||||
def __div__(self, x: float) -> float: ...
|
||||
def __truediv__(self, x: float) -> float: ...
|
||||
def __mod__(self, x: float) -> float: ...
|
||||
def __divmod__(self, x: float) -> Tuple[float, float]: ...
|
||||
def __pow__(self, x: float) -> float: ...
|
||||
def __radd__(self, x: float) -> float: ...
|
||||
def __rsub__(self, x: float) -> float: ...
|
||||
@@ -161,6 +163,7 @@ class float:
|
||||
def __rdiv__(self, x: float) -> float: ...
|
||||
def __rtruediv__(self, x: float) -> float: ...
|
||||
def __rmod__(self, x: float) -> float: ...
|
||||
def __rdivmod__(self, x: float) -> Tuple[float, float]: ...
|
||||
def __rpow__(self, x: float) -> float: ...
|
||||
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
@@ -754,13 +757,67 @@ 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
|
||||
iter2: Iterable[_T2]) -> List[_S]: ...
|
||||
@overload
|
||||
def map(func: Callable[[_T1, _T2, _T3], _S],
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3]) -> List[_S]: ...
|
||||
@overload
|
||||
def map(func: Callable[[_T1, _T2, _T3, _T4], _S],
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4]) -> List[_S]: ...
|
||||
@overload
|
||||
def map(func: Callable[[_T1, _T2, _T3, _T4, _T5], _S],
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4],
|
||||
iter5: Iterable[_T5]) -> List[_S]: ...
|
||||
@overload
|
||||
def map(func: Callable[..., _S],
|
||||
iter1: Iterable[Any],
|
||||
iter2: Iterable[Any],
|
||||
iter3: Iterable[Any],
|
||||
iter4: Iterable[Any],
|
||||
iter5: Iterable[Any],
|
||||
iter6: Iterable[Any],
|
||||
*iterables: Iterable[Any]) -> List[_S]: ...
|
||||
@overload
|
||||
def map(func: None, iter1: Iterable[_T1]) -> List[_T1]: ...
|
||||
@overload
|
||||
def map(func: None,
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ... # TODO more than two iterables
|
||||
iter2: Iterable[_T2]) -> List[Tuple[_T1, _T2]]: ...
|
||||
@overload
|
||||
def map(func: None,
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3]) -> List[Tuple[_T1, _T2, _T3]]: ...
|
||||
@overload
|
||||
def map(func: None,
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4]) -> List[Tuple[_T1, _T2, _T3, _T4]]: ...
|
||||
@overload
|
||||
def map(func: None,
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4],
|
||||
iter5: Iterable[_T5]) -> List[Tuple[_T1, _T2, _T3, _T4, _T5]]: ...
|
||||
@overload
|
||||
def map(func: None,
|
||||
iter1: Iterable[Any],
|
||||
iter2: Iterable[Any],
|
||||
iter3: Iterable[Any],
|
||||
iter4: Iterable[Any],
|
||||
iter5: Iterable[Any],
|
||||
iter6: Iterable[Any],
|
||||
*iterables: Iterable[Any]) -> List[Tuple[Any, ...]]: ...
|
||||
@overload
|
||||
def max(arg1: _T, arg2: _T, *args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
|
||||
@overload
|
||||
@@ -903,7 +960,7 @@ class memoryview(Sized, Container[bytes]):
|
||||
|
||||
class BaseException(object):
|
||||
args = ... # type: Tuple[Any, ...]
|
||||
message = ... # type: str
|
||||
message = ... # type: Any
|
||||
def __init__(self, *args: object, **kwargs: object) -> None: ...
|
||||
def __getitem__(self, i: int) -> Any: ...
|
||||
def __getslice__(self, start: int, stop: int) -> Tuple[Any, ...]: ...
|
||||
|
||||
@@ -59,6 +59,8 @@ class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]):
|
||||
def __contains__(self, o: _T) -> bool: ...
|
||||
def __reversed__(self) -> Iterator[_T]: ...
|
||||
|
||||
_CounterT = TypeVar('_CounterT', bound=Counter)
|
||||
|
||||
class Counter(Dict[_T, int], Generic[_T]):
|
||||
@overload
|
||||
def __init__(self, **kwargs: int) -> None: ...
|
||||
@@ -66,6 +68,7 @@ class Counter(Dict[_T, int], Generic[_T]):
|
||||
def __init__(self, mapping: Mapping[_T, int]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, iterable: Iterable[_T]) -> None: ...
|
||||
def copy(self: _CounterT) -> _CounterT: ...
|
||||
def elements(self) -> Iterator[_T]: ...
|
||||
def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ...
|
||||
@overload
|
||||
@@ -93,10 +96,14 @@ class Counter(Dict[_T, int], Generic[_T]):
|
||||
def __iand__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
def __ior__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
|
||||
_OrderedDictT = TypeVar('_OrderedDictT', bound=OrderedDict)
|
||||
|
||||
class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
||||
def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
|
||||
def copy(self: _OrderedDictT) -> _OrderedDictT: ...
|
||||
def __reversed__(self) -> Iterator[_KT]: ...
|
||||
def __copy__(self) -> OrderedDict[_KT, _VT]: ...
|
||||
|
||||
_DefaultDictT = TypeVar('_DefaultDictT', bound=defaultdict)
|
||||
|
||||
class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
default_factory = ... # type: Callable[[], _VT]
|
||||
@@ -105,9 +112,18 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]],
|
||||
map: Mapping[_KT, _VT]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]],
|
||||
map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]],
|
||||
iterable: Iterable[Tuple[_KT, _VT]]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]],
|
||||
iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
def __missing__(self, key: _KT) -> _VT: ...
|
||||
def copy(self: _DefaultDictT) -> _DefaultDictT: ...
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from mypy_extensions import NoReturn
|
||||
from typing import Any, Callable, Dict, Optional, Tuple
|
||||
from typing import Any, Callable, Dict, NoReturn, Optional, Tuple
|
||||
|
||||
class error(Exception):
|
||||
def __init__(self, *args: Any) -> None: ...
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
# NOTE: This stub is incomplete.
|
||||
from email import message
|
||||
|
||||
# import message
|
||||
|
||||
# TODO
|
||||
# class MIMEBase(message.Message):
|
||||
class MIMEBase:
|
||||
class MIMEBase(message.Message):
|
||||
def __init__(self, _maintype, _subtype, **_params) -> None: ...
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import types
|
||||
from typing import Optional, Text
|
||||
|
||||
def import_module(name: str, package: str = ...) -> types.ModuleType: ...
|
||||
def import_module(name: Text, package: Optional[Text] = ...) -> types.ModuleType: ...
|
||||
|
||||
@@ -1,7 +1,27 @@
|
||||
from types import TracebackType, FrameType, ModuleType
|
||||
from typing import Any, Dict, Callable, List, Optional, Tuple, Union, NamedTuple, Type
|
||||
from types import CodeType, TracebackType, FrameType, ModuleType
|
||||
from typing import Any, Dict, Callable, List, NamedTuple, Optional, Sequence, Tuple, Type, Union
|
||||
|
||||
# Types and members
|
||||
class EndOfBlock(Exception): ...
|
||||
|
||||
class BlockFinder:
|
||||
indent: int
|
||||
islambda: bool
|
||||
started: bool
|
||||
passline: bool
|
||||
last: int
|
||||
def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int],
|
||||
erow_ecol: Tuple[int, int], line: str) -> None: ...
|
||||
|
||||
CO_GENERATOR = ... # type: int
|
||||
CO_NESTED = ... # type: int
|
||||
CO_NEWLOCALS = ... # type: int
|
||||
CO_NOFREE = ... # type: int
|
||||
CO_OPTIMIZED = ... # type: int
|
||||
CO_VARARGS = ... # type: int
|
||||
CO_VARKEYWORDS = ... # type: int
|
||||
TPFLAGS_IS_ABSTRACT = ... # type: int
|
||||
|
||||
ModuleInfo = NamedTuple('ModuleInfo', [('name', str),
|
||||
('suffix', str),
|
||||
('mode', str),
|
||||
@@ -32,6 +52,9 @@ def isgetsetdescriptor(object: object) -> bool: ...
|
||||
def ismemberdescriptor(object: object) -> bool: ...
|
||||
|
||||
# Retrieving source code
|
||||
def findsource(object: object) -> Tuple[List[str], int]: ...
|
||||
def getabsfile(object: object) -> str: ...
|
||||
def getblock(lines: Sequence[str]) -> Sequence[str]: ...
|
||||
def getdoc(object: object) -> str: ...
|
||||
def getcomments(object: object) -> str: ...
|
||||
def getfile(object: object) -> str: ...
|
||||
@@ -44,6 +67,7 @@ def getsourcelines(object: object) -> Tuple[List[str], int]: ...
|
||||
# or code object"
|
||||
def getsource(object: object) -> str: ...
|
||||
def cleandoc(doc: str) -> str: ...
|
||||
def indentsize(line: str) -> int: ...
|
||||
|
||||
# Classes and functions
|
||||
def getclasstree(classes: List[type], unique: bool = ...) -> List[
|
||||
@@ -61,6 +85,12 @@ ArgInfo = NamedTuple('ArgInfo', [('args', List[str]),
|
||||
('locals', Dict[str, Any]),
|
||||
])
|
||||
|
||||
Arguments = NamedTuple('Arguments', [('args', List[Union[str, List[Any]]]),
|
||||
('varargs', Optional[str]),
|
||||
('keywords', Optional[str]),
|
||||
])
|
||||
|
||||
def getargs(co: CodeType) -> Arguments: ...
|
||||
def getargspec(func: object) -> ArgSpec: ...
|
||||
def getargvalues(frame: FrameType) -> ArgInfo: ...
|
||||
def formatargspec(args, varargs=..., varkw=..., defaults=...,
|
||||
@@ -90,7 +120,16 @@ _FrameInfo = Tuple[FrameType, str, int, str, List[str], int]
|
||||
def getouterframes(frame: FrameType, context: int = ...) -> List[_FrameInfo]: ...
|
||||
def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ...
|
||||
def getinnerframes(traceback: TracebackType, context: int = ...) -> List[_FrameInfo]: ...
|
||||
def getlineno(frame: FrameType) -> int: ...
|
||||
|
||||
def currentframe(depth: int = ...) -> FrameType: ...
|
||||
def stack(context: int = ...) -> List[_FrameInfo]: ...
|
||||
def trace(context: int = ...) -> List[_FrameInfo]: ...
|
||||
|
||||
Attribute = NamedTuple('Attribute', [('name', str),
|
||||
('kind', str),
|
||||
('defining_class', type),
|
||||
('object', object),
|
||||
])
|
||||
|
||||
def classify_class_attrs(cls: type) -> List[Attribute]: ...
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from typing import Optional, TypeVar
|
||||
from typing import Any, Callable, Optional, TypeVar, Iterable
|
||||
|
||||
from multiprocessing import pool
|
||||
from multiprocessing.process import Process as Process, current_process as current_process, active_children as active_children
|
||||
from multiprocessing.util import SUBDEBUG as SUBDEBUG, SUBWARNING as SUBWARNING
|
||||
from Queue import Queue as _BaseQueue
|
||||
@@ -38,8 +39,12 @@ def Semaphore(value=1): ...
|
||||
def BoundedSemaphore(value=1): ...
|
||||
def Event(): ...
|
||||
def JoinableQueue(maxsize=0): ...
|
||||
def Pool(processes=None, initializer=None, initargs=..., maxtasksperchild=None): ...
|
||||
def RawValue(typecode_or_type, *args): ...
|
||||
def RawArray(typecode_or_type, size_or_initializer): ...
|
||||
def Value(typecode_or_type, *args, **kwds): ...
|
||||
def Array(typecode_or_type, size_or_initializer, **kwds): ...
|
||||
|
||||
def Pool(processes: Optional[int] = ...,
|
||||
initializer: Optional[Callable[..., Any]] = ...,
|
||||
initargs: Iterable[Any] = ...,
|
||||
maxtasksperchild: Optional[int] = ...) -> pool.Pool: ...
|
||||
|
||||
@@ -7,10 +7,9 @@ from posix import stat_result as stat_result # TODO: use this, see https://gith
|
||||
import sys
|
||||
from typing import (
|
||||
Mapping, MutableMapping, Dict, List, Any, Tuple, Iterator, overload, Union, AnyStr,
|
||||
Optional, Generic, Set, Callable, Text, Sequence, IO, NamedTuple, TypeVar
|
||||
Optional, Generic, Set, Callable, Text, Sequence, IO, NamedTuple, NoReturn, TypeVar
|
||||
)
|
||||
from . import path as path
|
||||
from mypy_extensions import NoReturn
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, Optional, Tuple, Type, Union
|
||||
from mypy_extensions import NoReturn
|
||||
from typing import Any, AnyStr, Callable, Container, Dict, IO, List, Mapping, MutableMapping, NoReturn, Optional, Tuple, Type, Union
|
||||
from repr import Repr
|
||||
|
||||
from types import FunctionType, MethodType, ModuleType, TracebackType
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
from typing import (
|
||||
List, Iterator, overload, Callable, Tuple, Sequence, Dict,
|
||||
Generic, AnyStr, Match, Pattern, Any, Union
|
||||
Generic, AnyStr, Match, Pattern, Any, Optional, Union
|
||||
)
|
||||
|
||||
# ----- re variables and constants -----
|
||||
@@ -34,14 +34,14 @@ def compile(pattern: AnyStr, flags: int = ...) -> Pattern[AnyStr]: ...
|
||||
def compile(pattern: Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ...
|
||||
|
||||
@overload
|
||||
def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
|
||||
def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
@overload
|
||||
def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
|
||||
def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
|
||||
@overload
|
||||
def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
|
||||
def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
@overload
|
||||
def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
|
||||
def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
|
||||
@overload
|
||||
def split(pattern: Union[str, unicode], string: AnyStr,
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
"""Stubs for the 'sys' module."""
|
||||
|
||||
from typing import (
|
||||
IO, Union, List, Sequence, Any, Dict, Tuple, BinaryIO, Optional, Callable,
|
||||
overload, Type,
|
||||
IO, NoReturn, Union, List, Sequence, Any, Dict, Tuple, BinaryIO, Optional,
|
||||
Callable, overload, Text, Type,
|
||||
)
|
||||
from types import FrameType, ModuleType, TracebackType, ClassType
|
||||
from mypy_extensions import NoReturn
|
||||
|
||||
class _flags:
|
||||
bytes_warning = ... # type: int
|
||||
@@ -128,10 +127,11 @@ def getfilesystemencoding() -> str: ... # In practice, never returns None
|
||||
def getrefcount(arg: Any) -> int: ...
|
||||
def getrecursionlimit() -> int: ...
|
||||
def getsizeof(obj: object, default: int = ...) -> int: ...
|
||||
def getprofile() -> None: ...
|
||||
def gettrace() -> None: ...
|
||||
def getprofile() -> Optional[Any]: ...
|
||||
def gettrace() -> Optional[Any]: ...
|
||||
def setcheckinterval(interval: int) -> None: ... # deprecated
|
||||
def setdlopenflags(n: int) -> None: ...
|
||||
def setdefaultencoding(encoding: Text) -> None: ... # only exists after reload(sys)
|
||||
def setprofile(profilefunc: Any) -> None: ... # TODO type
|
||||
def setrecursionlimit(limit: int) -> None: ...
|
||||
def settrace(tracefunc: Any) -> None: ... # TODO type
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
"""Stub file for the 'time' module."""
|
||||
# See https://docs.python.org/2/library/time.html
|
||||
|
||||
from typing import NamedTuple, Tuple, Union, Any, Optional
|
||||
|
||||
# ----- variables and constants -----
|
||||
accept2dyear = False
|
||||
altzone = 0
|
||||
daylight = 0
|
||||
timezone = 0
|
||||
tzname = ... # type: Tuple[str, str]
|
||||
|
||||
class 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)])):
|
||||
def __init__(self, o: Tuple[int, int, int,
|
||||
int, int, int,
|
||||
int, int, int], _arg: Any = ...) -> None: ...
|
||||
def __new__(cls, o: Tuple[int, int, int,
|
||||
int, int, int,
|
||||
int, int, int], _arg: Any = ...) -> struct_time: ...
|
||||
|
||||
_TIME_TUPLE = Tuple[int, int, int, int, int, int, int, int, int]
|
||||
|
||||
def asctime(t: Union[struct_time, _TIME_TUPLE] = ...) -> str:
|
||||
raise ValueError()
|
||||
|
||||
def clock() -> float: ...
|
||||
|
||||
def ctime(secs: Optional[float] = ...) -> str:
|
||||
raise ValueError()
|
||||
|
||||
def gmtime(secs: Optional[float] = ...) -> struct_time: ...
|
||||
|
||||
def localtime(secs: Optional[float] = ...) -> struct_time: ...
|
||||
|
||||
def mktime(t: Union[struct_time, _TIME_TUPLE]) -> float:
|
||||
raise OverflowError()
|
||||
raise ValueError()
|
||||
|
||||
def sleep(secs: float) -> None: ...
|
||||
|
||||
def strftime(format: str, t: Union[struct_time, _TIME_TUPLE] = ...) -> str:
|
||||
raise MemoryError()
|
||||
raise ValueError()
|
||||
|
||||
def strptime(string: str, format: str = ...) -> struct_time:
|
||||
raise ValueError()
|
||||
|
||||
def time() -> float:
|
||||
raise IOError()
|
||||
|
||||
def tzset() -> None: ...
|
||||
@@ -388,9 +388,9 @@ class Pattern(Generic[AnyStr]):
|
||||
pattern = ... # type: AnyStr
|
||||
|
||||
def search(self, string: AnyStr, pos: int = ...,
|
||||
endpos: int = ...) -> Match[AnyStr]: ...
|
||||
endpos: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
def match(self, string: AnyStr, pos: int = ...,
|
||||
endpos: int = ...) -> Match[AnyStr]: ...
|
||||
endpos: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
def split(self, string: AnyStr, maxsplit: int = ...) -> list[AnyStr]: ...
|
||||
def findall(self, string: AnyStr, pos: int = ...,
|
||||
endpos: int = ...) -> list[Any]: ...
|
||||
|
||||
@@ -2,18 +2,18 @@
|
||||
|
||||
# Based on http://docs.python.org/2.7/library/unittest.html
|
||||
|
||||
# Only a subset of functionality is included.
|
||||
|
||||
from mypy_extensions import NoReturn
|
||||
from typing import (Any, Callable, Dict, FrozenSet, Iterable, List, Optional,
|
||||
overload, Pattern, Sequence, Set, TextIO, Tuple, Type,
|
||||
TypeVar, Union)
|
||||
from typing import (Any, Callable, Dict, FrozenSet, Iterable, Iterator,
|
||||
List, NoReturn, Optional, overload, Pattern, Sequence, Set,
|
||||
Text, TextIO, Tuple, Type, TypeVar, Union)
|
||||
from abc import abstractmethod, ABCMeta
|
||||
import types
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_FT = TypeVar('_FT')
|
||||
|
||||
_ExceptionType = Union[Type[BaseException], Tuple[Type[BaseException], ...]]
|
||||
_Regexp = Union[Text, Pattern[Text]]
|
||||
|
||||
class Testable(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
def run(self, result: 'TestResult') -> None: ...
|
||||
@@ -27,18 +27,28 @@ class Testable(metaclass=ABCMeta):
|
||||
class TestResult:
|
||||
errors = ... # type: List[Tuple[Testable, str]]
|
||||
failures = ... # type: List[Tuple[Testable, str]]
|
||||
testsRun = 0
|
||||
skipped = ... # type: List[Tuple[Testable, str]]
|
||||
expectedFailures = ... # type: List[Tuple[Testable, str]]
|
||||
unexpectedSuccesses = ... # type: List[Testable]
|
||||
shouldStop = ... # type: bool
|
||||
testsRun = ... # type: int
|
||||
buffer = ... # type: bool
|
||||
failfast = ... # type: bool
|
||||
|
||||
def wasSuccessful(self) -> bool: ...
|
||||
def stop(self) -> None: ...
|
||||
def startTest(self, test: Testable) -> None: ...
|
||||
def stopTest(self, test: Testable) -> None: ...
|
||||
def startTestRun(self) -> None: ...
|
||||
def stopTestRun(self) -> None: ...
|
||||
def addError(self, test: Testable,
|
||||
err: Tuple[type, Any, Any]) -> None: ... # TODO
|
||||
def addFailure(self, test: Testable,
|
||||
err: Tuple[type, Any, Any]) -> None: ... # TODO
|
||||
def addSuccess(self, test: Testable) -> None: ...
|
||||
def addSkip(self, test: Testable, reason: str) -> None: ...
|
||||
def addExpectedFailure(self, test: Testable, err: str) -> None: ...
|
||||
def addUnexpectedSuccess(self, test: Testable) -> None: ...
|
||||
|
||||
class _AssertRaisesBaseContext:
|
||||
expected = ... # type: Any
|
||||
@@ -53,6 +63,8 @@ class _AssertRaisesContext(_AssertRaisesBaseContext):
|
||||
|
||||
class TestCase(Testable):
|
||||
failureException = ... # type: Type[BaseException]
|
||||
longMessage = ... # type: bool
|
||||
maxDiff = ... # type: Optional[int]
|
||||
def __init__(self, methodName: str = ...) -> None: ...
|
||||
def setUp(self) -> None: ...
|
||||
def tearDown(self) -> None: ...
|
||||
@@ -114,8 +126,23 @@ class TestCase(Testable):
|
||||
msg: object = ...) -> None: ...
|
||||
def assertLessEqual(self, first: Any, second: Any,
|
||||
msg: object = ...) -> None: ...
|
||||
def assertRaises(self, expected_exception: type, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def failUnlessRaises(self, expected_exception: type, *args: Any, **kwargs: Any) -> Any: ...
|
||||
@overload
|
||||
def assertRaises(self, exception: _ExceptionType, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
|
||||
@overload
|
||||
def assertRaises(self, exception: _ExceptionType) -> _AssertRaisesContext: ...
|
||||
@overload
|
||||
def assertRaisesRegexp(self, exception: _ExceptionType, regexp: _Regexp, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
|
||||
@overload
|
||||
def assertRaisesRegexp(self, exception: _ExceptionType, regexp: _Regexp) -> _AssertRaisesContext: ...
|
||||
def assertRegexpMatches(self, text: Text, regexp: _Regexp, msg: object = ...) -> None: ...
|
||||
def assertNotRegexpMatches(self, text: Text, regexp: _Regexp, msg: object = ...) -> None: ...
|
||||
def assertItemsEqual(self, first: Iterable[Any], second: Iterable[Any], msg: object = ...) -> None: ...
|
||||
def assertDictContainsSubset(self, expected: Dict[Any, Any], actual: Dict[Any, Any], msg: object = ...) -> None: ...
|
||||
def addTypeEqualityFunc(self, typeobj: type, function: Callable[..., None]) -> None: ...
|
||||
@overload
|
||||
def failUnlessRaises(self, exception: _ExceptionType, callable: Callable[..., Any], *args: Any, **kwargs: Any) -> None: ...
|
||||
@overload
|
||||
def failUnlessRaises(self, exception: _ExceptionType) -> _AssertRaisesContext: ...
|
||||
def failIf(self, expr: Any, msg: object = ...) -> None: ...
|
||||
def assertFalse(self, expr: Any, msg: object = ...) -> None: ...
|
||||
def assertIs(self, first: object, second: object,
|
||||
@@ -138,13 +165,14 @@ class TestCase(Testable):
|
||||
def id(self) -> str: ...
|
||||
def shortDescription(self) -> str: ... # May return None
|
||||
def addCleanup(function: Any, *args: Any, **kwargs: Any) -> None: ...
|
||||
def doCleanups(self) -> bool: ...
|
||||
def skipTest(self, reason: Any) -> None: ...
|
||||
|
||||
class CallableTestCase(Testable):
|
||||
class FunctionTestCase(Testable):
|
||||
def __init__(self, testFunc: Callable[[], None],
|
||||
setUp: Callable[[], None] = ...,
|
||||
tearDown: Callable[[], None] = ...,
|
||||
description: str = ...) -> None: ...
|
||||
setUp: Optional[Callable[[], None]] = ...,
|
||||
tearDown: Optional[Callable[[], None]] = ...,
|
||||
description: Optional[str] = ...) -> None: ...
|
||||
def run(self, result: TestResult) -> None: ...
|
||||
def debug(self) -> None: ...
|
||||
def countTestCases(self) -> int: ...
|
||||
@@ -156,6 +184,7 @@ class TestSuite(Testable):
|
||||
def run(self, result: TestResult) -> None: ...
|
||||
def debug(self) -> None: ...
|
||||
def countTestCases(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[Testable]: ...
|
||||
|
||||
class TestLoader:
|
||||
testMethodPrefix = ... # type: str
|
||||
@@ -173,11 +202,16 @@ class TestLoader:
|
||||
top_level_dir: Optional[str] = ...) -> TestSuite: ...
|
||||
def getTestCaseNames(self, testCaseClass: Type[TestCase] = ...) -> List[str]: ...
|
||||
|
||||
defaultTestLoader = TestLoader
|
||||
defaultTestLoader = ... # type: TestLoader
|
||||
|
||||
class TextTestResult(TestResult):
|
||||
def __init__(self, stream: TextIO, descriptions: bool, verbosity: int) -> None: ...
|
||||
|
||||
class TextTestRunner:
|
||||
def __init__(self, stream: Optional[TextIO] = ..., descriptions: bool = ...,
|
||||
verbosity: int = ..., failfast: bool = ...) -> None: ...
|
||||
verbosity: int = ..., failfast: bool = ..., buffer: bool = ...,
|
||||
resultclass: Optional[Type[TestResult]] = ...) -> None: ...
|
||||
def _makeResult(self) -> TestResult: ...
|
||||
|
||||
class SkipTest(Exception):
|
||||
...
|
||||
@@ -199,5 +233,15 @@ def main(module: str = ..., defaultTest: Optional[str] = ...,
|
||||
failfast: Optional[bool] = ..., catchbreak: Optional[bool] = ...,
|
||||
buffer: Optional[bool] = ...) -> TestProgram: ...
|
||||
|
||||
def load_tests(loader: TestLoader, tests: TestSuite, pattern: Optional[Text]) -> TestSuite: ...
|
||||
|
||||
def installHandler() -> None: ...
|
||||
def registerResult(result: TestResult) -> None: ...
|
||||
def removeResult(result: TestResult) -> bool: ...
|
||||
@overload
|
||||
def removeHandler() -> None: ...
|
||||
@overload
|
||||
def removeHandler(function: Callable[..., Any]) -> Callable[..., Any]: ...
|
||||
|
||||
# private but occasionally used
|
||||
util = ... # type: types.ModuleType
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Mapping, Union, Tuple, Sequence, IO
|
||||
from typing import Any, AnyStr, IO, Mapping, Sequence, Text, Tuple, Union
|
||||
|
||||
def url2pathname(pathname: str) -> str: ...
|
||||
def pathname2url(pathname: str) -> str: ...
|
||||
@@ -119,10 +119,10 @@ def splitquery(url): ...
|
||||
def splittag(url): ...
|
||||
def splitattr(url): ...
|
||||
def splitvalue(attr): ...
|
||||
def unquote(s: str) -> str: ...
|
||||
def unquote_plus(s: str) -> str: ...
|
||||
def quote(s: str, safe=...) -> str: ...
|
||||
def quote_plus(s: str, safe=...) -> str: ...
|
||||
def unquote(s: AnyStr) -> AnyStr: ...
|
||||
def unquote_plus(s: AnyStr) -> AnyStr: ...
|
||||
def quote(s: AnyStr, safe: Text = ...) -> AnyStr: ...
|
||||
def quote_plus(s: AnyStr, safe: Text = ...) -> AnyStr: ...
|
||||
def urlencode(query: Union[Sequence[Tuple[Any, Any]], Mapping[Any, Any]], doseq=...) -> str: ...
|
||||
|
||||
def getproxies() -> Mapping[str, str]: ...
|
||||
|
||||
@@ -18,4 +18,7 @@ if sys.version_info >= (3, 0):
|
||||
if sys.version_info >= (3, 5):
|
||||
generator_stop: _Feature
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
annotations: _Feature
|
||||
|
||||
all_feature_names: List[str]
|
||||
|
||||
@@ -115,20 +115,30 @@ if sys.version_info >= (3,):
|
||||
class MetavarTypeHelpFormatter(HelpFormatter): ...
|
||||
|
||||
class Action:
|
||||
option_strings: Sequence[_Text]
|
||||
dest: _Text
|
||||
nargs: Optional[Union[int, _Text]]
|
||||
const: Any
|
||||
default: Any
|
||||
type: Optional[Union[Callable[[str], Any], FileType]]
|
||||
choices: Optional[Iterable[Any]]
|
||||
required: bool
|
||||
help: Optional[_Text]
|
||||
metavar: Optional[Union[_Text, Tuple[_Text, ...]]]
|
||||
def __init__(self,
|
||||
option_strings: Sequence[_Text],
|
||||
dest: _Text = ...,
|
||||
nargs: Optional[Union[int, _Text]] = ...,
|
||||
const: Any = ...,
|
||||
default: Any = ...,
|
||||
type: Union[Callable[[str], _T], FileType, None] = ...,
|
||||
type: Optional[Union[Callable[[str], _T], FileType]] = ...,
|
||||
choices: Optional[Iterable[_T]] = ...,
|
||||
required: bool = ...,
|
||||
help: Optional[_Text] = ...,
|
||||
metavar: Union[_Text, Tuple[_Text, ...]] = ...) -> None: ...
|
||||
metavar: Optional[Union[_Text, Tuple[_Text, ...]]] = ...) -> None: ...
|
||||
def __call__(self, parser: ArgumentParser, namespace: Namespace,
|
||||
values: Union[_Text, Sequence[Any], None],
|
||||
option_string: _Text = ...) -> None: ...
|
||||
option_string: Optional[_Text] = ...) -> None: ...
|
||||
|
||||
class Namespace:
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
|
||||
@@ -21,7 +21,10 @@ else:
|
||||
_Ascii = Union[bytes, Text]
|
||||
|
||||
def a2b_uu(string: _Ascii) -> bytes: ...
|
||||
def b2a_uu(data: _Bytes) -> bytes: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def b2a_uu(data: _Bytes, *, backtick: bool = ...) -> bytes: ...
|
||||
else:
|
||||
def b2a_uu(data: _Bytes) -> bytes: ...
|
||||
def a2b_base64(string: _Ascii) -> bytes: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
def b2a_base64(data: _Bytes, *, newline: bool = ...) -> bytes: ...
|
||||
|
||||
@@ -65,6 +65,14 @@ class HTMLCalendar(Calendar):
|
||||
def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
|
||||
def formatyear(self, theyear: int, width: int = ...) -> str: ...
|
||||
def formatyearpage(self, theyear: int, width: int = ..., css: Optional[str] = ..., encoding: Optional[str] = ...) -> str: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
cssclasses: List[str]
|
||||
cssclass_today: str
|
||||
cssclasses_weekday_head: List[str]
|
||||
cssclass_month_head: str
|
||||
cssclass_month: str
|
||||
cssclass_year: str
|
||||
cssclass_year_head: str
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
class TimeEncoding:
|
||||
|
||||
@@ -14,6 +14,8 @@ if sys.version_info >= (3, 5):
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from typing import ContextManager as AbstractContextManager
|
||||
if sys.version_info >= (3, 7):
|
||||
from typing import AsyncContextManager as AbstractAsyncContextManager
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
@@ -59,8 +61,33 @@ if sys.version_info >= (3,):
|
||||
def __init__(self) -> None: ...
|
||||
def enter_context(self, cm: ContextManager[_T]) -> _T: ...
|
||||
def push(self, exit: _CM_EF) -> _CM_EF: ...
|
||||
def callback(self, callback: Callable[..., None],
|
||||
*args: Any, **kwds: Any) -> Callable[..., None]: ...
|
||||
def pop_all(self) -> ExitStack: ...
|
||||
def callback(self, callback: Callable[..., Any],
|
||||
*args: Any, **kwds: Any) -> Callable[..., Any]: ...
|
||||
def pop_all(self: _U) -> _U: ...
|
||||
def close(self) -> None: ...
|
||||
def __enter__(self: _U) -> _U: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from typing import Awaitable
|
||||
|
||||
_S = TypeVar('_S', bound='AsyncExitStack')
|
||||
|
||||
_ExitCoroFunc = Callable[[Optional[Type[BaseException]],
|
||||
Optional[BaseException],
|
||||
Optional[TracebackType]], Awaitable[bool]]
|
||||
_CallbackCoroFunc = Callable[..., Awaitable[Any]]
|
||||
_ACM_EF = TypeVar('_ACM_EF', AsyncContextManager, _ExitCoroFunc)
|
||||
|
||||
class AsyncExitStack(AsyncContextManager[AsyncExitStack]):
|
||||
def __init__(self) -> None: ...
|
||||
def enter_context(self, cm: ContextManager[_T]) -> _T: ...
|
||||
def enter_async_context(self, cm: AsyncContextManager[_T]) -> Awaitable[_T]: ...
|
||||
def push(self, exit: _CM_EF) -> _CM_EF: ...
|
||||
def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ...
|
||||
def callback(self, callback: Callable[..., Any],
|
||||
*args: Any, **kwds: Any) -> Callable[..., Any]: ...
|
||||
def push_async_callback(self, callback: _CallbackCoroFunc,
|
||||
*args: Any, **kwds: Any) -> _CallbackCoroFunc: ...
|
||||
def pop_all(self: _S) -> _S: ...
|
||||
def aclose(self) -> Awaitable[None]: ...
|
||||
def __aenter__(self: _S) -> Awaitable[_S]: ...
|
||||
|
||||
@@ -9,10 +9,15 @@ if sys.version_info >= (3, 3):
|
||||
METHOD_MD5: _Method
|
||||
METHOD_SHA256: _Method
|
||||
METHOD_SHA512: _Method
|
||||
if sys.version_info >= (3, 7):
|
||||
METHOD_BLOWFISH: _Method
|
||||
|
||||
methods: List[_Method]
|
||||
|
||||
def mksalt(method: Optional[_Method] = ...) -> str: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def mksalt(method: Optional[_Method] = ..., *, rounds: Optional[int] = ...) -> str: ...
|
||||
else:
|
||||
def mksalt(method: Optional[_Method] = ...) -> str: ...
|
||||
def crypt(word: str, salt: Optional[Union[str, _Method]] = ...) -> str: ...
|
||||
else:
|
||||
def crypt(word: str, salt: str) -> str: ...
|
||||
|
||||
@@ -14,7 +14,7 @@ MINYEAR: int
|
||||
MAXYEAR: int
|
||||
|
||||
class tzinfo:
|
||||
def tzname(self, dt: Optional[datetime]) -> str: ...
|
||||
def tzname(self, dt: Optional[datetime]) -> Optional[str]: ...
|
||||
def utcoffset(self, dt: Optional[datetime]) -> Optional[timedelta]: ...
|
||||
def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ...
|
||||
def fromutc(self, dt: datetime) -> datetime: ...
|
||||
@@ -223,6 +223,9 @@ class datetime:
|
||||
else:
|
||||
@classmethod
|
||||
def combine(cls, date: date, time: time) -> datetime: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls, date_string: str) -> datetime: ...
|
||||
def strftime(self, fmt: _Text) -> str: ...
|
||||
if sys.version_info >= (3,):
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from abc import abstractmethod
|
||||
from typing import Any, Optional, TypeVar, Union, Pattern, Tuple
|
||||
from typing import Any, Optional, TypeVar, Union, Pattern, Text, Tuple
|
||||
|
||||
_T = TypeVar('_T', bound='Version')
|
||||
|
||||
@@ -15,9 +15,9 @@ class Version:
|
||||
def __ge__(self: _T, other: Union[_T, str]) -> bool: ...
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self, vstring: Optional[str] = ...) -> None: ...
|
||||
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
|
||||
@abstractmethod
|
||||
def parse(self: _T, vstring: str) -> _T: ...
|
||||
def parse(self: _T, vstring: Text) -> _T: ...
|
||||
@abstractmethod
|
||||
def __str__(self) -> str: ...
|
||||
if sys.version_info >= (3,):
|
||||
@@ -30,10 +30,10 @@ class Version:
|
||||
class StrictVersion(Version):
|
||||
version_re: Pattern[str]
|
||||
version: Tuple[int, int, int]
|
||||
prerelease: Optional[Tuple[str, int]]
|
||||
prerelease: Optional[Tuple[Text, int]]
|
||||
|
||||
def __init__(self, vstring: Optional[str] = ...) -> None: ...
|
||||
def parse(self: _T, vstring: str) -> _T: ...
|
||||
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
|
||||
def parse(self: _T, vstring: Text) -> _T: ...
|
||||
def __str__(self) -> str: ...
|
||||
if sys.version_info >= (3,):
|
||||
def _cmp(self: _T, other: Union[_T, str]) -> bool: ...
|
||||
@@ -42,11 +42,11 @@ class StrictVersion(Version):
|
||||
|
||||
class LooseVersion(Version):
|
||||
component_re: Pattern[str]
|
||||
vstring: str
|
||||
version: Tuple[Union[str, int], ...]
|
||||
vstring: Text
|
||||
version: Tuple[Union[Text, int], ...]
|
||||
|
||||
def __init__(self, vstring: Optional[str] = ...) -> None: ...
|
||||
def parse(self: _T, vstring: str) -> _T: ...
|
||||
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
|
||||
def parse(self: _T, vstring: Text) -> _T: ...
|
||||
def __str__(self) -> str: ...
|
||||
if sys.version_info >= (3,):
|
||||
def _cmp(self: _T, other: Union[_T, str]) -> bool: ...
|
||||
|
||||
@@ -62,6 +62,8 @@ class Fraction(Rational):
|
||||
def __rfloordiv__(self, other) -> int: ...
|
||||
def __mod__(self, other): ...
|
||||
def __rmod__(self, other): ...
|
||||
def __divmod__(self, other): ...
|
||||
def __rdivmod__(self, other): ...
|
||||
def __pow__(self, other): ...
|
||||
def __rpow__(self, other): ...
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# Stubs for lib2to3.pgen2.pgen (Python 3.6)
|
||||
|
||||
from typing import Any, Dict, IO, Iterable, Iterator, List, Optional, Text, Tuple
|
||||
from mypy_extensions import NoReturn
|
||||
from typing import (
|
||||
Any, Dict, IO, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple
|
||||
)
|
||||
|
||||
from lib2to3.pgen2 import _Path, grammar
|
||||
from lib2to3.pgen2.tokenize import _TokenInfo
|
||||
|
||||
@@ -5,7 +5,7 @@ _ModuleGlobals = Dict[str, Any]
|
||||
|
||||
def getline(filename: Text, lineno: int, module_globals: Optional[_ModuleGlobals] = ...) -> str: ...
|
||||
def clearcache() -> None: ...
|
||||
def getlines(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> None: ...
|
||||
def getlines(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ...
|
||||
def checkcache(filename: Optional[Text] = ...) -> None: ...
|
||||
def updatecache(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
|
||||
@@ -373,6 +373,10 @@ class StreamHandler(Handler):
|
||||
|
||||
|
||||
class FileHandler(Handler):
|
||||
baseFilename = ... # type: str
|
||||
mode = ... # type: str
|
||||
encoding = ... # type: Optional[str]
|
||||
delay = ... # type: bool
|
||||
def __init__(self, filename: str, mode: str = ...,
|
||||
encoding: Optional[str] = ..., delay: bool = ...) -> None: ...
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ class WatchedFileHandler(Handler):
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
class BaseRotatingHandler(FileHandler):
|
||||
terminator = ... # type: str
|
||||
namer = ... # type: Optional[Callable[[str], str]]
|
||||
rotator = ... # type: Optional[Callable[[str, str], None]]
|
||||
def __init__(self, filename: str, mode: str,
|
||||
|
||||
@@ -20,7 +20,10 @@ 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: ...
|
||||
if sys.version_info >= (3,):
|
||||
def ceil(x: float) -> int: ...
|
||||
else:
|
||||
def ceil(x: float) -> float: ...
|
||||
def copysign(x: float, y: float) -> float: ...
|
||||
def cos(x: float) -> float: ...
|
||||
def cosh(x: float) -> float: ...
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
# Stubs for poplib (Python 2 and 3)
|
||||
|
||||
from mypy_extensions import NoReturn
|
||||
import socket
|
||||
import ssl
|
||||
import sys
|
||||
from typing import Any, BinaryIO, Dict, List, Optional, overload, Pattern, Text, Tuple
|
||||
from typing import (
|
||||
Any, BinaryIO, Dict, List, NoReturn, Optional, overload, Pattern, Text,
|
||||
Tuple,
|
||||
)
|
||||
|
||||
_LongResp = Tuple[bytes, List[bytes], int]
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# Stubs for sunau (Python 2 and 3)
|
||||
|
||||
import sys
|
||||
from mypy_extensions import NoReturn
|
||||
from typing import Any, NamedTuple, Optional, Text, IO, Union, Tuple
|
||||
from typing import Any, NamedTuple, NoReturn, Optional, Text, IO, Union, Tuple
|
||||
|
||||
_File = Union[Text, IO[bytes]]
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# Stubs for wave (Python 2 and 3)
|
||||
|
||||
import sys
|
||||
from mypy_extensions import NoReturn
|
||||
from typing import Any, NamedTuple, Optional, Text, BinaryIO, Union, Tuple
|
||||
from typing import (
|
||||
Any, NamedTuple, NoReturn, Optional, Text, BinaryIO, Union, Tuple
|
||||
)
|
||||
|
||||
_File = Union[Text, BinaryIO]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Stubs for xml.etree.ElementTree
|
||||
|
||||
from typing import Any, Callable, Dict, Generator, IO, ItemsView, Iterable, Iterator, KeysView, List, MutableSequence, Optional, Sequence, Text, Tuple, TypeVar, Union
|
||||
from typing import Any, Callable, Dict, Generator, IO, ItemsView, Iterable, Iterator, KeysView, List, MutableSequence, Optional, overload, Sequence, Text, Tuple, TypeVar, Union
|
||||
import io
|
||||
import sys
|
||||
|
||||
@@ -70,6 +70,17 @@ class Element(MutableSequence['Element']):
|
||||
def remove(self, subelement: 'Element') -> None: ...
|
||||
def set(self, key: _str_argument_type, value: _str_argument_type) -> None: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __delitem__(self, i: Union[int, slice]) -> None: ...
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> 'Element': ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> Sequence['Element']: ...
|
||||
def __len__(self) -> int: ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, o: 'Element') -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, s: slice, o: Iterable['Element']) -> None: ...
|
||||
|
||||
|
||||
def SubElement(parent: Element, tag: _str_argument_type, attrib: Dict[_str_argument_type, _str_argument_type]=..., **extra: _str_argument_type) -> Element: ...
|
||||
def Comment(text: _str_argument_type=...) -> Element: ...
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from typing import Any, List, Optional, Text, Union, IO
|
||||
from mypy_extensions import NoReturn
|
||||
from typing import Any, List, NoReturn, Optional, Text, Union, IO
|
||||
|
||||
import xml.sax
|
||||
from xml.sax.xmlreader import InputSource, Locator
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# Stubs for zipfile
|
||||
|
||||
from typing import Callable, IO, List, Optional, Tuple, Type, Union
|
||||
from typing import Callable, IO, Iterable, List, Optional, Text, Tuple, Type, Union
|
||||
from types import TracebackType
|
||||
import sys
|
||||
|
||||
|
||||
_SZI = Union[str, ZipInfo]
|
||||
_SZI = Union[Text, ZipInfo]
|
||||
_DT = Tuple[int, int, int, int, int, int]
|
||||
|
||||
|
||||
@@ -22,28 +22,28 @@ class ZipFile:
|
||||
debug = ... # type: int
|
||||
comment = ... # type: bytes
|
||||
filelist = ... # type: List[ZipInfo]
|
||||
def __init__(self, file: Union[str, IO[bytes]], mode: str = ..., compression: int = ...,
|
||||
def __init__(self, file: Union[Text, IO[bytes]], mode: Text = ..., compression: int = ...,
|
||||
allowZip64: bool = ...) -> None: ...
|
||||
def __enter__(self) -> ZipFile: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[Exception],
|
||||
exc_tb: Optional[TracebackType]) -> bool: ...
|
||||
def close(self) -> None: ...
|
||||
def getinfo(self, name: str) -> ZipInfo: ...
|
||||
def getinfo(self, name: Text) -> ZipInfo: ...
|
||||
def infolist(self) -> List[ZipInfo]: ...
|
||||
def namelist(self) -> List[str]: ...
|
||||
def open(self, name: _SZI, mode: str = ...,
|
||||
def namelist(self) -> List[Text]: ...
|
||||
def open(self, name: _SZI, mode: Text = ...,
|
||||
pwd: Optional[bytes] = ...) -> IO[bytes]: ...
|
||||
def extract(self, member: _SZI, path: Optional[_SZI] = ...,
|
||||
pwd: bytes = ...) -> str: ...
|
||||
def extractall(self, path: Optional[str] = ...,
|
||||
members: Optional[List[str]] = ...,
|
||||
def extractall(self, path: Optional[Text] = ...,
|
||||
members: Optional[Iterable[Text]] = ...,
|
||||
pwd: Optional[bytes] = ...) -> None: ...
|
||||
def printdir(self) -> None: ...
|
||||
def setpassword(self, pwd: bytes) -> None: ...
|
||||
def read(self, name: _SZI, pwd: Optional[bytes] = ...) -> bytes: ...
|
||||
def testzip(self) -> Optional[str]: ...
|
||||
def write(self, filename: str, arcname: Optional[str] = ...,
|
||||
def write(self, filename: Text, arcname: Optional[Text] = ...,
|
||||
compress_type: Optional[int] = ...) -> None: ...
|
||||
if sys.version_info >= (3,):
|
||||
def writestr(self, zinfo_or_arcname: _SZI, data: Union[bytes, str],
|
||||
@@ -62,10 +62,10 @@ class PyZipFile(ZipFile):
|
||||
filterfunc: Optional[Callable[[str], bool]] = ...) -> None: ...
|
||||
else:
|
||||
def writepy(self,
|
||||
pathname: str, basename: str = ...) -> None: ...
|
||||
pathname: Text, basename: Text = ...) -> None: ...
|
||||
|
||||
class ZipInfo:
|
||||
filename = ... # type: str
|
||||
filename = ... # type: Text
|
||||
date_time = ... # type: _DT
|
||||
compress_type = ... # type: int
|
||||
comment = ... # type: bytes
|
||||
@@ -83,11 +83,11 @@ class ZipInfo:
|
||||
compress_size = ... # type: int
|
||||
file_size = ... # type: int
|
||||
if sys.version_info < (3,):
|
||||
def __init__(self, filename: Optional[str] = ...,
|
||||
def __init__(self, filename: Optional[Text] = ...,
|
||||
date_time: Optional[_DT] = ...) -> None: ...
|
||||
|
||||
|
||||
def is_zipfile(filename: Union[str, IO[bytes]]) -> bool: ...
|
||||
def is_zipfile(filename: Union[Text, IO[bytes]]) -> bool: ...
|
||||
|
||||
ZIP_STORED = ... # type: int
|
||||
ZIP_DEFLATED = ... # type: int
|
||||
|
||||
@@ -88,7 +88,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
@abstractmethod
|
||||
@coroutine
|
||||
def run_in_executor(self, executor: Any,
|
||||
callback: Callable[..., _T], *args: Any) -> Generator[Any, None, _T]: ...
|
||||
func: Callable[..., _T], *args: Any) -> Generator[Any, None, _T]: ...
|
||||
@abstractmethod
|
||||
def set_default_executor(self, executor: Any) -> None: ...
|
||||
# Network I/O methods returning Futures.
|
||||
@@ -96,7 +96,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
|
||||
@coroutine
|
||||
# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers
|
||||
# https://github.com/python/mypy/issues/2509
|
||||
def getaddrinfo(self, host: str, port: int, *,
|
||||
def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *,
|
||||
family: int = ..., type: int = ..., proto: int = ..., flags: int = ...) -> Generator[Any, None, List[Tuple[int, int, int, str, Tuple[Any, ...]]]]: ...
|
||||
@abstractmethod
|
||||
@coroutine
|
||||
|
||||
@@ -56,7 +56,7 @@ if sys.platform != 'win32':
|
||||
client_connected_cb: _ClientConnectedCallback,
|
||||
path: str = ...,
|
||||
*,
|
||||
loop: int = ...,
|
||||
loop: Optional[events.AbstractEventLoop] = ...,
|
||||
limit: int = ...,
|
||||
**kwds: Any) -> Generator[Any, None, events.AbstractServer]: ...
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ def run_coroutine_threadsafe(coro: _FutureT[_T],
|
||||
def shield(arg: _FutureT[_T], *, loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
def sleep(delay: float, result: _T = ..., loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
def wait(fs: Iterable[_FutureT[_T]], *, loop: AbstractEventLoop = ...,
|
||||
timeout: float = ...,
|
||||
timeout: Optional[float] = ...,
|
||||
return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ...
|
||||
def wait_for(fut: _FutureT[_T], timeout: Optional[float],
|
||||
*, loop: AbstractEventLoop = ...) -> Future[_T]: ...
|
||||
|
||||
@@ -9,6 +9,6 @@ _T = TypeVar('_T')
|
||||
def randbelow(exclusive_upper_bound: int) -> int: ...
|
||||
def randbits(k: int) -> int: ...
|
||||
def choice(seq: Sequence[_T]) -> _T: ...
|
||||
def token_bytes(nbytes: Optional[int]) -> bytes: ...
|
||||
def token_hex(nbytes: Optional[int]) -> str: ...
|
||||
def token_urlsafe(nbytes: Optional[int]) -> str: ...
|
||||
def token_bytes(nbytes: Optional[int] = ...) -> bytes: ...
|
||||
def token_hex(nbytes: Optional[int] = ...) -> str: ...
|
||||
def token_urlsafe(nbytes: Optional[int] = ...) -> str: ...
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from mypy_extensions import NoReturn
|
||||
from typing import Any, Callable, Dict, Optional, Tuple
|
||||
from typing import Any, Callable, Dict, NoReturn, Optional, Tuple
|
||||
|
||||
TIMEOUT_MAX: int
|
||||
error = RuntimeError
|
||||
|
||||
@@ -13,7 +13,7 @@ class ABCMeta(type):
|
||||
def register(cls: "ABCMeta", subclass: Type[Any]) -> None: ...
|
||||
|
||||
def abstractmethod(callable: _FuncT) -> _FuncT: ...
|
||||
def abstractproperty(callable: _FuncT) -> _FuncT: ...
|
||||
class abstractproperty(property): ...
|
||||
# These two are deprecated and not supported by mypy
|
||||
def abstractstaticmethod(callable: _FuncT) -> _FuncT: ...
|
||||
def abstractclassmethod(callable: _FuncT) -> _FuncT: ...
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
from typing import (
|
||||
TypeVar, Iterator, Iterable, overload, Container,
|
||||
Sequence, MutableSequence, Mapping, MutableMapping, Tuple, List, Any, Dict, Callable, Generic,
|
||||
Sequence, MutableSequence, Mapping, MutableMapping, NoReturn, Tuple, List, Any, Dict, Callable, Generic,
|
||||
Set, AbstractSet, FrozenSet, MutableSet, Sized, Reversible, SupportsInt, SupportsFloat,
|
||||
SupportsBytes, SupportsAbs, SupportsRound, IO, Union, ItemsView, KeysView, ValuesView,
|
||||
ByteString, Optional, AnyStr, Type,
|
||||
@@ -10,7 +10,6 @@ from typing import (
|
||||
from abc import abstractmethod, ABCMeta
|
||||
from types import TracebackType, CodeType
|
||||
import sys
|
||||
from mypy_extensions import NoReturn
|
||||
|
||||
# Note that names imported above are not automatically made visible via the
|
||||
# implicit builtins import.
|
||||
@@ -121,12 +120,14 @@ class int:
|
||||
def __floordiv__(self, x: int) -> int: ...
|
||||
def __truediv__(self, x: int) -> float: ...
|
||||
def __mod__(self, x: int) -> int: ...
|
||||
def __divmod__(self, x: int) -> Tuple[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 __rdivmod__(self, x: int) -> Tuple[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: ...
|
||||
@@ -171,6 +172,7 @@ class float:
|
||||
def __floordiv__(self, x: float) -> float: ...
|
||||
def __truediv__(self, x: float) -> float: ...
|
||||
def __mod__(self, x: float) -> float: ...
|
||||
def __divmod__(self, x: float) -> Tuple[float, float]: ...
|
||||
def __pow__(self, x: float) -> float: ...
|
||||
def __radd__(self, x: float) -> float: ...
|
||||
def __rsub__(self, x: float) -> float: ...
|
||||
@@ -178,6 +180,7 @@ class float:
|
||||
def __rfloordiv__(self, x: float) -> float: ...
|
||||
def __rtruediv__(self, x: float) -> float: ...
|
||||
def __rmod__(self, x: float) -> float: ...
|
||||
def __rdivmod__(self, x: float) -> Tuple[float, float]: ...
|
||||
def __rpow__(self, x: float) -> float: ...
|
||||
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
@@ -804,8 +807,7 @@ def eval(source: Union[str, bytes, CodeType], globals: Optional[Dict[str, Any]]
|
||||
def exec(object: Union[str, bytes, CodeType], globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> Any: ...
|
||||
def exit(code: Any = ...) -> NoReturn: ...
|
||||
@overload
|
||||
def filter(function: Optional[Callable[[_T], Any]],
|
||||
iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
def filter(function: Callable[[_T], Any], iterable: Iterable[_T]) -> Iterator[_T]: ...
|
||||
@overload
|
||||
def filter(function: None, iterable: Iterable[Optional[_T]]) -> Iterator[_T]: ...
|
||||
def format(o: object, format_spec: str = ...) -> str: ...
|
||||
@@ -830,7 +832,34 @@ def locals() -> Dict[str, Any]: ...
|
||||
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
|
||||
iter2: Iterable[_T2]) -> Iterator[_S]: ...
|
||||
@overload
|
||||
def map(func: Callable[[_T1, _T2, _T3], _S],
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3]) -> Iterator[_S]: ...
|
||||
@overload
|
||||
def map(func: Callable[[_T1, _T2, _T3, _T4], _S],
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4]) -> Iterator[_S]: ...
|
||||
@overload
|
||||
def map(func: Callable[[_T1, _T2, _T3, _T4, _T5], _S],
|
||||
iter1: Iterable[_T1],
|
||||
iter2: Iterable[_T2],
|
||||
iter3: Iterable[_T3],
|
||||
iter4: Iterable[_T4],
|
||||
iter5: Iterable[_T5]) -> Iterator[_S]: ...
|
||||
@overload
|
||||
def map(func: Callable[..., _S],
|
||||
iter1: Iterable[Any],
|
||||
iter2: Iterable[Any],
|
||||
iter3: Iterable[Any],
|
||||
iter4: Iterable[Any],
|
||||
iter5: Iterable[Any],
|
||||
iter6: Iterable[Any],
|
||||
*iterables: Iterable[Any]) -> Iterator[_S]: ...
|
||||
@overload
|
||||
def max(arg1: _T, arg2: _T, *args: _T, key: Callable[[_T], Any] = ...) -> _T: ...
|
||||
@overload
|
||||
@@ -937,11 +966,17 @@ class SystemExit(BaseException):
|
||||
code = 0
|
||||
class Exception(BaseException): ...
|
||||
class ArithmeticError(Exception): ...
|
||||
class EnvironmentError(Exception):
|
||||
class OSError(Exception):
|
||||
errno = 0
|
||||
strerror = ... # type: str
|
||||
# TODO can this be bytes?
|
||||
filename = ... # type: str
|
||||
# filename, filename2 are actually Union[str, bytes, None]
|
||||
filename = ... # type: Any
|
||||
if sys.version_info >= (3, 4):
|
||||
filename2 = ... # type: Any
|
||||
IOError = OSError
|
||||
EnvironmentError = OSError
|
||||
class WindowsError(OSError):
|
||||
winerror = ... # type: int
|
||||
class LookupError(Exception): ...
|
||||
class RuntimeError(Exception): ...
|
||||
class ValueError(Exception): ...
|
||||
@@ -950,7 +985,6 @@ class AttributeError(Exception): ...
|
||||
class BufferError(Exception): ...
|
||||
class EOFError(Exception): ...
|
||||
class FloatingPointError(ArithmeticError): ...
|
||||
class IOError(EnvironmentError): ...
|
||||
class ImportError(Exception):
|
||||
if sys.version_info >= (3, 3):
|
||||
name = ... # type: str
|
||||
@@ -962,7 +996,6 @@ class KeyError(LookupError): ...
|
||||
class MemoryError(Exception): ...
|
||||
class NameError(Exception): ...
|
||||
class NotImplementedError(RuntimeError): ...
|
||||
class OSError(EnvironmentError): ...
|
||||
class BlockingIOError(OSError):
|
||||
characters_written = 0
|
||||
class ChildProcessError(OSError): ...
|
||||
@@ -979,8 +1012,6 @@ class NotADirectoryError(OSError): ...
|
||||
class PermissionError(OSError): ...
|
||||
class ProcessLookupError(OSError): ...
|
||||
class TimeoutError(OSError): ...
|
||||
class WindowsError(OSError):
|
||||
winerror = ... # type: int
|
||||
class OverflowError(ArithmeticError): ...
|
||||
class ReferenceError(Exception): ...
|
||||
class StopIteration(Exception):
|
||||
|
||||
@@ -62,6 +62,7 @@ else:
|
||||
_UserDictT = TypeVar('_UserDictT', bound=UserDict)
|
||||
|
||||
class UserDict(MutableMapping[_KT, _VT]):
|
||||
data = ... # type: Mapping[_KT, _VT]
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, key: _KT) -> _VT: ...
|
||||
def __setitem__(self, key: _KT, item: _VT) -> None: ...
|
||||
@@ -182,7 +183,8 @@ class UserString(Sequence[str]):
|
||||
def zfill(self: _UserStringT, width: int) -> _UserStringT: ...
|
||||
|
||||
|
||||
# Technically, deque only derives from MutableSequence in 3.5.
|
||||
# Technically, deque only derives from MutableSequence in 3.5 (before then, the insert and index
|
||||
# methods did not exist).
|
||||
# But in practice it's not worth losing sleep over.
|
||||
class deque(MutableSequence[_T], Generic[_T]):
|
||||
maxlen = ... # type: Optional[int] # TODO readonly
|
||||
@@ -196,9 +198,8 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
def count(self, x: _T) -> int: ...
|
||||
def extend(self, iterable: Iterable[_T]) -> None: ...
|
||||
def extendleft(self, iterable: Iterable[_T]) -> None: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def insert(self, i: int, x: _T) -> None: ...
|
||||
def index(self, x: _T, start: int = ..., stop: int = ...) -> int: ...
|
||||
def insert(self, i: int, x: _T) -> None: ...
|
||||
def index(self, x: _T, start: int = ..., stop: int = ...) -> int: ...
|
||||
def pop(self, i: int = ...) -> _T: ...
|
||||
def popleft(self) -> _T: ...
|
||||
def remove(self, value: _T) -> None: ...
|
||||
@@ -236,6 +237,7 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
def __mul__(self, other: int) -> deque[_T]: ...
|
||||
def __imul__(self, other: int) -> None: ...
|
||||
|
||||
_CounterT = TypeVar('_CounterT', bound=Counter)
|
||||
|
||||
class Counter(Dict[_T, int], Generic[_T]):
|
||||
@overload
|
||||
@@ -244,7 +246,7 @@ class Counter(Dict[_T, int], Generic[_T]):
|
||||
def __init__(self, mapping: Mapping[_T, int]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, iterable: Iterable[_T]) -> None: ...
|
||||
|
||||
def copy(self: _CounterT) -> _CounterT: ...
|
||||
def elements(self) -> Iterator[_T]: ...
|
||||
|
||||
def most_common(self, n: Optional[int] = ...) -> List[Tuple[_T, int]]: ...
|
||||
@@ -277,11 +279,15 @@ class Counter(Dict[_T, int], Generic[_T]):
|
||||
def __iand__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
def __ior__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
|
||||
_OrderedDictT = TypeVar('_OrderedDictT', bound=OrderedDict)
|
||||
|
||||
class OrderedDict(Dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
||||
def popitem(self, last: bool = ...) -> Tuple[_KT, _VT]: ...
|
||||
def move_to_end(self, key: _KT, last: bool = ...) -> None: ...
|
||||
def copy(self: _OrderedDictT) -> _OrderedDictT: ...
|
||||
def __reversed__(self) -> Iterator[_KT]: ...
|
||||
def __copy__(self) -> OrderedDict[_KT, _VT]: ...
|
||||
|
||||
_DefaultDictT = TypeVar('_DefaultDictT', bound=defaultdict)
|
||||
|
||||
class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
default_factory = ... # type: Callable[[], _VT]
|
||||
@@ -291,14 +297,22 @@ class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]], **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]],
|
||||
map: Mapping[_KT, _VT]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]],
|
||||
map: Mapping[_KT, _VT], **kwargs: _VT) -> None: ...
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]],
|
||||
iterable: Iterable[Tuple[_KT, _VT]]) -> None: ...
|
||||
|
||||
@overload
|
||||
def __init__(self, default_factory: Optional[Callable[[], _VT]],
|
||||
iterable: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
|
||||
def __missing__(self, key: _KT) -> _VT: ...
|
||||
# TODO __reversed__
|
||||
def copy(self: _DefaultDictT) -> _DefaultDictT: ...
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
|
||||
@@ -14,8 +14,6 @@ class Error(Exception): ...
|
||||
class CancelledError(Error): ...
|
||||
class TimeoutError(Error): ...
|
||||
|
||||
DoneAndNotDoneFutures = NamedTuple('DoneAndNotDoneFutures', [('done', Future[Any]), ('not_done', Future[Any])])
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class Future(Generic[_T]):
|
||||
@@ -27,7 +25,7 @@ class Future(Generic[_T]):
|
||||
def add_done_callback(self, fn: Callable[[Future[_T]], Any]) -> None: ...
|
||||
def result(self, timeout: Optional[float] = ...) -> _T: ...
|
||||
def exception(self, timeout: Optional[float] = ...) -> Optional[BaseException]: ...
|
||||
def set_running_or_notify_cancel(self) -> None: ...
|
||||
def set_running_or_notify_cancel(self) -> bool: ...
|
||||
def set_result(self, result: _T) -> None: ...
|
||||
def set_exception(self, exception: Optional[BaseException]) -> None: ...
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ class InterpolationSyntaxError(InterpolationError):
|
||||
pass
|
||||
|
||||
|
||||
class ParsingError:
|
||||
class ParsingError(Error):
|
||||
source = ... # type: str
|
||||
errors = ... # type: Sequence[Tuple[int, str]]
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ if sys.version_info >= (3, 3):
|
||||
raise_on_defect = ... # type: bool
|
||||
if sys.version_info >= (3, 5):
|
||||
mange_from = ... # type: bool
|
||||
def __init__(**kw: Any) -> None: ...
|
||||
def clone(**kw: Any) -> 'Policy': ...
|
||||
def __init__(self, **kw: Any) -> None: ...
|
||||
def clone(self, **kw: Any) -> 'Policy': ...
|
||||
def handle_defect(self, obj: Message,
|
||||
defect: MessageDefect) -> None: ...
|
||||
def register_defect(self, obj: Message,
|
||||
|
||||
@@ -24,6 +24,7 @@ class _lru_cache_wrapper(Generic[_T]):
|
||||
__wrapped__ = ... # type: Callable[..., _T]
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> _T: ...
|
||||
def cache_info(self) -> _CacheInfo: ...
|
||||
def cache_clear(self) -> None: ...
|
||||
|
||||
class lru_cache():
|
||||
def __init__(self, maxsize: Optional[int] = ..., typed: bool = ...) -> None: ...
|
||||
|
||||
@@ -1,12 +1,35 @@
|
||||
import sys
|
||||
from typing import (AbstractSet, Any, Tuple, List, Dict, Callable, Generator,
|
||||
Mapping, MutableMapping, NamedTuple, Optional, Sequence, Union,
|
||||
from typing import (AbstractSet, Any, Callable, Dict, Generator, List, Mapping,
|
||||
MutableMapping, NamedTuple, Optional, Sequence, Tuple,
|
||||
Union,
|
||||
)
|
||||
from types import FrameType, ModuleType, TracebackType
|
||||
from types import CodeType, FrameType, ModuleType, TracebackType
|
||||
|
||||
#
|
||||
# Types and members
|
||||
#
|
||||
class EndOfBlock(Exception): ...
|
||||
|
||||
class BlockFinder:
|
||||
indent: int
|
||||
islambda: bool
|
||||
started: bool
|
||||
passline: bool
|
||||
indecorator: bool
|
||||
decoratorhasargs: bool
|
||||
last: int
|
||||
def tokeneater(self, type: int, token: str, srow_scol: Tuple[int, int],
|
||||
erow_ecol: Tuple[int, int], line: str) -> None: ...
|
||||
|
||||
CO_GENERATOR = ... # type: int
|
||||
CO_NESTED = ... # type: int
|
||||
CO_NEWLOCALS = ... # type: int
|
||||
CO_NOFREE = ... # type: int
|
||||
CO_OPTIMIZED = ... # type: int
|
||||
CO_VARARGS = ... # type: int
|
||||
CO_VARKEYWORDS = ... # type: int
|
||||
TPFLAGS_IS_ABSTRACT = ... # type: int
|
||||
|
||||
if sys.version_info < (3, 6):
|
||||
ModuleInfo = NamedTuple('ModuleInfo', [('name', str),
|
||||
('suffix', str),
|
||||
@@ -47,6 +70,9 @@ def ismemberdescriptor(object: object) -> bool: ...
|
||||
#
|
||||
# Retrieving source code
|
||||
#
|
||||
def findsource(object: object) -> Tuple[List[str], int]: ...
|
||||
def getabsfile(object: object) -> str: ...
|
||||
def getblock(lines: Sequence[str]) -> Sequence[str]: ...
|
||||
def getdoc(object: object) -> str: ...
|
||||
def getcomments(object: object) -> str: ...
|
||||
def getfile(object: object) -> str: ...
|
||||
@@ -59,6 +85,7 @@ def getsourcelines(object: object) -> Tuple[List[str], int]: ...
|
||||
# or code object"
|
||||
def getsource(object: object) -> str: ...
|
||||
def cleandoc(doc: str) -> str: ...
|
||||
def indentsize(line: str) -> int: ...
|
||||
|
||||
|
||||
#
|
||||
@@ -149,6 +176,12 @@ ArgSpec = NamedTuple('ArgSpec', [('args', List[str]),
|
||||
('defaults', tuple),
|
||||
])
|
||||
|
||||
Arguments = NamedTuple('Arguments', [('args', List[str]),
|
||||
('varargs', Optional[str]),
|
||||
('varkw', Optional[str]),
|
||||
])
|
||||
|
||||
def getargs(co: CodeType) -> Arguments: ...
|
||||
def getargspec(func: object) -> ArgSpec: ...
|
||||
|
||||
FullArgSpec = NamedTuple('FullArgSpec', [('args', List[str]),
|
||||
@@ -170,6 +203,8 @@ ArgInfo = NamedTuple('ArgInfo', [('args', List[str]),
|
||||
])
|
||||
|
||||
def getargvalues(frame: FrameType) -> ArgInfo: ...
|
||||
def formatannotation(annotation: object, base_module: Optional[str] = None) -> str: ...
|
||||
def formatannotationrelativeto(object: object) -> Callable[[object], str]: ...
|
||||
def formatargspec(args: List[str],
|
||||
varargs: Optional[str] = ...,
|
||||
varkw: Optional[str] = ...,
|
||||
@@ -219,6 +254,17 @@ def unwrap(func: Callable[..., Any],
|
||||
# The interpreter stack
|
||||
#
|
||||
|
||||
Traceback = NamedTuple(
|
||||
'Traceback',
|
||||
[
|
||||
('filename', str),
|
||||
('lineno', int),
|
||||
('function', str),
|
||||
('code_context', List[str]),
|
||||
('index', int),
|
||||
]
|
||||
)
|
||||
|
||||
# Python 3.5+ (functions returning it used to return regular tuples)
|
||||
FrameInfo = NamedTuple('FrameInfo', [('frame', FrameType),
|
||||
('filename', str),
|
||||
@@ -228,11 +274,10 @@ FrameInfo = NamedTuple('FrameInfo', [('frame', FrameType),
|
||||
('index', int),
|
||||
])
|
||||
|
||||
# TODO make the frame type more specific
|
||||
def getframeinfo(frame: Any, context: int = ...) -> FrameInfo: ...
|
||||
def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ...
|
||||
def getouterframes(frame: Any, context: int = ...) -> List[FrameInfo]: ...
|
||||
def getinnerframes(traceback: TracebackType, context: int = ...) -> List[FrameInfo]:
|
||||
...
|
||||
def getinnerframes(traceback: TracebackType, context: int = ...) -> List[FrameInfo]: ...
|
||||
def getlineno(frame: FrameType) -> int: ...
|
||||
def currentframe() -> Optional[FrameType]: ...
|
||||
def stack(context: int = ...) -> List[FrameInfo]: ...
|
||||
def trace(context: int = ...) -> List[FrameInfo]: ...
|
||||
@@ -274,17 +319,10 @@ def getgeneratorlocals(generator: Generator[Any, Any, Any]) -> Dict[str, Any]: .
|
||||
# TODO can we be more specific than "object"?
|
||||
def getcoroutinelocals(coroutine: object) -> Dict[str, Any]: ...
|
||||
|
||||
|
||||
#
|
||||
# The following seems undocumented but it was already present in this file
|
||||
#
|
||||
_object = object
|
||||
|
||||
# namedtuple('Attribute', 'name kind defining_class object')
|
||||
class Attribute(tuple):
|
||||
name = ... # type: str
|
||||
kind = ... # type: str
|
||||
defining_class = ... # type: type
|
||||
object = ... # type: _object
|
||||
Attribute = NamedTuple('Attribute', [('name', str),
|
||||
('kind', str),
|
||||
('defining_class', type),
|
||||
('object', object),
|
||||
])
|
||||
|
||||
def classify_class_attrs(cls: type) -> List[Attribute]: ...
|
||||
|
||||
@@ -2,21 +2,19 @@
|
||||
|
||||
from typing import (
|
||||
Any, Callable, ContextManager, Iterable, Mapping, Optional, Dict, List,
|
||||
Union, TypeVar, Sequence, Tuple
|
||||
Union, Sequence, Tuple
|
||||
)
|
||||
|
||||
from logging import Logger
|
||||
from multiprocessing import connection, pool, synchronize
|
||||
from multiprocessing.context import (
|
||||
BaseContext,
|
||||
ProcessError, BufferTooShort, TimeoutError, AuthenticationError)
|
||||
ProcessError as ProcessError, BufferTooShort as BufferTooShort, TimeoutError as TimeoutError, AuthenticationError as AuthenticationError)
|
||||
from multiprocessing.managers import SyncManager
|
||||
from multiprocessing.process import current_process as current_process
|
||||
import queue
|
||||
from multiprocessing.queues import Queue as Queue, SimpleQueue as SimpleQueue, JoinableQueue as JoinableQueue
|
||||
import sys
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
# N.B. The functions below are generated at runtime by partially applying
|
||||
# multiprocessing.context.BaseContext's methods, so the two signatures should
|
||||
# be identical (modulo self).
|
||||
@@ -62,19 +60,6 @@ class Process():
|
||||
def is_alive(self) -> bool: ...
|
||||
def join(self, timeout: Optional[float] = ...) -> None: ...
|
||||
|
||||
class Queue(queue.Queue[_T]):
|
||||
def __init__(self, maxsize: int = ...) -> None: ...
|
||||
def get(self, block: bool = ..., timeout: Optional[float] = ...) -> _T: ...
|
||||
def put(self, item: _T, block: bool = ..., timeout: Optional[float] = ...) -> None: ...
|
||||
def qsize(self) -> int: ...
|
||||
def empty(self) -> bool: ...
|
||||
def full(self) -> bool: ...
|
||||
def put_nowait(self, item: _T) -> None: ...
|
||||
def get_nowait(self) -> _T: ...
|
||||
def close(self) -> None: ...
|
||||
def join_thread(self) -> None: ...
|
||||
def cancel_join_thread(self) -> None: ...
|
||||
|
||||
class Value():
|
||||
value: Any = ...
|
||||
def __init__(self, typecode_or_type: str, *args: Any, lock: bool = ...) -> None: ...
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
from logging import Logger
|
||||
import multiprocessing
|
||||
from multiprocessing import synchronize
|
||||
from multiprocessing import queues
|
||||
import sys
|
||||
from typing import (
|
||||
Any, Callable, Iterable, Optional, List, Mapping, Sequence, Tuple, Type,
|
||||
@@ -51,12 +52,9 @@ class BaseContext(object):
|
||||
def RLock(self) -> synchronize.RLock: ...
|
||||
def Semaphore(self, value: int = ...) -> synchronize.Semaphore: ...
|
||||
|
||||
# TODO: change return to Queue once a stub exists in multiprocessing.queues
|
||||
def Queue(self, maxsize: int = ...) -> Any: ...
|
||||
# TODO: change return to Queue once a stub exists in multiprocessing.queues
|
||||
def JoinableQueue(self, maxsize: int = ...) -> Any: ...
|
||||
# TODO: change return to SimpleQueue once a stub exists in multiprocessing.queues
|
||||
def SimpleQueue(self) -> Any: ...
|
||||
def Queue(self, maxsize: int = ...) -> queues.Queue: ...
|
||||
def JoinableQueue(self, maxsize: int = ...) -> queues.JoinableQueue: ...
|
||||
def SimpleQueue(self) -> queues.SimpleQueue: ...
|
||||
def Pool(
|
||||
self,
|
||||
processes: Optional[int] = ...,
|
||||
|
||||
@@ -10,11 +10,14 @@ from typing import (
|
||||
_T = TypeVar('_T', bound='Pool')
|
||||
|
||||
class AsyncResult():
|
||||
def get(self, timeout: float = ...) -> Any: ...
|
||||
def wait(self, timeout: float = ...) -> None: ...
|
||||
def get(self, timeout: Optional[float] = ...) -> Any: ...
|
||||
def wait(self, timeout: Optional[float] = ...) -> None: ...
|
||||
def ready(self) -> bool: ...
|
||||
def successful(self) -> bool: ...
|
||||
|
||||
class IMapIterator(Iterable[Any]):
|
||||
def next(self, timeout: Optional[float] = ...) -> Any: ...
|
||||
|
||||
class Pool(ContextManager[Pool]):
|
||||
def __init__(self, processes: Optional[int] = ...,
|
||||
initializer: Optional[Callable[..., None]] = ...,
|
||||
@@ -43,11 +46,11 @@ class Pool(ContextManager[Pool]):
|
||||
def imap(self,
|
||||
func: Callable[..., Any],
|
||||
iterable: Iterable[Any] = ...,
|
||||
chunksize: Optional[int] = ...) -> Iterable[Any]: ...
|
||||
chunksize: Optional[int] = ...) -> IMapIterator: ...
|
||||
def imap_unordered(self,
|
||||
func: Callable[..., Any],
|
||||
iterable: Iterable[Any] = ...,
|
||||
chunksize: Optional[int] = ...) -> Iterable[Any]: ...
|
||||
chunksize: Optional[int] = ...) -> IMapIterator: ...
|
||||
def starmap(self,
|
||||
func: Callable[..., Any],
|
||||
iterable: Iterable[Iterable[Any]] = ...,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
from io import TextIOWrapper as _TextIOWrapper
|
||||
import sys
|
||||
from typing import (
|
||||
Mapping, MutableMapping, Dict, List, Any, Tuple, IO, Iterable, Iterator, overload, Union, AnyStr,
|
||||
Mapping, MutableMapping, Dict, List, Any, Tuple, IO, Iterable, Iterator, NoReturn, overload, Union, AnyStr,
|
||||
Optional, Generic, Set, Callable, Text, Sequence, NamedTuple, TypeVar, ContextManager
|
||||
)
|
||||
from mypy_extensions import NoReturn
|
||||
|
||||
# Re-exported names from other modules.
|
||||
from builtins import OSError as error
|
||||
@@ -383,7 +382,16 @@ if sys.version_info >= (3, 3):
|
||||
else:
|
||||
def link(src: _PathType, link_name: _PathType) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
if sys.version_info >= (3, 6):
|
||||
@overload
|
||||
def listdir(path: Optional[str] = ...) -> List[str]: ...
|
||||
@overload
|
||||
def listdir(path: bytes) -> List[bytes]: ...
|
||||
@overload
|
||||
def listdir(path: int) -> List[str]: ...
|
||||
@overload
|
||||
def listdir(path: PathLike[str]) -> List[str]: ...
|
||||
elif sys.version_info >= (3, 3):
|
||||
@overload
|
||||
def listdir(path: Optional[str] = ...) -> List[str]: ...
|
||||
@overload
|
||||
|
||||
@@ -79,14 +79,14 @@ def compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]: ...
|
||||
def compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ...
|
||||
|
||||
@overload
|
||||
def search(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Match[AnyStr]: ...
|
||||
def search(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
|
||||
@overload
|
||||
def search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Match[AnyStr]: ...
|
||||
def search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
|
||||
|
||||
@overload
|
||||
def match(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Match[AnyStr]: ...
|
||||
def match(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
|
||||
@overload
|
||||
def match(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Match[AnyStr]: ...
|
||||
def match(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
|
||||
|
||||
# New in Python 3.4
|
||||
@overload
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
from email.message import Message as _Message
|
||||
from typing import (
|
||||
Any, AnyStr, Dict, Generic, List, Optional, Sequence, Tuple, Union)
|
||||
Any, AnyStr, Dict, Generic, List, Optional, Sequence, Tuple, Union,
|
||||
Pattern)
|
||||
|
||||
_Reply = Tuple[int, bytes]
|
||||
_SendErrs = Dict[str, _Reply]
|
||||
|
||||
SMTP_PORT: int
|
||||
SMTP_SSL_PORT: int
|
||||
CRLF: str
|
||||
bCRLF: bytes
|
||||
|
||||
OLDSTYLE_AUTH: Pattern[str]
|
||||
|
||||
class SMTPException(OSError): ...
|
||||
class SMTPServerDisconnected(SMTPException): ...
|
||||
|
||||
|
||||
@@ -5,6 +5,18 @@ import sys
|
||||
from typing import Sequence, Any, Mapping, Callable, Tuple, IO, Optional, Union, List, Type, Text
|
||||
from types import TracebackType
|
||||
|
||||
# We prefer to annotate inputs to methods (eg subprocess.check_call) with these
|
||||
# union types. However, outputs (eg check_call return) and class attributes
|
||||
# (eg TimeoutError.cmd) we prefer to annotate with Any, so the caller does not
|
||||
# have to use an assertion to confirm which type.
|
||||
#
|
||||
# For example:
|
||||
#
|
||||
# try:
|
||||
# x = subprocess.check_output(["ls", "-l"])
|
||||
# reveal_type(x) # Any, but morally is _TXT
|
||||
# except TimeoutError as e:
|
||||
# reveal_type(e.cmd) # Any, but morally is _CMD
|
||||
_FILE = Union[None, int, IO[Any]]
|
||||
_TXT = Union[bytes, Text]
|
||||
if sys.version_info >= (3, 6):
|
||||
@@ -250,7 +262,14 @@ STDOUT = ... # type: int
|
||||
if sys.version_info >= (3, 3):
|
||||
DEVNULL = ... # type: int
|
||||
class SubprocessError(Exception): ...
|
||||
class TimeoutExpired(SubprocessError): ...
|
||||
class TimeoutExpired(SubprocessError):
|
||||
# morally: _CMD
|
||||
cmd = ... # type: Any
|
||||
timeout = ... # type: float
|
||||
# morally: Optional[_TXT]
|
||||
output = ... # type: Any
|
||||
stdout = ... # type: Any
|
||||
stderr = ... # type: Any
|
||||
|
||||
|
||||
class CalledProcessError(Exception):
|
||||
@@ -350,4 +369,6 @@ class Popen:
|
||||
def getstatusoutput(cmd: _TXT) -> Tuple[int, str]: ...
|
||||
def getoutput(cmd: _TXT) -> str: ...
|
||||
|
||||
def list2cmdline(seq: Sequence[str]) -> str: ... # undocumented
|
||||
|
||||
# Windows-only: STARTUPINFO etc.
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
# based on http://docs.python.org/3.2/library/sys.html
|
||||
|
||||
from typing import (
|
||||
List, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, Union,
|
||||
TypeVar, Callable, Type,
|
||||
List, NoReturn, Sequence, Any, Dict, Tuple, TextIO, overload, Optional,
|
||||
Union, TypeVar, Callable, Type,
|
||||
)
|
||||
import sys
|
||||
from types import FrameType, TracebackType
|
||||
from mypy_extensions import NoReturn
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
# Stubs for time
|
||||
# Ron Murawski <ron@horizonchess.com>
|
||||
|
||||
# based on: http://docs.python.org/3.3/library/time.html#module-time
|
||||
# see: http://nullege.com/codes/search?cq=time
|
||||
|
||||
import sys
|
||||
from typing import Any, NamedTuple, Tuple, Union
|
||||
from types import SimpleNamespace
|
||||
|
||||
TimeTuple = Tuple[int, int, int, int, int, int, int, int, int]
|
||||
|
||||
# ----- variables and constants -----
|
||||
accept2dyear = False
|
||||
altzone = 0
|
||||
daylight = 0
|
||||
timezone = 0
|
||||
tzname = ... # type: Tuple[str, str]
|
||||
|
||||
if sys.version_info >= (3, 3) and sys.platform != 'win32':
|
||||
CLOCK_HIGHRES = 0 # Solaris only
|
||||
CLOCK_MONOTONIC = 0 # Unix only
|
||||
CLOCK_MONOTONIC_RAW = 0 # Linux 2.6.28 or later
|
||||
CLOCK_PROCESS_CPUTIME_ID = 0 # Unix only
|
||||
CLOCK_REALTIME = 0 # Unix only
|
||||
CLOCK_THREAD_CPUTIME_ID = 0 # Unix only
|
||||
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
class 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),
|
||||
('tm_zone', str), ('tm_gmtoff', int)]
|
||||
)
|
||||
):
|
||||
def __init__(
|
||||
self,
|
||||
o: Union[
|
||||
Tuple[int, int, int, int, int, int, int, int, int],
|
||||
Tuple[int, int, int, int, int, int, int, int, int, str],
|
||||
Tuple[int, int, int, int, int, int, int, int, int, str, int]
|
||||
],
|
||||
_arg: Any = ...,
|
||||
) -> None: ...
|
||||
def __new__(
|
||||
cls,
|
||||
o: Union[
|
||||
Tuple[int, int, int, int, int, int, int, int, int],
|
||||
Tuple[int, int, int, int, int, int, int, int, int, str],
|
||||
Tuple[int, int, int, int, int, int, int, int, int, str, int]
|
||||
],
|
||||
_arg: Any = ...,
|
||||
) -> struct_time: ...
|
||||
else:
|
||||
class 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)]
|
||||
)
|
||||
):
|
||||
def __init__(self, o: TimeTuple, _arg: Any = ...) -> None: ...
|
||||
def __new__(cls, o: TimeTuple, _arg: Any = ...) -> struct_time: ...
|
||||
|
||||
|
||||
# ----- functions -----
|
||||
def asctime(t: Union[TimeTuple, 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[TimeTuple, struct_time]) -> float: ...
|
||||
def sleep(secs: Union[int, float]) -> None: ...
|
||||
def strftime(format: str,
|
||||
t: Union[TimeTuple, struct_time, None] = ...) -> str: ... # return current time
|
||||
def strptime(string: str,
|
||||
format: str = ...) -> struct_time: ...
|
||||
def time() -> float: ...
|
||||
if sys.platform != 'win32':
|
||||
def tzset() -> None: ... # Unix only
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
def get_clock_info(name: str) -> SimpleNamespace: ...
|
||||
def monotonic() -> float: ...
|
||||
def perf_counter() -> float: ...
|
||||
def process_time() -> float: ...
|
||||
if sys.platform != 'win32':
|
||||
def clock_getres(clk_id: int) -> float: ... # Unix only
|
||||
def clock_gettime(clk_id: int) -> float: ... # Unix only
|
||||
def clock_settime(clk_id: int, time: float) -> None: ... # Unix only
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def clock_gettime_ns(clock_id: int) -> int: ...
|
||||
def clock_settime_ns(clock_id: int, time: int) -> int: ...
|
||||
def monotonic_ns() -> int: ...
|
||||
def perf_counter_ns() -> int: ...
|
||||
def process_time_ns() -> int: ...
|
||||
def time_ns() -> int: ...
|
||||
@@ -1,5 +1,6 @@
|
||||
from typing import Any, Callable, Generator, Iterable, List, NamedTuple, Optional, Union, Sequence, TextIO, Tuple
|
||||
from builtins import open as _builtin_open
|
||||
import sys
|
||||
from token import * # noqa: F403
|
||||
|
||||
COMMENT = ... # type: int
|
||||
@@ -41,7 +42,11 @@ def detect_encoding(readline: Callable[[], bytes]) -> Tuple[str, Sequence[bytes]
|
||||
def tokenize(readline: Callable[[], bytes]) -> Generator[TokenInfo, None, None]: ...
|
||||
def generate_tokens(readline: Callable[[], str]) -> Generator[TokenInfo, None, None]: ...
|
||||
|
||||
def open(filename: Union[str, bytes, int]) -> TextIO: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
from os import PathLike
|
||||
def open(filename: Union[str, bytes, int, PathLike]) -> TextIO: ...
|
||||
else:
|
||||
def open(filename: Union[str, bytes, int]) -> TextIO: ...
|
||||
|
||||
# Names in __all__ with no definition:
|
||||
# AMPER
|
||||
|
||||
@@ -152,10 +152,19 @@ class BuiltinFunctionType:
|
||||
BuiltinMethodType = BuiltinFunctionType
|
||||
|
||||
class TracebackType:
|
||||
tb_frame = ... # type: FrameType
|
||||
tb_lasti = ... # type: int
|
||||
tb_lineno = ... # type: int
|
||||
tb_next = ... # type: TracebackType
|
||||
if sys.version_info >= (3, 7):
|
||||
def __init__(self, tb_next: Optional[TracebackType], tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> None: ...
|
||||
tb_next: Optional[TracebackType]
|
||||
else:
|
||||
@property
|
||||
def tb_next(self) -> Optional[TracebackType]: ...
|
||||
# the rest are read-only even in 3.7
|
||||
@property
|
||||
def tb_frame(self) -> FrameType: ...
|
||||
@property
|
||||
def tb_lasti(self) -> int: ...
|
||||
@property
|
||||
def tb_lineno(self) -> int: ...
|
||||
|
||||
class FrameType:
|
||||
f_back = ... # type: FrameType
|
||||
|
||||
@@ -498,9 +498,9 @@ class Pattern(Generic[AnyStr]):
|
||||
pattern = ... # type: AnyStr
|
||||
|
||||
def search(self, string: AnyStr, pos: int = ...,
|
||||
endpos: int = ...) -> Match[AnyStr]: ...
|
||||
endpos: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
def match(self, string: AnyStr, pos: int = ...,
|
||||
endpos: int = ...) -> Match[AnyStr]: ...
|
||||
endpos: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
# New in Python 3.4
|
||||
def fullmatch(self, string: AnyStr, pos: int = ...,
|
||||
endpos: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
@@ -535,6 +535,7 @@ def cast(tp: Type[_T], obj: Any) -> _T: ...
|
||||
|
||||
# NamedTuple is special-cased in the type checker
|
||||
class NamedTuple(tuple):
|
||||
_field_types = ... # type: collections.OrderedDict[str, Type[Any]]
|
||||
_fields = ... # type: Tuple[str, ...]
|
||||
_source = ... # type: str
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# Stubs for unittest
|
||||
|
||||
from mypy_extensions import NoReturn
|
||||
from typing import (
|
||||
Any, Callable, ContextManager, Dict, FrozenSet, Generic, Iterable, Iterator,
|
||||
List, Optional, overload, Pattern, Sequence, Set, TextIO, Tuple, Type,
|
||||
TypeVar, Union
|
||||
List, NoReturn, Optional, overload, Pattern, Sequence, Set, TextIO, Tuple,
|
||||
Type, TypeVar, Union
|
||||
)
|
||||
import logging
|
||||
import sys
|
||||
@@ -279,8 +278,8 @@ class TestResult:
|
||||
outcome: Optional[_SysExcInfoType]) -> None: ...
|
||||
|
||||
class TextTestResult(TestResult):
|
||||
def __init__(self, stream: TextIO = ..., descriptions: bool = ...,
|
||||
verbosity: int = ...) -> None: ...
|
||||
def __init__(self, stream: TextIO, descriptions: bool,
|
||||
verbosity: int) -> None: ...
|
||||
_TextTestResult = TextTestResult
|
||||
|
||||
defaultTestLoader = ... # type: TestLoader
|
||||
@@ -324,10 +323,12 @@ def main(module: str = ..., defaultTest: _DefaultTestType = ...,
|
||||
buffer: Optional[bool] = ...,
|
||||
warnings: Optional[str] = ...) -> TestProgram: ...
|
||||
|
||||
def load_tests(loader: TestLoader, tests: TestSuite,
|
||||
pattern: Optional[str]) -> TestSuite: ...
|
||||
|
||||
def installHandler() -> None: ...
|
||||
def registerResult(result: TestResult) -> None: ...
|
||||
def removeResult(result: TestResult) -> None: ...
|
||||
def removeResult(result: TestResult) -> bool: ...
|
||||
@overload
|
||||
def removeHandler() -> None: ...
|
||||
@overload
|
||||
|
||||
@@ -97,13 +97,6 @@ if sys.version_info >= (3, 3):
|
||||
def start(self) -> Any: ...
|
||||
def stop(self) -> Any: ...
|
||||
|
||||
class _patcher:
|
||||
def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> Any: ...
|
||||
def object(self, target: Any, attribute: str, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ...
|
||||
def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> Any: ...
|
||||
|
||||
patch = ... # type: _patcher
|
||||
|
||||
class _patch_dict:
|
||||
in_dict = ... # type: Any
|
||||
values = ... # type: Any
|
||||
@@ -116,6 +109,16 @@ if sys.version_info >= (3, 3):
|
||||
start = ... # type: Any
|
||||
stop = ... # type: Any
|
||||
|
||||
class _patcher:
|
||||
TEST_PREFIX = ... # type: str
|
||||
dict = ... # type: _patch_dict
|
||||
def __call__(self, target: Any, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> Any: ...
|
||||
def object(self, target: Any, attribute: str, new: Optional[Any] = ..., spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> _patch: ...
|
||||
def multiple(self, target: Any, spec: Optional[Any] = ..., create: bool = ..., spec_set: Optional[Any] = ..., autospec: Optional[Any] = ..., new_callable: Optional[Any] = ..., **kwargs: Any) -> Any: ...
|
||||
def stopall(self) -> None: ...
|
||||
|
||||
patch = ... # type: _patcher
|
||||
|
||||
class MagicMixin:
|
||||
def __init__(self, *args: Any, **kw: Any) -> None: ...
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ class Request:
|
||||
origin_req_host = ... # type: str
|
||||
selector = ... # type: str
|
||||
data = ... # type: Optional[bytes]
|
||||
headers = ... # type: Dict[str, str]
|
||||
unverifiable = ... # type: bool
|
||||
method = ... # type: Optional[str]
|
||||
def __init__(self, url: str, data: Optional[bytes] = ...,
|
||||
|
||||
@@ -90,7 +90,7 @@ def main():
|
||||
print("Cannot import mypy. Did you install it?")
|
||||
sys.exit(1)
|
||||
|
||||
versions = [(3, 6), (3, 5), (3, 4), (3, 3), (2, 7)]
|
||||
versions = [(3, 7), (3, 6), (3, 5), (3, 4), (3, 3), (2, 7)]
|
||||
if args.python_version:
|
||||
versions = [v for v in versions
|
||||
if any(('%d.%d' % v).startswith(av) for av in args.python_version)]
|
||||
|
||||
@@ -7,87 +7,15 @@ stdlib/2/builtins.pyi
|
||||
stdlib/2/typing.pyi
|
||||
stdlib/3/builtins.pyi
|
||||
stdlib/3/typing.pyi
|
||||
stdlib/3/collections/__init__.pyi # parse only
|
||||
|
||||
# builtins not found
|
||||
stdlib/2/os/__init__.pyi # parse only
|
||||
|
||||
# pytype doesn't yet support aliases with implicit type parameters
|
||||
# (e.g., here, FutureT = Future[T])
|
||||
stdlib/3.4/asyncio/tasks.pyi
|
||||
|
||||
# builtins not found
|
||||
stdlib/2/os/__init__.pyi # parse only
|
||||
|
||||
# Below files can not be loaded by PyType without an error.
|
||||
# Notice that the current travis configuration loads these files with Python 2.7.
|
||||
# The files will be parsed but not loaded to verify them.
|
||||
stdlib/3.4/asyncio/__init__.pyi # parse only
|
||||
stdlib/3.4/asyncio/events.pyi # parse only
|
||||
stdlib/3.4/asyncio/futures.pyi # parse only
|
||||
stdlib/3.4/asyncio/locks.pyi # parse only
|
||||
stdlib/3.4/asyncio/protocols.pyi # parse only
|
||||
stdlib/3.4/asyncio/queues.pyi # parse only
|
||||
stdlib/3.4/asyncio/streams.pyi # parse only
|
||||
stdlib/3.4/asyncio/subprocess.pyi # parse only
|
||||
stdlib/3.5/zipapp.pyi # parse only
|
||||
stdlib/3/_compression.pyi # parse only
|
||||
stdlib/3/ast.pyi # parse only
|
||||
stdlib/3/collections/__init__.pyi # parse only.pyi
|
||||
stdlib/3/concurrent/futures/__init__.pyi # parse only
|
||||
stdlib/3/concurrent/futures/process.pyi # parse only
|
||||
stdlib/3/concurrent/futures/thread.pyi # parse only
|
||||
stdlib/3/curses/__init__.pyi # parse only
|
||||
stdlib/3/curses/panel.pyi # parse only
|
||||
stdlib/3/curses/textpad.pyi # parse only
|
||||
stdlib/3/email/__init__.pyi # parse only
|
||||
stdlib/3/email/contentmanager.pyi # parse only
|
||||
stdlib/3/email/encoders.pyi # parse only
|
||||
stdlib/3/email/feedparser.pyi # parse only
|
||||
stdlib/3/email/generator.pyi # parse only
|
||||
stdlib/3/email/header.pyi # parse only
|
||||
stdlib/3/email/headerregistry.pyi # parse only
|
||||
stdlib/3/email/iterators.pyi # parse only
|
||||
stdlib/3/email/message.pyi # parse only
|
||||
stdlib/3/email/mime/base.pyi # parse only
|
||||
stdlib/3/email/mime/message.pyi # parse only
|
||||
stdlib/3/email/mime/multipart.pyi # parse only
|
||||
stdlib/3/email/parser.pyi # parse only
|
||||
stdlib/3/email/policy.pyi # parse only
|
||||
stdlib/3/email/utils.pyi # parse only
|
||||
stdlib/3/gzip.pyi # parse only
|
||||
stdlib/3/html/parser.pyi # parse only
|
||||
stdlib/3/http/client.pyi # parse only
|
||||
stdlib/3/http/cookiejar.pyi # parse only
|
||||
stdlib/3/http/server.pyi # parse only
|
||||
stdlib/3/imp.pyi # parse only
|
||||
stdlib/3/importlib/__init__.pyi # parse only
|
||||
stdlib/3/importlib/abc.pyi # parse only
|
||||
stdlib/3/importlib/machinery.pyi # parse only
|
||||
stdlib/3/importlib/util.pyi # parse only
|
||||
stdlib/3/io.pyi # parse only
|
||||
stdlib/3/json/__init__.pyi # parse only
|
||||
stdlib/3/multiprocessing/__init__.pyi # parse only
|
||||
stdlib/3/multiprocessing/context.pyi # parse only
|
||||
stdlib/3/multiprocessing/managers.pyi # parse only
|
||||
stdlib/3/multiprocessing/pool.pyi # parse only
|
||||
stdlib/3/multiprocessing/process.pyi # parse only
|
||||
stdlib/3/multiprocessing/synchronize.pyi # parse only
|
||||
stdlib/3/os/__init__.pyi # parse only
|
||||
stdlib/3/pipes.pyi # parse only
|
||||
stdlib/3/smtplib.pyi # parse only
|
||||
stdlib/3/sqlite3/__init__.pyi # parse only
|
||||
stdlib/3/sre_parse.pyi # parse only
|
||||
stdlib/3/time.pyi # parse only
|
||||
stdlib/3/tkinter/__init__.pyi # parse only
|
||||
stdlib/3/tkinter/ttk.pyi # parse only
|
||||
stdlib/3/tokenize.pyi # parse only
|
||||
stdlib/3/types.pyi # parse only
|
||||
stdlib/3/urllib/error.pyi # parse only
|
||||
stdlib/3/urllib/request.pyi # parse only
|
||||
stdlib/3/collections/abc.pyi # parse only
|
||||
# aliases to class constants
|
||||
stdlib/3/signal.pyi # parse only
|
||||
stdlib/3/shutil.pyi # parse only
|
||||
stdlib/3/re.pyi # parse only
|
||||
stdlib/3/posix.pyi # parse only
|
||||
stdlib/3/platform.pyi # parse only
|
||||
stdlib/3/fcntl.pyi # parse only
|
||||
stdlib/3/configparser.pyi # parse only
|
||||
stdlib/3/compileall.pyi # parse only
|
||||
stdlib/3.4/pathlib.pyi # parse only
|
||||
|
||||
@@ -141,6 +141,7 @@ def can_run(path, exe, *args):
|
||||
except OSError:
|
||||
return False
|
||||
|
||||
|
||||
def pytype_test(args):
|
||||
dirs = get_project_dirs(args)
|
||||
pytype_exe = os.path.join(dirs.pytype, 'pytype')
|
||||
@@ -159,6 +160,11 @@ def pytype_test(args):
|
||||
print('Cannot run pytd. Did you install pytype?')
|
||||
return 0, 0
|
||||
|
||||
if not can_run('', args.python36_exe, '--version'):
|
||||
print('Cannot run python3.6 from %s. (point to a valid executable via '
|
||||
'--python36_exe)' % args.python36_exe)
|
||||
return 0, 0
|
||||
|
||||
wanted = re.compile(r'stdlib/.*\.pyi$')
|
||||
skip, parse_only = load_blacklist(dirs)
|
||||
skipped = PathMatcher(skip)
|
||||
@@ -181,6 +187,8 @@ def pytype_test(args):
|
||||
running_tests = collections.deque()
|
||||
max_code, runs, errors = 0, 0, 0
|
||||
files = pytype_run + pytd_run
|
||||
total_files = len(files)
|
||||
print("Testing files with pytype...")
|
||||
while 1:
|
||||
while files and len(running_tests) < args.num_parallel:
|
||||
f = files.pop()
|
||||
@@ -222,6 +230,9 @@ def pytype_test(args):
|
||||
bad.append((_get_relative(test_run.args[-1]),
|
||||
stderr.rstrip().rsplit('\n', 1)[-1]))
|
||||
|
||||
if runs % 25 == 0:
|
||||
print(" %3d/%d with %3d errors" % (runs, total_files, errors))
|
||||
|
||||
print('Ran pytype with %d pyis, got %d errors.' % (runs, errors))
|
||||
for f, err in bad:
|
||||
print('%s: %s' % (f, err))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from typing import Any
|
||||
from thrift.Thrift import TProcessor
|
||||
from thrift.Thrift import TProcessor # type: ignore
|
||||
|
||||
fastbinary = ... # type: Any
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ from typing import Any
|
||||
|
||||
import fb303.FacebookService
|
||||
from .ttypes import * # noqa: F403
|
||||
from thrift.Thrift import TProcessor
|
||||
from thrift.Thrift import TProcessor # type: ignore # We don't have thrift stubs in typeshed
|
||||
|
||||
class Iface(fb303.FacebookService.Iface):
|
||||
def Log(self, messages): ...
|
||||
|
||||
+1
-2
@@ -4,12 +4,11 @@ from __future__ import print_function
|
||||
|
||||
import types
|
||||
from typing import (
|
||||
Any, AnyStr, Callable, Dict, Iterable, Mapping, Optional,
|
||||
Any, AnyStr, Callable, Dict, Iterable, Mapping, NoReturn, Optional,
|
||||
Pattern, Tuple, Type, TypeVar, Union, overload, ValuesView, KeysView, ItemsView
|
||||
)
|
||||
import typing
|
||||
import unittest
|
||||
from mypy_extensions import NoReturn
|
||||
|
||||
# Exports
|
||||
from __builtin__ import unichr as unichr
|
||||
|
||||
+39
-28
@@ -1,12 +1,14 @@
|
||||
from datetime import datetime
|
||||
from typing import (
|
||||
Any, Iterable, Mapping, Optional, Sequence, Tuple, Type, Union,
|
||||
Any, Iterable, Mapping, MutableMapping, Optional, Sequence, Tuple, Type,
|
||||
Union,
|
||||
)
|
||||
|
||||
from wsgiref.types import WSGIEnvironment
|
||||
|
||||
from .datastructures import (
|
||||
CombinedMultiDict, EnvironHeaders, Headers, ImmutableMultiDict,
|
||||
MultiDict, TypeConversionDict,
|
||||
MultiDict, TypeConversionDict, HeaderSet,
|
||||
)
|
||||
|
||||
class BaseRequest:
|
||||
@@ -168,36 +170,45 @@ class ResponseStreamMixin:
|
||||
def stream(self): ...
|
||||
|
||||
class CommonRequestDescriptorsMixin:
|
||||
content_type = ... # type: Any
|
||||
def content_length(self): ...
|
||||
content_encoding = ... # type: Any
|
||||
content_md5 = ... # type: Any
|
||||
referrer = ... # type: Any
|
||||
date = ... # type: Any
|
||||
max_forwards = ... # type: Any
|
||||
@property
|
||||
def mimetype(self): ...
|
||||
def content_type(self) -> Optional[str]: ...
|
||||
@property
|
||||
def mimetype_params(self): ...
|
||||
def pragma(self): ...
|
||||
def content_length(self) -> Optional[int]: ...
|
||||
@property
|
||||
def content_encoding(self) -> Optional[str]: ...
|
||||
@property
|
||||
def content_md5(self) -> Optional[str]: ...
|
||||
@property
|
||||
def referrer(self) -> Optional[str]: ...
|
||||
@property
|
||||
def date(self) -> Optional[datetime]: ...
|
||||
@property
|
||||
def max_forwards(self) -> Optional[int]: ...
|
||||
@property
|
||||
def mimetype(self) -> str: ...
|
||||
@property
|
||||
def mimetype_params(self) -> Mapping[str, str]: ...
|
||||
@property
|
||||
def pragma(self) -> HeaderSet: ...
|
||||
|
||||
class CommonResponseDescriptorsMixin:
|
||||
mimetype = ... # type: Any
|
||||
mimetype_params = ... # type: Any
|
||||
location = ... # type: Any
|
||||
age = ... # type: Any
|
||||
content_type = ... # type: Any
|
||||
content_length = ... # type: Any
|
||||
content_location = ... # type: Any
|
||||
content_encoding = ... # type: Any
|
||||
content_md5 = ... # type: Any
|
||||
date = ... # type: Any
|
||||
expires = ... # type: Any
|
||||
last_modified = ... # type: Any
|
||||
retry_after = ... # type: Any
|
||||
vary = ... # type: Any
|
||||
content_language = ... # type: Any
|
||||
allow = ... # type: Any
|
||||
mimetype: Optional[str] = ...
|
||||
@property
|
||||
def mimetype_params(self) -> MutableMapping[str, str]: ...
|
||||
location: Optional[str] = ...
|
||||
age: Any = ... # get: Optional[datetime.timedelta]
|
||||
content_type: Optional[str] = ...
|
||||
content_length: Optional[int] = ...
|
||||
content_location: Optional[str] = ...
|
||||
content_encoding: Optional[str] = ...
|
||||
content_md5: Optional[str] = ...
|
||||
date: Any = ... # get: Optional[datetime.datetime]
|
||||
expires: Any = ... # get: Optional[datetime.datetime]
|
||||
last_modified: Any = ... # get: Optional[datetime.datetime]
|
||||
retry_after: Any = ... # get: Optional[datetime.datetime]
|
||||
vary: Optional[str] = ...
|
||||
content_language: Optional[str] = ...
|
||||
allow: Optional[str] = ...
|
||||
|
||||
class WWWAuthenticateMixin:
|
||||
@property
|
||||
|
||||
@@ -17,6 +17,7 @@ from typing import (
|
||||
|
||||
from click.formatting import HelpFormatter
|
||||
from click.parser import OptionParser
|
||||
from click.types import ParamType, _ConvertibleType
|
||||
|
||||
|
||||
def invoke_param_callback(
|
||||
@@ -317,7 +318,7 @@ class Parameter:
|
||||
name: str
|
||||
opts: List[str]
|
||||
secondary_opts: List[str]
|
||||
type: 'ParamType'
|
||||
type: ParamType
|
||||
required: bool
|
||||
callback: Optional[Callable[[Context, 'Parameter', str], Any]]
|
||||
nargs: int
|
||||
@@ -333,7 +334,7 @@ class Parameter:
|
||||
def __init__(
|
||||
self,
|
||||
param_decls: Optional[List[str]] = ...,
|
||||
type: Optional[Union[type, 'ParamType']] = ...,
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
required: bool = ...,
|
||||
default: Optional[Any] = ...,
|
||||
callback: Optional[Callable[[Context, 'Parameter', str], Any]] = ...,
|
||||
@@ -412,7 +413,7 @@ class Option(Parameter):
|
||||
multiple: bool = ...,
|
||||
count: bool = ...,
|
||||
allow_from_autoenv: bool = ...,
|
||||
type: Optional[Union[type, 'ParamType']] = ...,
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
help: Optional[str] = ...,
|
||||
**attrs
|
||||
) -> None:
|
||||
@@ -430,6 +431,3 @@ class Argument(Parameter):
|
||||
**attrs
|
||||
) -> None:
|
||||
...
|
||||
|
||||
# cyclic dependency
|
||||
from click.types import ParamType # noqa: E402
|
||||
|
||||
@@ -2,7 +2,7 @@ from distutils.version import Version
|
||||
from typing import Any, Callable, Dict, List, Optional, Type, TypeVar, Union, Text
|
||||
|
||||
from click.core import Command, Group, Argument, Option, Parameter, Context
|
||||
from click.types import ParamType
|
||||
from click.types import _ConvertibleType
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_Decorator = Callable[[_T], _T]
|
||||
@@ -74,7 +74,7 @@ def argument(
|
||||
# Argument
|
||||
required: Optional[bool] = ...,
|
||||
# Parameter
|
||||
type: Optional[Union[type, ParamType]] = ...,
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
default: Optional[Any] = ...,
|
||||
callback: Optional[_Callback] = ...,
|
||||
nargs: Optional[int] = ...,
|
||||
@@ -99,7 +99,7 @@ def option(
|
||||
multiple: bool = ...,
|
||||
count: bool = ...,
|
||||
allow_from_autoenv: bool = ...,
|
||||
type: Optional[Union[type, ParamType]] = ...,
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
help: Optional[str] = ...,
|
||||
# Parameter
|
||||
default: Optional[Any] = ...,
|
||||
@@ -109,7 +109,9 @@ def option(
|
||||
metavar: Optional[str] = ...,
|
||||
expose_value: bool = ...,
|
||||
is_eager: bool = ...,
|
||||
envvar: Optional[Union[str, List[str]]] = ...
|
||||
envvar: Optional[Union[str, List[str]]] = ...,
|
||||
# User-defined
|
||||
**kwargs: Any,
|
||||
) -> _Decorator:
|
||||
...
|
||||
|
||||
@@ -127,7 +129,7 @@ def confirmation_option(
|
||||
multiple: bool = ...,
|
||||
count: bool = ...,
|
||||
allow_from_autoenv: bool = ...,
|
||||
type: Optional[Union[type, ParamType]] = ...,
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
help: str = ...,
|
||||
# Parameter
|
||||
default: Optional[Any] = ...,
|
||||
@@ -154,7 +156,7 @@ def password_option(
|
||||
multiple: bool = ...,
|
||||
count: bool = ...,
|
||||
allow_from_autoenv: bool = ...,
|
||||
type: Optional[Union[type, ParamType]] = ...,
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
help: Optional[str] = ...,
|
||||
# Parameter
|
||||
default: Optional[Any] = ...,
|
||||
@@ -184,7 +186,7 @@ def version_option(
|
||||
multiple: bool = ...,
|
||||
count: bool = ...,
|
||||
allow_from_autoenv: bool = ...,
|
||||
type: Optional[Union[type, ParamType]] = ...,
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
help: str = ...,
|
||||
# Parameter
|
||||
default: Optional[Any] = ...,
|
||||
@@ -211,7 +213,7 @@ def help_option(
|
||||
multiple: bool = ...,
|
||||
count: bool = ...,
|
||||
allow_from_autoenv: bool = ...,
|
||||
type: Optional[Union[type, ParamType]] = ...,
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
help: str = ...,
|
||||
# Parameter
|
||||
default: Optional[Any] = ...,
|
||||
|
||||
@@ -11,6 +11,8 @@ from typing import (
|
||||
TypeVar,
|
||||
)
|
||||
|
||||
from click.types import _ConvertibleType
|
||||
|
||||
|
||||
def hidden_prompt_func(prompt: str) -> str:
|
||||
...
|
||||
@@ -30,7 +32,7 @@ def prompt(
|
||||
default: Optional[str] = ...,
|
||||
hide_input: bool = ...,
|
||||
confirmation_prompt: bool = ...,
|
||||
type: Optional[Any] = ...,
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
value_proc: Optional[Callable[[Optional[str]], Any]] = ...,
|
||||
prompt_suffix: str = ...,
|
||||
show_default: bool = ...,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, IO, Iterable, List, Optional, TypeVar, Union
|
||||
from typing import Any, Callable, IO, Iterable, List, Optional, TypeVar, Union, Tuple as _PyTuple
|
||||
import uuid
|
||||
|
||||
from click.core import Context, Parameter
|
||||
@@ -270,7 +270,9 @@ class UUIDParameterType(ParamType):
|
||||
...
|
||||
|
||||
|
||||
def convert_type(ty: Any, default: Optional[Any] = ...) -> ParamType:
|
||||
_ConvertibleType = Union[type, ParamType, _PyTuple[type, ...], Callable[[str], Any], Callable[[Optional[str]], Any]]
|
||||
|
||||
def convert_type(ty: Optional[_ConvertibleType], default: Optional[Any] = ...) -> ParamType:
|
||||
...
|
||||
|
||||
# parameter type shortcuts
|
||||
|
||||
@@ -14,4 +14,4 @@ def KwArg(type: _T = ...) -> _T: ...
|
||||
# Return type that indicates a function does not return.
|
||||
# This type is equivalent to the None type, but the no-op Union is necessary to
|
||||
# distinguish the None type from the None value.
|
||||
NoReturn = Union[None]
|
||||
NoReturn = Union[None] # Deprecated: Use typing.NoReturn instead.
|
||||
|
||||
@@ -100,10 +100,10 @@ class Connection:
|
||||
def __enter__(self): ...
|
||||
def __exit__(self, exc, value, traceback): ...
|
||||
def query(self, sql): ...
|
||||
def next_result(self): ...
|
||||
def next_result(self, unbuffered: bool = ...): ...
|
||||
def affected_rows(self): ...
|
||||
def kill(self, thread_id): ...
|
||||
def ping(self, reconnect=True): ...
|
||||
def ping(self, reconnect: bool = ...): ...
|
||||
def set_charset(self, charset): ...
|
||||
def read_packet(self, packet_type=...): ...
|
||||
def insert_id(self): ...
|
||||
@@ -112,6 +112,7 @@ class Connection:
|
||||
def get_host_info(self): ...
|
||||
def get_proto_info(self): ...
|
||||
def get_server_info(self): ...
|
||||
def show_warnings(self): ...
|
||||
Warning = ... # type: Any
|
||||
Error = ... # type: Any
|
||||
InterfaceError = ... # type: Any
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Union, Tuple, Any, Dict, Optional, Text
|
||||
from typing import Union, Tuple, Any, Dict, Optional, Text, Iterator, List
|
||||
from .connections import Connection
|
||||
|
||||
Gen = Union[Tuple[Any, ...], Dict[str, Any]]
|
||||
@@ -22,12 +22,25 @@ class Cursor:
|
||||
def executemany(self, query: str, args) -> int: ...
|
||||
def callproc(self, procname, args=...): ...
|
||||
def fetchone(self) -> Optional[Gen]: ...
|
||||
def fetchmany(self, size: Optional[int] = ...) -> Optional[Gen]: ...
|
||||
def fetchmany(self, size: Optional[int] = ...) -> Union[Optional[Gen], List[Gen]]: ...
|
||||
def fetchall(self) -> Optional[Tuple[Gen, ...]]: ...
|
||||
def scroll(self, value, mode=''): ...
|
||||
def scroll(self, value: int, mode: str = ...): ...
|
||||
def __iter__(self): ...
|
||||
|
||||
class DictCursor(Cursor):
|
||||
def fetchone(self) -> Optional[Dict[str, Any]]: ...
|
||||
def fetchmany(self, size=None) -> Optional[Tuple[Dict[str, Any], ...]]: ...
|
||||
def fetchmany(self, size: Optional[int] = ...) -> Optional[Tuple[Dict[str, Any], ...]]: ...
|
||||
def fetchall(self) -> Optional[Tuple[Dict[str, Any], ...]]: ...
|
||||
|
||||
class DictCursorMixin:
|
||||
dict_type = ... # type: Any
|
||||
|
||||
class SSCursor(Cursor):
|
||||
# fetchall return type is incompatible with the supertype.
|
||||
def fetchall(self) -> List[Gen]: ... # type: ignore
|
||||
def fetchall_unbuffered(self) -> Iterator[Tuple[Gen, ...]]: ...
|
||||
def __iter__(self) -> Iterator[Tuple[Gen, ...]]: ...
|
||||
def fetchmany(self, size: Optional[int] = ...) -> List[Gen]: ...
|
||||
def scroll(self, value: int, mode: str = ...) -> None: ...
|
||||
|
||||
class SSDictCursor(DictCursorMixin, SSCursor): ...
|
||||
|
||||
@@ -6,7 +6,6 @@ _T = TypeVar('_T')
|
||||
_KT = TypeVar('_KT')
|
||||
_VT = TypeVar('_VT')
|
||||
_MT = TypeVar('_MT', bound='MapAttribute')
|
||||
Number = Union[int, float]
|
||||
|
||||
class Attribute(Generic[_T]):
|
||||
attr_name: Optional[Text]
|
||||
@@ -20,6 +19,19 @@ class Attribute(Generic[_T]):
|
||||
def serialize(self, value: Any) -> Any: ...
|
||||
def deserialize(self, value: Any) -> Any: ...
|
||||
def get_value(self, value: Any) -> Any: ...
|
||||
def between(self, lower: Any, upper: Any) -> Any: ...
|
||||
def is_in(self, *values: Any) -> Any: ...
|
||||
def exists(self) -> Any: ...
|
||||
def does_not_exist(self) -> Any: ...
|
||||
def is_type(self) -> Any: ...
|
||||
def startswith(self, prefix: str) -> Any: ...
|
||||
def contains(self, item: Any) -> Any: ...
|
||||
def append(self, other: Any) -> Any: ...
|
||||
def prepend(self, other: Any) -> Any: ...
|
||||
def set(self, value: Any) -> Any: ...
|
||||
def remove(self) -> Any: ...
|
||||
def add(self, *values: Any) -> Any: ...
|
||||
def delete(self, *values: Any) -> Any: ...
|
||||
|
||||
class SetMixin(object):
|
||||
def serialize(self, value): ...
|
||||
@@ -48,11 +60,11 @@ class LegacyBooleanAttribute(Attribute[bool]):
|
||||
class BooleanAttribute(Attribute[bool]):
|
||||
def __get__(self, instance: Any, owner: Any) -> bool: ...
|
||||
|
||||
class NumberSetAttribute(SetMixin, Attribute[Set[Number]]):
|
||||
def __get__(self, instance: Any, owner: Any) -> Set[Number]: ...
|
||||
class NumberSetAttribute(SetMixin, Attribute[Set[float]]):
|
||||
def __get__(self, instance: Any, owner: Any) -> Set[float]: ...
|
||||
|
||||
class NumberAttribute(Attribute[Number]):
|
||||
def __get__(self, instance: Any, owner: Any) -> Number: ...
|
||||
class NumberAttribute(Attribute[float]):
|
||||
def __get__(self, instance: Any, owner: Any) -> float: ...
|
||||
|
||||
class UTCDateTimeAttribute(Attribute[datetime]):
|
||||
def __get__(self, instance: Any, owner: Any) -> datetime: ...
|
||||
|
||||
@@ -29,9 +29,9 @@ class Model(metaclass=MetaModel):
|
||||
@classmethod
|
||||
def batch_write(cls: Type[_T], auto_commit: bool = ...) -> BatchWrite[_T]: ...
|
||||
def delete(self, conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ...
|
||||
def update(self, attributes: Dict[Text, Dict[Text, Any]], conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ...
|
||||
def update(self, attributes: Optional[Dict[Text, Dict[Text, Any]]] = ..., actions: Optional[List[Any]] = ..., condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Any: ...
|
||||
def update_item(self, attribute: Text, value: Optional[Any] = ..., action: Optional[Text] = ..., conditional_operator: Optional[Text] = ..., **expected_values): ...
|
||||
def save(self, conditional_operator: Optional[Text] = ..., **expected_values) -> Dict[str, Any]: ...
|
||||
def save(self, condition: Optional[Any] = ..., conditional_operator: Optional[Text] = ..., **expected_values) -> Dict[str, Any]: ...
|
||||
def refresh(self, consistent_read: bool = ...): ...
|
||||
@classmethod
|
||||
def get(cls: Type[_T], hash_key: KeyType, range_key: Optional[KeyType] = ..., consistent_read: bool = ...) -> _T: ...
|
||||
|
||||
@@ -13,6 +13,7 @@ else:
|
||||
_ParamsMappingValueType = Union[_Text, bytes, int, float, Iterable[Union[_Text, bytes, int, float]]]
|
||||
_Data = Union[
|
||||
None,
|
||||
_Text,
|
||||
bytes,
|
||||
MutableMapping[str, str],
|
||||
MutableMapping[str, Text],
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
from typing import Any, Iterator, MutableMapping, Text, Tuple, Union
|
||||
from typing import Any, Iterator, MutableMapping, Tuple, TypeVar, Generic
|
||||
|
||||
class CaseInsensitiveDict(MutableMapping[str, Union[Text, bytes]]):
|
||||
def lower_items(self) -> Iterator[Tuple[str, Union[Text, bytes]]]: ...
|
||||
def __setitem__(self, key: str, value: Union[Text, bytes]) -> None: ...
|
||||
def __getitem__(self, key: str) -> Union[Text, bytes]: ...
|
||||
_VT = TypeVar('_VT')
|
||||
|
||||
class CaseInsensitiveDict(MutableMapping[str, _VT], Generic[_VT]):
|
||||
def lower_items(self) -> Iterator[Tuple[str, _VT]]: ...
|
||||
def __setitem__(self, key: str, value: _VT) -> None: ...
|
||||
def __getitem__(self, key: str) -> _VT: ...
|
||||
def __delitem__(self, key: str) -> None: ...
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
@@ -40,6 +40,7 @@ def address_in_network(ip, net): ...
|
||||
def dotted_netmask(mask): ...
|
||||
def is_ipv4_address(string_ip): ...
|
||||
def is_valid_cidr(string_network): ...
|
||||
def set_environ(env_name, value): ...
|
||||
def should_bypass_proxies(url): ...
|
||||
def get_environ_proxies(url): ...
|
||||
def default_user_agent(name=...): ...
|
||||
|
||||
+1
-1
@@ -11,6 +11,7 @@ from typing import (
|
||||
Iterable,
|
||||
KeysView,
|
||||
Mapping,
|
||||
NoReturn,
|
||||
Optional,
|
||||
Pattern,
|
||||
Tuple,
|
||||
@@ -23,7 +24,6 @@ from typing import (
|
||||
import types
|
||||
import typing
|
||||
import unittest
|
||||
from mypy_extensions import NoReturn
|
||||
|
||||
# Exports
|
||||
from io import StringIO as StringIO, BytesIO as BytesIO
|
||||
|
||||
+39
-28
@@ -1,12 +1,14 @@
|
||||
from datetime import datetime
|
||||
from typing import (
|
||||
Any, Iterable, Mapping, Optional, Sequence, Tuple, Type, Union,
|
||||
Any, Iterable, Mapping, MutableMapping, Optional, Sequence, Tuple, Type,
|
||||
Union,
|
||||
)
|
||||
|
||||
from wsgiref.types import WSGIEnvironment
|
||||
|
||||
from .datastructures import (
|
||||
CombinedMultiDict, EnvironHeaders, Headers, ImmutableMultiDict,
|
||||
MultiDict, TypeConversionDict,
|
||||
MultiDict, TypeConversionDict, HeaderSet,
|
||||
)
|
||||
|
||||
class BaseRequest:
|
||||
@@ -167,36 +169,45 @@ class ResponseStreamMixin:
|
||||
def stream(self): ...
|
||||
|
||||
class CommonRequestDescriptorsMixin:
|
||||
content_type = ... # type: Any
|
||||
def content_length(self): ...
|
||||
content_encoding = ... # type: Any
|
||||
content_md5 = ... # type: Any
|
||||
referrer = ... # type: Any
|
||||
date = ... # type: Any
|
||||
max_forwards = ... # type: Any
|
||||
@property
|
||||
def mimetype(self): ...
|
||||
def content_type(self) -> Optional[str]: ...
|
||||
@property
|
||||
def mimetype_params(self): ...
|
||||
def pragma(self): ...
|
||||
def content_length(self) -> Optional[int]: ...
|
||||
@property
|
||||
def content_encoding(self) -> Optional[str]: ...
|
||||
@property
|
||||
def content_md5(self) -> Optional[str]: ...
|
||||
@property
|
||||
def referrer(self) -> Optional[str]: ...
|
||||
@property
|
||||
def date(self) -> Optional[datetime]: ...
|
||||
@property
|
||||
def max_forwards(self) -> Optional[int]: ...
|
||||
@property
|
||||
def mimetype(self) -> str: ...
|
||||
@property
|
||||
def mimetype_params(self) -> Mapping[str, str]: ...
|
||||
@property
|
||||
def pragma(self) -> HeaderSet: ...
|
||||
|
||||
class CommonResponseDescriptorsMixin:
|
||||
mimetype = ... # type: Any
|
||||
mimetype_params = ... # type: Any
|
||||
location = ... # type: Any
|
||||
age = ... # type: Any
|
||||
content_type = ... # type: Any
|
||||
content_length = ... # type: Any
|
||||
content_location = ... # type: Any
|
||||
content_encoding = ... # type: Any
|
||||
content_md5 = ... # type: Any
|
||||
date = ... # type: Any
|
||||
expires = ... # type: Any
|
||||
last_modified = ... # type: Any
|
||||
retry_after = ... # type: Any
|
||||
vary = ... # type: Any
|
||||
content_language = ... # type: Any
|
||||
allow = ... # type: Any
|
||||
mimetype: Optional[str] = ...
|
||||
@property
|
||||
def mimetype_params(self) -> MutableMapping[str, str]: ...
|
||||
location: Optional[str] = ...
|
||||
age: Any = ... # get: Optional[datetime.timedelta]
|
||||
content_type: Optional[str] = ...
|
||||
content_length: Optional[int] = ...
|
||||
content_location: Optional[str] = ...
|
||||
content_encoding: Optional[str] = ...
|
||||
content_md5: Optional[str] = ...
|
||||
date: Any = ... # get: Optional[datetime.datetime]
|
||||
expires: Any = ... # get: Optional[datetime.datetime]
|
||||
last_modified: Any = ... # get: Optional[datetime.datetime]
|
||||
retry_after: Any = ... # get: Optional[datetime.datetime]
|
||||
vary: Optional[str] = ...
|
||||
content_language: Optional[str] = ...
|
||||
allow: Optional[str] = ...
|
||||
|
||||
class WWWAuthenticateMixin:
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user