Sync with typeshed @ 06074e1e02249a366b314acb3938022f82f116a0

This commit is contained in:
Andrey Vlasovskikh
2017-02-19 19:02:24 +03:00
parent 21b3f46f1a
commit ab82d80866
90 changed files with 515 additions and 1159 deletions
+1
View File
@@ -60,3 +60,4 @@ analyze.py
*~
.*.sw?
.vscode/
.idea/
@@ -30,13 +30,13 @@ class classmethod: pass # Special, only valid as a decorator.
class object:
__doc__ = ... # type: Optional[str]
__class__ = ... # type: type
__dict__ = ... # type: Dict[str, Any]
__slots__ = ... # type: Optional[Union[str, unicode, Iterable[Union[str, unicode]]]]
__module__ = ... # type: Any
def __init__(self) -> None: ...
def __new__(cls) -> Any: ...
def __setattr__(self, name: str, value: Any) -> None: ...
def __eq__(self, o: object) -> bool: ...
def __ne__(self, o: object) -> bool: ...
def __str__(self) -> str: ...
def __repr__(self) -> str: ...
def __hash__(self) -> int: ...
@@ -44,13 +44,12 @@ class object:
def __getattribute__(self, name: str) -> Any: ...
def __delattr__(self, name: str) -> None: ...
def __sizeof__(self) -> int: ...
def __reduce__(self) -> Union[str, unicode, tuple]: ...
def __reduce_ex__(self, protocol: int) -> Union[str, unicode, tuple]: ...
class type(object):
__bases__ = ... # type: Tuple[type, ...]
__name__ = ... # type: str
__module__ = ... # type: str
__dict__ = ... # type: Dict[unicode, Any]
@overload
def __init__(self, o: object) -> None: ...
@@ -471,9 +470,9 @@ class slice(object):
step = ... # type: Optional[int]
stop = ... # type: Optional[int]
@overload
def __init__(self, stop: int) -> None: ...
def __init__(self, stop: int = None) -> None: ...
@overload
def __init__(self, start: int, stop: int, step: int = None) -> None: ...
def __init__(self, start: int = None, stop: int = None, step: int = None) -> None: ...
class tuple(Sequence[_T_co], Generic[_T_co]):
def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...
@@ -488,14 +487,17 @@ class tuple(Sequence[_T_co], Generic[_T_co]):
def __le__(self, x: Tuple[_T_co, ...]) -> bool: ...
def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ...
def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ...
def __eq__(self, x: Tuple[_T_co, ...]) -> bool: ...
def __ne__(self, x: Tuple[_T_co, ...]) -> bool: ...
def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ...
def __mul__(self, n: int) -> Tuple[_T_co, ...]: ...
def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ...
def count(self, x: Any) -> int: ...
def index(self, x: Any) -> int: ...
class function:
# TODO name of the class (corresponds to Python 'function' class)
__name__ = ... # type: str
__module__ = ... # type: str
class list(MutableSequence[_T], Generic[_T]):
@overload
def __init__(self) -> None: ...
@@ -656,11 +658,12 @@ class xrange(Sized, Iterable[int], Reversible[int]):
def __getitem__(self, i: int) -> int: ...
def __reversed__(self) -> Iterator[int]: ...
class module(object):
class module:
__name__ = ... # type: str
__file__ = ... # type: str
__dict__ = ... # type: Dict[unicode, Any]
class property(object):
class property:
def __init__(self, fget: Callable[[Any], Any] = None,
fset: Callable[[Any, Any], None] = None,
fdel: Callable[[Any], None] = None, doc: str = None) -> None: ...
@@ -70,9 +70,10 @@ class Counter(Dict[_T, int], Generic[_T]):
@overload
def update(self, m: Union[Iterable[_T], Iterable[Tuple[_T, int]]], **kwargs: _VT) -> None: ...
class OrderedDict(Dict[_KT, _VT], Generic[_KT, _VT]):
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 __reversed__(self) -> Iterator[_KT]: ...
class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
default_factory = ... # type: Callable[[], _VT]
+4 -4
View File
@@ -2,7 +2,7 @@
#
# NOTE: Based on a dynamically typed stub automatically generated by stubgen.
from typing import Any, Dict, Iterable, List, Sequence, Union
from typing import Any, Dict, Iterable, List, Sequence, Type, Union
# Public interface of _csv.reader's return type
class _Reader(Iterable[List[str]]):
@@ -11,7 +11,7 @@ class _Reader(Iterable[List[str]]):
def next(self) -> List[str]: ...
_Row = Sequence[Union[str, int]]
_Row = Sequence[Any] # May contain anything: csv calls str() on the elements that are not None
# Public interface of _csv.writer's return type
class _Writer:
@@ -27,7 +27,7 @@ QUOTE_NONNUMERIC = ... # type: int
class Error(Exception): ...
_Dialect = Union[str, Dialect]
_Dialect = Union[str, Dialect, Type[Dialect]]
def writer(csvfile: Any, dialect: _Dialect = ..., **fmtparams) -> _Writer: ...
def reader(csvfile: Iterable[str], dialect: _Dialect = ..., **fmtparams) -> _Reader: ...
@@ -66,7 +66,7 @@ class DictReader(Iterable):
def __init__(self, f: Iterable[str], fieldnames: Sequence[Any] = ..., restkey=...,
restval=..., dialect: _Dialect = ..., *args, **kwds) -> None: ...
def __iter__(self): ...
def __next__(self): ...
def next(self): ...
_DictRow = Dict[Any, Union[str, int]]
+10 -8
View File
@@ -1,24 +1,26 @@
# Stubs for hashlib (Python 2)
from typing import Tuple
from typing import Tuple, Union
_DataType = Union[str, bytearray, buffer, memoryview]
class _hash(object):
# This is not actually in the module namespace.
digest_size = 0
block_size = 0
def update(self, arg: str) -> None: ...
def update(self, arg: _DataType) -> None: ...
def digest(self) -> str: ...
def hexdigest(self) -> str: ...
def copy(self) -> _hash: ...
def new(name: str, data: str = ...) -> _hash: ...
def md5(s: str = ...) -> _hash: ...
def sha1(s: str = ...) -> _hash: ...
def sha224(s: str = ...) -> _hash: ...
def sha256(s: str = ...) -> _hash: ...
def sha384(s: str = ...) -> _hash: ...
def sha512(s: str = ...) -> _hash: ...
def md5(s: _DataType = ...) -> _hash: ...
def sha1(s: _DataType = ...) -> _hash: ...
def sha224(s: _DataType = ...) -> _hash: ...
def sha256(s: _DataType = ...) -> _hash: ...
def sha384(s: _DataType = ...) -> _hash: ...
def sha512(s: _DataType = ...) -> _hash: ...
algorithms = ... # type: Tuple[str, ...]
algorithms_guaranteed = ... # type: Tuple[str, ...]
+25 -17
View File
@@ -1,6 +1,5 @@
# TODO incomplete
from types import TracebackType, FrameType, ModuleType
from typing import Any, Callable, List, Optional, Tuple, Union, NamedTuple
from typing import Any, Dict, Callable, List, Optional, Tuple, Union, NamedTuple, Type
# Types and members
ModuleInfo = NamedTuple('ModuleInfo', [('name', str),
@@ -47,22 +46,31 @@ def getsource(object: object) -> str: ...
def cleandoc(doc: str) -> str: ...
# Classes and functions
# TODO make the return type more specific
def getclasstree(classes: List[type], unique: bool = ...) -> Any: ...
def getclasstree(classes: List[type], unique: bool = ...) -> List[
Union[Tuple[type, Tuple[type, ...]], list]]: ...
ArgSpec = NamedTuple('ArgSpec', [('args', List[str]),
('varargs', str),
('keywords', str),
('varargs', Optional[str]),
('keywords', Optional[str]),
('defaults', tuple),
])
ArgInfo = NamedTuple('ArgInfo', [('args', List[str]),
('varargs', Optional[str]),
('keywords', Optional[str]),
('locals', Dict[str, Any]),
])
def getargspec(func: object) -> ArgSpec: ...
# TODO make the return type more specific
def getargvalues(frame: FrameType) -> Any: ...
# TODO formatargspec
# TODO formatargvalues
def getargvalues(frame: FrameType) -> ArgInfo: ...
def formatargspec(args, varargs=..., varkw=..., defaults=...,
formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=...,
join=...) -> str: ...
def formatargvalues(args, varargs=..., varkw=..., defaults=...,
formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=...,
join=...) -> str: ...
def getmro(cls: type) -> Tuple[type, ...]: ...
# TODO getcallargs
def getcallargs(func, *args, **kwds) -> Dict[str, Any]: ...
# The interpreter stack
@@ -77,12 +85,12 @@ Traceback = NamedTuple(
]
)
_FrameRecord = Tuple[FrameType, str, int, str, List[str], int]
_FrameInfo = Tuple[FrameType, str, int, str, List[str], int]
def getouterframes(frame: FrameType, context: int = ...) -> List[FrameType]: ...
def getouterframes(frame: FrameType, context: int = ...) -> List[_FrameInfo]: ...
def getframeinfo(frame: Union[FrameType, TracebackType], context: int = ...) -> Traceback: ...
def getinnerframes(traceback: TracebackType, context: int = ...) -> List[FrameType]: ...
def getinnerframes(traceback: TracebackType, context: int = ...) -> List[_FrameInfo]: ...
def currentframe() -> FrameType: ...
def stack(context: int = ...) -> List[_FrameRecord]: ...
def trace(context: int = ...) -> List[_FrameRecord]: ...
def currentframe(depth: int = ...) -> FrameType: ...
def stack(context: int = ...) -> List[_FrameInfo]: ...
def trace(context: int = ...) -> List[_FrameInfo]: ...
+1 -1
View File
@@ -1,4 +1,4 @@
from typing import List, Mapping, Tuple, Union, Sequence, IO, Optional, TypeVar
from typing import Dict, List, Mapping, Tuple, Union, Sequence, IO, Optional, TypeVar
error = OSError
+31
View File
@@ -0,0 +1,31 @@
class Repr:
maxarray = ... # type: int
maxdeque = ... # type: int
maxdict = ... # type: int
maxfrozenset = ... # type: int
maxlevel = ... # type: int
maxlist = ... # type: int
maxlong = ... # type: int
maxother = ... # type: int
maxset = ... # type: int
maxstring = ... # type: int
maxtuple = ... # type: int
def __init__(self) -> None: ...
def _repr_iterable(self, x, level: complex, left, right, maxiter, trail=...) -> str: ...
def repr(self, x) -> str: ...
def repr1(self, x, level: complex) -> str: ...
def repr_array(self, x, level: complex) -> str: ...
def repr_deque(self, x, level: complex) -> str: ...
def repr_dict(self, x, level: complex) -> str: ...
def repr_frozenset(self, x, level: complex) -> str: ...
def repr_instance(self, x, level: complex) -> str: ...
def repr_list(self, x, level: complex) -> str: ...
def repr_long(self, x, level: complex) -> str: ...
def repr_set(self, x, level: complex) -> str: ...
def repr_str(self, x, level: complex) -> str: ...
def repr_tuple(self, x, level: complex) -> str: ...
def _possibly_sorted(x) -> list: ...
aRepr = ... # type: Repr
def repr(x) -> str: ...
+6 -3
View File
@@ -319,7 +319,10 @@ class socket:
def send(self, data: str, flags: int = ...) -> int: ...
def sendall(self, data: str, flags: int = ...) -> None:
... # return type: None on success
def sendto(self, data: str, address: Union[tuple, str], flags: int = ...) -> int: ...
@overload
def sendto(self, data: str, address: Union[tuple, str]) -> int: ...
@overload
def sendto(self, data: str, flags: int, address: Union[tuple, str]) -> int: ...
def setblocking(self, flag: bool) -> None: ...
def settimeout(self, value: Union[float, None]) -> None: ...
def setsockopt(self, level: int, optname: int, value: Union[int, bytes]) -> None: ...
@@ -358,5 +361,5 @@ def inet_aton(ip_string: str) -> str: ... # ret val 4 bytes in length
def inet_ntoa(packed_ip: str) -> str: ...
def inet_pton(address_family: int, ip_string: str) -> str: ...
def inet_ntop(address_family: int, packed_ip: str) -> str: ...
def getdefaulttimeout() -> Union[float, None]: ...
def setdefaulttimeout(timeout: float) -> None: ...
def getdefaulttimeout() -> Optional[float]: ...
def setdefaulttimeout(timeout: Optional[float]) -> None: ...
+5 -1
View File
@@ -148,6 +148,10 @@ class SSLSocket(socket.socket):
def selected_npn_protocol(self) -> Optional[str]: ...
def unwrap(self) -> socket.socket: ...
def version(self) -> Optional[str]: ...
def read(self, len: int = ...,
buffer: Optional[bytearray] = ...) -> str: ...
def write(self, buf: str) -> int: ...
def pending(self) -> int: ...
class SSLContext:
@@ -178,7 +182,7 @@ class SSLContext:
def wrap_socket(self, sock: socket.socket, server_side: bool = ...,
do_handshake_on_connect: bool = ...,
suppress_ragged_eofs: bool = ...,
server_hostname: Optional[str] = ...) -> 'SSLContext': ...
server_hostname: Optional[str] = ...) -> SSLSocket: ...
def session_stats(self) -> Dict[str, int]: ...
+2 -2
View File
@@ -20,7 +20,7 @@ class struct_time(NamedTuple('_struct_time',
_TIME_TUPLE = Tuple[int, int, int, int, int, int, int, int, int]
def asctime(t: struct_time = ...) -> str:
def asctime(t: Union[struct_time, _TIME_TUPLE] = ...) -> str:
raise ValueError()
def clock() -> float: ...
@@ -38,7 +38,7 @@ def mktime(t: struct_time) -> float:
def sleep(secs: float) -> None: ...
def strftime(format: str, t: struct_time = ...) -> str:
def strftime(format: str, t: Union[struct_time, _TIME_TUPLE] = ...) -> str:
raise MemoryError()
raise ValueError()
+2 -1
View File
@@ -28,7 +28,7 @@ DictType = DictionaryType = dict
class _Cell:
cell_contents = ... # type: Any
class FunctionType(object):
class FunctionType:
func_closure = ... # type: Optional[Tuple[_Cell, ...]]
func_code = ... # type: CodeType
func_defaults = ... # type: Optional[Tuple[Any, ...]]
@@ -39,6 +39,7 @@ class FunctionType(object):
__closure__ = func_closure
__code__ = func_code
__defaults__ = func_defaults
__dict__ = func_dict
__globals__ = func_globals
__name__ = func_name
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
+10 -13
View File
@@ -1,7 +1,6 @@
# Stubs for typing (Python 2.7)
from abc import abstractmethod, ABCMeta
from types import CodeType, FrameType
# Definitions of special type checking related constructs. Their definition
# are not used, so their value does not matter.
@@ -31,6 +30,8 @@ List = TypeAlias(object)
Dict = TypeAlias(object)
DefaultDict = TypeAlias(object)
Set = TypeAlias(object)
Counter = TypeAlias(object)
Deque = TypeAlias(object)
# Predefined type variables.
AnyStr = TypeVar('AnyStr', str, unicode)
@@ -93,10 +94,6 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
@abstractmethod
def close(self) -> None: ...
gi_code = ... # type: CodeType
gi_frame = ... # type: FrameType
gi_running = ... # type: bool
class Container(Generic[_T_co]):
@abstractmethod
def __contains__(self, x: object) -> bool: ...
@@ -191,9 +188,9 @@ class Mapping(Iterable[_KT], Container[_KT], Sized, Generic[_KT, _VT_co]):
def get(self, k: _KT) -> Optional[_VT_co]: ...
@overload # type: ignore
def get(self, k: _KT, default: Union[_VT_co, _T]) -> Union[_VT_co, _T]: ...
def keys(self) -> List[_KT]: ...
def values(self) -> List[_VT_co]: ...
def items(self) -> List[Tuple[_KT, _VT_co]]: ...
def keys(self) -> list[_KT]: ...
def values(self) -> list[_VT_co]: ...
def items(self) -> list[Tuple[_KT, _VT_co]]: ...
def iterkeys(self) -> Iterator[_KT]: ...
def itervalues(self) -> Iterator[_VT_co]: ...
def iteritems(self) -> Iterator[Tuple[_KT, _VT_co]]: ...
@@ -243,7 +240,7 @@ class IO(Iterator[AnyStr], Generic[AnyStr]):
@abstractmethod
def readline(self, limit: int = ...) -> AnyStr: ...
@abstractmethod
def readlines(self, hint: int = ...) -> List[AnyStr]: ...
def readlines(self, hint: int = ...) -> list[AnyStr]: ...
@abstractmethod
def seek(self, offset: int, whence: int = ...) -> None: ...
@abstractmethod
@@ -318,7 +315,7 @@ class Match(Generic[AnyStr]):
*groups: str) -> Sequence[AnyStr]: ...
def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ...
def groupdict(self, default: AnyStr = ...) -> Dict[str, AnyStr]: ...
def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ...
def start(self, group: Union[int, str] = ...) -> int: ...
def end(self, group: Union[int, str] = ...) -> int: ...
def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ...
@@ -333,9 +330,9 @@ class Pattern(Generic[AnyStr]):
endpos: int = ...) -> Match[AnyStr]: ...
def match(self, string: AnyStr, pos: int = ...,
endpos: int = ...) -> Match[AnyStr]: ...
def split(self, string: AnyStr, maxsplit: int = ...) -> List[AnyStr]: ...
def split(self, string: AnyStr, maxsplit: int = ...) -> list[AnyStr]: ...
def findall(self, string: AnyStr, pos: int = ...,
endpos: int = ...) -> List[Any]: ...
endpos: int = ...) -> list[Any]: ...
def finditer(self, string: AnyStr, pos: int = ...,
endpos: int = ...) -> Iterator[Match[AnyStr]]: ...
@@ -355,7 +352,7 @@ class Pattern(Generic[AnyStr]):
# Functions
def get_type_hints(obj: Callable) -> Dict[str, Any]: ...
def get_type_hints(obj: Callable) -> dict[str, Any]: ...
def cast(tp: Type[_T], obj: Any) -> _T: ...
@@ -6,7 +6,7 @@
from typing import (
Any, Callable, Dict, Iterable, Tuple, List, TextIO, Sequence,
overload, Set, TypeVar, Union, Pattern
overload, Set, TypeVar, Union, Pattern, Type
)
from abc import abstractmethod, ABCMeta
@@ -41,7 +41,7 @@ class TestResult:
class _AssertRaisesBaseContext:
expected = ... # type: Any
failureException = ... # type: type
failureException = ... # type: Type[BaseException]
obj_name = ... # type: str
expected_regex = ... # type: Pattern[str]
@@ -51,8 +51,8 @@ class _AssertRaisesContext(_AssertRaisesBaseContext):
def __exit__(self, exc_type, exc_value, tb) -> bool: ...
class TestCase(Testable):
failureException = ... # type: Type[BaseException]
def __init__(self, methodName: str = ...) -> None: ...
# TODO failureException
def setUp(self) -> None: ...
def tearDown(self) -> None: ...
def run(self, result: TestResult = ...) -> None: ...
+34 -13
View File
@@ -1,23 +1,44 @@
from typing import NamedTuple, Any, Tuple
from typing import Any, Tuple, Optional
_int_type = int
class _UUIDFields(NamedTuple('_UUIDFields',
[('time_low', int), ('time_mid', int), ('time_hi_version', int), ('clock_seq_hi_variant', int), ('clock_seq_low', int), ('node', int)])):
time = ... # type: int
clock_seq = ... # type: int
_int = int
class UUID:
def __init__(self, hex: str = ..., bytes: str = ..., bytes_le: str = ...,
fields: Tuple[int, int, int, int, int, int] = ..., int: int = ..., version: Any = ...) -> None: ...
def __init__(self, hex: Optional[str] = ..., bytes: Optional[str] = ...,
bytes_le: Optional[str] = ...,
fields: Optional[Tuple[int, int, int, int, int, int]] = ...,
int: Optional[int] = ...,
version: Optional[int] = ...) -> None: ...
int = ... # type: _int
def get_bytes(self) -> _int: ...
bytes = ... # type: str
def get_bytes_le(self) -> str: ...
bytes_le = ... # type: str
fields = ... # type: _UUIDFields
def get_fields(self) -> Tuple[_int, _int, _int, _int, _int, _int]: ...
fields = ... # type: Tuple[_int, _int, _int, _int, _int, _int]
def get_time_low(self) -> _int: ...
time_low = ... # type: _int
def get_time_mid(self) -> _int: ...
time_mid = ... # type: _int
def get_time_hi_version(self) -> _int: ...
time_hi_version = ... # type: _int
def get_clock_seq_hi_variant(self) -> _int: ...
clock_seq_hi_variant = ... # type: _int
def get_clock_seq_low(self) -> _int: ...
clock_seq_low = ... # type: _int
def get_time(self) -> _int: ...
time = ... # type: _int
def get_clock_seq(self) -> _int: ...
clock_seq = ... # type: _int
def get_node(self) -> _int: ...
node = ... # type: _int
def get_hex(self) -> str: ...
hex = ... # type: str
int = ... # type: _int_type
def get_urn(self) -> str: ...
urn = ... # type: str
variant = ... # type: _int_type
version = ... # type: _int_type
def get_variant(self) -> _int: ...
variant = ... # type: _int
def get_version(self) -> _int: ...
version = ... # type: _int
RESERVED_NCS = ... # type: int
RFC_4122 = ... # type: int
@@ -1,116 +0,0 @@
# Stubs for xml.etree.ElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, AnyStr, Union, IO, Callable, Dict, List, Tuple, Sequence, Iterator, TypeVar, Optional, Generator
import io
VERSION = ... # type: str
_Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class _SimpleElementPath:
def find(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> Optional['Element']: ...
def findtext(self, element: 'Element', tag: _str_or_bytes, default: _T=..., namespaces: Any=...) -> Union[str, bytes, _T]: ...
def iterfind(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> Generator['Element', None, None]: ...
def findall(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> List['Element']: ...
class ParseError(SyntaxError): ...
def iselement(element: 'Element') -> bool: ...
class Element(Sequence['Element']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., 'Element']], attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> None: ...
def append(self, element: 'Element') -> None: ...
def clear(self) -> None: ...
def copy(self) -> 'Element': ...
def extend(self, elements: Sequence['Element']) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional['Element']: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def getchildren(self) -> List['Element']: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['Element']: ...
def insert(self, index: int, element: 'Element') -> None: ...
def items(self) -> List[Tuple[AnyStr, AnyStr]]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator['Element', None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def itertext(self) -> Generator[str, None, None]: ...
def keys(self) -> List[AnyStr]: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> 'Element': ...
def remove(self, element: 'Element') -> None: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def __bool__(self) -> bool: ...
def __delitem__(self, index: int) -> None: ...
def __getitem__(self, index) -> 'Element': ...
def __len__(self) -> int: ...
def __setitem__(self, index: int, element: 'Element') -> None: ...
def SubElement(parent: Element, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> Element: ...
def Comment(text: _str_or_bytes=...) -> Element: ...
def ProcessingInstruction(target: str, text: str=...) -> Element: ...
PI = ... # type: Callable[..., Element]
class QName:
text = ... # type: str
def __init__(self, text_or_uri: str, tag: str=...) -> None: ...
_file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> Element: ...
def parse(self, source: _file_or_filename, parser: 'XMLParser'=...) -> Element: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def write(self, file_or_filename: _file_or_filename, encoding: str=..., xml_declaration: Optional[bool]=..., default_namespace: str=..., method: str=...) -> None: ...
def write_c14n(self, file: _file_or_filename) -> None: ...
def register_namespace(prefix: str, uri: str) -> None: ...
def tostring(element: Element, encoding: str=..., method: str=...) -> str: ...
def tostringlist(element: Element, encoding: str=..., method: str=...) -> List[str]: ...
def dump(elem: Element) -> None: ...
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Element]]: ...
class _IterParseIterator:
root = ... # type: Any
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
def next(self) -> Tuple[str, Element]: ...
def __iter__(self) -> _IterParseIterator: ...
def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
# TODO-improve this type
fromstring = ... # type: Callable[..., Element]
def fromstringlist(sequence: Sequence[AnyStr], parser: 'XMLParser'=...) -> Element: ...
class TreeBuilder:
def __init__(self, element_factory: Callable[[AnyStr, Dict[AnyStr, AnyStr]], Element]=...) -> None: ...
def close(self) -> Element: ...
def data(self, data: AnyStr) -> None: ...
def start(self, tag: AnyStr, attrs: Dict[AnyStr, AnyStr]) -> Element: ...
def end(self, tag: AnyStr) -> Element: ...
class XMLParser:
parser = ... # type: Any
target = ... # type: TreeBuilder
# TODO-what is entity used for???
entity = ... # type: Any
version = ... # type: str
def __init__(self, html: int=..., target: TreeBuilder=..., encoding: str=...) -> None: ...
def doctype(self, name: str, pubid: str, system: str) -> None: ...
def close(self) -> Any: ... # TODO-most of the time, this will be Element, but it can be anything target.close() returns
def feed(self, data: AnyStr)-> None: ...
@@ -1,7 +1,7 @@
# Stubs for logging (Python 3.4)
from typing import (
Any, Callable, Dict, Iterable, Mapping, MutableMapping, Optional, IO,
Any, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, IO,
Tuple, Text, Union, overload,
)
from string import Template
@@ -8,7 +8,7 @@ _T = TypeVar('_T', bound='Stats')
class Stats:
def __init__(self: _T, __arg: Union[None, str, Text, Profile, cProfile] = ...,
*args: Union[None, str, Text, Profile, cProfile, _T],
stream: IO[Any]) -> None: ...
stream: IO[Any] = ...) -> None: ...
def init(self, arg: Union[None, str, Text, Profile, cProfile]) -> None: ...
def load_stats(self, arg: Union[None, str, Text, Profile, cProfile]) -> None: ...
def get_top_level_stats(self) -> None: ...
@@ -1,6 +1,4 @@
# Stubs for xml.etree.ElementInclude (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Union, Optional, Callable
from xml.etree.ElementTree import Element
@@ -1,6 +1,4 @@
# Stubs for xml.etree.ElementPath (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional
from xml.etree.ElementTree import Element
@@ -1,26 +1,19 @@
# Stubs for xml.etree.ElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, AnyStr, Union, IO, Callable, Dict, List, Tuple, Sequence, Iterator, TypeVar, Optional, KeysView, ItemsView, Generator
import io
import sys
VERSION = ... # type: str
_Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class _SimpleElementPath:
def find(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> Optional['Element']: ...
def findtext(self, element: 'Element', tag: _str_or_bytes, default: _T=..., namespaces: Any=...) -> Union[str, bytes, _T]: ...
def iterfind(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> Generator['Element', None, None]: ...
def findall(self, element: 'Element', tag: _str_or_bytes, namespaces: Any=...) -> List['Element']: ...
class ParseError(SyntaxError): ...
def iselement(element: 'Element') -> bool: ...
_Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class Element(Sequence['Element']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
@@ -37,7 +30,10 @@ class Element(Sequence['Element']):
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def getchildren(self) -> List['Element']: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['Element']: ...
def insert(self, index: int, subelement: 'Element') -> None: ...
if sys.version_info >= (3, 2):
def insert(self, index: int, subelement: 'Element') -> None: ...
else:
def insert(self, index: int, element: 'Element') -> None: ...
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator['Element', None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
@@ -75,23 +71,29 @@ class ElementTree:
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def write(self, file_or_filename: _file_or_filename, encoding: str=..., xml_declaration: Optional[bool]=..., default_namespace: str=..., method: str=...) -> None: ...
if sys.version_info >= (3, 4):
def write(self, file_or_filename: _file_or_filename, encoding: str=..., xml_declaration: Optional[bool]=..., default_namespace: str=..., method: str=..., *, short_empty_elements: bool=...) -> None: ...
else:
def write(self, file_or_filename: _file_or_filename, encoding: str=..., xml_declaration: Optional[bool]=..., default_namespace: str=..., method: str=...) -> None: ...
def write_c14n(self, file: _file_or_filename) -> None: ...
def register_namespace(prefix: str, uri: str) -> None: ...
def tostring(element: Element, encoding: str=..., method: str=...) -> str: ...
def tostringlist(element: Element, encoding: str=..., method: str=...) -> List[str]: ...
if sys.version_info >= (3, 4):
def tostring(element: Element, encoding: str=..., method: str=..., *, short_empty_elements: bool=...) -> str: ...
def tostringlist(element: Element, encoding: str=..., method: str=..., *, short_empty_elements: bool=...) -> List[str]: ...
else:
def tostring(element: Element, encoding: str=..., method: str=...) -> str: ...
def tostringlist(element: Element, encoding: str=..., method: str=...) -> List[str]: ...
def dump(elem: Element) -> None: ...
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Element]]: ...
class _IterParseIterator:
root = ... # type: Any
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
def __next__(self) -> Tuple[str, Element]: ...
def __iter__(self) -> _IterParseIterator: ...
if sys.version_info >= (3, 4):
class XMLPullParser:
def __init__(self, events: Sequence[str]=..., *, _parser: 'XMLParser'=...) -> None: ...
def feed(self, data: bytes) -> None: ...
def close(self) -> None: ...
def read_events(self) -> Iterator[Tuple[str, Element]]: ...
def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
@@ -1,5 +1,3 @@
# Stubs for xml.etree.cElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from xml.etree.ElementTree import * # noqa: F403
@@ -1,19 +0,0 @@
# Stubs for xml.etree.ElementInclude (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Union, Optional, Callable
from .ElementTree import Element
XINCLUDE = ... # type: str
XINCLUDE_INCLUDE = ... # type: str
XINCLUDE_FALLBACK = ... # type: str
class FatalIncludeError(SyntaxError): ...
def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str]=...) -> Union[str, Element]: ...
# TODO: loader is of type default_loader ie it takes a callable that has the
# same signature as default_loader. But default_loader has a keyword argument
# Which can't be represented using Callable...
def include(elem: Element, loader: Callable[..., Union[str, Element]]=...) -> None: ...
@@ -1,35 +0,0 @@
# Stubs for xml.etree.ElementPath (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional
from .ElementTree import Element
xpath_tokenizer_re = ... # type: Pattern
_token = Tuple[str, str]
_next = Callable[[], _token]
_callback = Callable[['_SelectorContext', List[Element]], Generator[Element, None, None]]
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
def get_parent_map(context: '_SelectorContext') -> Dict[Element, Element]: ...
def prepare_child(next: _next, token: _token) -> _callback: ...
def prepare_star(next: _next, token: _token) -> _callback: ...
def prepare_self(next: _next, token: _token) -> _callback: ...
def prepare_descendant(next: _next, token: _token) -> _callback: ...
def prepare_parent(next: _next, token: _token) -> _callback: ...
def prepare_predicate(next: _next, token: _token) -> _callback: ...
ops = ... # type: Dict[str, Callable[[_next, _token], _callback]]
class _SelectorContext:
parent_map = ... # type: Dict[Element, Element]
root = ... # type: Element
def __init__(self, root: Element) -> None: ...
_T = TypeVar('_T')
def iterfind(elem: Element, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def find(elem: Element, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findall(elem: Element, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def findtext(elem: Element, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
@@ -1,5 +0,0 @@
# Stubs for xml.etree.cElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from xml.etree.ElementTree import * # noqa: F403
@@ -1,19 +0,0 @@
# Stubs for xml.etree.ElementInclude (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Union, Optional, Callable
from .ElementTree import Element
XINCLUDE = ... # type: str
XINCLUDE_INCLUDE = ... # type: str
XINCLUDE_FALLBACK = ... # type: str
class FatalIncludeError(SyntaxError): ...
def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str]=...) -> Union[str, Element]: ...
# TODO: loader is of type default_loader ie it takes a callable that has the
# same signature as default_loader. But default_loader has a keyword argument
# Which can't be represented using Callable...
def include(elem: Element, loader: Callable[..., Union[str, Element]]=...) -> None: ...
@@ -1,35 +0,0 @@
# Stubs for xml.etree.ElementPath (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional
from .ElementTree import Element
xpath_tokenizer_re = ... # type: Pattern
_token = Tuple[str, str]
_next = Callable[[], _token]
_callback = Callable[['_SelectorContext', List[Element]], Generator[Element, None, None]]
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
def get_parent_map(context: '_SelectorContext') -> Dict[Element, Element]: ...
def prepare_child(next: _next, token: _token) -> _callback: ...
def prepare_star(next: _next, token: _token) -> _callback: ...
def prepare_self(next: _next, token: _token) -> _callback: ...
def prepare_descendant(next: _next, token: _token) -> _callback: ...
def prepare_parent(next: _next, token: _token) -> _callback: ...
def prepare_predicate(next: _next, token: _token) -> _callback: ...
ops = ... # type: Dict[str, Callable[[_next, _token], _callback]]
class _SelectorContext:
parent_map = ... # type: Dict[Element, Element]
root = ... # type: Element
def __init__(self, root: Element) -> None: ...
_T = TypeVar('_T')
def iterfind(elem: Element, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def find(elem: Element, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findall(elem: Element, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def findtext(elem: Element, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
@@ -1,113 +0,0 @@
# Stubs for xml.etree.ElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, AnyStr, Union, IO, Callable, Dict, List, Tuple, Sequence, Iterator, TypeVar, Optional, KeysView, ItemsView, Generator
import io
VERSION = ... # type: str
class ParseError(SyntaxError): ...
def iselement(element: 'Element') -> bool: ...
_Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class Element(Sequence['Element']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., 'Element']], attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> None: ...
def append(self, subelement: 'Element') -> None: ...
def clear(self) -> None: ...
def copy(self) -> 'Element': ...
def extend(self, elements: Sequence['Element']) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional['Element']: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def getchildren(self) -> List['Element']: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['Element']: ...
def insert(self, index: int, subelement: 'Element') -> None: ...
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator['Element', None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def itertext(self) -> Generator[str, None, None]: ...
def keys(self) -> KeysView[AnyStr]: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> 'Element': ...
def remove(self, subelement: 'Element') -> None: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def __bool__(self) -> bool: ...
def __delitem__(self, index: int) -> None: ...
def __getitem__(self, index) -> 'Element': ...
def __len__(self) -> int: ...
def __setitem__(self, index: int, element: 'Element') -> None: ...
def SubElement(parent: Element, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> Element: ...
def Comment(text: _str_or_bytes=...) -> Element: ...
def ProcessingInstruction(target: str, text: str=...) -> Element: ...
PI = ... # type: Callable[..., Element]
class QName:
text = ... # type: str
def __init__(self, text_or_uri: str, tag: str=...) -> None: ...
_file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> Element: ...
def parse(self, source: _file_or_filename, parser: 'XMLParser'=...) -> Element: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def write(self, file_or_filename: _file_or_filename, encoding: str=..., xml_declaration: Optional[bool]=..., default_namespace: str=..., method: str=...) -> None: ...
def write_c14n(self, file: _file_or_filename) -> None: ...
def register_namespace(prefix: str, uri: str) -> None: ...
def tostring(element: Element, encoding: str=..., method: str=...) -> str: ...
def tostringlist(element: Element, encoding: str=..., method: str=...) -> List[str]: ...
def dump(elem: Element) -> None: ...
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Element]]: ...
class _IterParseIterator:
root = ... # type: Any
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
def __next__(self) -> Tuple[str, Element]: ...
def __iter__(self) -> _IterParseIterator: ...
def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
# TODO-improve this type
fromstring = ... # type: Callable[..., Element]
def fromstringlist(sequence: Sequence[AnyStr], parser: 'XMLParser'=...) -> Element: ...
class TreeBuilder:
def __init__(self, element_factory: Callable[[AnyStr, Dict[AnyStr, AnyStr]], Element]=...) -> None: ...
def close(self) -> Element: ...
def data(self, data: AnyStr) -> None: ...
def start(self, tag: AnyStr, attrs: Dict[AnyStr, AnyStr]) -> Element: ...
def end(self, tag: AnyStr) -> Element: ...
class XMLParser:
parser = ... # type: Any
target = ... # type: TreeBuilder
# TODO-what is entity used for???
entity = ... # type: Any
version = ... # type: str
def __init__(self, html: int=..., target: TreeBuilder=..., encoding: str=...) -> None: ...
def doctype(self, name: str, pubid: str, system: str) -> None: ...
def close(self) -> Any: ... # TODO-most of the time, this will be Element, but it can be anything target.close() returns
def feed(self, data: AnyStr)-> None: ...
@@ -1,5 +0,0 @@
# Stubs for xml.etree.cElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from xml.etree.ElementTree import * # noqa: F403
@@ -1,5 +1,6 @@
"""The asyncio package, tracking PEP 3156."""
import socket
import sys
from typing import Type
@@ -85,6 +86,11 @@ from asyncio.locks import (
if sys.version_info < (3, 5):
from asyncio.queues import JoinableQueue as JoinableQueue
if sys.platform != 'win32':
from asyncio.streams import (
open_unix_connection as open_unix_connection,
start_unix_server as start_unix_server,
)
# TODO: It should be possible to instantiate these classes, but mypy
# currently disallows this.
@@ -1,5 +1,5 @@
import sys
from typing import Any, Awaitable, TypeVar, List, Callable, Tuple, Union, Dict, Generator, overload, Optional
from typing import Any, Awaitable, Callable, Dict, Generator, List, Optional, Tuple, TypeVar, Union, overload
from abc import ABCMeta, abstractmethod
from asyncio.futures import Future
from asyncio.coroutines import coroutine
@@ -8,6 +8,7 @@ from asyncio.tasks import Task
__all__ = ... # type: str
_T = TypeVar('_T')
_Context = Dict[str, Any]
PIPE = ... # type: Any # from subprocess.PIPE
@@ -71,7 +72,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
def call_soon_threadsafe(self, callback: Callable[..., Any], *args: Any) -> Handle: ...
@abstractmethod
def run_in_executor(self, executor: Any,
callback: Callable[[], Any], *args: Any) -> Future[Any]: ...
callback: Callable[..., Any], *args: Any) -> Future[Any]: ...
@abstractmethod
def set_default_executor(self, executor: Any) -> None: ...
# Network I/O methods returning Futures.
@@ -113,11 +114,11 @@ class AbstractEventLoop(metaclass=ABCMeta):
stdout: Any = ..., stderr: Any = ...,
**kwargs: Any) -> tuple: ...
@abstractmethod
def add_reader(self, fd: int, callback: Callable[[], Any], *args: List[Any]) -> None: ...
def add_reader(self, fd: int, callback: Callable[..., Any], *args: List[Any]) -> None: ...
@abstractmethod
def remove_reader(self, fd: int) -> None: ...
@abstractmethod
def add_writer(self, fd: int, callback: Callable[[], Any], *args: List[Any]) -> None: ...
def add_writer(self, fd: int, callback: Callable[..., Any], *args: List[Any]) -> None: ...
@abstractmethod
def remove_writer(self, fd: int) -> None: ...
# Completion based I/O methods returning Futures.
@@ -131,16 +132,16 @@ class AbstractEventLoop(metaclass=ABCMeta):
def sock_accept(self, sock: Any) -> Any: ...
# Signal handling.
@abstractmethod
def add_signal_handler(self, sig: int, callback: Callable[[], Any], *args: List[Any]) -> None: ...
def add_signal_handler(self, sig: int, callback: Callable[..., Any], *args: List[Any]) -> None: ...
@abstractmethod
def remove_signal_handler(self, sig: int) -> None: ...
# Error handlers.
@abstractmethod
def set_exception_handler(self, handler: Callable[[], Any]) -> None: ...
def set_exception_handler(self, handler: Callable[[AbstractEventLoop, _Context], Any]) -> None: ...
@abstractmethod
def default_exception_handler(self, context: Any) -> None: ...
def default_exception_handler(self, context: _Context) -> None: ...
@abstractmethod
def call_exception_handler(self, context: Any) -> None: ...
def call_exception_handler(self, context: _Context) -> None: ...
# Debug flag management.
@abstractmethod
def get_debug(self) -> bool: ...
@@ -24,7 +24,7 @@ class Lock(_ContextManagerMixin):
def __init__(self, *, loop: AbstractEventLoop = None) -> None: ...
def locked(self) -> bool: ...
@coroutine
def acquire(self) -> Future[bool]: ...
def acquire(self) -> Generator[Any, None, bool]: ...
def release(self) -> None: ...
class Event:
@@ -33,18 +33,18 @@ class Event:
def set(self) -> None: ...
def clear(self) -> None: ...
@coroutine
def wait(self) -> bool: ...
def wait(self) -> Generator[Any, None, bool]: ...
class Condition(_ContextManagerMixin):
def __init__(self, lock: Lock = None, *, loop: AbstractEventLoop = None) -> None: ...
def locked(self) -> bool: ...
@coroutine
def acquire(self) -> Future[bool]: ...
def acquire(self) -> Generator[Any, None, bool]: ...
def release(self) -> None: ...
@coroutine
def wait(self) -> Future[bool]: ...
def wait(self) -> Generator[Any, None, bool]: ...
@coroutine
def wait_for(self, predicate: Callable[[], T]) -> Future[T]: ...
def wait_for(self, predicate: Callable[[], T]) -> Generator[Any, None, T]: ...
def notify(self, n: int = 1) -> None: ...
def notify_all(self) -> None: ...
@@ -52,7 +52,7 @@ class Semaphore(_ContextManagerMixin):
def __init__(self, value: int = 1, *, loop: AbstractEventLoop = None) -> None: ...
def locked(self) -> bool: ...
@coroutine
def acquire(self) -> Future[bool]: ...
def acquire(self) -> Generator[Any, None, bool]: ...
def release(self) -> None: ...
class BoundedSemaphore(Semaphore):
@@ -2,7 +2,7 @@ import sys
from asyncio.events import AbstractEventLoop
from .coroutines import coroutine
from .futures import Future
from typing import TypeVar, Generic
from typing import Any, Generator, Generic, TypeVar
__all__ = ... # type: str
@@ -28,14 +28,14 @@ class Queue(Generic[T]):
def empty(self) -> bool: ...
def full(self) -> bool: ...
@coroutine
def put(self, item: T) -> Future[None]: ...
def put(self, item: T) -> Generator[Any, None, None]: ...
def put_nowait(self, item: T) -> None: ...
@coroutine
def get(self) -> Future[T]: ...
def get(self) -> Generator[Any, None, T]: ...
def get_nowait(self) -> T: ...
if sys.version_info >= (3, 4):
@coroutine
def join(self) -> None: ...
def join(self) -> Generator[Any, None, bool]: ...
def task_done(self) -> None: ...
@@ -48,4 +48,4 @@ if sys.version_info < (3, 5):
class JoinableQueue(Queue):
def task_done(self) -> None: ...
@coroutine
def join(self) -> None: ...
def join(self) -> Generator[Any, None, bool]: ...
@@ -1,12 +1,12 @@
import socket
from typing import Any, Callable, Generator, Iterable, Tuple
import sys
from typing import Any, Awaitable, Callable, Generator, Iterable, Optional, Tuple
from . import coroutines
from . import events
from . import protocols
from . import transports
ClientConnectedCallback = Callable[[Tuple[StreamReader, StreamWriter]], None]
ClientConnectedCallback = Callable[[StreamReader, StreamWriter], Optional[Awaitable[None]]]
__all__ = ... # type: str
@@ -38,7 +38,7 @@ def start_server(
**kwds: Any
) -> Generator[Any, None, events.AbstractServer]: ...
if hasattr(socket, 'AF_UNIX'):
if sys.platform != 'win32':
@coroutines.coroutine
def open_unix_connection(
path: str = ...,
@@ -84,7 +84,7 @@ class StreamWriter:
def close(self) -> None: ...
def get_extra_info(self, name: str, default: Any = ...) -> Any: ...
@coroutines.coroutine
def drain(self) -> None: ...
def drain(self) -> Generator[Any, None, None]: ...
class StreamReader:
def __init__(self,
@@ -3,7 +3,7 @@ from asyncio import protocols
from asyncio import streams
from asyncio import transports
from asyncio.coroutines import coroutine
from typing import Any, AnyStr, Optional, Tuple, Union
from typing import Any, AnyStr, Generator, Optional, Tuple, Union
__all__ = ... # type: str
@@ -28,12 +28,12 @@ class Process:
@property
def returncode(self) -> int: ...
@coroutine
def wait(self) -> int: ...
def wait(self) -> Generator[Any, None, int]: ...
def send_signal(self, signal: int) -> None: ...
def terminate(self) -> None: ...
def kill(self) -> None: ...
@coroutine
def communicate(self, input: Optional[bytes] = ...) -> Tuple[bytes, bytes]: ...
def communicate(self, input: Optional[bytes] = ...) -> Generator[Any, None, Tuple[bytes, bytes]]: ...
@coroutine
@@ -45,7 +45,7 @@ def create_subprocess_shell(
loop: events.AbstractEventLoop = ...,
limit: int = ...,
**kwds: Any
): ...
) -> Generator[Any, None, Process]: ...
@coroutine
def create_subprocess_exec(
@@ -57,4 +57,4 @@ def create_subprocess_exec(
loop: events.AbstractEventLoop = ...,
limit: int = ...,
**kwds: Any
) -> Process: ...
) -> Generator[Any, None, Process]: ...
@@ -26,7 +26,7 @@ def run_coroutine_threadsafe(coro: _FutureT[_T],
loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ...
def shield(arg: _FutureT[_T], *, loop: AbstractEventLoop = ...) -> Future[_T]: ...
def sleep(delay: float, result: _T = ..., loop: AbstractEventLoop = ...) -> Future[_T]: ...
def wait(fs: List[_FutureT[_T]], *, loop: AbstractEventLoop = ...,
def wait(fs: Iterable[_FutureT[_T]], *, loop: AbstractEventLoop = ...,
timeout: float = ...,
return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ...
def wait_for(fut: _FutureT[_T], timeout: Optional[float],
@@ -1,6 +1,6 @@
# Stubs for pathlib (Python 3.4)
from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union
from typing import Any, Generator, IO, Optional, Sequence, Tuple, Type, TypeVar, Union, List
import os
import sys
@@ -1,19 +0,0 @@
# Stubs for xml.etree.ElementInclude (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Union, Optional, Callable
from .ElementTree import Element
XINCLUDE = ... # type: str
XINCLUDE_INCLUDE = ... # type: str
XINCLUDE_FALLBACK = ... # type: str
class FatalIncludeError(SyntaxError): ...
def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str]=...) -> Union[str, Element]: ...
# TODO: loader is of type default_loader ie it takes a callable that has the
# same signature as default_loader. But default_loader has a keyword argument
# Which can't be represented using Callable...
def include(elem: Element, loader: Callable[..., Union[str, Element]]=...) -> None: ...
@@ -1,35 +0,0 @@
# Stubs for xml.etree.ElementPath (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional
from .ElementTree import Element
xpath_tokenizer_re = ... # type: Pattern
_token = Tuple[str, str]
_next = Callable[[], _token]
_callback = Callable[['_SelectorContext', List[Element]], Generator[Element, None, None]]
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
def get_parent_map(context: '_SelectorContext') -> Dict[Element, Element]: ...
def prepare_child(next: _next, token: _token) -> _callback: ...
def prepare_star(next: _next, token: _token) -> _callback: ...
def prepare_self(next: _next, token: _token) -> _callback: ...
def prepare_descendant(next: _next, token: _token) -> _callback: ...
def prepare_parent(next: _next, token: _token) -> _callback: ...
def prepare_predicate(next: _next, token: _token) -> _callback: ...
ops = ... # type: Dict[str, Callable[[_next, _token], _callback]]
class _SelectorContext:
parent_map = ... # type: Dict[Element, Element]
root = ... # type: Element
def __init__(self, root: Element) -> None: ...
_T = TypeVar('_T')
def iterfind(elem: Element, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def find(elem: Element, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findall(elem: Element, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def findtext(elem: Element, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
@@ -1,118 +0,0 @@
# Stubs for xml.etree.ElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, AnyStr, Union, IO, Callable, Dict, List, Tuple, Sequence, Iterator, TypeVar, Optional, KeysView, ItemsView, Generator
import io
VERSION = ... # type: str
class ParseError(SyntaxError): ...
def iselement(element: 'Element') -> bool: ...
_Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class Element(Sequence['Element']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., 'Element']], attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> None: ...
def append(self, subelement: 'Element') -> None: ...
def clear(self) -> None: ...
def copy(self) -> 'Element': ...
def extend(self, elements: Sequence['Element']) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional['Element']: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def getchildren(self) -> List['Element']: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['Element']: ...
def insert(self, index: int, subelement: 'Element') -> None: ...
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator['Element', None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def itertext(self) -> Generator[str, None, None]: ...
def keys(self) -> KeysView[AnyStr]: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> 'Element': ...
def remove(self, subelement: 'Element') -> None: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def __bool__(self) -> bool: ...
def __delitem__(self, index: int) -> None: ...
def __getitem__(self, index) -> 'Element': ...
def __len__(self) -> int: ...
def __setitem__(self, index: int, element: 'Element') -> None: ...
def SubElement(parent: Element, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> Element: ...
def Comment(text: _str_or_bytes=...) -> Element: ...
def ProcessingInstruction(target: str, text: str=...) -> Element: ...
PI = ... # type: Callable[..., Element]
class QName:
text = ... # type: str
def __init__(self, text_or_uri: str, tag: str=...) -> None: ...
_file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> Element: ...
def parse(self, source: _file_or_filename, parser: 'XMLParser'=...) -> Element: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def write(self, file_or_filename: _file_or_filename, encoding: str=..., xml_declaration: Optional[bool]=..., default_namespace: str=..., method: str=..., *, short_empty_elements: bool=...) -> None: ...
def write_c14n(self, file: _file_or_filename) -> None: ...
def register_namespace(prefix: str, uri: str) -> None: ...
def tostring(element: Element, encoding: str=..., method: str=..., *, short_empty_elements: bool=...) -> str: ...
def tostringlist(element: Element, encoding: str=..., method: str=..., *, short_empty_elements: bool=...) -> List[str]: ...
def dump(elem: Element) -> None: ...
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Element]]: ...
class XMLPullParser:
def __init__(self, events: Sequence[str]=..., *, _parser: 'XMLParser'=...) -> None: ...
def feed(self, data: bytes) -> None: ...
def close(self) -> None: ...
def read_events(self) -> Iterator[Tuple[str, Element]]: ...
class _IterParseIterator:
root = ... # type: Any
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
def __next__(self) -> Tuple[str, Element]: ...
def __iter__(self) -> _IterParseIterator: ...
def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
# TODO-improve this type
fromstring = ... # type: Callable[..., Element]
def fromstringlist(sequence: Sequence[AnyStr], parser: 'XMLParser'=...) -> Element: ...
class TreeBuilder:
def __init__(self, element_factory: Callable[[AnyStr, Dict[AnyStr, AnyStr]], Element]=...) -> None: ...
def close(self) -> Element: ...
def data(self, data: AnyStr) -> None: ...
def start(self, tag: AnyStr, attrs: Dict[AnyStr, AnyStr]) -> Element: ...
def end(self, tag: AnyStr) -> Element: ...
class XMLParser:
parser = ... # type: Any
target = ... # type: TreeBuilder
# TODO-what is entity used for???
entity = ... # type: Any
version = ... # type: str
def __init__(self, html: int=..., target: TreeBuilder=..., encoding: str=...) -> None: ...
def doctype(self, name: str, pubid: str, system: str) -> None: ...
def close(self) -> Any: ... # TODO-most of the time, this will be Element, but it can be anything target.close() returns
def feed(self, data: AnyStr)-> None: ...
@@ -1,5 +0,0 @@
# Stubs for xml.etree.cElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from xml.etree.ElementTree import * # noqa: F403
@@ -1,19 +0,0 @@
# Stubs for xml.etree.ElementInclude (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Union, Optional, Callable
from .ElementTree import Element
XINCLUDE = ... # type: str
XINCLUDE_INCLUDE = ... # type: str
XINCLUDE_FALLBACK = ... # type: str
class FatalIncludeError(SyntaxError): ...
def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str]=...) -> Union[str, Element]: ...
# TODO: loader is of type default_loader ie it takes a callable that has the
# same signature as default_loader. But default_loader has a keyword argument
# Which can't be represented using Callable...
def include(elem: Element, loader: Callable[..., Union[str, Element]]=...) -> None: ...
@@ -1,35 +0,0 @@
# Stubs for xml.etree.ElementPath (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Pattern, Dict, Generator, Tuple, List, Union, TypeVar, Callable, Optional
from .ElementTree import Element
xpath_tokenizer_re = ... # type: Pattern
_token = Tuple[str, str]
_next = Callable[[], _token]
_callback = Callable[['_SelectorContext', List[Element]], Generator[Element, None, None]]
def xpath_tokenizer(pattern: str, namespaces: Dict[str, str]=...) -> Generator[_token, None, None]: ...
def get_parent_map(context: '_SelectorContext') -> Dict[Element, Element]: ...
def prepare_child(next: _next, token: _token) -> _callback: ...
def prepare_star(next: _next, token: _token) -> _callback: ...
def prepare_self(next: _next, token: _token) -> _callback: ...
def prepare_descendant(next: _next, token: _token) -> _callback: ...
def prepare_parent(next: _next, token: _token) -> _callback: ...
def prepare_predicate(next: _next, token: _token) -> _callback: ...
ops = ... # type: Dict[str, Callable[[_next, _token], _callback]]
class _SelectorContext:
parent_map = ... # type: Dict[Element, Element]
root = ... # type: Element
def __init__(self, root: Element) -> None: ...
_T = TypeVar('_T')
def iterfind(elem: Element, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def find(elem: Element, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findall(elem: Element, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def findtext(elem: Element, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
@@ -1,118 +0,0 @@
# Stubs for xml.etree.ElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, AnyStr, Union, IO, Callable, Dict, List, Tuple, Sequence, Iterator, TypeVar, Optional, KeysView, ItemsView, Generator
import io
VERSION = ... # type: str
class ParseError(SyntaxError): ...
def iselement(element: 'Element') -> bool: ...
_Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class Element(Sequence['Element']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., 'Element']], attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> None: ...
def append(self, subelement: 'Element') -> None: ...
def clear(self) -> None: ...
def copy(self) -> 'Element': ...
def extend(self, elements: Sequence['Element']) -> None: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional['Element']: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def getchildren(self) -> List['Element']: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['Element']: ...
def insert(self, index: int, subelement: 'Element') -> None: ...
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator['Element', None, None]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List['Element']: ...
def itertext(self) -> Generator[str, None, None]: ...
def keys(self) -> KeysView[AnyStr]: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> 'Element': ...
def remove(self, subelement: 'Element') -> None: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def __bool__(self) -> bool: ...
def __delitem__(self, index: int) -> None: ...
def __getitem__(self, index) -> 'Element': ...
def __len__(self) -> int: ...
def __setitem__(self, index: int, element: 'Element') -> None: ...
def SubElement(parent: Element, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> Element: ...
def Comment(text: _str_or_bytes=...) -> Element: ...
def ProcessingInstruction(target: str, text: str=...) -> Element: ...
PI = ... # type: Callable[..., Element]
class QName:
text = ... # type: str
def __init__(self, text_or_uri: str, tag: str=...) -> None: ...
_file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: Element=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> Element: ...
def parse(self, source: _file_or_filename, parser: 'XMLParser'=...) -> Element: ...
def iter(self, tag: Union[str, AnyStr]=...) -> Generator[Element, None, None]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[Element]: ...
def find(self, path: str, namespaces: Dict[str, str]=...) -> Optional[Element]: ...
def findtext(self, path: str, default: _T=..., namespaces: Dict[str, str]=...) -> Union[_T, str]: ...
def findall(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def iterfind(self, path: str, namespaces: Dict[str, str]=...) -> List[Element]: ...
def write(self, file_or_filename: _file_or_filename, encoding: str=..., xml_declaration: Optional[bool]=..., default_namespace: str=..., method: str=..., *, short_empty_elements: bool=...) -> None: ...
def write_c14n(self, file: _file_or_filename) -> None: ...
def register_namespace(prefix: str, uri: str) -> None: ...
def tostring(element: Element, encoding: str=..., method: str=..., *, short_empty_elements: bool=...) -> str: ...
def tostringlist(element: Element, encoding: str=..., method: str=..., *, short_empty_elements: bool=...) -> List[str]: ...
def dump(elem: Element) -> None: ...
def parse(source: _file_or_filename, parser: 'XMLParser'=...) -> ElementTree: ...
def iterparse(source: _file_or_filename, events: Sequence[str]=..., parser: 'XMLParser'=...) -> Iterator[Tuple[str, Element]]: ...
class XMLPullParser:
def __init__(self, events: Sequence[str]=..., *, _parser: 'XMLParser'=...) -> None: ...
def feed(self, data: bytes) -> None: ...
def close(self) -> None: ...
def read_events(self) -> Iterator[Tuple[str, Element]]: ...
class _IterParseIterator:
root = ... # type: Any
def __init__(self, source: _file_or_filename, events: Sequence[str], parser: 'XMLParser', close_source: bool=...) -> None: ...
def __next__(self) -> Tuple[str, Element]: ...
def __iter__(self) -> _IterParseIterator: ...
def XML(text: AnyStr, parser: 'XMLParser'=...) -> Element: ...
def XMLID(text: AnyStr, parser: 'XMLParser'=...) -> Tuple[Element, Dict[str, Element]]: ...
# TODO-improve this type
fromstring = ... # type: Callable[..., Element]
def fromstringlist(sequence: Sequence[AnyStr], parser: 'XMLParser'=...) -> Element: ...
class TreeBuilder:
def __init__(self, element_factory: Callable[[AnyStr, Dict[AnyStr, AnyStr]], Element]=...) -> None: ...
def close(self) -> Element: ...
def data(self, data: AnyStr) -> None: ...
def start(self, tag: AnyStr, attrs: Dict[AnyStr, AnyStr]) -> Element: ...
def end(self, tag: AnyStr) -> Element: ...
class XMLParser:
parser = ... # type: Any
target = ... # type: TreeBuilder
# TODO-what is entity used for???
entity = ... # type: Any
version = ... # type: str
def __init__(self, html: int=..., target: TreeBuilder=..., encoding: str=...) -> None: ...
def doctype(self, name: str, pubid: str, system: str) -> None: ...
def close(self) -> Any: ... # TODO-most of the time, this will be Element, but it can be anything target.close() returns
def feed(self, data: AnyStr)-> None: ...
@@ -1,5 +0,0 @@
# Stubs for xml.etree.cElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from xml.etree.ElementTree import * # noqa: F403
+56 -20
View File
@@ -34,11 +34,12 @@ class object:
__class__ = ... # type: type
__dict__ = ... # type: Dict[str, Any]
__slots__ = ... # type: Optional[Union[str, Iterable[str]]]
__module__ = ... # type: Any
def __init__(self) -> None: ...
def __new__(cls) -> Any: ...
def __setattr__(self, name: str, value: Any) -> None: ...
def __eq__(self, o: object) -> bool: ...
def __ne__(self, o: object) -> bool: ...
def __str__(self) -> str: ...
def __repr__(self) -> str: ...
def __hash__(self) -> int: ...
@@ -46,8 +47,6 @@ class object:
def __getattribute__(self, name: str) -> Any: ...
def __delattr__(self, name: str) -> None: ...
def __sizeof__(self) -> int: ...
def __reduce__(self) -> Union[str, tuple]: ...
def __reduce_ex__(self, protocol: int) -> Union[str, tuple]: ...
if sys.version_info >= (3, 6):
def __init_subclass__(cls) -> None: ...
@@ -57,6 +56,7 @@ class type:
__name__ = ... # type: str
__qualname__ = ... # type: str
__module__ = ... # type: str
__dict__ = ... # type: Dict[str, Any]
__mro__ = ... # type: Tuple[type, ...]
@overload
@@ -299,14 +299,23 @@ class bytes(ByteString):
def __init__(self, o: SupportsBytes) -> None: ...
def capitalize(self) -> bytes: ...
def center(self, width: int, fillchar: bytes = ...) -> bytes: ...
def count(self, x: bytes) -> int: ...
if sys.version_info >= (3, 3):
def count(self, sub: Union[bytes, int], start: int = None, end: int = None) -> int: ...
else:
def count(self, sub: bytes, start: int = None, end: int = None) -> int: ...
def decode(self, encoding: str = 'utf-8', errors: str = 'strict') -> str: ...
def endswith(self, suffix: Union[bytes, Tuple[bytes, ...]]) -> bool: ...
def expandtabs(self, tabsize: int = 8) -> bytes: ...
def find(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
if sys.version_info >= (3, 3):
def find(self, sub: Union[bytes, int], start: int = None, end: int = None) -> int: ...
else:
def find(self, sub: bytes, start: int = None, end: int = None) -> int: ...
if sys.version_info >= (3, 5):
def hex(self) -> str: ...
def index(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
if sys.version_info >= (3, 3):
def index(self, sub: Union[bytes, int], start: int = None, end: int = None) -> int: ...
else:
def index(self, sub: bytes, start: int = None, end: int = None) -> int: ...
def isalnum(self) -> bool: ...
def isalpha(self) -> bool: ...
def isdigit(self) -> bool: ...
@@ -320,8 +329,14 @@ class bytes(ByteString):
def lstrip(self, chars: bytes = None) -> bytes: ...
def partition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
def replace(self, old: bytes, new: bytes, count: int = -1) -> bytes: ...
def rfind(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
def rindex(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
if sys.version_info >= (3, 3):
def rfind(self, sub: Union[bytes, int], start: int = None, end: int = None) -> int: ...
else:
def rfind(self, sub: bytes, start: int = None, end: int = None) -> int: ...
if sys.version_info >= (3, 3):
def rindex(self, sub: Union[bytes, int], start: int = None, end: int = None) -> int: ...
else:
def rindex(self, sub: bytes, start: int = None, end: int = None) -> int: ...
def rjust(self, width: int, fillchar: bytes = ...) -> bytes: ...
def rpartition(self, sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
def rsplit(self, sep: bytes = None, maxsplit: int = -1) -> List[bytes]: ...
@@ -373,14 +388,23 @@ class bytearray(MutableSequence[int], ByteString):
def __init__(self) -> None: ...
def capitalize(self) -> bytearray: ...
def center(self, width: int, fillchar: bytes = ...) -> bytearray: ...
def count(self, x: bytes) -> int: ...
if sys.version_info >= (3, 3):
def count(self, sub: Union[bytes, int], start: int = None, end: int = None) -> int: ...
else:
def count(self, sub: bytes, start: int = None, end: int = None) -> int: ...
def decode(self, encoding: str = 'utf-8', errors: str = 'strict') -> str: ...
def endswith(self, suffix: bytes) -> bool: ...
def expandtabs(self, tabsize: int = 8) -> bytearray: ...
def find(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
if sys.version_info >= (3, 3):
def find(self, sub: Union[bytes, int], start: int = None, end: int = None) -> int: ...
else:
def find(self, sub: bytes, start: int = None, end: int = None) -> int: ...
if sys.version_info >= (3, 5):
def hex(self) -> str: ...
def index(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
if sys.version_info >= (3, 3):
def index(self, sub: Union[bytes, int], start: int = None, end: int = None) -> int: ...
else:
def index(self, sub: bytes, start: int = None, end: int = None) -> int: ...
def insert(self, index: int, object: int) -> None: ...
def isalnum(self) -> bool: ...
def isalpha(self) -> bool: ...
@@ -395,8 +419,14 @@ class bytearray(MutableSequence[int], ByteString):
def lstrip(self, chars: bytes = None) -> bytearray: ...
def partition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
def replace(self, old: bytes, new: bytes, count: int = -1) -> bytearray: ...
def rfind(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
def rindex(self, sub: bytes, start: int = 0, end: int = 0) -> int: ...
if sys.version_info >= (3, 3):
def rfind(self, sub: Union[bytes, int], start: int = None, end: int = None) -> int: ...
else:
def rfind(self, sub: bytes, start: int = None, end: int = None) -> int: ...
if sys.version_info >= (3, 3):
def rindex(self, sub: Union[bytes, int], start: int = None, end: int = None) -> int: ...
else:
def rindex(self, sub: bytes, start: int = None, end: int = None) -> int: ...
def rjust(self, width: int, fillchar: bytes = ...) -> bytearray: ...
def rpartition(self, sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
def rsplit(self, sep: bytes = None, maxsplit: int = -1) -> List[bytearray]: ...
@@ -487,9 +517,9 @@ class slice:
step = ... # type: Optional[int]
stop = ... # type: Optional[int]
@overload
def __init__(self, stop: int) -> None: ...
def __init__(self, stop: int = None) -> None: ...
@overload
def __init__(self, start: int, stop: int, step: int = None) -> None: ...
def __init__(self, start: int = None, stop: int = None, step: int = None) -> None: ...
class tuple(Sequence[_T_co], Generic[_T_co]):
def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...
@@ -504,8 +534,6 @@ class tuple(Sequence[_T_co], Generic[_T_co]):
def __le__(self, x: Tuple[_T_co, ...]) -> bool: ...
def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ...
def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ...
def __eq__(self, x: Tuple[_T_co, ...]) -> bool: ...
def __ne__(self, x: Tuple[_T_co, ...]) -> bool: ...
def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ...
def __mul__(self, n: int) -> Tuple[_T_co, ...]: ...
def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ...
@@ -515,6 +543,13 @@ class tuple(Sequence[_T_co], Generic[_T_co]):
else:
def index(self, x: Any) -> int: ...
class function:
# TODO not defined in builtins!
__name__ = ... # type: str
__qualname__ = ... # type: str
__module__ = ... # type: str
__code__ = ... # type: Any
class list(MutableSequence[_T], Generic[_T]):
@overload
def __init__(self) -> None: ...
@@ -673,10 +708,11 @@ class range(Sequence[int]):
def __repr__(self) -> str: ...
def __reversed__(self) -> Iterator[int]: ...
class module(object):
class module:
# TODO not defined in builtins!
__name__ = ... # type: str
__file__ = ... # type: str
__dict__ = ... # type: Dict[str, Any]
class property:
def __init__(self, fget: Callable[[Any], Any] = None,
@@ -753,8 +789,8 @@ def next(i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ...
def oct(i: int) -> str: ... # TODO __index__
if sys.version_info >= (3, 6):
import os
def open(file: Union[str, bytes, int, os.PathLike], mode: str = 'r', buffering: int = -1, encoding: str = None,
from pathlib import Path
def open(file: Union[str, bytes, int, Path], mode: str = 'r', buffering: int = -1, encoding: str = None,
errors: str = None, newline: str = None, closefd: bool = ...) -> IO[Any]: ...
else:
def open(file: Union[str, bytes, int], mode: str = 'r', buffering: int = -1, encoding: str = None,
@@ -139,10 +139,10 @@ class Counter(Dict[_T, int], Generic[_T]):
def __iand__(self, other: Counter[_T]) -> Counter[_T]: ...
def __ior__(self, other: Counter[_T]) -> Counter[_T]: ...
class OrderedDict(Dict[_KT, _VT], Generic[_KT, _VT]):
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 __reversed__(self) -> Iterator[_KT]: ...
class defaultdict(Dict[_KT, _VT], Generic[_KT, _VT]):
default_factory = ... # type: Callable[[], _VT]
@@ -180,3 +180,9 @@ if sys.version_info >= (3, 3):
@property
def parents(self) -> ChainMap[_KT, _VT]: ...
def __setitem__(self, k: _KT, v: _VT) -> None: ...
def __delitem__(self, v: _KT) -> None: ...
def __getitem__(self, k: _KT) -> _VT: ...
def __iter__(self) -> Iterator[_KT]: ...
def __len__(self) -> int: ...
@@ -27,10 +27,10 @@ class Future(Generic[_T]):
def done(self) -> bool: ...
def add_done_callback(self, fn: Callable[[Future], Any]) -> None: ...
def result(self, timeout: Optional[float] = ...) -> _T: ...
def exception(self, timeout: Optional[float] = ...) -> Exception: ...
def exception(self, timeout: Optional[float] = ...) -> BaseException: ...
def set_running_or_notify_cancel(self) -> None: ...
def set_result(self, result: _T) -> None: ...
def set_exception(self, exception: Exception) -> None: ...
def set_exception(self, exception: BaseException) -> None: ...
class Executor:
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
+1 -1
View File
@@ -1,4 +1,4 @@
from typing import List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple
from typing import List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple, Dict
from opcode import (hasconst, hasname, hasjrel, hasjabs, haslocal, hascompare,
hasfree, hasnargs, cmp_op, opname, opmap, HAVE_ARGUMENT,
+12 -12
View File
@@ -1,7 +1,9 @@
# Stubs for hashlib
from abc import abstractmethod, ABCMeta
from typing import AbstractSet
from typing import AbstractSet, Union
_DataType = Union[bytes, bytearray, memoryview]
class Hash(metaclass=ABCMeta):
digest_size = ... # type: int
@@ -13,7 +15,7 @@ class Hash(metaclass=ABCMeta):
name = ... # type: str
@abstractmethod
def update(self, arg: bytes) -> None: ...
def update(self, arg: _DataType) -> None: ...
@abstractmethod
def digest(self) -> bytes: ...
@abstractmethod
@@ -21,20 +23,18 @@ class Hash(metaclass=ABCMeta):
@abstractmethod
def copy(self) -> 'Hash': ...
def md5(arg: bytes = ...) -> Hash: ...
def sha1(arg: bytes = ...) -> Hash: ...
def sha224(arg: bytes = ...) -> Hash: ...
def sha256(arg: bytes = ...) -> Hash: ...
def sha384(arg: bytes = ...) -> Hash: ...
def sha512(arg: bytes = ...) -> Hash: ...
def md5(arg: _DataType = ...) -> Hash: ...
def sha1(arg: _DataType = ...) -> Hash: ...
def sha224(arg: _DataType = ...) -> Hash: ...
def sha256(arg: _DataType = ...) -> Hash: ...
def sha384(arg: _DataType = ...) -> Hash: ...
def sha512(arg: _DataType = ...) -> Hash: ...
def new(name: str, data: bytes = ...) -> Hash: ...
def new(name: str, data: _DataType = ...) -> Hash: ...
# New in version 3.2
algorithms_guaranteed = ... # type: AbstractSet[str]
algorithms_available = ... # type: AbstractSet[str]
# New in version 3.4
# TODO The documentation says "password and salt are interpreted as buffers of
# bytes", should we declare something other than bytes here?
def pbkdf2_hmac(name: str, password: bytes, salt: bytes, rounds: int, dklen: int = ...) -> bytes: ...
def pbkdf2_hmac(name: str, password: _DataType, salt: _DataType, rounds: int, dklen: int = ...) -> bytes: ...
@@ -9,60 +9,60 @@ if sys.version_info >= (3, 5):
self.phrase = ... # type: str
self.description = ... # type: str
CONTINUE = ... # type: object
SWITCHING_PROTOCOLS = ... # type: object
PROCESSING = ... # type: object
OK = ... # type: object
CREATED = ... # type: object
ACCEPTED = ... # type: object
NON_AUTHORITATIVE_INFORMATION = ... # type: object
NO_CONTENT = ... # type: object
RESET_CONTENT = ... # type: object
PARTIAL_CONTENT = ... # type: object
MULTI_STATUS = ... # type: object
ALREADY_REPORTED = ... # type: object
IM_USED = ... # type: object
MULTIPLE_CHOICES = ... # type: object
MOVED_PERMANENTLY = ... # type: object
FOUND = ... # type: object
SEE_OTHER = ... # type: object
NOT_MODIFIED = ... # type: object
USE_PROXY = ... # type: object
TEMPORARY_REDIRECT = ... # type: object
PERMANENT_REDIRECT = ... # type: object
BAD_REQUEST = ... # type: object
UNAUTHORIZED = ... # type: object
PAYMENT_REQUIRED = ... # type: object
FORBIDDEN = ... # type: object
NOT_FOUND = ... # type: object
METHOD_NOT_ALLOWED = ... # type: object
NOT_ACCEPTABLE = ... # type: object
PROXY_AUTHENTICATION_REQUIRED = ... # type: object
REQUEST_TIMEOUT = ... # type: object
CONFLICT = ... # type: object
GONE = ... # type: object
LENGTH_REQUIRED = ... # type: object
PRECONDITION_FAILED = ... # type: object
REQUEST_ENTITY_TOO_LARGE = ... # type: object
REQUEST_URI_TOO_LONG = ... # type: object
UNSUPPORTED_MEDIA_TYPE = ... # type: object
REQUESTED_RANGE_NOT_SATISFIABLE = ... # type: object
EXPECTATION_FAILED = ... # type: object
UNPROCESSABLE_ENTITY = ... # type: object
LOCKED = ... # type: object
FAILED_DEPENDENCY = ... # type: object
UPGRADE_REQUIRED = ... # type: object
PRECONDITION_REQUIRED = ... # type: object
TOO_MANY_REQUESTS = ... # type: object
REQUEST_HEADER_FIELDS_TOO_LARGE = ... # type: object
INTERNAL_SERVER_ERROR = ... # type: object
NOT_IMPLEMENTED = ... # type: object
BAD_GATEWAY = ... # type: object
SERVICE_UNAVAILABLE = ... # type: object
GATEWAY_TIMEOUT = ... # type: object
HTTP_VERSION_NOT_SUPPORTED = ... # type: object
VARIANT_ALSO_NEGOTIATES = ... # type: object
INSUFFICIENT_STORAGE = ... # type: object
LOOP_DETECTED = ... # type: object
NOT_EXTENDED = ... # type: object
NETWORK_AUTHENTICATION_REQUIRED = ... # type: object
CONTINUE = ... # type: HTTPStatus
SWITCHING_PROTOCOLS = ... # type: HTTPStatus
PROCESSING = ... # type: HTTPStatus
OK = ... # type: HTTPStatus
CREATED = ... # type: HTTPStatus
ACCEPTED = ... # type: HTTPStatus
NON_AUTHORITATIVE_INFORMATION = ... # type: HTTPStatus
NO_CONTENT = ... # type: HTTPStatus
RESET_CONTENT = ... # type: HTTPStatus
PARTIAL_CONTENT = ... # type: HTTPStatus
MULTI_STATUS = ... # type: HTTPStatus
ALREADY_REPORTED = ... # type: HTTPStatus
IM_USED = ... # type: HTTPStatus
MULTIPLE_CHOICES = ... # type: HTTPStatus
MOVED_PERMANENTLY = ... # type: HTTPStatus
FOUND = ... # type: HTTPStatus
SEE_OTHER = ... # type: HTTPStatus
NOT_MODIFIED = ... # type: HTTPStatus
USE_PROXY = ... # type: HTTPStatus
TEMPORARY_REDIRECT = ... # type: HTTPStatus
PERMANENT_REDIRECT = ... # type: HTTPStatus
BAD_REQUEST = ... # type: HTTPStatus
UNAUTHORIZED = ... # type: HTTPStatus
PAYMENT_REQUIRED = ... # type: HTTPStatus
FORBIDDEN = ... # type: HTTPStatus
NOT_FOUND = ... # type: HTTPStatus
METHOD_NOT_ALLOWED = ... # type: HTTPStatus
NOT_ACCEPTABLE = ... # type: HTTPStatus
PROXY_AUTHENTICATION_REQUIRED = ... # type: HTTPStatus
REQUEST_TIMEOUT = ... # type: HTTPStatus
CONFLICT = ... # type: HTTPStatus
GONE = ... # type: HTTPStatus
LENGTH_REQUIRED = ... # type: HTTPStatus
PRECONDITION_FAILED = ... # type: HTTPStatus
REQUEST_ENTITY_TOO_LARGE = ... # type: HTTPStatus
REQUEST_URI_TOO_LONG = ... # type: HTTPStatus
UNSUPPORTED_MEDIA_TYPE = ... # type: HTTPStatus
REQUESTED_RANGE_NOT_SATISFIABLE = ... # type: HTTPStatus
EXPECTATION_FAILED = ... # type: HTTPStatus
UNPROCESSABLE_ENTITY = ... # type: HTTPStatus
LOCKED = ... # type: HTTPStatus
FAILED_DEPENDENCY = ... # type: HTTPStatus
UPGRADE_REQUIRED = ... # type: HTTPStatus
PRECONDITION_REQUIRED = ... # type: HTTPStatus
TOO_MANY_REQUESTS = ... # type: HTTPStatus
REQUEST_HEADER_FIELDS_TOO_LARGE = ... # type: HTTPStatus
INTERNAL_SERVER_ERROR = ... # type: HTTPStatus
NOT_IMPLEMENTED = ... # type: HTTPStatus
BAD_GATEWAY = ... # type: HTTPStatus
SERVICE_UNAVAILABLE = ... # type: HTTPStatus
GATEWAY_TIMEOUT = ... # type: HTTPStatus
HTTP_VERSION_NOT_SUPPORTED = ... # type: HTTPStatus
VARIANT_ALSO_NEGOTIATES = ... # type: HTTPStatus
INSUFFICIENT_STORAGE = ... # type: HTTPStatus
LOOP_DETECTED = ... # type: HTTPStatus
NOT_EXTENDED = ... # type: HTTPStatus
NETWORK_AUTHENTICATION_REQUIRED = ... # type: HTTPStatus
@@ -17,7 +17,7 @@ def repeat(object: _T) -> Iterator[_T]: ...
@overload
def repeat(object: _T, times: int) -> Iterator[_T]: ...
def accumulate(iterable: Iterable[_T]) -> Iterator[_T]: ...
def accumulate(iterable: Iterable[_T], func: Callable[[_T, _T], _T] = ...) -> Iterator[_T]: ...
class chain(Iterator[_T], Generic[_T]):
def __init__(self, *iterables: Iterable[_T]) -> None: ...
+54 -11
View File
@@ -7,25 +7,67 @@ import sys
# sometimes they only work partially (broken exception messages), and the test
# cases don't use them.
from typing import List, Iterable, Callable, Any, Tuple, Sequence, IO, AnyStr, Optional
from typing import (
List, Iterable, Callable, Any, Tuple, Sequence, NamedTuple, IO,
AnyStr, Optional
)
def copyfileobj(fsrc: IO[AnyStr], fdst: IO[AnyStr],
length: int = ...) -> None: ...
def copyfile(src: str, dst: str) -> None: ...
def copymode(src: str, dst: str) -> None: ...
def copystat(src: str, dst: str) -> None: ...
def copy(src: str, dst: str) -> None: ...
def copy2(src: str, dst: str) -> None: ...
if sys.version_info >= (3, 3):
def copymode(src: str, dst: str, *,
follow_symlinks: bool = ...) -> None: ...
def copystat(src: str, dst: str, *,
follow_symlinks: bool = ...) -> None: ...
def copy(src: str, dst: str, *,
follow_symlinks: bool = ...) -> None: ...
def copy2(src: str, dst: str, *,
follow_symlinks: bool = ...) -> None: ...
else:
def copymode(src: str, dst: str) -> None: ...
def copystat(src: str, dst: str) -> None: ...
def copy(src: str, dst: str) -> None: ...
def copy2(src: str, dst: str) -> None: ...
def ignore_patterns(*patterns: str) -> Callable[[str, List[str]],
Iterable[str]]: ...
def copytree(src: str, dst: str, symlinks: bool = ...,
ignore: Optional[Callable[[str, List[str]], Iterable[str]]] = ...,
copy_function: Callable[[str, str], None] = ...,
ignore_dangling_symlinks: bool = ...) -> None: ...
if sys.version_info >= (3, 3):
def copytree(src: str, dst: str, symlinks: bool = ...,
ignore: Optional[Callable[[str, List[str]],
Iterable[str]]] = ...,
copy_function: Callable[[str, str], None] = ...,
ignore_dangling_symlinks: bool = ...) -> str: ...
else:
def copytree(src: str, dst: str, symlinks: bool = ...,
ignore: Optional[Callable[[str, List[str]],
Iterable[str]]] = ...,
copy_function: Callable[[str, str], None] = ...,
ignore_dangling_symlinks: bool = ...) -> None: ...
def rmtree(path: str, ignore_errors: bool = ...,
onerror: Callable[[Any, str, Any], None] = ...) -> None: ...
def move(src: str, dst: str) -> None: ...
if sys.version_info >= (3, 5):
def move(src: str, dst: str,
copy_function: Callable[[str, str], None] = ...) -> str: ...
elif sys.version_info >= (3, 3):
def move(src: str, dst: str) -> str: ...
else:
def move(src: str, dst: str) -> None: ...
if sys.version_info >= (3, 3):
_ntuple_diskusage = NamedTuple('usage', [('total', int),
('used', int),
('free', int)])
def disk_usage(path: str) -> _ntuple_diskusage: ...
def chown(path: str, user: Optional[str] = ...,
group: Optional[str] = ...) -> None: ...
def which(cmd: str, mode: int = ...,
path: Optional[str] = ...) -> Optional[str]: ...
class Error(Exception): ...
if sys.version_info >= (3, 4):
@@ -48,4 +90,5 @@ def register_unpack_format(name: str, extensions: List[str], function: Any,
def unregister_unpack_format(name: str) -> None: ...
def get_unpack_formats() -> List[Tuple[str, List[str], str]]: ...
def which(cmd: str, mode: int = ..., path: str = ...) -> Optional[str]: ...
if sys.version_info >= (3, 3):
def get_terminal_size(fallback: Tuple[int, int] = ...) -> Tuple[int, int]: ...
+2 -2
View File
@@ -357,5 +357,5 @@ def inet_aton(ip_string: str) -> bytes: ... # ret val 4 bytes in length
def inet_ntoa(packed_ip: bytes) -> str: ...
def inet_pton(address_family: int, ip_string: str) -> bytes: ...
def inet_ntop(address_family: int, packed_ip: bytes) -> str: ...
def getdefaulttimeout() -> Union[float, None]: ...
def setdefaulttimeout(timeout: float) -> None: ...
def getdefaulttimeout() -> Optional[float]: ...
def setdefaulttimeout(timeout: Optional[float]) -> None: ...
+1 -1
View File
@@ -229,7 +229,7 @@ class SSLContext:
def wrap_socket(self, sock: socket.socket, server_side: bool = ...,
do_handshake_on_connect: bool = ...,
suppress_ragged_eofs: bool = ...,
server_hostname: Optional[str] = ...) -> 'SSLContext': ...
server_hostname: Optional[str] = ...) -> SSLSocket: ...
if sys.version_info >= (3, 5):
def wrap_bio(self, incoming: 'MemoryBIO', outgoing: 'MemoryBIO',
server_side: bool = ...,
+5
View File
@@ -7,6 +7,7 @@ from typing import (
List, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, Union,
TypeVar, Callable, Type,
)
import sys
from types import TracebackType
from mypy_extensions import NoReturn
@@ -146,6 +147,10 @@ def getprofile() -> Any: ... # TODO return type
def gettrace() -> Any: ... # TODO return
def getwindowsversion() -> Any: ... # Windows only, TODO return type
def intern(string: str) -> str: ...
if sys.version_info >= (3, 5):
def is_finalizing() -> bool: ...
def setcheckinterval(interval: int) -> None: ... # deprecated
def setdlopenflags(n: int) -> None: ... # Linux only
def setprofile(profilefunc: Any) -> None: ... # TODO type
@@ -24,6 +24,7 @@ class FunctionType:
__closure__ = ... # type: Optional[Tuple[_Cell, ...]]
__code__ = ... # type: CodeType
__defaults__ = ... # type: Optional[Tuple[Any, ...]]
__dict__ = ... # type: Dict[str, Any]
__globals__ = ... # type: Dict[str, Any]
__name__ = ... # type: str
__annotations__ = ... # type: Dict[str, Any]
+11 -16
View File
@@ -2,7 +2,6 @@
import sys
from abc import abstractmethod, ABCMeta
from types import CodeType, FrameType
# Definitions of special type checking related constructs. Their definition
# are not used, so their value does not matter.
@@ -33,6 +32,10 @@ List = TypeAlias(object)
Dict = TypeAlias(object)
DefaultDict = TypeAlias(object)
Set = TypeAlias(object)
Counter = TypeAlias(object)
Deque = TypeAlias(object)
if sys.version_info >= (3, 3):
ChainMap = TypeAlias(object)
# Predefined type variables.
AnyStr = TypeVar('AnyStr', str, bytes)
@@ -116,11 +119,6 @@ class Generator(Iterator[_T_co], Generic[_T_co, _T_contra, _V_co]):
@abstractmethod
def __iter__(self) -> 'Generator[_T_co, _T_contra, _V_co]': ...
gi_code = ... # type: CodeType
gi_frame = ... # type: FrameType
gi_running = ... # type: bool
gi_yieldfrom = ... # type: Optional[Generator]
# TODO: Several types should only be defined if sys.python_version >= (3, 5):
# Awaitable, AsyncIterator, AsyncIterable, Coroutine, Collection, ContextManager.
# See https: //github.com/python/typeshed/issues/655 for why this is not easy.
@@ -176,11 +174,6 @@ if sys.version_info >= (3, 6):
@abstractmethod
def __aiter__(self) -> 'AsyncGenerator[_T_co, _T_contra]': ...
ag_await = ... # type: Any
ag_code = ... # type: CodeType
ag_frame = ... # type: FrameType
ag_running = ... # type: bool
class Container(Generic[_T_co]):
@abstractmethod
def __contains__(self, x: object) -> bool: ...
@@ -343,7 +336,7 @@ class IO(Iterator[AnyStr], Generic[AnyStr]):
@abstractmethod
def readline(self, limit: int = ...) -> AnyStr: ...
@abstractmethod
def readlines(self, hint: int = ...) -> List[AnyStr]: ...
def readlines(self, hint: int = ...) -> list[AnyStr]: ...
@abstractmethod
def seek(self, offset: int, whence: int = ...) -> int: ...
@abstractmethod
@@ -428,10 +421,12 @@ class Match(Generic[AnyStr]):
*groups: str) -> Sequence[AnyStr]: ...
def groups(self, default: AnyStr = ...) -> Sequence[AnyStr]: ...
def groupdict(self, default: AnyStr = ...) -> Dict[str, AnyStr]: ...
def groupdict(self, default: AnyStr = ...) -> dict[str, AnyStr]: ...
def start(self, group: Union[int, str] = ...) -> int: ...
def end(self, group: Union[int, str] = ...) -> int: ...
def span(self, group: Union[int, str] = ...) -> Tuple[int, int]: ...
if sys.version_info >= (3, 6):
def __getitem__(self, g: Union[int, str]) -> AnyStr: ...
class Pattern(Generic[AnyStr]):
flags = 0
@@ -446,9 +441,9 @@ class Pattern(Generic[AnyStr]):
# New in Python 3.4
def fullmatch(self, string: AnyStr, pos: int = ...,
endpos: int = ...) -> Optional[Match[AnyStr]]: ...
def split(self, string: AnyStr, maxsplit: int = ...) -> List[AnyStr]: ...
def split(self, string: AnyStr, maxsplit: int = ...) -> list[AnyStr]: ...
def findall(self, string: AnyStr, pos: int = ...,
endpos: int = ...) -> List[Any]: ...
endpos: int = ...) -> list[Any]: ...
def finditer(self, string: AnyStr, pos: int = ...,
endpos: int = ...) -> Iterator[Match[AnyStr]]: ...
@@ -468,7 +463,7 @@ class Pattern(Generic[AnyStr]):
# Functions
def get_type_hints(obj: Callable) -> Dict[str, Any]: ...
def get_type_hints(obj: Callable) -> dict[str, Any]: ...
def cast(tp: Type[_T], obj: Any) -> _T: ...
@@ -1,5 +1,6 @@
# Stubs for urllib.parse
from typing import Any, List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union, NamedTuple
from typing import Any, List, Dict, Tuple, AnyStr, Generic, overload, Sequence, Mapping, Union, NamedTuple, Callable
import sys
__all__ = (
'urlparse',
@@ -123,11 +124,19 @@ def urldefrag(url: str) -> DefragResult: ...
@overload
def urldefrag(url: bytes) -> DefragResultBytes: ...
def urlencode(query: Union[Mapping[Any, Any],
Mapping[Any, Sequence[Any]],
Sequence[Tuple[Any, Any]],
Sequence[Tuple[Any, Sequence[Any]]]],
doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ...
if sys.version_info >= (3, 5):
def urlencode(query: Union[Mapping[Any, Any],
Mapping[Any, Sequence[Any]],
Sequence[Tuple[Any, Any]],
Sequence[Tuple[Any, Sequence[Any]]]],
doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...,
quote_via: Callable[[str, AnyStr, str, str], str] = ...) -> str: ...
else:
def urlencode(query: Union[Mapping[Any, Any],
Mapping[Any, Sequence[Any]],
Sequence[Tuple[Any, Any]],
Sequence[Tuple[Any, Sequence[Any]]]],
doseq: bool = ..., safe: AnyStr = ..., encoding: str = ..., errors: str = ...) -> str: ...
def urljoin(base: AnyStr, url: AnyStr, allow_fragments: bool = ...) -> AnyStr: ...
@@ -30,6 +30,7 @@ def url2pathname(path: str) -> str: ...
def pathname2url(path: str) -> str: ...
def getproxies() -> Dict[str, str]: ...
def parse_http_list(s: str) -> List[str]: ...
def parse_keqv_list(l: List[str]) -> Dict[str, str]: ...
class Request:
if sys.version_info >= (3, 4):
@@ -1,19 +0,0 @@
# Stubs for xml.etree.ElementInclude (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Union, Optional, Callable
from .ElementTree import _ElementInterface
XINCLUDE = ... # type: str
XINCLUDE_INCLUDE = ... # type: str
XINCLUDE_FALLBACK = ... # type: str
class FatalIncludeError(SyntaxError): ...
def default_loader(href: Union[str, bytes, int], parse: str, encoding: Optional[str]=...) -> Union[str, _ElementInterface]: ...
# TODO: loader is of type default_loader ie it takes a callable that has the
# same signature as default_loader. But default_loader has a keyword argument
# Which can't be represented using Callable...
def include(elem: _ElementInterface, loader: Callable[..., Union[str, _ElementInterface]]=...) -> None: ...
@@ -1,25 +0,0 @@
# Stubs for xml.etree.ElementPath (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Tuple, List, Union, TypeVar, Callable, Optional
from .ElementTree import _ElementInterface
xpath_tokenizer_re = ... # type: Callable[..., List[Tuple[str, str]]]
class xpath_descendant_or_self: ...
_T = TypeVar('_T')
class Path:
def __init__(self, path: str) -> None: ...
def find(self, element: _ElementInterface) -> Optional[_ElementInterface]: ...
def findtext(self, element: _ElementInterface, default: _T=...) -> Union[str, _T]: ...
def findall(self, element: _ElementInterface) -> List[_ElementInterface]: ...
def find(element: _ElementInterface, path: str) -> Optional[_ElementInterface]: ...
def findtext(element: _ElementInterface, path: str, default: _T=...) -> Union[str, _T]: ...
def findall(element: _ElementInterface, path: str) -> List[_ElementInterface]: ...
@@ -1,98 +0,0 @@
# Stubs for xml.etree.ElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, AnyStr, Union, IO, Callable, Dict, List, Tuple, Sequence, Iterator, TypeVar, Optional, KeysView, ItemsView, Generator
import io
VERSION = ... # type: str
_Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class _ElementInterface(Sequence['_ElementInterface']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]
tail = ... # type: Optional[_str_or_bytes]
def __init__(self, tag: Union[AnyStr, Callable[..., '_ElementInterface']], attrib: Dict[AnyStr, AnyStr]) -> None: ...
def makeelement(self, tag: _Ss, attrib: Dict[_Ss, _Ss]) -> '_ElementInterface': ...
def __len__(self) -> int: ...
def __getitem__(self, index: int) -> '_ElementInterface': ...
def __setitem__(self, index: int, element: '_ElementInterface') -> None: ...
def __delitem__(self, index: int) -> None: ...
def __getslice__(self, start: int, stop: int) -> Sequence['_ElementInterface']: ...
def __setslice__(self, start: int, stop: int, elements: Sequence['_ElementInterface']) -> None: ...
def __delslice__(self, start: int, stop: int) -> None: ...
def append(self, element: '_ElementInterface') -> None: ...
def insert(self, index: int, element: '_ElementInterface') -> None: ...
def remove(self, element: '_ElementInterface') -> None: ...
def getchildren(self) -> List['_ElementInterface']: ...
def find(self, path: str) -> Optional['_ElementInterface']: ...
def findtext(self, path: str, default: _T=...) -> Union[str, _T]: ...
def findall(self, path: str) -> List['_ElementInterface']: ...
def clear(self) -> None: ...
def get(self, key: AnyStr, default: _T=...) -> Union[AnyStr, _T]: ...
def set(self, key: AnyStr, value: AnyStr) -> None: ...
def keys(self) -> KeysView[AnyStr]: ...
def items(self) -> ItemsView[AnyStr, AnyStr]: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List['_ElementInterface']: ...
def Element(tag: Union[AnyStr, Callable[..., _ElementInterface]], attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> _ElementInterface: ...
def SubElement(parent: _ElementInterface, tag: AnyStr, attrib: Dict[AnyStr, AnyStr]=..., **extra: AnyStr) -> _ElementInterface: ...
def Comment(text: _str_or_bytes=...) -> _ElementInterface: ...
def ProcessingInstruction(target: str, text: str=...) -> _ElementInterface: ...
PI = ... # type: Callable[..., _ElementInterface]
class QName:
text = ... # type: str
def __init__(self, text_or_uri: str, tag: str=...) -> None: ...
_file_or_filename = Union[str, bytes, int, IO[Any]]
class ElementTree:
def __init__(self, element: _ElementInterface=..., file: _file_or_filename=...) -> None: ...
def getroot(self) -> _ElementInterface: ...
def parse(self, source: _file_or_filename, parser: 'XMLTreeBuilder'=...) -> _ElementInterface: ...
def getiterator(self, tag: Union[str, AnyStr]=...) -> List[_ElementInterface]: ...
def find(self, path: str) -> Optional[_ElementInterface]: ...
def findtext(self, path: str, default: _T=...) -> Union[_T, str]: ...
def findall(self, path: str) -> List[_ElementInterface]: ...
def write(self, file_or_filename: _file_or_filename, encoding: str=...) -> None: ...
def iselement(element: _ElementInterface) -> bool: ...
def dump(elem: _ElementInterface) -> None: ...
def fixtag(tag: Union[str, QName], namespaces: Dict[str, str]) -> Tuple[str, Optional[str]]: ...
def parse(source: _file_or_filename, parser: 'XMLTreeBuilder'=...) -> ElementTree: ...
class iterparse:
def __init__(self, source: _file_or_filename, events: Sequence[str]=...) -> None: ...
# TODO-figure out this type...
def __next__(self) -> Tuple[str, _ElementInterface]: ...
def XML(text: AnyStr) -> _ElementInterface: ...
def XMLID(text: AnyStr) -> Tuple[_ElementInterface, Dict[str, _ElementInterface]]: ...
# TODO-improve this type
fromstring = ... # type: Callable[..., _ElementInterface]
def tostring(element: _ElementInterface, encoding: str=...) -> AnyStr: ...
class TreeBuilder:
def __init__(self, element_factory: Callable[[AnyStr, Dict[AnyStr, AnyStr]], _ElementInterface]=...) -> None: ...
def close(self) -> _ElementInterface: ...
def data(self, data: AnyStr) -> None: ...
def start(self, tag: AnyStr, attrs: Dict[AnyStr, AnyStr]) -> _ElementInterface: ...
def end(self, tag: AnyStr) -> _ElementInterface: ...
class XMLTreeBuilder:
# TODO-what is entity used for???
entity = ... # type: Any
def __init__(self, html: int=..., target: TreeBuilder=...) -> None: ...
def doctype(self, name: str, pubid: str, system: str) -> None: ...
def close(self) -> Any: ... # TODO-most of the time, this will be Element, but it can be anything target.close() returns
def feed(self, data: AnyStr)-> None: ...
@@ -1,5 +0,0 @@
# Stubs for xml.etree.cElementTree (Python 3.4)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from xml.etree.ElementTree import * # noqa: F403
@@ -8,12 +8,12 @@ class Future(Generic[_T]):
def running(self) -> bool: ...
def done(self) -> bool: ...
def result(self, timeout: float = ...) -> _T: ...
def exception(self, timeout: float = ...) -> Exception: ...
def exception(self, timeout: float = ...) -> BaseException: ...
def add_done_callback(self, fn: Callable[[Future], Any]) -> None: ...
def set_running_or_notify_cancel(self) -> None: ...
def set_result(self, result: _T) -> None: ...
def set_exception(self, exception: Exception) -> None: ...
def set_exception(self, exception: BaseException) -> None: ...
class Executor:
def submit(self, fn: Callable[..., _T], *args: Any, **kwargs: Any) -> Future[_T]: ...
@@ -1,4 +1,4 @@
from typing import Any, Optional, Union
from typing import Any, List, Optional, Union
from datetime import date, datetime, timedelta
__all__ = ... # type: List[str]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional, Union, IO, Tuple
from typing import Any, IO, List, Optional, Tuple, Union
import datetime
from ._common import tzname_in_python2 as tzname_in_python2, _tzinfo as _tzinfo
from ._common import tzrangebase as tzrangebase, enfold as enfold
+7 -7
View File
@@ -4,18 +4,18 @@ from typing import Union, Optional, Iterable, Mapping, Tuple
from .models import Response
ParamsMappingValueType = Union[str, unicode, int, float, Iterable[Union[str, unicode, int, float]]]
_ParamsMappingValueType = Union[str, unicode, int, float, Iterable[Union[str, unicode, int, float]]]
def request(method: str, url: str, **kwargs) -> Response: ...
def get(url: Union[str, unicode],
params: Optional[
Union[Mapping[Union[str, unicode, int, float], ParamsMappingValueType],
Union[Mapping[Union[str, unicode, int, float], _ParamsMappingValueType],
Union[str, unicode],
Tuple[Union[str, unicode, int, float], ParamsMappingValueType],
Mapping[str, ParamsMappingValueType],
Mapping[unicode, ParamsMappingValueType],
Mapping[int, ParamsMappingValueType],
Mapping[float, ParamsMappingValueType]]] = None,
Tuple[Union[str, unicode, int, float], _ParamsMappingValueType],
Mapping[str, _ParamsMappingValueType],
Mapping[unicode, _ParamsMappingValueType],
Mapping[int, _ParamsMappingValueType],
Mapping[float, _ParamsMappingValueType]]] = None,
**kwargs) -> Response: ...
def options(url: Union[str, unicode], **kwargs) -> Response: ...
def head(url: Union[str, unicode], **kwargs) -> Response: ...
+1 -1
View File
@@ -27,7 +27,7 @@ PY2 = True
PY3 = False
PY34 = False
string_types = basestring,
string_types = (str, unicode)
integer_types = (int, long)
class_types = (type, types.ClassType)
text_type = unicode
@@ -6,7 +6,7 @@ from .bucketlistresultset import BucketListResultSet
from .connection import S3Connection
from .key import Key
from typing import Any, Dict, Optional, Text, Type
from typing import Any, Dict, Optional, Text, Type, List
class S3WebsiteEndpointTranslate:
trans_region = ... # type: Dict[str, str]
+23 -10
View File
@@ -1,7 +1,7 @@
# Stubs for pytz (Python 3.5)
import datetime as dt
from typing import Optional, List, Set, Dict # NOQA
import datetime
from typing import Optional, List, Set, Dict, Union
all_timezones = ... # type: List
all_timezones_set = ... # type: Set
@@ -11,16 +11,29 @@ country_timezones = ... # type: Dict
country_names = ... # type: Dict
class _UTCclass(dt.tzinfo):
class _UTCclass(datetime.tzinfo):
zone = ... # type: str
def fromutc(self, dt: dt.datetime) -> dt.datetime: ...
def utcoffset(self, dt: Optional[dt.datetime]) -> dt.timedelta: ... # type: ignore
def tzname(self, dt: Optional[dt.datetime]) -> str: ...
def dst(self, dt: Optional[dt.datetime]) -> dt.timedelta: ... # type: ignore
def localize(self, dt: dt.datetime, is_dst: bool=...) -> dt.datetime: ...
def normalize(self, dt: dt.datetime, is_dst: bool=...) -> dt.datetime: ...
def fromutc(self, dt: datetime.datetime) -> datetime.datetime: ...
def utcoffset(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ... # type: ignore
def tzname(self, dt: Optional[datetime.datetime]) -> str: ...
def dst(self, dt: Optional[datetime.datetime]) -> datetime.timedelta: ... # type: ignore
def localize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ...
def normalize(self, dt: datetime.datetime, is_dst: bool = ...) -> datetime.datetime: ...
utc = ... # type: _UTCclass
UTC = ... # type: _UTCclass
def timezone(zone: str) -> dt.tzinfo: ...
class _BaseTzInfo(datetime.tzinfo):
zone = ... # type: str
def fromutc(self, dt: datetime.datetime) -> datetime.datetime: ...
def localize(self, dt: datetime.datetime, is_dst: Optional[bool] = ...) -> datetime.datetime: ...
def normalize(self, dt: datetime.datetime) -> datetime.datetime: ...
class _StaticTzInfo(_BaseTzInfo):
def normalize(self, dt: datetime.datetime, is_dst: Optional[bool] = ...) -> datetime.datetime: ...
def timezone(zone: str) -> _BaseTzInfo: ...
@@ -1,4 +1,4 @@
from typing import Any, AnyStr
from typing import Any, AnyStr, Set
from .base import SchemaEventTarget, DialectKWArgs
from .base import ColumnCollection
+1 -1
View File
@@ -1,4 +1,4 @@
from typing import List, Tuple, Optional, Callable, Union, IO, Any
from typing import List, Tuple, Optional, Callable, Union, IO, Any, Dict
from datetime import datetime
__all__ = ... # type: List[str]
@@ -1,4 +1,4 @@
from typing import Optional, overload, Union
from typing import Optional, overload, Union, List
from datetime import date, datetime, timedelta
__all__ = ... # type: List[str]
+1 -1
View File
@@ -2,7 +2,7 @@
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any, Optional, Union, IO, Tuple
from typing import Any, Optional, Union, IO, Tuple, List
import datetime
from ._common import tzname_in_python2 as tzname_in_python2, _tzinfo as _tzinfo
from ._common import tzrangebase as tzrangebase, enfold as enfold
+7 -7
View File
@@ -4,19 +4,19 @@ from typing import Optional, Union, Any, Iterable, Mapping, Tuple
from .models import Response
ParamsMappingValueType = Union[str, bytes, int, float, Iterable[Union[str, bytes, int, float]]]
_ParamsMappingValueType = Union[str, bytes, int, float, Iterable[Union[str, bytes, int, float]]]
def request(method: str, url: str, **kwargs) -> Response: ...
def get(url: Union[str, bytes],
params: Optional[
Union[
Mapping[Union[str, bytes, int, float], ParamsMappingValueType],
Mapping[Union[str, bytes, int, float], _ParamsMappingValueType],
Union[str, bytes],
Tuple[Union[str, bytes, int, float], ParamsMappingValueType],
Mapping[str, ParamsMappingValueType],
Mapping[bytes, ParamsMappingValueType],
Mapping[int, ParamsMappingValueType],
Mapping[float, ParamsMappingValueType]]]=None,
Tuple[Union[str, bytes, int, float], _ParamsMappingValueType],
Mapping[str, _ParamsMappingValueType],
Mapping[bytes, _ParamsMappingValueType],
Mapping[int, _ParamsMappingValueType],
Mapping[float, _ParamsMappingValueType]]]=None,
**kwargs) -> Response: ...
def options(url: str, **kwargs) -> Response: ...
def head(url: str, **kwargs) -> Response: ...
@@ -1,2 +1,2 @@
# This module is a fork of the CPython 2.7 and 3.5 ast modules with PEP 484 support.
# See: https://github.com/dropbox/typed_ast
# This module is a fork of the CPython 2 and 3 ast modules with PEP 484 support.
# See: https://github.com/python/typed_ast
@@ -8,7 +8,10 @@ class NodeVisitor():
class NodeTransformer(NodeVisitor):
def generic_visit(self, node: AST) -> None: ...
def parse(source: Union[str, bytes], filename: Union[str, bytes] = ..., mode: str = ...) -> AST: ...
def parse(source: Union[str, bytes],
filename: Union[str, bytes] = ...,
mode: str = ...,
feature_version: int = ...) -> AST: ...
def copy_location(new_node: AST, old_node: AST) -> AST: ...
def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
def fix_missing_locations(node: AST) -> AST: ...
@@ -86,15 +89,20 @@ class Delete(stmt):
class Assign(stmt):
targets = ... # type: typing.List[expr]
value = ... # type: Optional[expr]
value = ... # type: expr
type_comment = ... # type: Optional[str]
annotation = ... # type: Optional[expr]
class AugAssign(stmt):
target = ... # type: expr
op = ... # type: operator
value = ... # type: expr
class AnnAssign(stmt):
target = ... # type: expr
annotation = ... # type: expr
value = ... # type: Optional[expr]
simple = ... # type: int
class For(stmt):
target = ... # type: expr
iter = ... # type: expr
@@ -107,6 +115,7 @@ class AsyncFor(stmt):
iter = ... # type: expr
body = ... # type: typing.List[stmt]
orelse = ... # type: typing.List[stmt]
type_comment = ... # type: Optional[str]
class While(stmt):
test = ... # type: expr
@@ -126,6 +135,7 @@ class With(stmt):
class AsyncWith(stmt):
items = ... # type: typing.List[withitem]
body = ... # type: typing.List[stmt]
type_comment = ... # type: Optional[str]
class Raise(stmt):
exc = ... # type: Optional[expr]
@@ -255,6 +265,14 @@ class Num(expr):
class Str(expr):
s = ... # type: str
class FormattedValue(expr):
value = ... # type: expr
conversion = ... # type: typing.Optional[int]
format_spec = ... # type: typing.Optional[expr]
class JoinedStr(expr):
values = ... # type: typing.List[expr]
class Bytes(expr):
s = ... # type: bytes
@@ -351,6 +369,7 @@ class comprehension(AST):
target = ... # type: expr
iter = ... # type: expr
ifs = ... # type: typing.List[expr]
is_async = ... # type: int
class ExceptHandler(AST):
@@ -374,6 +393,7 @@ class arg(AST):
annotation = ... # type: Optional[expr]
lineno = ... # type: int
col_offset = ... # type: int
type_comment = ... # type: typing.Optional[str]
class keyword(AST):
arg = ... # type: Optional[identifier]
@@ -1,4 +1,4 @@
from . import ast27
from . import ast35
from . import ast3
def py2to3(ast: ast27.AST) -> ast35.AST: ...
def py2to3(ast: ast27.AST) -> ast3.AST: ...