apply black and isort (#4287)

* apply black and isort

* move some type ignores
This commit is contained in:
Jelle Zijlstra
2020-06-28 13:31:00 -07:00
committed by GitHub
parent fe58699ca5
commit 5d553c9584
800 changed files with 13875 additions and 10332 deletions

View File

@@ -1,8 +1,9 @@
"""Stub file for the '_bisect' module."""
from typing import Optional, Sequence, MutableSequence, TypeVar
from typing import MutableSequence, Optional, Sequence, TypeVar
_T = TypeVar("_T")
_T = TypeVar('_T')
def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> int: ...
def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> int: ...
def insort_left(a: MutableSequence[_T], x: _T, lo: int = ..., hi: Optional[int] = ...) -> None: ...

View File

@@ -1,9 +1,8 @@
"""Stub file for the '_codecs' module."""
import sys
from typing import Any, Callable, Tuple, Optional, Dict, Text, Union
import codecs
import sys
from typing import Any, Callable, Dict, Optional, Text, Tuple, Union
# For convenience:
_Handler = Callable[[Exception], Tuple[Text, int]]
@@ -19,6 +18,7 @@ else:
# This type is not exposed; it is defined in unicodeobject.c
class _EncodingMap(object):
def size(self) -> int: ...
_MapT = Union[Dict[int, int], _EncodingMap]
def register(__search_function: Callable[[str], Any]) -> None: ...
@@ -28,11 +28,12 @@ def lookup_error(__name: Union[str, Text]) -> _Handler: ...
def decode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ...
def encode(obj: Any, encoding: Union[str, Text] = ..., errors: _Errors = ...) -> Any: ...
def charmap_build(__map: Text) -> _MapT: ...
def ascii_decode(__data: _Decodable, __errors: _Errors = ...) -> Tuple[Text, int]: ...
def ascii_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
if sys.version_info < (3, 2):
def charbuffer_encode(__data: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def charmap_decode(__data: _Decodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[Text, int]: ...
def charmap_encode(__str: _Encodable, __errors: _Errors = ..., __mapping: Optional[_MapT] = ...) -> Tuple[bytes, int]: ...
def escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[str, int]: ...
@@ -44,21 +45,27 @@ def raw_unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> Tup
def readbuffer_encode(__data: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def unicode_escape_decode(__data: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ...
def unicode_escape_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
if sys.version_info < (3, 8):
def unicode_internal_decode(__obj: _String, __errors: _Errors = ...) -> Tuple[Text, int]: ...
def unicode_internal_encode(__obj: _String, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_16_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_16_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_16_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_16_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ...
def utf_16_ex_decode(__data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ...) -> Tuple[Text, int, int]: ...
def utf_16_ex_decode(
__data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ...
) -> Tuple[Text, int, int]: ...
def utf_16_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_16_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_32_be_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_32_be_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_32_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_32_encode(__str: _Encodable, __errors: _Errors = ..., __byteorder: int = ...) -> Tuple[bytes, int]: ...
def utf_32_ex_decode(__data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ...) -> Tuple[Text, int, int]: ...
def utf_32_ex_decode(
__data: _Decodable, __errors: _Errors = ..., __byteorder: int = ..., __final: int = ...
) -> Tuple[Text, int, int]: ...
def utf_32_le_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_32_le_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
def utf_7_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
@@ -66,7 +73,7 @@ def utf_7_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int
def utf_8_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def utf_8_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
if sys.platform == 'win32':
if sys.platform == "win32":
def mbcs_decode(__data: _Decodable, __errors: _Errors = ..., __final: int = ...) -> Tuple[Text, int]: ...
def mbcs_encode(__str: _Encodable, __errors: _Errors = ...) -> Tuple[bytes, int]: ...
if sys.version_info >= (3, 0):

View File

@@ -1,5 +1,4 @@
import sys
from typing import Any, Iterable, Iterator, List, Optional, Protocol, Sequence, Text, Type, Union
QUOTE_ALL: int
@@ -40,9 +39,9 @@ class _writer:
def writerow(self, row: Sequence[Any]) -> Any: ...
def writerows(self, rows: Iterable[Sequence[Any]]) -> None: ...
class _Writer(Protocol):
def write(self, s: str) -> Any: ...
def writer(csvfile: _Writer, dialect: _DialectLike = ..., **fmtparams: Any) -> _writer: ...
def reader(csvfile: Iterable[Text], dialect: _DialectLike = ..., **fmtparams: Any) -> _reader: ...
def register_dialect(name: str, dialect: Any = ..., **fmtparams: Any) -> None: ...

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, BinaryIO, IO, NamedTuple, Optional, Tuple, Union, overload
from typing import IO, Any, BinaryIO, NamedTuple, Optional, Tuple, Union, overload
_chtype = Union[str, bytes, int]
@@ -283,15 +283,30 @@ def termname() -> bytes: ...
def tigetflag(__capname: str) -> int: ...
def tigetnum(__capname: str) -> int: ...
def tigetstr(__capname: str) -> bytes: ...
def tparm(__str: bytes, __i1: int = ..., __i2: int = ..., __i3: int = ..., __i4: int = ..., __i5: int = ..., __i6: int = ..., __i7: int = ..., __i8: int = ..., __i9: int = ...) -> bytes: ...
def tparm(
__str: bytes,
__i1: int = ...,
__i2: int = ...,
__i3: int = ...,
__i4: int = ...,
__i5: int = ...,
__i6: int = ...,
__i7: int = ...,
__i8: int = ...,
__i9: int = ...,
) -> bytes: ...
def typeahead(__fd: int) -> None: ...
def unctrl(__ch: _chtype) -> bytes: ...
if sys.version_info >= (3, 3):
def unget_wch(__ch: Union[int, str]) -> None: ...
def ungetch(__ch: _chtype) -> None: ...
def ungetmouse(__id: int, __x: int, __y: int, __z: int, __bstate: int) -> None: ...
if sys.version_info >= (3, 5):
def update_lines_cols() -> int: ...
def use_default_colors() -> None: ...
def use_env(__flag: bool) -> None: ...
@@ -317,7 +332,17 @@ class _CursesWindow:
def attrset(self, attr: int) -> None: ...
def bkgd(self, ch: _chtype, attr: int = ...) -> None: ...
def bkgdset(self, ch: _chtype, attr: int = ...) -> None: ...
def border(self, ls: _chtype = ..., rs: _chtype = ..., ts: _chtype = ..., bs: _chtype = ..., tl: _chtype = ..., tr: _chtype = ..., bl: _chtype = ..., br: _chtype = ...) -> None: ...
def border(
self,
ls: _chtype = ...,
rs: _chtype = ...,
ts: _chtype = ...,
bs: _chtype = ...,
tl: _chtype = ...,
tr: _chtype = ...,
bl: _chtype = ...,
br: _chtype = ...,
) -> None: ...
@overload
def box(self) -> None: ...
@overload
@@ -415,11 +440,15 @@ class _CursesWindow:
@overload
def overlay(self, destwin: _CursesWindow) -> None: ...
@overload
def overlay(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ...
def overlay(
self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int
) -> None: ...
@overload
def overwrite(self, destwin: _CursesWindow) -> None: ...
@overload
def overwrite(self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int) -> None: ...
def overwrite(
self, destwin: _CursesWindow, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int
) -> None: ...
def putwin(self, file: IO[Any]) -> None: ...
def redrawln(self, beg: int, num: int) -> None: ...
def redrawwin(self) -> None: ...

View File

@@ -1,20 +1,17 @@
from typing import (
Any, Callable, Iterable, List, Mapping, Optional, Text, Tuple, Type, Union,
TypeVar,
)
from types import FrameType, TracebackType
import sys
from types import FrameType, TracebackType
from typing import Any, Callable, Iterable, List, Mapping, Optional, Text, Tuple, Type, TypeVar, Union
# TODO recursive type
_TF = Callable[[FrameType, str, Any], Optional[Callable[..., Any]]]
_PF = Callable[[FrameType, str, Any], None]
_T = TypeVar('_T')
_T = TypeVar("_T")
__all__: List[str]
def active_count() -> int: ...
if sys.version_info < (3,):
def activeCount() -> int: ...
@@ -41,30 +38,35 @@ if sys.version_info >= (3,):
class ThreadError(Exception): ...
class local(object):
def __getattribute__(self, name: str) -> Any: ...
def __setattr__(self, name: str, value: Any) -> None: ...
def __delattr__(self, name: str) -> None: ...
class Thread:
name: str
ident: Optional[int]
daemon: bool
if sys.version_info >= (3,):
def __init__(self, group: None = ...,
target: Optional[Callable[..., Any]] = ...,
name: Optional[str] = ...,
args: Iterable[Any] = ...,
kwargs: Mapping[str, Any] = ...,
*, daemon: Optional[bool] = ...) -> None: ...
def __init__(
self,
group: None = ...,
target: Optional[Callable[..., Any]] = ...,
name: Optional[str] = ...,
args: Iterable[Any] = ...,
kwargs: Mapping[str, Any] = ...,
*,
daemon: Optional[bool] = ...,
) -> None: ...
else:
def __init__(self, group: None = ...,
target: Optional[Callable[..., Any]] = ...,
name: Optional[Text] = ...,
args: Iterable[Any] = ...,
kwargs: Mapping[Text, Any] = ...) -> None: ...
def __init__(
self,
group: None = ...,
target: Optional[Callable[..., Any]] = ...,
name: Optional[Text] = ...,
args: Iterable[Any] = ...,
kwargs: Mapping[Text, Any] = ...,
) -> None: ...
def start(self) -> None: ...
def run(self) -> None: ...
def join(self, timeout: Optional[float] = ...) -> None: ...
@@ -79,16 +81,14 @@ class Thread:
def isDaemon(self) -> bool: ...
def setDaemon(self, daemonic: bool) -> None: ...
class _DummyThread(Thread): ...
class Lock:
def __init__(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> Optional[bool]: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
@@ -96,29 +96,26 @@ class Lock:
def release(self) -> None: ...
def locked(self) -> bool: ...
class _RLock:
def __init__(self) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> Optional[bool]: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
def acquire(self, blocking: bool = ...) -> bool: ...
def release(self) -> None: ...
RLock = _RLock
class Condition:
def __init__(self, lock: Union[Lock, _RLock, None] = ...) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> Optional[bool]: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
@@ -126,19 +123,17 @@ class Condition:
def release(self) -> None: ...
def wait(self, timeout: Optional[float] = ...) -> bool: ...
if sys.version_info >= (3,):
def wait_for(self, predicate: Callable[[], _T],
timeout: Optional[float] = ...) -> _T: ...
def wait_for(self, predicate: Callable[[], _T], timeout: Optional[float] = ...) -> _T: ...
def notify(self, n: int = ...) -> None: ...
def notify_all(self) -> None: ...
def notifyAll(self) -> None: ...
class Semaphore:
def __init__(self, value: int = ...) -> None: ...
def __enter__(self) -> bool: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> Optional[bool]: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> Optional[bool]: ...
if sys.version_info >= (3,):
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
else:
@@ -150,7 +145,6 @@ class Semaphore:
class BoundedSemaphore(Semaphore): ...
class Event:
def __init__(self) -> None: ...
def is_set(self) -> bool: ...
@@ -162,29 +156,31 @@ class Event:
if sys.version_info >= (3, 8):
from _thread import _ExceptHookArgs as ExceptHookArgs, ExceptHookArgs as _ExceptHookArgs # don't ask
excepthook: Callable[[_ExceptHookArgs], Any]
class Timer(Thread):
if sys.version_info >= (3,):
def __init__(self, interval: float, function: Callable[..., Any],
args: Optional[Iterable[Any]] = ...,
kwargs: Optional[Mapping[str, Any]] = ...) -> None: ...
def __init__(
self,
interval: float,
function: Callable[..., Any],
args: Optional[Iterable[Any]] = ...,
kwargs: Optional[Mapping[str, Any]] = ...,
) -> None: ...
else:
def __init__(self, interval: float, function: Callable[..., Any],
args: Iterable[Any] = ...,
kwargs: Mapping[str, Any] = ...) -> None: ...
def __init__(
self, interval: float, function: Callable[..., Any], args: Iterable[Any] = ..., kwargs: Mapping[str, Any] = ...
) -> None: ...
def cancel(self) -> None: ...
if sys.version_info >= (3,):
class Barrier:
parties: int
n_waiting: int
broken: bool
def __init__(self, parties: int, action: Optional[Callable[[], None]] = ...,
timeout: Optional[float] = ...) -> None: ...
def __init__(self, parties: int, action: Optional[Callable[[], None]] = ..., timeout: Optional[float] = ...) -> None: ...
def wait(self, timeout: Optional[float] = ...) -> int: ...
def reset(self) -> None: ...
def abort(self) -> None: ...
class BrokenBarrierError(RuntimeError): ...

View File

@@ -1,7 +1,7 @@
"""Stub file for the '_heapq' module."""
from typing import TypeVar, List, Iterable, Any, Callable, Optional
import sys
from typing import Any, Callable, Iterable, List, Optional, TypeVar
_T = TypeVar("_T")
@@ -10,6 +10,7 @@ def heappop(__heap: List[_T]) -> _T: ...
def heappush(__heap: List[_T], __item: _T) -> None: ...
def heappushpop(__heap: List[_T], __item: _T) -> _T: ...
def heapreplace(__heap: List[_T], __item: _T) -> _T: ...
if sys.version_info < (3,):
def nlargest(__n: int, __iterable: Iterable[_T], __key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ...
def nsmallest(__n: int, __iterable: Iterable[_T], __key: Optional[Callable[[_T], Any]] = ...) -> List[_T]: ...

View File

@@ -1,49 +1,38 @@
import sys
from typing import List, Optional, Union
if sys.platform == 'win32':
if sys.platform == "win32":
# Actual typename View, not exposed by the implementation
class _View:
def Execute(self, params: Optional[_Record] = ...) -> None: ...
def GetColumnInfo(self, kind: int) -> _Record: ...
def Fetch(self) -> _Record: ...
def Modify(self, mode: int, record: _Record) -> None: ...
def Close(self) -> None: ...
# Don't exist at runtime
__new__: None # type: ignore
__init__: None # type: ignore
# Actual typename Summary, not exposed by the implementation
class _Summary:
def GetProperty(self, propid: int) -> Optional[Union[str, bytes]]: ...
def GetPropertyCount(self) -> int: ...
def SetProperty(self, propid: int, value: Union[str, bytes]) -> None: ...
def Persist(self) -> None: ...
# Don't exist at runtime
__new__: None # type: ignore
__init__: None # type: ignore
# Actual typename Database, not exposed by the implementation
class _Database:
def OpenView(self, sql: str) -> _View: ...
def Commit(self) -> None: ...
def GetSummaryInformation(self, updateCount: int) -> _Summary: ...
def Close(self) -> None: ...
# Don't exist at runtime
__new__: None # type: ignore
__init__: None # type: ignore
# Actual typename Record, not exposed by the implementation
class _Record:
def GetFieldCount(self) -> int: ...
def GetInteger(self, field: int) -> int: ...
def GetString(self, field: int) -> str: ...
@@ -51,11 +40,9 @@ if sys.platform == 'win32':
def SetStream(self, field: int, stream: str) -> None: ...
def SetInteger(self, field: int, int: int) -> None: ...
def ClearData(self) -> None: ...
# Don't exist at runtime
__new__: None # type: ignore
__init__: None # type: ignore
def UuidCreate() -> str: ...
def FCICreate(cabname: str, files: List[str]) -> None: ...
def OpenDatabase(name: str, flags: int) -> _Database: ...

View File

@@ -16,6 +16,7 @@ import array
import mmap
import sys
from typing import Protocol, Text, TypeVar, Union
from typing_extensions import Literal
_T_co = TypeVar("_T_co", covariant=True)
@@ -25,6 +26,7 @@ _T_contra = TypeVar("_T_contra", contravariant=True)
# path can be used instead of a string, starting with Python 3.6.
if sys.version_info >= (3, 6):
from os import PathLike
StrPath = Union[str, PathLike[str]]
BytesPath = Union[bytes, PathLike[bytes]]
AnyPath = Union[str, bytes, PathLike[str], PathLike[bytes]]
@@ -34,26 +36,91 @@ else:
AnyPath = Union[Text, bytes]
OpenTextMode = Literal[
'r', 'r+', '+r', 'rt', 'tr', 'rt+', 'r+t', '+rt', 'tr+', 't+r', '+tr',
'w', 'w+', '+w', 'wt', 'tw', 'wt+', 'w+t', '+wt', 'tw+', 't+w', '+tw',
'a', 'a+', '+a', 'at', 'ta', 'at+', 'a+t', '+at', 'ta+', 't+a', '+ta',
'x', 'x+', '+x', 'xt', 'tx', 'xt+', 'x+t', '+xt', 'tx+', 't+x', '+tx',
'U', 'rU', 'Ur', 'rtU', 'rUt', 'Urt', 'trU', 'tUr', 'Utr',
"r",
"r+",
"+r",
"rt",
"tr",
"rt+",
"r+t",
"+rt",
"tr+",
"t+r",
"+tr",
"w",
"w+",
"+w",
"wt",
"tw",
"wt+",
"w+t",
"+wt",
"tw+",
"t+w",
"+tw",
"a",
"a+",
"+a",
"at",
"ta",
"at+",
"a+t",
"+at",
"ta+",
"t+a",
"+ta",
"x",
"x+",
"+x",
"xt",
"tx",
"xt+",
"x+t",
"+xt",
"tx+",
"t+x",
"+tx",
"U",
"rU",
"Ur",
"rtU",
"rUt",
"Urt",
"trU",
"tUr",
"Utr",
]
OpenBinaryModeUpdating = Literal[
'rb+', 'r+b', '+rb', 'br+', 'b+r', '+br',
'wb+', 'w+b', '+wb', 'bw+', 'b+w', '+bw',
'ab+', 'a+b', '+ab', 'ba+', 'b+a', '+ba',
'xb+', 'x+b', '+xb', 'bx+', 'b+x', '+bx',
"rb+",
"r+b",
"+rb",
"br+",
"b+r",
"+br",
"wb+",
"w+b",
"+wb",
"bw+",
"b+w",
"+bw",
"ab+",
"a+b",
"+ab",
"ba+",
"b+a",
"+ba",
"xb+",
"x+b",
"+xb",
"bx+",
"b+x",
"+bx",
]
OpenBinaryModeWriting = Literal[
'wb', 'bw',
'ab', 'ba',
'xb', 'bx',
"wb", "bw", "ab", "ba", "xb", "bx",
]
OpenBinaryModeReading = Literal[
'rb', 'br',
'rbU', 'rUb', 'Urb', 'brU', 'bUr', 'Ubr',
"rb", "br", "rbU", "rUb", "Urb", "brU", "bUr", "Ubr",
]
OpenBinaryMode = Union[OpenBinaryModeUpdating, OpenBinaryModeReading, OpenBinaryModeWriting]
@@ -65,8 +132,10 @@ FileDescriptorLike = Union[int, HasFileno]
class SupportsRead(Protocol[_T_co]):
def read(self, __length: int = ...) -> _T_co: ...
class SupportsReadline(Protocol[_T_co]):
def readline(self, __length: int = ...) -> _T_co: ...
class SupportsWrite(Protocol[_T_contra]):
def write(self, __s: _T_contra) -> int: ...

View File

@@ -4,10 +4,12 @@
# file. They are provided for type checking purposes.
from sys import _OptExcInfo
from typing import Callable, Dict, Iterable, List, Any, Text, Protocol, Tuple, Optional
from typing import Any, Callable, Dict, Iterable, List, Optional, Protocol, Text, Tuple
class StartResponse(Protocol):
def __call__(self, status: str, headers: List[Tuple[str, str]], exc_info: Optional[_OptExcInfo] = ...) -> Callable[[bytes], Any]: ...
def __call__(
self, status: str, headers: List[Tuple[str, str]], exc_info: Optional[_OptExcInfo] = ...
) -> Callable[[bytes], Any]: ...
WSGIEnvironment = Dict[Text, Any]
WSGIApplication = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]]
@@ -27,6 +29,7 @@ class ErrorStream(Protocol):
class _Readable(Protocol):
def read(self, size: int = ...) -> bytes: ...
# Optional file wrapper in wsgi.file_wrapper
class FileWrapper(Protocol):
def __call__(self, file: _Readable, block_size: int = ...) -> Iterable[bytes]: ...

View File

@@ -12,7 +12,9 @@ filters: List[Tuple[Any, ...]]
if sys.version_info >= (3, 6):
@overload
def warn(message: str, category: Optional[Type[Warning]] = ..., stacklevel: int = ..., source: Optional[Any] = ...) -> None: ...
def warn(
message: str, category: Optional[Type[Warning]] = ..., stacklevel: int = ..., source: Optional[Any] = ...
) -> None: ...
@overload
def warn(message: Warning, category: Any = ..., stacklevel: int = ..., source: Optional[Any] = ...) -> None: ...
@overload
@@ -37,6 +39,7 @@ if sys.version_info >= (3, 6):
module_globals: Optional[Dict[str, Any]] = ...,
source: Optional[Any] = ...,
) -> None: ...
else:
@overload
def warn(message: str, category: Optional[Type[Warning]] = ..., stacklevel: int = ...) -> None: ...

View File

@@ -1,8 +1,8 @@
import sys
from typing import Any, Callable, Generic, Optional, TypeVar, overload
_C = TypeVar('_C', bound=Callable[..., Any])
_T = TypeVar('_T')
_C = TypeVar("_C", bound=Callable[..., Any])
_T = TypeVar("_T")
class CallableProxyType(object): # "weakcallableproxy"
def __getattr__(self, attr: str) -> Any: ...
@@ -23,6 +23,7 @@ def getweakrefcount(object: Any) -> int: ...
def getweakrefs(object: Any) -> int: ...
@overload
def proxy(object: _C, callback: Optional[Callable[[_C], Any]] = ...) -> CallableProxyType: ...
# Return CallableProxyType if object is callable, ProxyType otherwise
@overload
def proxy(object: _T, callback: Optional[Callable[[_T], Any]] = ...) -> Any: ...

View File

@@ -1,12 +1,11 @@
from typing import Iterator, Any, Iterable, MutableSet, Optional, TypeVar, Generic, Union
from typing import Any, Generic, Iterable, Iterator, MutableSet, Optional, TypeVar, Union
_S = TypeVar('_S')
_T = TypeVar('_T')
_SelfT = TypeVar('_SelfT', bound=WeakSet[Any])
_S = TypeVar("_S")
_T = TypeVar("_T")
_SelfT = TypeVar("_SelfT", bound=WeakSet[Any])
class WeakSet(MutableSet[_T], Generic[_T]):
def __init__(self, data: Optional[Iterable[_T]] = ...) -> None: ...
def add(self, item: _T) -> None: ...
def clear(self) -> None: ...
def discard(self, item: _T) -> None: ...
@@ -17,7 +16,6 @@ class WeakSet(MutableSet[_T], Generic[_T]):
def __contains__(self, item: object) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T]: ...
def __ior__(self, other: Iterable[_S]) -> WeakSet[Union[_S, _T]]: ...
def difference(self: _SelfT, other: Iterable[_T]) -> _SelfT: ...
def __sub__(self: _SelfT, other: Iterable[_T]) -> _SelfT: ...

View File

@@ -1,7 +1,8 @@
from typing import Union, IO, Optional, Type, NamedTuple, List, Tuple, Any, Text, overload
from typing_extensions import Literal
from types import TracebackType
import sys
from types import TracebackType
from typing import IO, Any, List, NamedTuple, Optional, Text, Tuple, Type, Union, overload
from typing_extensions import Literal
class Error(Exception): ...
@@ -20,8 +21,9 @@ class Aifc_read:
def __init__(self, f: _File) -> None: ...
if sys.version_info >= (3, 4):
def __enter__(self) -> Aifc_read: ...
def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> None: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> None: ...
def initfp(self, file: IO[bytes]) -> None: ...
def getfp(self) -> IO[bytes]: ...
def rewind(self) -> None: ...
@@ -44,8 +46,9 @@ class Aifc_write:
def __del__(self) -> None: ...
if sys.version_info >= (3, 4):
def __enter__(self) -> Aifc_write: ...
def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> None: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> None: ...
def initfp(self, file: IO[bytes]) -> None: ...
def aiff(self) -> None: ...
def aifc(self) -> None: ...

View File

@@ -1,4 +1,3 @@
import sys
if sys.version_info >= (3, 0):

View File

@@ -1,12 +1,28 @@
from typing import (
Any, Callable, Dict, Generator, Iterable, List, IO, NoReturn, Optional,
Pattern, Protocol, Sequence, Text, Tuple, Type, Union, TypeVar, overload
)
import sys
from typing import (
IO,
Any,
Callable,
Dict,
Generator,
Iterable,
List,
NoReturn,
Optional,
Pattern,
Protocol,
Sequence,
Text,
Tuple,
Type,
TypeVar,
Union,
overload,
)
_T = TypeVar('_T')
_ActionT = TypeVar('_ActionT', bound=Action)
_N = TypeVar('_N')
_T = TypeVar("_T")
_ActionT = TypeVar("_ActionT", bound=Action)
_N = TypeVar("_N")
if sys.version_info >= (3,):
_Text = str
@@ -44,27 +60,29 @@ class _ActionsContainer:
_defaults: Dict[str, Any]
_negative_number_matcher: Pattern[str]
_has_negative_number_optionals: List[bool]
def __init__(self, description: Optional[Text], prefix_chars: Text,
argument_default: Optional[Text], conflict_handler: Text) -> None: ...
def __init__(
self, description: Optional[Text], prefix_chars: Text, argument_default: Optional[Text], conflict_handler: Text
) -> None: ...
def register(self, registry_name: Text, value: Any, object: Any) -> None: ...
def _registry_get(self, registry_name: Text, value: Any, default: Any = ...) -> Any: ...
def set_defaults(self, **kwargs: Any) -> None: ...
def get_default(self, dest: Text) -> Any: ...
def add_argument(self,
*name_or_flags: Text,
action: Union[Text, Type[Action]] = ...,
nargs: Union[int, Text] = ...,
const: Any = ...,
default: Any = ...,
type: Union[Callable[[Text], _T], Callable[[str], _T], FileType] = ...,
choices: Iterable[_T] = ...,
required: bool = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...,
dest: Optional[Text] = ...,
version: Text = ...,
**kwargs: Any) -> Action: ...
def add_argument(
self,
*name_or_flags: Text,
action: Union[Text, Type[Action]] = ...,
nargs: Union[int, Text] = ...,
const: Any = ...,
default: Any = ...,
type: Union[Callable[[Text], _T], Callable[[str], _T], FileType] = ...,
choices: Iterable[_T] = ...,
required: bool = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...,
dest: Optional[Text] = ...,
version: Text = ...,
**kwargs: Any,
) -> Action: ...
def add_argument_group(self, *args: Any, **kwargs: Any) -> _ArgumentGroup: ...
def add_mutually_exclusive_group(self, **kwargs: Any) -> _MutuallyExclusiveGroup: ...
def _add_action(self, action: _ActionT) -> _ActionT: ...
@@ -98,48 +116,53 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
_subparsers: Optional[_ArgumentGroup]
if sys.version_info >= (3, 9):
def __init__(self,
prog: Optional[str] = ...,
usage: Optional[str] = ...,
description: Optional[str] = ...,
epilog: Optional[str] = ...,
parents: Sequence[ArgumentParser] = ...,
formatter_class: _FormatterClass = ...,
prefix_chars: str = ...,
fromfile_prefix_chars: Optional[str] = ...,
argument_default: Optional[str] = ...,
conflict_handler: str = ...,
add_help: bool = ...,
allow_abbrev: bool = ...,
exit_on_error: bool = ...) -> None: ...
def __init__(
self,
prog: Optional[str] = ...,
usage: Optional[str] = ...,
description: Optional[str] = ...,
epilog: Optional[str] = ...,
parents: Sequence[ArgumentParser] = ...,
formatter_class: _FormatterClass = ...,
prefix_chars: str = ...,
fromfile_prefix_chars: Optional[str] = ...,
argument_default: Optional[str] = ...,
conflict_handler: str = ...,
add_help: bool = ...,
allow_abbrev: bool = ...,
exit_on_error: bool = ...,
) -> None: ...
elif sys.version_info >= (3, 5):
def __init__(self,
prog: Optional[str] = ...,
usage: Optional[str] = ...,
description: Optional[str] = ...,
epilog: Optional[str] = ...,
parents: Sequence[ArgumentParser] = ...,
formatter_class: _FormatterClass = ...,
prefix_chars: str = ...,
fromfile_prefix_chars: Optional[str] = ...,
argument_default: Optional[str] = ...,
conflict_handler: str = ...,
add_help: bool = ...,
allow_abbrev: bool = ...) -> None: ...
def __init__(
self,
prog: Optional[str] = ...,
usage: Optional[str] = ...,
description: Optional[str] = ...,
epilog: Optional[str] = ...,
parents: Sequence[ArgumentParser] = ...,
formatter_class: _FormatterClass = ...,
prefix_chars: str = ...,
fromfile_prefix_chars: Optional[str] = ...,
argument_default: Optional[str] = ...,
conflict_handler: str = ...,
add_help: bool = ...,
allow_abbrev: bool = ...,
) -> None: ...
else:
def __init__(self,
prog: Optional[Text] = ...,
usage: Optional[Text] = ...,
description: Optional[Text] = ...,
epilog: Optional[Text] = ...,
parents: Sequence[ArgumentParser] = ...,
formatter_class: _FormatterClass = ...,
prefix_chars: Text = ...,
fromfile_prefix_chars: Optional[Text] = ...,
argument_default: Optional[Text] = ...,
conflict_handler: Text = ...,
add_help: bool = ...) -> None: ...
def __init__(
self,
prog: Optional[Text] = ...,
usage: Optional[Text] = ...,
description: Optional[Text] = ...,
epilog: Optional[Text] = ...,
parents: Sequence[ArgumentParser] = ...,
formatter_class: _FormatterClass = ...,
prefix_chars: Text = ...,
fromfile_prefix_chars: Optional[Text] = ...,
argument_default: Optional[Text] = ...,
conflict_handler: Text = ...,
add_help: bool = ...,
) -> None: ...
# The type-ignores in these overloads should be temporary. See:
# https://github.com/python/typeshed/pull/2643#issuecomment-442280277
@overload
@@ -152,44 +175,52 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore
@overload
def parse_args(self, *, namespace: _N) -> _N: ...
if sys.version_info >= (3, 7):
def add_subparsers(self, *, title: str = ...,
description: Optional[str] = ...,
prog: str = ...,
parser_class: Type[ArgumentParser] = ...,
action: Type[Action] = ...,
option_string: str = ...,
dest: Optional[str] = ...,
required: bool = ...,
help: Optional[str] = ...,
metavar: Optional[str] = ...) -> _SubParsersAction: ...
def add_subparsers(
self,
*,
title: str = ...,
description: Optional[str] = ...,
prog: str = ...,
parser_class: Type[ArgumentParser] = ...,
action: Type[Action] = ...,
option_string: str = ...,
dest: Optional[str] = ...,
required: bool = ...,
help: Optional[str] = ...,
metavar: Optional[str] = ...,
) -> _SubParsersAction: ...
else:
def add_subparsers(self, *, title: Text = ...,
description: Optional[Text] = ...,
prog: Text = ...,
parser_class: Type[ArgumentParser] = ...,
action: Type[Action] = ...,
option_string: Text = ...,
dest: Optional[Text] = ...,
help: Optional[Text] = ...,
metavar: Optional[Text] = ...) -> _SubParsersAction: ...
def add_subparsers(
self,
*,
title: Text = ...,
description: Optional[Text] = ...,
prog: Text = ...,
parser_class: Type[ArgumentParser] = ...,
action: Type[Action] = ...,
option_string: Text = ...,
dest: Optional[Text] = ...,
help: Optional[Text] = ...,
metavar: Optional[Text] = ...,
) -> _SubParsersAction: ...
def print_usage(self, file: Optional[IO[str]] = ...) -> None: ...
def print_help(self, file: Optional[IO[str]] = ...) -> None: ...
def format_usage(self) -> str: ...
def format_help(self) -> str: ...
def parse_known_args(self, args: Optional[Sequence[Text]] = ...,
namespace: Optional[Namespace] = ...) -> Tuple[Namespace, List[str]]: ...
def parse_known_args(
self, args: Optional[Sequence[Text]] = ..., namespace: Optional[Namespace] = ...
) -> Tuple[Namespace, List[str]]: ...
def convert_arg_line_to_args(self, arg_line: Text) -> List[str]: ...
def exit(self, status: int = ..., message: Optional[Text] = ...) -> NoReturn: ...
def error(self, message: Text) -> NoReturn: ...
if sys.version_info >= (3, 7):
def parse_intermixed_args(self, args: Optional[Sequence[str]] = ...,
namespace: Optional[Namespace] = ...) -> Namespace: ...
def parse_known_intermixed_args(self,
args: Optional[Sequence[str]] = ...,
namespace: Optional[Namespace] = ...) -> Tuple[Namespace, List[str]]: ...
def parse_intermixed_args(
self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...
) -> Namespace: ...
def parse_known_intermixed_args(
self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...
) -> Tuple[Namespace, List[str]]: ...
# undocumented
def _get_optional_actions(self) -> List[Action]: ...
def _get_positional_actions(self) -> List[Action]: ...
@@ -220,21 +251,25 @@ class HelpFormatter:
_whitespace_matcher: Pattern[str]
_long_break_matcher: Pattern[str]
_Section: Type[Any] # Nested class
def __init__(self, prog: Text, indent_increment: int = ...,
max_help_position: int = ...,
width: Optional[int] = ...) -> None: ...
def __init__(
self, prog: Text, indent_increment: int = ..., max_help_position: int = ..., width: Optional[int] = ...
) -> None: ...
def _indent(self) -> None: ...
def _dedent(self) -> None: ...
def _add_item(self, func: Callable[..., _Text], args: Iterable[Any]) -> None: ...
def start_section(self, heading: Optional[Text]) -> None: ...
def end_section(self) -> None: ...
def add_text(self, text: Optional[Text]) -> None: ...
def add_usage(self, usage: Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[Text] = ...) -> None: ...
def add_usage(
self, usage: Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[Text] = ...
) -> None: ...
def add_argument(self, action: Action) -> None: ...
def add_arguments(self, actions: Iterable[Action]) -> None: ...
def format_help(self) -> _Text: ...
def _join_parts(self, part_strings: Iterable[Text]) -> _Text: ...
def _format_usage(self, usage: Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[Text]) -> _Text: ...
def _format_usage(
self, usage: Text, actions: Iterable[Action], groups: Iterable[_ArgumentGroup], prefix: Optional[Text]
) -> _Text: ...
def _format_actions_usage(self, actions: Iterable[Action], groups: Iterable[_ArgumentGroup]) -> _Text: ...
def _format_text(self, text: Text) -> _Text: ...
def _format_action(self, action: Action) -> _Text: ...
@@ -252,6 +287,7 @@ class HelpFormatter:
class RawDescriptionHelpFormatter(HelpFormatter): ...
class RawTextHelpFormatter(RawDescriptionHelpFormatter): ...
class ArgumentDefaultsHelpFormatter(HelpFormatter): ...
if sys.version_info >= (3,):
class MetavarTypeHelpFormatter(HelpFormatter): ...
@@ -266,21 +302,26 @@ class Action(_AttributeHolder):
required: bool
help: Optional[_Text]
metavar: Optional[Union[_Text, Tuple[_Text, ...]]]
def __init__(self,
option_strings: Sequence[Text],
dest: Text,
nargs: Optional[Union[int, Text]] = ...,
const: Optional[_T] = ...,
default: Union[_T, str, None] = ...,
type: Optional[Union[Callable[[Text], _T], Callable[[str], _T], FileType]] = ...,
choices: Optional[Iterable[_T]] = ...,
required: bool = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ...
def __call__(self, parser: ArgumentParser, namespace: Namespace,
values: Union[Text, Sequence[Any], None],
option_string: Optional[Text] = ...) -> None: ...
def __init__(
self,
option_strings: Sequence[Text],
dest: Text,
nargs: Optional[Union[int, Text]] = ...,
const: Optional[_T] = ...,
default: Union[_T, str, None] = ...,
type: Optional[Union[Callable[[Text], _T], Callable[[str], _T], FileType]] = ...,
choices: Optional[Iterable[_T]] = ...,
required: bool = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...,
) -> None: ...
def __call__(
self,
parser: ArgumentParser,
namespace: Namespace,
values: Union[Text, Sequence[Any], None],
option_string: Optional[Text] = ...,
) -> None: ...
if sys.version_info >= (3, 9):
def format_usage(self) -> str: ...
@@ -311,21 +352,20 @@ class FileType:
if sys.version_info >= (3,):
_encoding: Optional[str]
_errors: Optional[str]
def __init__(self, mode: str = ..., bufsize: int = ...,
encoding: Optional[str] = ...,
errors: Optional[str] = ...) -> None: ...
def __init__(
self, mode: str = ..., bufsize: int = ..., encoding: Optional[str] = ..., errors: Optional[str] = ...
) -> None: ...
else:
def __init__(self,
mode: Text = ..., bufsize: Optional[int] = ...) -> None: ...
def __init__(self, mode: Text = ..., bufsize: Optional[int] = ...) -> None: ...
def __call__(self, string: Text) -> IO[Any]: ...
# undocumented
class _ArgumentGroup(_ActionsContainer):
title: Optional[_Text]
_group_actions: List[Action]
def __init__(self, container: _ActionsContainer,
title: Optional[Text] = ...,
description: Optional[Text] = ..., **kwargs: Any) -> None: ...
def __init__(
self, container: _ActionsContainer, title: Optional[Text] = ..., description: Optional[Text] = ..., **kwargs: Any
) -> None: ...
# undocumented
class _MutuallyExclusiveGroup(_ArgumentGroup):
@@ -338,73 +378,68 @@ class _StoreAction(Action): ...
# undocumented
class _StoreConstAction(Action):
def __init__(self,
option_strings: Sequence[Text],
dest: Text,
const: Any,
default: Any = ...,
required: bool = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ...
def __init__(
self,
option_strings: Sequence[Text],
dest: Text,
const: Any,
default: Any = ...,
required: bool = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...,
) -> None: ...
# undocumented
class _StoreTrueAction(_StoreConstAction):
def __init__(self,
option_strings: Sequence[Text],
dest: Text,
default: bool = ...,
required: bool = ...,
help: Optional[Text] = ...) -> None: ...
def __init__(
self, option_strings: Sequence[Text], dest: Text, default: bool = ..., required: bool = ..., help: Optional[Text] = ...
) -> None: ...
# undocumented
class _StoreFalseAction(_StoreConstAction):
def __init__(self,
option_strings: Sequence[Text],
dest: Text,
default: bool = ...,
required: bool = ...,
help: Optional[Text] = ...) -> None: ...
def __init__(
self, option_strings: Sequence[Text], dest: Text, default: bool = ..., required: bool = ..., help: Optional[Text] = ...
) -> None: ...
# undocumented
class _AppendAction(Action): ...
# undocumented
class _AppendConstAction(Action):
def __init__(self,
option_strings: Sequence[Text],
dest: Text,
const: Any,
default: Any = ...,
required: bool = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ...
def __init__(
self,
option_strings: Sequence[Text],
dest: Text,
const: Any,
default: Any = ...,
required: bool = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...,
) -> None: ...
# undocumented
class _CountAction(Action):
def __init__(self,
option_strings: Sequence[Text],
dest: Text,
default: Any = ...,
required: bool = ...,
help: Optional[Text] = ...) -> None: ...
def __init__(
self, option_strings: Sequence[Text], dest: Text, default: Any = ..., required: bool = ..., help: Optional[Text] = ...
) -> None: ...
# undocumented
class _HelpAction(Action):
def __init__(self,
option_strings: Sequence[Text],
dest: Text = ...,
default: Text = ...,
help: Optional[Text] = ...) -> None: ...
def __init__(
self, option_strings: Sequence[Text], dest: Text = ..., default: Text = ..., help: Optional[Text] = ...
) -> None: ...
# undocumented
class _VersionAction(Action):
version: Optional[_Text]
def __init__(self,
option_strings: Sequence[Text],
version: Optional[Text] = ...,
dest: Text = ...,
default: Text = ...,
help: Text = ...) -> None: ...
def __init__(
self,
option_strings: Sequence[Text],
version: Optional[Text] = ...,
dest: Text = ...,
default: Text = ...,
help: Text = ...,
) -> None: ...
# undocumented
class _SubParsersAction(Action):
@@ -415,22 +450,26 @@ class _SubParsersAction(Action):
choices: Dict[_Text, ArgumentParser]
_choices_actions: List[Action]
if sys.version_info >= (3, 7):
def __init__(self,
option_strings: Sequence[Text],
prog: Text,
parser_class: Type[ArgumentParser],
dest: Text = ...,
required: bool = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ...
def __init__(
self,
option_strings: Sequence[Text],
prog: Text,
parser_class: Type[ArgumentParser],
dest: Text = ...,
required: bool = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...,
) -> None: ...
else:
def __init__(self,
option_strings: Sequence[Text],
prog: Text,
parser_class: Type[ArgumentParser],
dest: Text = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...) -> None: ...
def __init__(
self,
option_strings: Sequence[Text],
prog: Text,
parser_class: Type[ArgumentParser],
dest: Text = ...,
help: Optional[Text] = ...,
metavar: Optional[Union[Text, Tuple[Text, ...]]] = ...,
) -> None: ...
# TODO: Type keyword args properly.
def add_parser(self, name: Text, **kwargs: Any) -> ArgumentParser: ...
def _get_subactions(self) -> List[Action]: ...

View File

@@ -3,16 +3,16 @@
# Based on http://docs.python.org/3.6/library/array.html
import sys
from typing import (Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence,
overload, Text, Tuple, TypeVar, Union)
from typing import Any, BinaryIO, Generic, Iterable, Iterator, List, MutableSequence, Text, Tuple, TypeVar, Union, overload
from typing_extensions import Literal
_IntTypeCode = Literal['b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q']
_FloatTypeCode = Literal['f', 'd']
_UnicodeTypeCode = Literal['u']
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
_FloatTypeCode = Literal["f", "d"]
_UnicodeTypeCode = Literal["u"]
_TypeCode = Union[_IntTypeCode, _FloatTypeCode, _UnicodeTypeCode]
_T = TypeVar('_T', int, float, Text)
_T = TypeVar("_T", int, float, Text)
if sys.version_info >= (3,):
typecodes: str
@@ -21,17 +21,13 @@ class array(MutableSequence[_T], Generic[_T]):
typecode: _TypeCode
itemsize: int
@overload
def __init__(self: array[int], typecode: _IntTypeCode,
__initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
def __init__(self: array[int], typecode: _IntTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
@overload
def __init__(self: array[float], typecode: _FloatTypeCode,
__initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
def __init__(self: array[float], typecode: _FloatTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
@overload
def __init__(self: array[Text], typecode: _UnicodeTypeCode,
__initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
def __init__(self: array[Text], typecode: _UnicodeTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
@overload
def __init__(self, typecode: str,
__initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
def __init__(self, typecode: str, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
def append(self, __v: _T) -> None: ...
def buffer_info(self) -> Tuple[int, int]: ...
def byteswap(self) -> None: ...
@@ -59,19 +55,15 @@ class array(MutableSequence[_T], Generic[_T]):
if sys.version_info < (3, 9):
def fromstring(self, __buffer: bytes) -> None: ...
def tostring(self) -> bytes: ...
def __len__(self) -> int: ...
@overload
def __getitem__(self, i: int) -> _T: ...
@overload
def __getitem__(self, s: slice) -> array[_T]: ...
@overload # type: ignore # Overrides MutableSequence
def __setitem__(self, i: int, o: _T) -> None: ...
@overload
def __setitem__(self, s: slice, o: array[_T]) -> None: ...
def __delitem__(self, i: Union[int, slice]) -> None: ...
def __add__(self, x: array[_T]) -> array[_T]: ...
def __ge__(self, other: array[_T]) -> bool: ...

View File

@@ -1,10 +1,9 @@
from abc import abstractmethod
import asyncore
import socket
import sys
from abc import abstractmethod
from typing import Optional, Sequence, Tuple, Union
class simple_producer:
def __init__(self, data: bytes, buffer_size: int = ...) -> None: ...
def more(self) -> bytes: ...
@@ -13,7 +12,6 @@ class async_chat(asyncore.dispatcher):
ac_in_buffer_size: int
ac_out_buffer_size: int
def __init__(self, sock: Optional[socket.socket] = ..., map: Optional[asyncore._maptype] = ...) -> None: ...
@abstractmethod
def collect_incoming_data(self, data: bytes) -> None: ...
@abstractmethod

View File

@@ -1,8 +1,7 @@
from typing import Tuple, Union, Any, Dict, overload
import sys
from socket import SocketType
from typing import Optional
from typing import Any, Dict, Optional, Tuple, Union, overload
from _typeshed import FileDescriptorLike
# cyclic dependence with asynchat
@@ -22,7 +21,6 @@ poll3 = poll2
def loop(timeout: float = ..., use_poll: bool = ..., map: Optional[_maptype] = ..., count: Optional[int] = ...) -> None: ...
# Not really subclass of socket.socket; it's only delegation.
# It is not covariant to it.
class dispatcher:
@@ -34,7 +32,6 @@ class dispatcher:
closing: bool
ignore_log_types: frozenset[str]
socket: Optional[SocketType]
def __init__(self, sock: Optional[SocketType] = ..., map: Optional[_maptype] = ...) -> None: ...
def add_channel(self, map: Optional[_maptype] = ...) -> None: ...
def del_channel(self, map: Optional[_maptype] = ...) -> None: ...
@@ -50,7 +47,6 @@ class dispatcher:
def send(self, data: bytes) -> int: ...
def recv(self, buffer_size: int) -> bytes: ...
def close(self) -> None: ...
def log(self, message: Any) -> None: ...
def log_info(self, message: Any, type: str = ...) -> None: ...
def handle_read_event(self) -> None: ...
@@ -64,34 +60,26 @@ class dispatcher:
def handle_connect(self) -> None: ...
def handle_accept(self) -> None: ...
def handle_close(self) -> None: ...
if sys.version_info < (3, 5):
# Historically, some methods were "imported" from `self.socket` by
# means of `__getattr__`. This was long deprecated, and as of Python
# 3.5 has been removed; simply call the relevant methods directly on
# self.socket if necessary.
def detach(self) -> int: ...
def fileno(self) -> int: ...
# return value is an address
def getpeername(self) -> Any: ...
def getsockname(self) -> Any: ...
@overload
def getsockopt(self, level: int, optname: int, buflen: None = ...) -> int: ...
@overload
def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ...
def gettimeout(self) -> float: ...
def ioctl(self, control: object,
option: Tuple[int, int, int]) -> None: ...
def ioctl(self, control: object, option: Tuple[int, int, int]) -> None: ...
# TODO the return value may be BinaryIO or TextIO, depending on mode
def makefile(self, mode: str = ..., buffering: int = ...,
encoding: str = ..., errors: str = ...,
newline: str = ...) -> Any:
...
def makefile(
self, mode: str = ..., buffering: int = ..., encoding: str = ..., errors: str = ..., newline: str = ...
) -> Any: ...
# return type is an address
def recvfrom(self, bufsize: int, flags: int = ...) -> Any: ...
def recvfrom_into(self, buffer: bytes, nbytes: int, flags: int = ...) -> Any: ...
@@ -116,22 +104,17 @@ def close_all(map: Optional[_maptype] = ..., ignore_all: bool = ...) -> None: ..
if sys.platform != "win32":
class file_wrapper:
fd: int
def __init__(self, fd: int) -> None: ...
def recv(self, bufsize: int, flags: int = ...) -> bytes: ...
def send(self, data: bytes, flags: int = ...) -> int: ...
@overload
def getsockopt(self, level: int, optname: int, buflen: None = ...) -> int: ...
@overload
def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ...
def read(self, bufsize: int, flags: int = ...) -> bytes: ...
def write(self, data: bytes, flags: int = ...) -> int: ...
def close(self) -> None: ...
def fileno(self) -> int: ...
class file_dispatcher(dispatcher):
def __init__(self, fd: FileDescriptorLike, map: Optional[_maptype] = ...) -> None: ...
def set_file(self, fd: int) -> None: ...

View File

@@ -1,7 +1,7 @@
# Stubs for base64
from typing import IO, Optional, Text, Union
import sys
from typing import IO, Optional, Text, Union
if sys.version_info < (3,):
_encodable = Union[bytes, unicode]
@@ -11,30 +11,29 @@ else:
_decodable = Union[bytes, str]
def b64encode(s: _encodable, altchars: Optional[bytes] = ...) -> bytes: ...
def b64decode(s: _decodable, altchars: Optional[bytes] = ...,
validate: bool = ...) -> bytes: ...
def b64decode(s: _decodable, altchars: Optional[bytes] = ..., validate: bool = ...) -> bytes: ...
def standard_b64encode(s: _encodable) -> bytes: ...
def standard_b64decode(s: _decodable) -> bytes: ...
def urlsafe_b64encode(s: _encodable) -> bytes: ...
def urlsafe_b64decode(s: _decodable) -> bytes: ...
def b32encode(s: _encodable) -> bytes: ...
def b32decode(s: _decodable, casefold: bool = ...,
map01: Optional[bytes] = ...) -> bytes: ...
def b32decode(s: _decodable, casefold: bool = ..., map01: Optional[bytes] = ...) -> bytes: ...
def b16encode(s: _encodable) -> bytes: ...
def b16decode(s: _decodable, casefold: bool = ...) -> bytes: ...
if sys.version_info >= (3, 4):
def a85encode(b: _encodable, *, foldspaces: bool = ..., wrapcol: int = ...,
pad: bool = ..., adobe: bool = ...) -> bytes: ...
def a85decode(b: _decodable, *, foldspaces: bool = ...,
adobe: bool = ..., ignorechars: Union[str, bytes] = ...) -> bytes: ...
def a85encode(b: _encodable, *, foldspaces: bool = ..., wrapcol: int = ..., pad: bool = ..., adobe: bool = ...) -> bytes: ...
def a85decode(b: _decodable, *, foldspaces: bool = ..., adobe: bool = ..., ignorechars: Union[str, bytes] = ...) -> bytes: ...
def b85encode(b: _encodable, pad: bool = ...) -> bytes: ...
def b85decode(b: _decodable) -> bytes: ...
def decode(input: IO[bytes], output: IO[bytes]) -> None: ...
def encode(input: IO[bytes], output: IO[bytes]) -> None: ...
if sys.version_info >= (3,):
def encodebytes(s: bytes) -> bytes: ...
def decodebytes(s: bytes) -> bytes: ...
if sys.version_info < (3, 9):
def encodestring(s: bytes) -> bytes: ...
def decodestring(s: bytes) -> bytes: ...

View File

@@ -1,7 +1,5 @@
from typing import Set, Dict, Iterable, Any, Callable, Mapping, Tuple, Type, SupportsInt, List, Union, TypeVar, Optional, IO
from types import FrameType, TracebackType, CodeType
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, Callable, Dict, Iterable, List, Mapping, Optional, Set, SupportsInt, Tuple, Type, TypeVar, Union
_T = TypeVar("_T")
_TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type
@@ -22,7 +20,6 @@ class Bdb:
stopframe: Optional[FrameType]
returnframe: Optional[FrameType]
stoplineno: int
def __init__(self, skip: Optional[Iterable[str]] = ...) -> None: ...
def canonic(self, filename: str) -> str: ...
def reset(self) -> None: ...
@@ -47,7 +44,9 @@ class Bdb:
def set_trace(self, frame: Optional[FrameType] = ...) -> None: ...
def set_continue(self) -> None: ...
def set_quit(self) -> None: ...
def set_break(self, filename: str, lineno: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ...) -> None: ...
def set_break(
self, filename: str, lineno: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ...
) -> None: ...
def clear_break(self, filename: str, lineno: int) -> None: ...
def clear_bpbynumber(self, arg: SupportsInt) -> None: ...
def clear_all_file_breaks(self, filename: str) -> None: ...
@@ -63,7 +62,9 @@ class Bdb:
self, cmd: Union[str, CodeType], globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...
) -> None: ...
def runeval(self, expr: str, globals: Optional[Dict[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ...) -> None: ...
def runctx(self, cmd: Union[str, CodeType], globals: Optional[Dict[str, Any]], locals: Optional[Mapping[str, Any]]) -> None: ...
def runctx(
self, cmd: Union[str, CodeType], globals: Optional[Dict[str, Any]], locals: Optional[Mapping[str, Any]]
) -> None: ...
def runcall(self, __func: Callable[..., _T], *args: Any, **kwds: Any) -> Optional[_T]: ...
class Breakpoint:
@@ -82,8 +83,9 @@ class Breakpoint:
ignore: int
hits: int
number: int
def __init__(self, file: str, line: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ...) -> None: ...
def __init__(
self, file: str, line: int, temporary: bool = ..., cond: Optional[str] = ..., funcname: Optional[str] = ...
) -> None: ...
def deleteMe(self) -> None: ...
def enable(self) -> None: ...
def disable(self) -> None: ...

View File

@@ -3,7 +3,7 @@
# Based on http://docs.python.org/3.2/library/binascii.html
import sys
from typing import Union, Text
from typing import Text, Union
if sys.version_info < (3,):
# Python 2 accepts unicode ascii pretty much everywhere.
@@ -16,15 +16,21 @@ else:
_Ascii = Union[bytes, str]
def a2b_uu(__data: _Ascii) -> bytes: ...
if sys.version_info >= (3, 7):
def b2a_uu(__data: _Bytes, *, backtick: bool = ...) -> bytes: ...
else:
def b2a_uu(__data: _Bytes) -> bytes: ...
def a2b_base64(__data: _Ascii) -> bytes: ...
if sys.version_info >= (3, 6):
def b2a_base64(__data: _Bytes, *, newline: bool = ...) -> bytes: ...
else:
def b2a_base64(__data: _Bytes) -> bytes: ...
def a2b_qp(data: _Ascii, header: bool = ...) -> bytes: ...
def b2a_qp(data: _Bytes, quotetabs: bool = ..., istext: bool = ..., header: bool = ...) -> bytes: ...
def a2b_hqx(__data: _Ascii) -> bytes: ...
@@ -34,10 +40,13 @@ def b2a_hqx(__data: _Bytes) -> bytes: ...
def crc_hqx(__data: _Bytes, __crc: int) -> int: ...
def crc32(__data: _Bytes, __crc: int = ...) -> int: ...
def b2a_hex(__data: _Bytes) -> bytes: ...
if sys.version_info >= (3, 8):
def hexlify(data: bytes, sep: Union[str, bytes] = ..., bytes_per_sep: int = ...) -> bytes: ...
else:
def hexlify(__data: _Bytes) -> bytes: ...
def a2b_hex(__hexstr: _Ascii) -> bytes: ...
def unhexlify(__hexstr: _Ascii) -> bytes: ...

View File

@@ -1,10 +1,4 @@
from typing import (
Any,
IO,
Tuple,
Union,
)
from typing import IO, Any, Tuple, Union
class Error(Exception): ...

View File

@@ -1,4 +1,5 @@
# Stubs for bisect
from _bisect import *
bisect = bisect_right
insort = insort_right

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,11 @@
import io
import sys
from typing import IO, Any, Optional, TextIO, Union, overload, TypeVar
from _typeshed import AnyPath
from typing import IO, Any, Optional, TextIO, TypeVar, Union, overload
from typing_extensions import Literal
from _typeshed import AnyPath
_PathOrFile = Union[AnyPath, IO[bytes]]
_T = TypeVar("_T")
@@ -44,17 +46,11 @@ if sys.version_info >= (3, 3):
class BZ2File(io.BufferedIOBase, IO[bytes]):
def __enter__(self: _T) -> _T: ...
if sys.version_info >= (3, 9):
def __init__(self,
filename: _PathOrFile,
mode: str = ...,
*,
compresslevel: int = ...) -> None: ...
def __init__(self, filename: _PathOrFile, mode: str = ..., *, compresslevel: int = ...) -> None: ...
else:
def __init__(self,
filename: _PathOrFile,
mode: str = ...,
buffering: Optional[Any] = ...,
compresslevel: int = ...) -> None: ...
def __init__(
self, filename: _PathOrFile, mode: str = ..., buffering: Optional[Any] = ..., compresslevel: int = ...
) -> None: ...
class BZ2Compressor(object):
def __init__(self, compresslevel: int = ...) -> None: ...

View File

@@ -1,15 +1,20 @@
import sys
from _typeshed import AnyPath
from typing import Any, Callable, Dict, Optional, TypeVar, Union
def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ...
def runctx(statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ...
from _typeshed import AnyPath
_SelfT = TypeVar('_SelfT', bound=Profile)
_T = TypeVar('_T')
def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ...
def runctx(
statement: str, globals: Dict[str, Any], locals: Dict[str, Any], filename: Optional[str] = ..., sort: Union[str, int] = ...
) -> None: ...
_SelfT = TypeVar("_SelfT", bound=Profile)
_T = TypeVar("_T")
class Profile:
def __init__(self, timer: Callable[[], float] = ..., timeunit: float = ..., subcalls: bool = ..., builtins: bool = ...) -> None: ...
def __init__(
self, timer: Callable[[], float] = ..., timeunit: float = ..., subcalls: bool = ..., builtins: bool = ...
) -> None: ...
def enable(self) -> None: ...
def disable(self) -> None: ...
def print_stats(self, sort: Union[str, int] = ...) -> None: ...

View File

@@ -3,7 +3,6 @@ import sys
from time import struct_time
from typing import Any, Iterable, List, Optional, Sequence, Tuple, Union
_LocaleType = Tuple[Optional[str], Optional[str]]
class IllegalMonthError(ValueError):
@@ -82,6 +81,7 @@ if sys.version_info < (3, 0):
def __init__(self, locale: _LocaleType) -> None: ...
def __enter__(self) -> _LocaleType: ...
def __exit__(self, *args: Any) -> None: ...
else:
class different_locale:
def __init__(self, locale: _LocaleType) -> None: ...
@@ -99,6 +99,7 @@ class LocaleHTMLCalendar(HTMLCalendar):
def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ...
c: TextCalendar
def setfirstweekday(firstweekday: int) -> None: ...
def format(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...
def formatstring(cols: int, colwidth: int = ..., spacing: int = ...) -> str: ...

View File

@@ -1,25 +1,34 @@
import sys
from typing import Any, AnyStr, Dict, IO, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union
from typing import IO, Any, AnyStr, Dict, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union
_T = TypeVar('_T', bound=FieldStorage)
_T = TypeVar("_T", bound=FieldStorage)
def parse(
fp: Optional[IO[Any]] = ..., environ: Mapping[str, str] = ..., keep_blank_values: bool = ..., strict_parsing: bool = ...
) -> Dict[str, List[str]]: ...
def parse(fp: Optional[IO[Any]] = ..., environ: Mapping[str, str] = ...,
keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
if sys.version_info < (3, 8):
def parse_qs(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> Dict[str, List[str]]: ...
if sys.version_info >= (3, 7):
def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes], encoding: str = ..., errors: str = ...) -> Dict[str, List[Any]]: ...
def parse_multipart(
fp: IO[Any], pdict: Mapping[str, bytes], encoding: str = ..., errors: str = ...
) -> Dict[str, List[Any]]: ...
else:
def parse_multipart(fp: IO[Any], pdict: Mapping[str, bytes]) -> Dict[str, List[bytes]]: ...
def parse_header(line: str) -> Tuple[str, Dict[str, str]]: ...
def test(environ: Mapping[str, str] = ...) -> None: ...
def print_environ(environ: Mapping[str, str] = ...) -> None: ...
def print_form(form: Dict[str, Any]) -> None: ...
def print_directory() -> None: ...
def print_environ_usage() -> None: ...
if sys.version_info < (3,):
def escape(s: AnyStr, quote: bool = ...) -> AnyStr: ...
elif sys.version_info < (3, 8):
def escape(s: str, quote: Optional[bool] = ...) -> str: ...
@@ -35,11 +44,9 @@ class MiniFieldStorage:
headers: Dict[Any, Any]
name: Any
value: Any
def __init__(self, name: Any, value: Any) -> None: ...
def __repr__(self) -> str: ...
class FieldStorage(object):
FieldStorageClass: Optional[type]
keep_blank_values: int
@@ -65,17 +72,42 @@ class FieldStorage(object):
value: Union[None, bytes, List[Any]]
if sys.version_info >= (3, 6):
def __init__(self, fp: Optional[IO[Any]] = ..., headers: Optional[Mapping[str, str]] = ..., outerboundary: bytes = ...,
environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...,
limit: Optional[int] = ..., encoding: str = ..., errors: str = ..., max_num_fields: Optional[int] = ...) -> None: ...
def __init__(
self,
fp: Optional[IO[Any]] = ...,
headers: Optional[Mapping[str, str]] = ...,
outerboundary: bytes = ...,
environ: Mapping[str, str] = ...,
keep_blank_values: int = ...,
strict_parsing: int = ...,
limit: Optional[int] = ...,
encoding: str = ...,
errors: str = ...,
max_num_fields: Optional[int] = ...,
) -> None: ...
elif sys.version_info >= (3, 0):
def __init__(self, fp: Optional[IO[Any]] = ..., headers: Optional[Mapping[str, str]] = ..., outerboundary: bytes = ...,
environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...,
limit: Optional[int] = ..., encoding: str = ..., errors: str = ...) -> None: ...
def __init__(
self,
fp: Optional[IO[Any]] = ...,
headers: Optional[Mapping[str, str]] = ...,
outerboundary: bytes = ...,
environ: Mapping[str, str] = ...,
keep_blank_values: int = ...,
strict_parsing: int = ...,
limit: Optional[int] = ...,
encoding: str = ...,
errors: str = ...,
) -> None: ...
else:
def __init__(self, fp: IO[Any] = ..., headers: Mapping[str, str] = ..., outerboundary: bytes = ...,
environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ...
def __init__(
self,
fp: IO[Any] = ...,
headers: Mapping[str, str] = ...,
outerboundary: bytes = ...,
environ: Mapping[str, str] = ...,
keep_blank_values: int = ...,
strict_parsing: int = ...,
) -> None: ...
if sys.version_info >= (3, 0):
def __enter__(self: _T) -> _T: ...
def __exit__(self, *args: Any) -> None: ...
@@ -101,19 +133,14 @@ class FieldStorage(object):
# In Python 2 it always returns bytes and ignores the "binary" flag
def make_file(self, binary: Any = ...) -> IO[bytes]: ...
if sys.version_info < (3, 0):
from UserDict import UserDict
class FormContentDict(UserDict[str, List[str]]):
query_string: str
def __init__(self, environ: Mapping[str, str] = ..., keep_blank_values: int = ..., strict_parsing: int = ...) -> None: ...
class SvFormContentDict(FormContentDict):
def getlist(self, key: Any) -> Any: ...
class InterpFormContentDict(SvFormContentDict): ...
class FormContent(FormContentDict):
# TODO this should have
# def values(self, key: Any) -> Any: ...

View File

@@ -1,5 +1,6 @@
from typing import Dict, Any, List, Tuple, Optional, Callable, Type, IO
from types import FrameType, TracebackType
from typing import IO, Any, Callable, Dict, List, Optional, Tuple, Type
from _typeshed import AnyPath
_ExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
@@ -9,15 +10,25 @@ def small(text: str) -> str: ... # undocumented
def strong(text: str) -> str: ... # undocumented
def grey(text: str) -> str: ... # undocumented
def lookup(name: str, frame: FrameType, locals: Dict[str, Any]) -> Tuple[Optional[str], Any]: ... # undocumented
def scanvars(reader: Callable[[], bytes], frame: FrameType, locals: Dict[str, Any]) -> List[Tuple[str, Optional[str], Any]]: ... # undocumented
def scanvars(
reader: Callable[[], bytes], frame: FrameType, locals: Dict[str, Any]
) -> List[Tuple[str, Optional[str], Any]]: ... # undocumented
def html(einfo: _ExcInfo, context: int = ...) -> str: ...
def text(einfo: _ExcInfo, context: int = ...) -> str: ...
class Hook: # undocumented
def __init__(self, display: int = ..., logdir: Optional[AnyPath] = ..., context: int = ..., file: Optional[IO[str]] = ..., format: str = ...) -> None: ...
def __call__(self, etype: Optional[Type[BaseException]], evalue: Optional[BaseException], etb: Optional[TracebackType]) -> None: ...
def __init__(
self,
display: int = ...,
logdir: Optional[AnyPath] = ...,
context: int = ...,
file: Optional[IO[str]] = ...,
format: str = ...,
) -> None: ...
def __call__(
self, etype: Optional[Type[BaseException]], evalue: Optional[BaseException], etb: Optional[TracebackType]
) -> None: ...
def handle(self, info: Optional[_ExcInfo] = ...) -> None: ...
def handler(info: Optional[_ExcInfo] = ...) -> None: ...
def enable(display: int = ..., logdir: Optional[AnyPath] = ..., context: int = ..., format: str = ...) -> None: ...

View File

@@ -23,8 +23,10 @@ def atanh(__z: _C) -> complex: ...
def cos(__z: _C) -> complex: ...
def cosh(__z: _C) -> complex: ...
def exp(__z: _C) -> complex: ...
if sys.version_info >= (3, 5):
def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ...
def isinf(__z: _C) -> bool: ...
def isnan(__z: _C) -> bool: ...
def log(__x: _C, __y_obj: _C = ...) -> complex: ...

View File

@@ -1,6 +1,6 @@
# Stubs for cmd (Python 2/3)
from typing import Any, Optional, Text, IO, List, Callable, Tuple
from typing import IO, Any, Callable, List, Optional, Text, Tuple
class Cmd:
prompt: str

View File

@@ -1,24 +1,21 @@
# Stubs for code
import sys
from typing import Any, Callable, Mapping, Optional
from types import CodeType
from typing import Any, Callable, Mapping, Optional
class InteractiveInterpreter:
def __init__(self, locals: Optional[Mapping[str, Any]] = ...) -> None: ...
def runsource(self, source: str, filename: str = ...,
symbol: str = ...) -> bool: ...
def runsource(self, source: str, filename: str = ..., symbol: str = ...) -> bool: ...
def runcode(self, code: CodeType) -> None: ...
def showsyntaxerror(self, filename: Optional[str] = ...) -> None: ...
def showtraceback(self) -> None: ...
def write(self, data: str) -> None: ...
class InteractiveConsole(InteractiveInterpreter):
def __init__(self, locals: Optional[Mapping[str, Any]] = ...,
filename: str = ...) -> None: ...
def __init__(self, locals: Optional[Mapping[str, Any]] = ..., filename: str = ...) -> None: ...
if sys.version_info >= (3, 6):
def interact(self, banner: Optional[str] = ...,
exitmsg: Optional[str] = ...) -> None: ...
def interact(self, banner: Optional[str] = ..., exitmsg: Optional[str] = ...) -> None: ...
else:
def interact(self, banner: Optional[str] = ...) -> None: ...
def push(self, line: str) -> bool: ...
@@ -26,13 +23,16 @@ class InteractiveConsole(InteractiveInterpreter):
def raw_input(self, prompt: str = ...) -> str: ...
if sys.version_info >= (3, 6):
def interact(banner: Optional[str] = ...,
readfunc: Optional[Callable[[str], str]] = ...,
local: Optional[Mapping[str, Any]] = ...,
exitmsg: Optional[str] = ...) -> None: ...
def interact(
banner: Optional[str] = ...,
readfunc: Optional[Callable[[str], str]] = ...,
local: Optional[Mapping[str, Any]] = ...,
exitmsg: Optional[str] = ...,
) -> None: ...
else:
def interact(banner: Optional[str] = ...,
readfunc: Optional[Callable[[str], str]] = ...,
local: Optional[Mapping[str, Any]] = ...) -> None: ...
def compile_command(source: str, filename: str = ...,
symbol: str = ...) -> Optional[CodeType]: ...
def interact(
banner: Optional[str] = ..., readfunc: Optional[Callable[[str], str]] = ..., local: Optional[Mapping[str, Any]] = ...
) -> None: ...
def compile_command(source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ...

View File

@@ -1,8 +1,26 @@
import sys
from typing import Any, BinaryIO, Callable, Generator, IO, Iterable, Iterator, List, Optional, Protocol, Text, TextIO, Tuple, Type, TypeVar, Union, overload
from abc import abstractmethod
import types
from abc import abstractmethod
from typing import (
IO,
Any,
BinaryIO,
Callable,
Generator,
Iterable,
Iterator,
List,
Optional,
Protocol,
Text,
TextIO,
Tuple,
Type,
TypeVar,
Union,
overload,
)
from typing_extensions import Literal
# TODO: this only satisfies the most common interface, where
@@ -16,16 +34,19 @@ _Encoded = bytes
class _Encoder(Protocol):
def __call__(self, input: _Decoded, errors: str = ...) -> Tuple[_Encoded, int]: ... # signature of Codec().encode
class _Decoder(Protocol):
def __call__(self, input: _Encoded, errors: str = ...) -> Tuple[_Decoded, int]: ... # signature of Codec().decode
class _StreamReader(Protocol):
def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamReader: ...
class _StreamWriter(Protocol):
def __call__(self, stream: IO[_Encoded], errors: str = ...) -> StreamWriter: ...
class _IncrementalEncoder(Protocol):
def __call__(self, errors: str = ...) -> IncrementalEncoder: ...
class _IncrementalDecoder(Protocol):
def __call__(self, errors: str = ...) -> IncrementalDecoder: ...
@@ -55,14 +76,12 @@ def encode(obj: bytes, encoding: _BytesToBytesEncodingT, errors: str = ...) -> b
def encode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = ...) -> str: ... # type: ignore
@overload
def encode(obj: _Decoded, encoding: str = ..., errors: str = ...) -> _Encoded: ...
@overload
def decode(obj: bytes, encoding: _BytesToBytesEncodingT, errors: str = ...) -> bytes: ... # type: ignore
@overload
def decode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = ...) -> Text: ...
@overload
def decode(obj: _Encoded, encoding: str = ..., errors: str = ...) -> _Decoded: ...
def lookup(encoding: str) -> CodecInfo: ...
def utf_16_be_decode(__obj: _Encoded, __errors: str = ..., __final: bool = ...) -> Tuple[_Decoded, int]: ... # undocumented
def utf_16_be_encode(__obj: _Decoded, __errors: str = ...) -> Tuple[_Encoded, int]: ... # undocumented

View File

@@ -1,11 +1,20 @@
# ContextManager aliased here for backwards compatibility; TODO eventually remove this
from typing import (
Any, Callable, Generator, IO, Iterable, Iterator, Optional, Type,
Generic, TypeVar, overload
)
from types import TracebackType
import sys
from typing import ContextManager as ContextManager
from types import TracebackType
from typing import (
IO,
Any,
Callable,
ContextManager as ContextManager,
Generator,
Generic,
Iterable,
Iterator,
Optional,
Type,
TypeVar,
overload,
)
if sys.version_info >= (3, 5):
from typing import AsyncContextManager, AsyncIterator
@@ -15,19 +24,18 @@ if sys.version_info >= (3, 6):
if sys.version_info >= (3, 7):
from typing import AsyncContextManager as AbstractAsyncContextManager
_T = TypeVar('_T')
_T_io = TypeVar('_T_io', bound=Optional[IO[str]])
_F = TypeVar('_F', bound=Callable[..., Any])
_T = TypeVar("_T")
_T_io = TypeVar("_T_io", bound=Optional[IO[str]])
_F = TypeVar("_F", bound=Callable[..., Any])
_ExitFunc = Callable[[Optional[Type[BaseException]],
Optional[BaseException],
Optional[TracebackType]], bool]
_CM_EF = TypeVar('_CM_EF', ContextManager[Any], _ExitFunc)
_ExitFunc = Callable[[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]], bool]
_CM_EF = TypeVar("_CM_EF", ContextManager[Any], _ExitFunc)
if sys.version_info >= (3, 2):
class _GeneratorContextManager(ContextManager[_T], Generic[_T]):
def __call__(self, func: _F) -> _F: ...
def contextmanager(func: Callable[..., Iterator[_T]]) -> Callable[..., _GeneratorContextManager[_T]]: ...
else:
class GeneratorContextManager(ContextManager[_T], Generic[_T]):
def __call__(self, func: _F) -> _F: ...
@@ -45,10 +53,9 @@ class closing(ContextManager[_T], Generic[_T]):
if sys.version_info >= (3, 4):
class suppress(ContextManager[None]):
def __init__(self, *exceptions: Type[BaseException]) -> None: ...
def __exit__(self, exctype: Optional[Type[BaseException]],
excinst: Optional[BaseException],
exctb: Optional[TracebackType]) -> bool: ...
def __exit__(
self, exctype: Optional[Type[BaseException]], excinst: Optional[BaseException], exctb: Optional[TracebackType]
) -> bool: ...
class redirect_stdout(ContextManager[_T_io]):
def __init__(self, new_target: _T_io) -> None: ...
@@ -59,49 +66,47 @@ if sys.version_info >= (3, 5):
if sys.version_info >= (3,):
class ContextDecorator:
def __call__(self, func: Callable[..., None]) -> Callable[..., ContextManager[None]]: ...
_U = TypeVar('_U', bound=ExitStack)
_U = TypeVar("_U", bound=ExitStack)
class ExitStack(ContextManager[ExitStack]):
def __init__(self) -> None: ...
def enter_context(self, cm: ContextManager[_T]) -> _T: ...
def push(self, exit: _CM_EF) -> _CM_EF: ...
def callback(self, callback: Callable[..., Any],
*args: Any, **kwds: Any) -> Callable[..., Any]: ...
def callback(self, callback: Callable[..., Any], *args: Any, **kwds: Any) -> Callable[..., Any]: ...
def pop_all(self: _U) -> _U: ...
def close(self) -> None: ...
def __enter__(self: _U) -> _U: ...
def __exit__(self, __exc_type: Optional[Type[BaseException]],
__exc_value: Optional[BaseException],
__traceback: Optional[TracebackType]) -> bool: ...
def __exit__(
self,
__exc_type: Optional[Type[BaseException]],
__exc_value: Optional[BaseException],
__traceback: Optional[TracebackType],
) -> bool: ...
if sys.version_info >= (3, 7):
from typing import Awaitable
_S = TypeVar('_S', bound=AsyncExitStack)
_S = TypeVar("_S", bound=AsyncExitStack)
_ExitCoroFunc = Callable[[Optional[Type[BaseException]],
Optional[BaseException],
Optional[TracebackType]], Awaitable[bool]]
_ExitCoroFunc = Callable[[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]], Awaitable[bool]]
_CallbackCoroFunc = Callable[..., Awaitable[Any]]
_ACM_EF = TypeVar('_ACM_EF', AsyncContextManager[Any], _ExitCoroFunc)
_ACM_EF = TypeVar("_ACM_EF", AsyncContextManager[Any], _ExitCoroFunc)
class AsyncExitStack(AsyncContextManager[AsyncExitStack]):
def __init__(self) -> None: ...
def enter_context(self, cm: ContextManager[_T]) -> _T: ...
def enter_async_context(self, cm: AsyncContextManager[_T]) -> Awaitable[_T]: ...
def push(self, exit: _CM_EF) -> _CM_EF: ...
def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ...
def callback(self, callback: Callable[..., Any],
*args: Any, **kwds: Any) -> Callable[..., Any]: ...
def push_async_callback(self, callback: _CallbackCoroFunc,
*args: Any, **kwds: Any) -> _CallbackCoroFunc: ...
def callback(self, callback: Callable[..., Any], *args: Any, **kwds: Any) -> Callable[..., Any]: ...
def push_async_callback(self, callback: _CallbackCoroFunc, *args: Any, **kwds: Any) -> _CallbackCoroFunc: ...
def pop_all(self: _S) -> _S: ...
def aclose(self) -> Awaitable[None]: ...
def __aenter__(self: _S) -> Awaitable[_S]: ...
def __aexit__(self, __exc_type: Optional[Type[BaseException]],
__exc_value: Optional[BaseException],
__traceback: Optional[TracebackType]) -> Awaitable[bool]: ...
def __aexit__(
self,
__exc_type: Optional[Type[BaseException]],
__exc_value: Optional[BaseException],
__traceback: Optional[TracebackType],
) -> Awaitable[bool]: ...
if sys.version_info >= (3, 7):
@overload

View File

@@ -1,8 +1,8 @@
# Stubs for copy
from typing import TypeVar, Optional, Dict, Any
from typing import Any, Dict, Optional, TypeVar
_T = TypeVar('_T')
_T = TypeVar("_T")
# None in CPython but non-None in Jython
PyStringMap: Any
@@ -10,5 +10,7 @@ PyStringMap: Any
# Note: memo and _nil are internal kwargs.
def deepcopy(x: _T, memo: Optional[Dict[int, _T]] = ..., _nil: Any = ...) -> _T: ...
def copy(x: _T) -> _T: ...
class Error(Exception): ...
error = Error

View File

@@ -3,7 +3,6 @@ from typing import List, Optional, Union
if sys.version_info >= (3, 3):
class _Method: ...
METHOD_CRYPT: _Method
METHOD_MD5: _Method
METHOD_SHA256: _Method
@@ -18,5 +17,6 @@ if sys.version_info >= (3, 3):
else:
def mksalt(method: Optional[_Method] = ...) -> str: ...
def crypt(word: str, salt: Optional[Union[str, _Method]] = ...) -> str: ...
else:
def crypt(word: str, salt: str) -> str: ...

View File

@@ -1,23 +1,35 @@
# Stubs for ctypes
import sys
from array import array
from typing import (
Any, Callable, ClassVar, Iterator, Iterable, List, Mapping, Optional, Sequence, Sized, Text,
Tuple, Type, Generic, TypeVar, overload,
Any,
Callable,
ClassVar,
Generic,
Iterable,
Iterator,
List,
Mapping,
Optional,
Sequence,
Sized,
Text,
Tuple,
Type,
TypeVar,
Union as _UnionT,
overload,
)
from typing import Union as _UnionT
import sys
_T = TypeVar('_T')
_DLLT = TypeVar('_DLLT', bound=CDLL)
_CT = TypeVar('_CT', bound=_CData)
_T = TypeVar("_T")
_DLLT = TypeVar("_DLLT", bound=CDLL)
_CT = TypeVar("_CT", bound=_CData)
RTLD_GLOBAL: int = ...
RTLD_LOCAL: int = ...
DEFAULT_MODE: int = ...
class CDLL(object):
_func_flags_: ClassVar[int] = ...
_func_restype_: ClassVar[_CData] = ...
@@ -35,9 +47,11 @@ class CDLL(object):
) -> None: ...
def __getattr__(self, name: str) -> _FuncPointer: ...
def __getitem__(self, name: str) -> _FuncPointer: ...
if sys.platform == 'win32':
if sys.platform == "win32":
class OleDLL(CDLL): ...
class WinDLL(CDLL): ...
class PyDLL(CDLL): ...
class LibraryLoader(Generic[_DLLT]):
@@ -47,7 +61,7 @@ class LibraryLoader(Generic[_DLLT]):
def LoadLibrary(self, name: str) -> _DLLT: ...
cdll: LibraryLoader[CDLL] = ...
if sys.platform == 'win32':
if sys.platform == "win32":
windll: LibraryLoader[WinDLL] = ...
oledll: LibraryLoader[OleDLL] = ...
pydll: LibraryLoader[PyDLL] = ...
@@ -66,6 +80,7 @@ class _CDataMeta(type):
# uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here.
def __mul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore
def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore
class _CData(metaclass=_CDataMeta):
_b_base: int = ...
_b_needsfree_: bool = ...
@@ -83,15 +98,9 @@ class _CData(metaclass=_CDataMeta):
class _PointerLike(_CData): ...
_ECT = Callable[[Optional[Type[_CData]],
_FuncPointer,
Tuple[_CData, ...]],
_CData]
_PF = _UnionT[
Tuple[int],
Tuple[int, str],
Tuple[int, str, Any]
]
_ECT = Callable[[Optional[Type[_CData]], _FuncPointer, Tuple[_CData, ...]], _CData]
_PF = _UnionT[Tuple[int], Tuple[int, str], Tuple[int, str, Any]]
class _FuncPointer(_PointerLike, _CData):
restype: _UnionT[Type[_CData], Callable[[int], None], None] = ...
argtypes: Sequence[Type[_CData]] = ...
@@ -101,28 +110,23 @@ class _FuncPointer(_PointerLike, _CData):
@overload
def __init__(self, callable: Callable[..., Any]) -> None: ...
@overload
def __init__(self, func_spec: Tuple[_UnionT[str, int], CDLL],
paramflags: Tuple[_PF, ...] = ...) -> None: ...
def __init__(self, func_spec: Tuple[_UnionT[str, int], CDLL], paramflags: Tuple[_PF, ...] = ...) -> None: ...
@overload
def __init__(self, vtlb_index: int, name: str,
paramflags: Tuple[_PF, ...] = ...,
iid: pointer[c_int] = ...) -> None: ...
def __init__(self, vtlb_index: int, name: str, paramflags: Tuple[_PF, ...] = ..., iid: pointer[c_int] = ...) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
class ArgumentError(Exception): ...
def CFUNCTYPE(
restype: Optional[Type[_CData]], *argtypes: Type[_CData], use_errno: bool = ..., use_last_error: bool = ...
) -> Type[_FuncPointer]: ...
def CFUNCTYPE(restype: Optional[Type[_CData]],
*argtypes: Type[_CData],
use_errno: bool = ...,
use_last_error: bool = ...) -> Type[_FuncPointer]: ...
if sys.platform == 'win32':
def WINFUNCTYPE(restype: Optional[Type[_CData]],
*argtypes: Type[_CData],
use_errno: bool = ...,
use_last_error: bool = ...) -> Type[_FuncPointer]: ...
def PYFUNCTYPE(restype: Optional[Type[_CData]],
*argtypes: Type[_CData]) -> Type[_FuncPointer]: ...
if sys.platform == "win32":
def WINFUNCTYPE(
restype: Optional[Type[_CData]], *argtypes: Type[_CData], use_errno: bool = ..., use_last_error: bool = ...
) -> Type[_FuncPointer]: ...
def PYFUNCTYPE(restype: Optional[Type[_CData]], *argtypes: Type[_CData]) -> Type[_FuncPointer]: ...
class _CArgObject: ...
@@ -138,21 +142,27 @@ _CVoidConstPLike = _UnionT[_CVoidPLike, bytes]
def addressof(obj: _CData) -> int: ...
def alignment(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ...
def byref(obj: _CData, offset: int = ...) -> _CArgObject: ...
_PT = TypeVar('_PT', bound=_PointerLike)
_PT = TypeVar("_PT", bound=_PointerLike)
def cast(obj: _UnionT[_CData, _CArgObject], type: Type[_PT]) -> _PT: ...
def create_string_buffer(init_or_size: _UnionT[int, bytes],
size: Optional[int] = ...) -> Array[c_char]: ...
def create_string_buffer(init_or_size: _UnionT[int, bytes], size: Optional[int] = ...) -> Array[c_char]: ...
c_buffer = create_string_buffer
def create_unicode_buffer(init_or_size: _UnionT[int, Text],
size: Optional[int] = ...) -> Array[c_wchar]: ...
if sys.platform == 'win32':
def create_unicode_buffer(init_or_size: _UnionT[int, Text], size: Optional[int] = ...) -> Array[c_wchar]: ...
if sys.platform == "win32":
def DllCanUnloadNow() -> int: ...
def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO not documented
def FormatError(code: int) -> str: ...
def GetLastError() -> int: ...
def get_errno() -> int: ...
if sys.platform == 'win32':
if sys.platform == "win32":
def get_last_error() -> int: ...
def memmove(dst: _CVoidPLike, src: _CVoidConstPLike, count: int) -> None: ...
def memset(dst: _CVoidPLike, c: int, count: int) -> None: ...
def POINTER(type: Type[_CT]) -> Type[pointer[_CT]]: ...
@@ -174,16 +184,21 @@ class pointer(Generic[_CT], _PointerLike, _CData):
def __setitem__(self, s: slice, o: Iterable[_CT]) -> None: ...
def resize(obj: _CData, size: int) -> None: ...
if sys.version_info < (3,):
def set_conversion_mode(encoding: str, errors: str) -> Tuple[str, str]: ...
def set_errno(value: int) -> int: ...
if sys.platform == 'win32':
if sys.platform == "win32":
def set_last_error(value: int) -> int: ...
def sizeof(obj_or_type: _UnionT[_CData, Type[_CData]]) -> int: ...
def string_at(address: _CVoidConstPLike, size: int = ...) -> bytes: ...
if sys.platform == 'win32':
def WinError(code: Optional[int] = ...,
descr: Optional[str] = ...) -> OSError: ...
if sys.platform == "win32":
def WinError(code: Optional[int] = ..., descr: Optional[str] = ...) -> OSError: ...
def wstring_at(address: _CVoidConstPLike, size: int = ...) -> str: ...
class _SimpleCData(Generic[_T], _CData):
@@ -194,50 +209,42 @@ class c_byte(_SimpleCData[int]): ...
class c_char(_SimpleCData[bytes]):
def __init__(self, value: _UnionT[int, bytes] = ...) -> None: ...
class c_char_p(_PointerLike, _SimpleCData[Optional[bytes]]):
def __init__(self, value: Optional[_UnionT[int, bytes]] = ...) -> None: ...
class c_double(_SimpleCData[float]): ...
class c_longdouble(_SimpleCData[float]): ...
class c_float(_SimpleCData[float]): ...
class c_int(_SimpleCData[int]): ...
class c_int8(_SimpleCData[int]): ...
class c_int16(_SimpleCData[int]): ...
class c_int32(_SimpleCData[int]): ...
class c_int64(_SimpleCData[int]): ...
class c_long(_SimpleCData[int]): ...
class c_longlong(_SimpleCData[int]): ...
class c_short(_SimpleCData[int]): ...
class c_size_t(_SimpleCData[int]): ...
class c_ssize_t(_SimpleCData[int]): ...
class c_ubyte(_SimpleCData[int]): ...
class c_uint(_SimpleCData[int]): ...
class c_uint8(_SimpleCData[int]): ...
class c_uint16(_SimpleCData[int]): ...
class c_uint32(_SimpleCData[int]): ...
class c_uint64(_SimpleCData[int]): ...
class c_ulong(_SimpleCData[int]): ...
class c_ulonglong(_SimpleCData[int]): ...
class c_ushort(_SimpleCData[int]): ...
class c_void_p(_PointerLike, _SimpleCData[Optional[int]]): ...
class c_wchar(_SimpleCData[Text]): ...
class c_wchar_p(_PointerLike, _SimpleCData[Optional[Text]]):
def __init__(self, value: Optional[_UnionT[int, Text]] = ...) -> None: ...
class c_bool(_SimpleCData[bool]):
def __init__(self, value: bool = ...) -> None: ...
if sys.platform == 'win32':
if sys.platform == "win32":
class HRESULT(_SimpleCData[int]): ... # TODO undocumented
class py_object(_SimpleCData[_T]): ...
@@ -245,11 +252,13 @@ class py_object(_SimpleCData[_T]): ...
class _CField:
offset: int = ...
size: int = ...
class _StructUnionMeta(_CDataMeta):
_fields_: Sequence[_UnionT[Tuple[str, Type[_CData]], Tuple[str, Type[_CData], int]]] = ...
_pack_: int = ...
_anonymous_: Sequence[str] = ...
def __getattr__(self, name: str) -> _CField: ...
class _StructUnionBase(_CData, metaclass=_StructUnionMeta):
def __init__(self, *args: Any, **kw: Any) -> None: ...
def __getattr__(self, name: str) -> Any: ...

View File

@@ -1,8 +1,9 @@
# Stubs for ctypes.util
from typing import Optional
import sys
from typing import Optional
def find_library(name: str) -> Optional[str]: ...
if sys.platform == 'win32':
if sys.platform == "win32":
def find_msvcrt() -> Optional[str]: ...

View File

@@ -1,6 +1,23 @@
from ctypes import (
_SimpleCData, Array, Structure, c_byte, c_char, c_char_p, c_double, c_float, c_int, c_long,
c_longlong, c_short, c_uint, c_ulong, c_ulonglong, c_ushort, c_void_p, c_wchar, c_wchar_p,
Array,
Structure,
_SimpleCData,
c_byte,
c_char,
c_char_p,
c_double,
c_float,
c_int,
c_long,
c_longlong,
c_short,
c_uint,
c_ulong,
c_ulonglong,
c_ushort,
c_void_p,
c_wchar,
c_wchar_p,
pointer,
)
@@ -15,7 +32,9 @@ DOUBLE = c_double
FLOAT = c_float
BOOLEAN = BYTE
BOOL = c_long
class VARIANT_BOOL(_SimpleCData[bool]): ...
ULONG = c_ulong
LONG = c_long
USHORT = c_ushort
@@ -86,6 +105,7 @@ class RECT(Structure):
top: LONG
right: LONG
bottom: LONG
RECTL = RECT
_RECTL = RECT
tagRECT = RECT
@@ -95,6 +115,7 @@ class _SMALL_RECT(Structure):
Top: SHORT
Right: SHORT
Bottom: SHORT
SMALL_RECT = _SMALL_RECT
class _COORD(Structure):
@@ -104,6 +125,7 @@ class _COORD(Structure):
class POINT(Structure):
x: LONG
y: LONG
POINTL = POINT
_POINTL = POINT
tagPOINT = POINT
@@ -111,6 +133,7 @@ tagPOINT = POINT
class SIZE(Structure):
cx: LONG
cy: LONG
SIZEL = SIZE
tagSIZE = SIZE
@@ -119,6 +142,7 @@ def RGB(red: int, green: int, blue: int) -> int: ...
class FILETIME(Structure):
dwLowDateTime: DWORD
dwHighDateTime: DWORD
_FILETIME = FILETIME
class MSG(Structure):
@@ -128,6 +152,7 @@ class MSG(Structure):
lParam: LPARAM
time: DWORD
pt: POINT
tagMSG = MSG
MAX_PATH: int

View File

@@ -1,8 +1,8 @@
from _curses import * # noqa: F403
from _curses import _CursesWindow as _CursesWindow
from typing import TypeVar, Callable, Any
from typing import Any, Callable, TypeVar
_T = TypeVar('_T')
_T = TypeVar("_T")
# available after calling `curses.initscr()`
LINES: int

View File

@@ -1,6 +1,6 @@
from typing import List, Union, overload, TypeVar
from typing import List, TypeVar, Union, overload
_Ch = TypeVar('_Ch', str, int)
_Ch = TypeVar("_Ch", str, int)
NUL: int
SOH: int

View File

@@ -1,6 +1,6 @@
import sys
from time import struct_time
from typing import AnyStr, Optional, SupportsAbs, Tuple, Union, overload, ClassVar, Type, TypeVar
from typing import AnyStr, ClassVar, Optional, SupportsAbs, Tuple, Type, TypeVar, Union, overload
_S = TypeVar("_S")
@@ -23,7 +23,6 @@ if sys.version_info >= (3, 2):
utc: ClassVar[timezone]
min: ClassVar[timezone]
max: ClassVar[timezone]
def __init__(self, offset: timedelta, name: str = ...) -> None: ...
def __hash__(self) -> int: ...
@@ -33,9 +32,7 @@ class date:
min: ClassVar[date]
max: ClassVar[date]
resolution: ClassVar[timedelta]
def __new__(cls: Type[_S], year: int, month: int, day: int) -> _S: ...
@classmethod
def fromtimestamp(cls: Type[_S], __timestamp: float) -> _S: ...
@classmethod
@@ -48,14 +45,12 @@ class date:
if sys.version_info >= (3, 8):
@classmethod
def fromisocalendar(cls: Type[_S], year: int, week: int, day: int) -> _S: ...
@property
def year(self) -> int: ...
@property
def month(self) -> int: ...
@property
def day(self) -> int: ...
def ctime(self) -> str: ...
def strftime(self, fmt: _Text) -> str: ...
if sys.version_info >= (3,):
@@ -91,12 +86,20 @@ class time:
resolution: ClassVar[timedelta]
if sys.version_info >= (3, 6):
def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ...,
tzinfo: Optional[_tzinfo] = ..., *, fold: int = ...) -> None: ...
def __init__(
self,
hour: int = ...,
minute: int = ...,
second: int = ...,
microsecond: int = ...,
tzinfo: Optional[_tzinfo] = ...,
*,
fold: int = ...,
) -> None: ...
else:
def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ...,
tzinfo: Optional[_tzinfo] = ...) -> None: ...
def __init__(
self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...
) -> None: ...
@property
def hour(self) -> int: ...
@property
@@ -110,7 +113,6 @@ class time:
if sys.version_info >= (3, 6):
@property
def fold(self) -> int: ...
def __le__(self, other: time) -> bool: ...
def __lt__(self, other: time) -> bool: ...
def __ge__(self, other: time) -> bool: ...
@@ -132,12 +134,20 @@ class time:
def tzname(self) -> Optional[str]: ...
def dst(self) -> Optional[timedelta]: ...
if sys.version_info >= (3, 6):
def replace(self, hour: int = ..., minute: int = ..., second: int = ...,
microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...,
*, fold: int = ...) -> time: ...
def replace(
self,
hour: int = ...,
minute: int = ...,
second: int = ...,
microsecond: int = ...,
tzinfo: Optional[_tzinfo] = ...,
*,
fold: int = ...,
) -> time: ...
else:
def replace(self, hour: int = ..., minute: int = ..., second: int = ...,
microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...) -> time: ...
def replace(
self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...
) -> time: ...
_date = date
_time = time
@@ -148,21 +158,35 @@ class timedelta(SupportsAbs[timedelta]):
resolution: ClassVar[timedelta]
if sys.version_info >= (3, 6):
def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ...,
milliseconds: float = ..., minutes: float = ..., hours: float = ...,
weeks: float = ..., *, fold: int = ...) -> None: ...
def __init__(
self,
days: float = ...,
seconds: float = ...,
microseconds: float = ...,
milliseconds: float = ...,
minutes: float = ...,
hours: float = ...,
weeks: float = ...,
*,
fold: int = ...,
) -> None: ...
else:
def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ...,
milliseconds: float = ..., minutes: float = ..., hours: float = ...,
weeks: float = ...) -> None: ...
def __init__(
self,
days: float = ...,
seconds: float = ...,
microseconds: float = ...,
milliseconds: float = ...,
minutes: float = ...,
hours: float = ...,
weeks: float = ...,
) -> None: ...
@property
def days(self) -> int: ...
@property
def seconds(self) -> int: ...
@property
def microseconds(self) -> int: ...
def total_seconds(self) -> float: ...
def __add__(self, other: timedelta) -> timedelta: ...
def __radd__(self, other: timedelta) -> timedelta: ...
@@ -226,7 +250,6 @@ class datetime(date):
microsecond: int = ...,
tzinfo: Optional[_tzinfo] = ...,
) -> _S: ...
@property
def year(self) -> int: ...
@property
@@ -246,7 +269,6 @@ class datetime(date):
if sys.version_info >= (3, 6):
@property
def fold(self) -> int: ...
@classmethod
def fromtimestamp(cls: Type[_S], t: float, tz: Optional[_tzinfo] = ...) -> _S: ...
@classmethod
@@ -290,13 +312,31 @@ class datetime(date):
def time(self) -> _time: ...
def timetz(self) -> _time: ...
if sys.version_info >= (3, 6):
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
Optional[_tzinfo] = ..., *, fold: int = ...) -> datetime: ...
def replace(
self,
year: int = ...,
month: int = ...,
day: int = ...,
hour: int = ...,
minute: int = ...,
second: int = ...,
microsecond: int = ...,
tzinfo: Optional[_tzinfo] = ...,
*,
fold: int = ...,
) -> datetime: ...
else:
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
Optional[_tzinfo] = ...) -> datetime: ...
def replace(
self,
year: int = ...,
month: int = ...,
day: int = ...,
hour: int = ...,
minute: int = ...,
second: int = ...,
microsecond: int = ...,
tzinfo: Optional[_tzinfo] = ...,
) -> datetime: ...
if sys.version_info >= (3, 8):
def astimezone(self: _S, tz: Optional[_tzinfo] = ...) -> _S: ...
elif sys.version_info >= (3, 3):

View File

@@ -1,9 +1,7 @@
import numbers
import sys
from types import TracebackType
from typing import (
Any, Container, Dict, List, NamedTuple, Optional, overload, Sequence, Text, Tuple, Type, TypeVar, Union,
)
from typing import Any, Container, Dict, List, NamedTuple, Optional, Sequence, Text, Tuple, Type, TypeVar, Union, overload
_Decimal = Union[Decimal, int]
_DecimalNew = Union[Decimal, float, Text, Tuple[int, Sequence[int], int]]
@@ -11,7 +9,7 @@ if sys.version_info >= (3,):
_ComparableNum = Union[Decimal, float, numbers.Rational]
else:
_ComparableNum = Union[Decimal, float]
_DecimalT = TypeVar('_DecimalT', bound=Decimal)
_DecimalT = TypeVar("_DecimalT", bound=Decimal)
class DecimalTuple(NamedTuple):
sign: int
@@ -39,27 +37,16 @@ class DecimalException(ArithmeticError):
def handle(self, context: Context, *args: Any) -> Optional[Decimal]: ...
class Clamped(DecimalException): ...
class InvalidOperation(DecimalException): ...
class ConversionSyntax(InvalidOperation): ...
class DivisionByZero(DecimalException, ZeroDivisionError): ...
class DivisionImpossible(InvalidOperation): ...
class DivisionUndefined(InvalidOperation, ZeroDivisionError): ...
class Inexact(DecimalException): ...
class InvalidContext(InvalidOperation): ...
class Rounded(DecimalException): ...
class Subnormal(DecimalException): ...
class Overflow(Inexact, Rounded): ...
class Underflow(Inexact, Rounded, Subnormal): ...
if sys.version_info >= (3,):
@@ -80,15 +67,12 @@ class Decimal(object):
def __div__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ...
def __rdiv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ...
def __ne__(self, other: object, context: Optional[Context] = ...) -> bool: ...
def compare(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ...
def __hash__(self) -> int: ...
def as_tuple(self) -> DecimalTuple: ...
if sys.version_info >= (3, 6):
def as_integer_ratio(self) -> Tuple[int, int]: ...
def to_eng_string(self, context: Optional[Context] = ...) -> str: ...
if sys.version_info >= (3,):
def __abs__(self) -> Decimal: ...
def __add__(self, other: _Decimal) -> Decimal: ...
@@ -139,9 +123,7 @@ class Decimal(object):
def __str__(self, eng: bool = ..., context: Optional[Context] = ...) -> str: ...
def __sub__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ...
def __truediv__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ...
def remainder_near(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ...
def __float__(self) -> float: ...
def __int__(self) -> int: ...
def __trunc__(self) -> int: ...
@@ -161,16 +143,15 @@ class Decimal(object):
else:
def __long__(self) -> long: ...
def fma(self, other: _Decimal, third: _Decimal, context: Optional[Context] = ...) -> Decimal: ...
def __rpow__(self, other: _Decimal, context: Optional[Context] = ...) -> Decimal: ...
def normalize(self, context: Optional[Context] = ...) -> Decimal: ...
if sys.version_info >= (3,):
def quantize(self, exp: _Decimal, rounding: Optional[str] = ...,
context: Optional[Context] = ...) -> Decimal: ...
def quantize(self, exp: _Decimal, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ...
def same_quantum(self, other: _Decimal, context: Optional[Context] = ...) -> bool: ...
else:
def quantize(self, exp: _Decimal, rounding: Optional[str] = ...,
context: Optional[Context] = ..., watchexp: bool = ...) -> Decimal: ...
def quantize(
self, exp: _Decimal, rounding: Optional[str] = ..., context: Optional[Context] = ..., watchexp: bool = ...
) -> Decimal: ...
def same_quantum(self, other: _Decimal) -> bool: ...
def to_integral_exact(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ...
def to_integral_value(self, rounding: Optional[str] = ..., context: Optional[Context] = ...) -> Decimal: ...
@@ -251,19 +232,31 @@ class Context(object):
traps: Dict[_TrapType, bool]
flags: Dict[_TrapType, bool]
if sys.version_info >= (3,):
def __init__(self, prec: Optional[int] = ..., rounding: Optional[str] = ...,
Emin: Optional[int] = ..., Emax: Optional[int] = ...,
capitals: Optional[int] = ..., clamp: Optional[int] = ...,
flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ...,
traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ...,
_ignored_flags: Optional[List[_TrapType]] = ...) -> None: ...
def __init__(
self,
prec: Optional[int] = ...,
rounding: Optional[str] = ...,
Emin: Optional[int] = ...,
Emax: Optional[int] = ...,
capitals: Optional[int] = ...,
clamp: Optional[int] = ...,
flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ...,
traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ...,
_ignored_flags: Optional[List[_TrapType]] = ...,
) -> None: ...
else:
def __init__(self, prec: Optional[int] = ..., rounding: Optional[str] = ...,
traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ...,
flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ...,
Emin: Optional[int] = ..., Emax: Optional[int] = ...,
capitals: Optional[int] = ..., _clamp: Optional[int] = ...,
_ignored_flags: Optional[List[_TrapType]] = ...) -> None: ...
def __init__(
self,
prec: Optional[int] = ...,
rounding: Optional[str] = ...,
traps: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ...,
flags: Union[None, Dict[_TrapType, bool], Container[_TrapType]] = ...,
Emin: Optional[int] = ...,
Emax: Optional[int] = ...,
capitals: Optional[int] = ...,
_clamp: Optional[int] = ...,
_ignored_flags: Optional[List[_TrapType]] = ...,
) -> None: ...
if sys.version_info >= (3,):
# __setattr__() only allows to set a specific set of attributes,
# already defined above.

View File

@@ -2,17 +2,30 @@
import sys
from typing import (
Any, TypeVar, Callable, Iterable, Iterator, List, NamedTuple, Sequence, Tuple,
Generic, Optional, Text, Union, AnyStr, overload
Any,
AnyStr,
Callable,
Generic,
Iterable,
Iterator,
List,
NamedTuple,
Optional,
Sequence,
Text,
Tuple,
TypeVar,
Union,
overload,
)
_T = TypeVar('_T')
_T = TypeVar("_T")
if sys.version_info >= (3,):
_StrType = Text
else:
# Aliases can't point to type vars, so we need to redeclare AnyStr
_StrType = TypeVar('_StrType', Text, bytes)
_StrType = TypeVar("_StrType", Text, bytes)
_JunkCallback = Union[Callable[[Text], bool], Callable[[str], bool]]
@@ -22,31 +35,37 @@ class Match(NamedTuple):
size: int
class SequenceMatcher(Generic[_T]):
def __init__(self, isjunk: Optional[Callable[[_T], bool]] = ...,
a: Sequence[_T] = ..., b: Sequence[_T] = ...,
autojunk: bool = ...) -> None: ...
def __init__(
self, isjunk: Optional[Callable[[_T], bool]] = ..., a: Sequence[_T] = ..., b: Sequence[_T] = ..., autojunk: bool = ...
) -> None: ...
def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ...
def set_seq1(self, a: Sequence[_T]) -> None: ...
def set_seq2(self, b: Sequence[_T]) -> None: ...
if sys.version_info >= (3, 9):
def find_longest_match(self, alo: int = ..., ahi: Optional[int] = ..., blo: int = ..., bhi: Optional[int] = ...) -> Match: ...
def find_longest_match(
self, alo: int = ..., ahi: Optional[int] = ..., blo: int = ..., bhi: Optional[int] = ...
) -> Match: ...
else:
def find_longest_match(self, alo: int, ahi: int, blo: int, bhi: int) -> Match: ...
def get_matching_blocks(self) -> List[Match]: ...
def get_opcodes(self) -> List[Tuple[str, int, int, int, int]]: ...
def get_grouped_opcodes(self, n: int = ...
) -> Iterable[List[Tuple[str, int, int, int, int]]]: ...
def get_grouped_opcodes(self, n: int = ...) -> Iterable[List[Tuple[str, int, int, int, int]]]: ...
def ratio(self) -> float: ...
def quick_ratio(self) -> float: ...
def real_quick_ratio(self) -> float: ...
# mypy thinks the signatures of the overloads overlap, but the types still work fine
@overload
def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], # type: ignore
n: int = ..., cutoff: float = ...) -> List[AnyStr]: ...
def get_close_matches( # type: ignore
word: AnyStr,
possibilities: Iterable[AnyStr],
n: int = ...,
cutoff: float = ...,
) -> List[AnyStr]: ...
@overload
def get_close_matches(word: Sequence[_T], possibilities: Iterable[Sequence[_T]],
n: int = ..., cutoff: float = ...) -> List[Sequence[_T]]: ...
def get_close_matches(
word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = ..., cutoff: float = ...
) -> List[Sequence[_T]]: ...
class Differ:
def __init__(self, linejunk: Optional[_JunkCallback] = ..., charjunk: Optional[_JunkCallback] = ...) -> None: ...
@@ -54,33 +73,69 @@ class Differ:
def IS_LINE_JUNK(line: _StrType, pat: Any = ...) -> bool: ... # pat is undocumented
def IS_CHARACTER_JUNK(ch: _StrType, ws: _StrType = ...) -> bool: ... # ws is undocumented
def unified_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ...,
tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ...,
n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ...
def context_diff(a: Sequence[_StrType], b: Sequence[_StrType], fromfile: _StrType = ...,
tofile: _StrType = ..., fromfiledate: _StrType = ..., tofiledate: _StrType = ...,
n: int = ..., lineterm: _StrType = ...) -> Iterator[_StrType]: ...
def ndiff(a: Sequence[_StrType], b: Sequence[_StrType],
linejunk: Optional[_JunkCallback] = ...,
charjunk: Optional[_JunkCallback] = ...
) -> Iterator[_StrType]: ...
def unified_diff(
a: Sequence[_StrType],
b: Sequence[_StrType],
fromfile: _StrType = ...,
tofile: _StrType = ...,
fromfiledate: _StrType = ...,
tofiledate: _StrType = ...,
n: int = ...,
lineterm: _StrType = ...,
) -> Iterator[_StrType]: ...
def context_diff(
a: Sequence[_StrType],
b: Sequence[_StrType],
fromfile: _StrType = ...,
tofile: _StrType = ...,
fromfiledate: _StrType = ...,
tofiledate: _StrType = ...,
n: int = ...,
lineterm: _StrType = ...,
) -> Iterator[_StrType]: ...
def ndiff(
a: Sequence[_StrType], b: Sequence[_StrType], linejunk: Optional[_JunkCallback] = ..., charjunk: Optional[_JunkCallback] = ...
) -> Iterator[_StrType]: ...
class HtmlDiff(object):
def __init__(self, tabsize: int = ..., wrapcolumn: Optional[int] = ...,
linejunk: Optional[_JunkCallback] = ...,
charjunk: Optional[_JunkCallback] = ...
) -> None: ...
def __init__(
self,
tabsize: int = ...,
wrapcolumn: Optional[int] = ...,
linejunk: Optional[_JunkCallback] = ...,
charjunk: Optional[_JunkCallback] = ...,
) -> None: ...
if sys.version_info >= (3, 5):
def make_file(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType],
fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ...,
numlines: int = ..., *, charset: str = ...) -> _StrType: ...
def make_file(
self,
fromlines: Sequence[_StrType],
tolines: Sequence[_StrType],
fromdesc: _StrType = ...,
todesc: _StrType = ...,
context: bool = ...,
numlines: int = ...,
*,
charset: str = ...,
) -> _StrType: ...
else:
def make_file(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType],
fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ...,
numlines: int = ...) -> _StrType: ...
def make_table(self, fromlines: Sequence[_StrType], tolines: Sequence[_StrType],
fromdesc: _StrType = ..., todesc: _StrType = ..., context: bool = ...,
numlines: int = ...) -> _StrType: ...
def make_file(
self,
fromlines: Sequence[_StrType],
tolines: Sequence[_StrType],
fromdesc: _StrType = ...,
todesc: _StrType = ...,
context: bool = ...,
numlines: int = ...,
) -> _StrType: ...
def make_table(
self,
fromlines: Sequence[_StrType],
tolines: Sequence[_StrType],
fromdesc: _StrType = ...,
todesc: _StrType = ...,
context: bool = ...,
numlines: int = ...,
) -> _StrType: ...
def restore(delta: Iterable[_StrType], which: int) -> Iterator[_StrType]: ...
@@ -94,5 +149,5 @@ if sys.version_info >= (3, 5):
fromfiledate: bytes = ...,
tofiledate: bytes = ...,
n: int = ...,
lineterm: bytes = ...
lineterm: bytes = ...,
) -> Iterator[bytes]: ...

View File

@@ -1,12 +1,20 @@
from typing import Callable, List, Union, Iterator, Tuple, Optional, Any, IO, NamedTuple, Dict
import sys
import types
from opcode import (hasconst as hasconst, hasname as hasname, hasjrel as hasjrel,
hasjabs as hasjabs, haslocal as haslocal, hascompare as hascompare,
hasfree as hasfree, cmp_op as cmp_op, opname as opname, opmap as opmap,
HAVE_ARGUMENT as HAVE_ARGUMENT, EXTENDED_ARG as EXTENDED_ARG)
from opcode import (
EXTENDED_ARG as EXTENDED_ARG,
HAVE_ARGUMENT as HAVE_ARGUMENT,
cmp_op as cmp_op,
hascompare as hascompare,
hasconst as hasconst,
hasfree as hasfree,
hasjabs as hasjabs,
hasjrel as hasjrel,
haslocal as haslocal,
hasname as hasname,
opmap as opmap,
opname as opname,
)
from typing import IO, Any, Callable, Dict, Iterator, List, NamedTuple, Optional, Tuple, Union
if sys.version_info >= (3, 4):
from opcode import stack_effect as stack_effect
@@ -19,7 +27,6 @@ if sys.version_info >= (3, 6):
_have_code = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]]
_have_code_or_string = Union[_have_code, str, bytes]
if sys.version_info >= (3, 4):
class Instruction(NamedTuple):
opname: str
@@ -30,24 +37,21 @@ if sys.version_info >= (3, 4):
offset: int
starts_line: Optional[int]
is_jump_target: bool
class Bytecode:
codeobj: types.CodeType
first_line: int
def __init__(self, x: _have_code_or_string, *, first_line: Optional[int] = ...,
current_offset: Optional[int] = ...) -> None: ...
def __init__(
self, x: _have_code_or_string, *, first_line: Optional[int] = ..., current_offset: Optional[int] = ...
) -> None: ...
def __iter__(self) -> Iterator[Instruction]: ...
def __repr__(self) -> str: ...
def info(self) -> str: ...
def dis(self) -> str: ...
@classmethod
def from_traceback(cls, tb: types.TracebackType) -> Bytecode: ...
COMPILER_FLAG_NAMES: Dict[int, str]
def findlabels(code: _have_code) -> List[int]: ...
def findlinestarts(code: _have_code) -> Iterator[Tuple[int, int]]: ...
@@ -57,8 +61,10 @@ if sys.version_info >= (3, 0):
if sys.version_info >= (3, 7):
def dis(x: Optional[_have_code_or_string] = ..., *, file: Optional[IO[str]] = ..., depth: Optional[int] = ...) -> None: ...
elif sys.version_info >= (3, 4):
def dis(x: Optional[_have_code_or_string] = ..., *, file: Optional[IO[str]] = ...) -> None: ...
else:
def dis(x: _have_code_or_string = ...) -> None: ...
@@ -67,12 +73,11 @@ if sys.version_info >= (3, 4):
def disassemble(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ...
def disco(co: _have_code, lasti: int = ..., *, file: Optional[IO[str]] = ...) -> None: ...
def show_code(co: _have_code, *, file: Optional[IO[str]] = ...) -> None: ...
def get_instructions(x: _have_code, *, first_line: Optional[int] = ...) -> Iterator[Instruction]: ...
else:
def distb(tb: types.TracebackType = ...) -> None: ...
def disassemble(co: _have_code, lasti: int = ...) -> None: ...
def disco(co: _have_code, lasti: int = ...) -> None: ...
if sys.version_info >= (3, 0):
def show_code(co: _have_code) -> None: ...

View File

@@ -2,11 +2,13 @@
from typing import Optional
def make_archive(base_name: str, format: str, root_dir: Optional[str] = ...,
base_dir: Optional[str] = ..., verbose: int = ...,
dry_run: int = ...) -> str: ...
def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ...,
verbose: int = ..., dry_run: int = ...) -> str: ...
def make_zipfile(base_name: str, base_dir: str, verbose: int = ...,
dry_run: int = ...) -> str: ...
def make_archive(
base_name: str,
format: str,
root_dir: Optional[str] = ...,
base_dir: Optional[str] = ...,
verbose: int = ...,
dry_run: int = ...,
) -> str: ...
def make_tarball(base_name: str, base_dir: str, compress: Optional[str] = ..., verbose: int = ..., dry_run: int = ...) -> str: ...
def make_zipfile(base_name: str, base_dir: str, verbose: int = ..., dry_run: int = ...) -> str: ...

View File

@@ -2,5 +2,4 @@
from distutils.ccompiler import CCompiler
class BCPPCompiler(CCompiler): ...

View File

@@ -2,20 +2,16 @@
from typing import Any, Callable, List, Optional, Tuple, Union
_Macro = Union[Tuple[str], Tuple[str, Optional[str]]]
def gen_lib_options(compiler: CCompiler, library_dirs: List[str],
runtime_library_dirs: List[str],
libraries: List[str]) -> List[str]: ...
def gen_preprocess_options(macros: List[_Macro],
include_dirs: List[str]) -> List[str]: ...
def get_default_compiler(osname: Optional[str] = ...,
platform: Optional[str] = ...) -> str: ...
def new_compiler(plat: Optional[str] = ..., compiler: Optional[str] = ...,
verbose: int = ..., dry_run: int = ...,
force: int = ...) -> CCompiler: ...
def gen_lib_options(
compiler: CCompiler, library_dirs: List[str], runtime_library_dirs: List[str], libraries: List[str]
) -> List[str]: ...
def gen_preprocess_options(macros: List[_Macro], include_dirs: List[str]) -> List[str]: ...
def get_default_compiler(osname: Optional[str] = ..., platform: Optional[str] = ...) -> str: ...
def new_compiler(
plat: Optional[str] = ..., compiler: Optional[str] = ..., verbose: int = ..., dry_run: int = ..., force: int = ...
) -> CCompiler: ...
def show_compilers() -> None: ...
class CCompiler:
@@ -29,8 +25,7 @@ class CCompiler:
library_dirs: List[str]
runtime_library_dirs: List[str]
objects: List[str]
def __init__(self, verbose: int = ..., dry_run: int = ...,
force: int = ...) -> None: ...
def __init__(self, verbose: int = ..., dry_run: int = ..., force: int = ...) -> None: ...
def add_include_dir(self, dir: str) -> None: ...
def set_include_dirs(self, dirs: List[str]) -> None: ...
def add_library(self, libname: str) -> None: ...
@@ -44,83 +39,111 @@ class CCompiler:
def add_link_object(self, object: str) -> None: ...
def set_link_objects(self, objects: List[str]) -> None: ...
def detect_language(self, sources: Union[str, List[str]]) -> Optional[str]: ...
def find_library_file(self, dirs: List[str], lib: str,
debug: bool = ...) -> Optional[str]: ...
def has_function(self, funcname: str, includes: Optional[List[str]] = ...,
include_dirs: Optional[List[str]] = ...,
libraries: Optional[List[str]] = ...,
library_dirs: Optional[List[str]] = ...) -> bool: ...
def find_library_file(self, dirs: List[str], lib: str, debug: bool = ...) -> Optional[str]: ...
def has_function(
self,
funcname: str,
includes: Optional[List[str]] = ...,
include_dirs: Optional[List[str]] = ...,
libraries: Optional[List[str]] = ...,
library_dirs: Optional[List[str]] = ...,
) -> bool: ...
def library_dir_option(self, dir: str) -> str: ...
def library_option(self, lib: str) -> str: ...
def runtime_library_dir_option(self, dir: str) -> str: ...
def set_executables(self, **args: str) -> None: ...
def compile(self, sources: List[str], output_dir: Optional[str] = ...,
macros: Optional[_Macro] = ...,
include_dirs: Optional[List[str]] = ..., debug: bool = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
depends: Optional[List[str]] = ...) -> List[str]: ...
def create_static_lib(self, objects: List[str], output_libname: str,
output_dir: Optional[str] = ..., debug: bool = ...,
target_lang: Optional[str] = ...) -> None: ...
def link(self, target_desc: str, objects: List[str], output_filename: str,
output_dir: Optional[str] = ...,
libraries: Optional[List[str]] = ...,
library_dirs: Optional[List[str]] = ...,
runtime_library_dirs: Optional[List[str]] = ...,
export_symbols: Optional[List[str]] = ..., debug: bool = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
build_temp: Optional[str] = ...,
target_lang: Optional[str] = ...) -> None: ...
def link_executable(self, objects: List[str], output_progname: str,
output_dir: Optional[str] = ...,
libraries: Optional[List[str]] = ...,
library_dirs: Optional[List[str]] = ...,
runtime_library_dirs: Optional[List[str]] = ...,
debug: bool = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
target_lang: Optional[str] = ...) -> None: ...
def link_shared_lib(self, objects: List[str], output_libname: str,
output_dir: Optional[str] = ...,
libraries: Optional[List[str]] = ...,
library_dirs: Optional[List[str]] = ...,
runtime_library_dirs: Optional[List[str]] = ...,
export_symbols: Optional[List[str]] = ...,
debug: bool = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
build_temp: Optional[str] = ...,
target_lang: Optional[str] = ...) -> None: ...
def link_shared_object(self, objects: List[str], output_filename: str,
output_dir: Optional[str] = ...,
libraries: Optional[List[str]] = ...,
library_dirs: Optional[List[str]] = ...,
runtime_library_dirs: Optional[List[str]] = ...,
export_symbols: Optional[List[str]] = ...,
debug: bool = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
build_temp: Optional[str] = ...,
target_lang: Optional[str] = ...) -> None: ...
def preprocess(self, source: str, output_file: Optional[str] = ...,
macros: Optional[List[_Macro]] = ...,
include_dirs: Optional[List[str]] = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...) -> None: ...
def executable_filename(self, basename: str, strip_dir: int = ...,
output_dir: str = ...) -> str: ...
def library_filename(self, libname: str, lib_type: str = ...,
strip_dir: int = ...,
output_dir: str = ...) -> str: ...
def object_filenames(self, source_filenames: List[str],
strip_dir: int = ...,
output_dir: str = ...) -> List[str]: ...
def shared_object_filename(self, basename: str, strip_dir: int = ...,
output_dir: str = ...) -> str: ...
def execute(self, func: Callable[..., None], args: Tuple[Any, ...],
msg: Optional[str] = ..., level: int = ...) -> None: ...
def compile(
self,
sources: List[str],
output_dir: Optional[str] = ...,
macros: Optional[_Macro] = ...,
include_dirs: Optional[List[str]] = ...,
debug: bool = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
depends: Optional[List[str]] = ...,
) -> List[str]: ...
def create_static_lib(
self,
objects: List[str],
output_libname: str,
output_dir: Optional[str] = ...,
debug: bool = ...,
target_lang: Optional[str] = ...,
) -> None: ...
def link(
self,
target_desc: str,
objects: List[str],
output_filename: str,
output_dir: Optional[str] = ...,
libraries: Optional[List[str]] = ...,
library_dirs: Optional[List[str]] = ...,
runtime_library_dirs: Optional[List[str]] = ...,
export_symbols: Optional[List[str]] = ...,
debug: bool = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
build_temp: Optional[str] = ...,
target_lang: Optional[str] = ...,
) -> None: ...
def link_executable(
self,
objects: List[str],
output_progname: str,
output_dir: Optional[str] = ...,
libraries: Optional[List[str]] = ...,
library_dirs: Optional[List[str]] = ...,
runtime_library_dirs: Optional[List[str]] = ...,
debug: bool = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
target_lang: Optional[str] = ...,
) -> None: ...
def link_shared_lib(
self,
objects: List[str],
output_libname: str,
output_dir: Optional[str] = ...,
libraries: Optional[List[str]] = ...,
library_dirs: Optional[List[str]] = ...,
runtime_library_dirs: Optional[List[str]] = ...,
export_symbols: Optional[List[str]] = ...,
debug: bool = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
build_temp: Optional[str] = ...,
target_lang: Optional[str] = ...,
) -> None: ...
def link_shared_object(
self,
objects: List[str],
output_filename: str,
output_dir: Optional[str] = ...,
libraries: Optional[List[str]] = ...,
library_dirs: Optional[List[str]] = ...,
runtime_library_dirs: Optional[List[str]] = ...,
export_symbols: Optional[List[str]] = ...,
debug: bool = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
build_temp: Optional[str] = ...,
target_lang: Optional[str] = ...,
) -> None: ...
def preprocess(
self,
source: str,
output_file: Optional[str] = ...,
macros: Optional[List[_Macro]] = ...,
include_dirs: Optional[List[str]] = ...,
extra_preargs: Optional[List[str]] = ...,
extra_postargs: Optional[List[str]] = ...,
) -> None: ...
def executable_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ...
def library_filename(self, libname: str, lib_type: str = ..., strip_dir: int = ..., output_dir: str = ...) -> str: ...
def object_filenames(self, source_filenames: List[str], strip_dir: int = ..., output_dir: str = ...) -> List[str]: ...
def shared_object_filename(self, basename: str, strip_dir: int = ..., output_dir: str = ...) -> str: ...
def execute(self, func: Callable[..., None], args: Tuple[Any, ...], msg: Optional[str] = ..., level: int = ...) -> None: ...
def spawn(self, cmd: List[str]) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
def move_file(self, src: str, dst: str) -> str: ...

View File

@@ -1,8 +1,8 @@
# Stubs for distutils.cmd
from typing import Callable, List, Tuple, Union, Optional, Iterable, Any, Text
from abc import abstractmethod
from distutils.dist import Distribution
from typing import Any, Callable, Iterable, List, Optional, Text, Tuple, Union
class Command:
sub_commands: List[Tuple[str, Optional[Callable[[Command], bool]]]]
@@ -13,28 +13,57 @@ class Command:
def finalize_options(self) -> None: ...
@abstractmethod
def run(self) -> None: ...
def announce(self, msg: Text, level: int = ...) -> None: ...
def debug_print(self, msg: Text) -> None: ...
def ensure_string(self, option: str, default: Optional[str] = ...) -> None: ...
def ensure_string_list(self, option: Union[str, List[str]]) -> None: ...
def ensure_filename(self, option: str) -> None: ...
def ensure_dirname(self, option: str) -> None: ...
def get_command_name(self) -> str: ...
def set_undefined_options(self, src_cmd: Text, *option_pairs: Tuple[str, str]) -> None: ...
def get_finalized_command(self, command: Text, create: int = ...) -> Command: ...
def reinitialize_command(self, command: Union[Command, Text], reinit_subcommands: int = ...) -> Command: ...
def run_command(self, command: Text) -> None: ...
def get_sub_commands(self) -> List[str]: ...
def warn(self, msg: Text) -> None: ...
def execute(self, func: Callable[..., Any], args: Iterable[Any], msg: Optional[Text] = ..., level: int = ...) -> None: ...
def mkpath(self, name: str, mode: int = ...) -> None: ...
def copy_file(self, infile: str, outfile: str, preserve_mode: int = ..., preserve_times: int = ..., link: Optional[str] = ..., level: Any = ...) -> Tuple[str, bool]: ... # level is not used
def copy_tree(self, infile: str, outfile: str, preserve_mode: int = ..., preserve_times: int = ..., preserve_symlinks: int = ..., level: Any = ...) -> List[str]: ... # level is not used
def copy_file(
self,
infile: str,
outfile: str,
preserve_mode: int = ...,
preserve_times: int = ...,
link: Optional[str] = ...,
level: Any = ...,
) -> Tuple[str, bool]: ... # level is not used
def copy_tree(
self,
infile: str,
outfile: str,
preserve_mode: int = ...,
preserve_times: int = ...,
preserve_symlinks: int = ...,
level: Any = ...,
) -> List[str]: ... # level is not used
def move_file(self, src: str, dst: str, level: Any = ...) -> str: ... # level is not used
def spawn(self, cmd: Iterable[str], search_path: int = ..., level: Any = ...) -> None: ... # level is not used
def make_archive(self, base_name: str, format: str, root_dir: Optional[str] = ..., base_dir: Optional[str] = ..., owner: Optional[str] = ..., group: Optional[str] = ...) -> str: ...
def make_file(self, infiles: Union[str, List[str], Tuple[str]], outfile: str, func: Callable[..., Any], args: List[Any], exec_msg: Optional[str] = ..., skip_msg: Optional[str] = ..., level: Any = ...) -> None: ... # level is not used
def make_archive(
self,
base_name: str,
format: str,
root_dir: Optional[str] = ...,
base_dir: Optional[str] = ...,
owner: Optional[str] = ...,
group: Optional[str] = ...,
) -> str: ...
def make_file(
self,
infiles: Union[str, List[str], Tuple[str]],
outfile: str,
func: Callable[..., Any],
args: List[Any],
exec_msg: Optional[str] = ...,
skip_msg: Optional[str] = ...,
level: Any = ...,
) -> None: ... # level is not used

View File

@@ -1,10 +1,9 @@
from distutils.cmd import Command
import sys
from distutils.cmd import Command
if sys.version_info >= (3,):
class build_py(Command):
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...
class build_py_2to3(build_py): ...

View File

@@ -1,14 +1,12 @@
from distutils.cmd import Command
from typing import Optional, Text
class install(Command):
user: bool
prefix: Optional[Text]
home: Optional[Text]
root: Optional[Text]
install_lib: Optional[Text]
def initialize_options(self) -> None: ...
def finalize_options(self) -> None: ...
def run(self) -> None: ...

View File

@@ -1,9 +1,9 @@
# Stubs for distutils.core
from typing import Any, List, Mapping, Optional, Tuple, Type, Union
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
from distutils.extension import Extension as Extension
from typing import Any, List, Mapping, Optional, Tuple, Type, Union
def setup(
*,

View File

@@ -2,6 +2,5 @@
from distutils.unixccompiler import UnixCCompiler
class CygwinCCompiler(UnixCCompiler): ...
class Mingw32CCompiler(CygwinCCompiler): ...

View File

@@ -3,6 +3,5 @@
from typing import List, Tuple
def newer(source: str, target: str) -> bool: ...
def newer_pairwise(sources: List[str],
targets: List[str]) -> List[Tuple[str, str]]: ...
def newer_pairwise(sources: List[str], targets: List[str]) -> List[Tuple[str, str]]: ...
def newer_group(sources: List[str], target: str, missing: str = ...) -> bool: ...

View File

@@ -2,14 +2,16 @@
from typing import List
def mkpath(name: str, mode: int = ..., verbose: int = ...,
dry_run: int = ...) -> List[str]: ...
def create_tree(base_dir: str, files: List[str], mode: int = ...,
verbose: int = ..., dry_run: int = ...) -> None: ...
def copy_tree(src: str, dst: str, preserve_mode: int = ...,
preserve_times: int = ..., preserve_symlinks: int = ...,
update: int = ..., verbose: int = ...,
dry_run: int = ...) -> List[str]: ...
def remove_tree(directory: str, verbose: int = ...,
dry_run: int = ...) -> None: ...
def mkpath(name: str, mode: int = ..., verbose: int = ..., dry_run: int = ...) -> List[str]: ...
def create_tree(base_dir: str, files: List[str], mode: int = ..., verbose: int = ..., dry_run: int = ...) -> None: ...
def copy_tree(
src: str,
dst: str,
preserve_mode: int = ...,
preserve_times: int = ...,
preserve_symlinks: int = ...,
update: int = ...,
verbose: int = ...,
dry_run: int = ...,
) -> List[str]: ...
def remove_tree(directory: str, verbose: int = ..., dry_run: int = ...) -> None: ...

View File

@@ -1,9 +1,7 @@
# Stubs for distutils.dist
from distutils.cmd import Command
from typing import Any, Dict, Iterable, Mapping, Optional, Text, Tuple, Type
class Distribution:
cmdclass: Dict[str, Type[Command]]
def __init__(self, attrs: Optional[Mapping[str, Any]] = ...) -> None: ...

View File

@@ -1,41 +1,45 @@
# Stubs for distutils.extension
from typing import List, Optional, Tuple
import sys
from typing import List, Optional, Tuple
class Extension:
if sys.version_info >= (3,):
def __init__(self,
name: str,
sources: List[str],
include_dirs: List[str] = ...,
define_macros: List[Tuple[str, Optional[str]]] = ...,
undef_macros: List[str] = ...,
library_dirs: List[str] = ...,
libraries: List[str] = ...,
runtime_library_dirs: List[str] = ...,
extra_objects: List[str] = ...,
extra_compile_args: List[str] = ...,
extra_link_args: List[str] = ...,
export_symbols: List[str] = ...,
swig_opts: Optional[str] = ..., # undocumented
depends: List[str] = ...,
language: str = ...,
optional: bool = ...) -> None: ...
def __init__(
self,
name: str,
sources: List[str],
include_dirs: List[str] = ...,
define_macros: List[Tuple[str, Optional[str]]] = ...,
undef_macros: List[str] = ...,
library_dirs: List[str] = ...,
libraries: List[str] = ...,
runtime_library_dirs: List[str] = ...,
extra_objects: List[str] = ...,
extra_compile_args: List[str] = ...,
extra_link_args: List[str] = ...,
export_symbols: List[str] = ...,
swig_opts: Optional[str] = ..., # undocumented
depends: List[str] = ...,
language: str = ...,
optional: bool = ...,
) -> None: ...
else:
def __init__(self,
name: str,
sources: List[str],
include_dirs: List[str] = ...,
define_macros: List[Tuple[str, Optional[str]]] = ...,
undef_macros: List[str] = ...,
library_dirs: List[str] = ...,
libraries: List[str] = ...,
runtime_library_dirs: List[str] = ...,
extra_objects: List[str] = ...,
extra_compile_args: List[str] = ...,
extra_link_args: List[str] = ...,
export_symbols: List[str] = ...,
swig_opts: Optional[str] = ..., # undocumented
depends: List[str] = ...,
language: str = ...) -> None: ...
def __init__(
self,
name: str,
sources: List[str],
include_dirs: List[str] = ...,
define_macros: List[Tuple[str, Optional[str]]] = ...,
undef_macros: List[str] = ...,
library_dirs: List[str] = ...,
libraries: List[str] = ...,
runtime_library_dirs: List[str] = ...,
extra_objects: List[str] = ...,
extra_compile_args: List[str] = ...,
extra_link_args: List[str] = ...,
export_symbols: List[str] = ...,
swig_opts: Optional[str] = ..., # undocumented
depends: List[str] = ...,
language: str = ...,
) -> None: ...

View File

@@ -1,17 +1,13 @@
# Stubs for distutils.fancy_getopt
from typing import (
Any, List, Mapping, Optional, Tuple, Union,
TypeVar, overload,
)
from typing import Any, List, Mapping, Optional, Tuple, TypeVar, Union, overload
_Option = Tuple[str, Optional[str], str]
_GR = Tuple[List[str], OptionDummy]
def fancy_getopt(options: List[_Option],
negative_opt: Mapping[_Option, _Option],
object: Any,
args: Optional[List[str]]) -> Union[List[str], _GR]: ...
def fancy_getopt(
options: List[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: Optional[List[str]]
) -> Union[List[str], _GR]: ...
def wrap_text(text: str, width: int) -> List[str]: ...
class FancyGetopt:

View File

@@ -2,11 +2,15 @@
from typing import Optional, Sequence, Tuple
def copy_file(src: str, dst: str, preserve_mode: bool = ...,
preserve_times: bool = ..., update: bool = ...,
link: Optional[str] = ..., verbose: bool = ...,
dry_run: bool = ...) -> Tuple[str, str]: ...
def move_file(src: str, dst: str, verbose: bool = ...,
dry_run: bool = ...) -> str: ...
def copy_file(
src: str,
dst: str,
preserve_mode: bool = ...,
preserve_times: bool = ...,
update: bool = ...,
link: Optional[str] = ...,
verbose: bool = ...,
dry_run: bool = ...,
) -> Tuple[str, str]: ...
def move_file(src: str, dst: str, verbose: bool = ..., dry_run: bool = ...) -> str: ...
def write_file(filename: str, contents: Sequence[str]) -> None: ...

View File

@@ -2,5 +2,4 @@
from distutils.ccompiler import CCompiler
class MSVCCompiler(CCompiler): ...

View File

@@ -2,7 +2,5 @@
from typing import List, Optional
def spawn(cmd: List[str], search_path: bool = ...,
verbose: bool = ..., dry_run: bool = ...) -> None: ...
def find_executable(executable: str,
path: Optional[str] = ...) -> Optional[str]: ...
def spawn(cmd: List[str], search_path: bool = ..., verbose: bool = ..., dry_run: bool = ...) -> None: ...
def find_executable(executable: str, path: Optional[str] = ...) -> Optional[str]: ...

View File

@@ -1,7 +1,7 @@
# Stubs for distutils.sysconfig
from typing import Mapping, Optional, Union
from distutils.ccompiler import CCompiler
from typing import Mapping, Optional, Union
PREFIX: str
EXEC_PREFIX: str
@@ -10,10 +10,7 @@ def get_config_var(name: str) -> Union[int, str, None]: ...
def get_config_vars(*args: str) -> Mapping[str, Union[int, str]]: ...
def get_config_h_filename() -> str: ...
def get_makefile_filename() -> str: ...
def get_python_inc(plat_specific: bool = ...,
prefix: Optional[str] = ...) -> str: ...
def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ...,
prefix: Optional[str] = ...) -> str: ...
def get_python_inc(plat_specific: bool = ..., prefix: Optional[str] = ...) -> str: ...
def get_python_lib(plat_specific: bool = ..., standard_lib: bool = ..., prefix: Optional[str] = ...) -> str: ...
def customize_compiler(compiler: CCompiler) -> None: ...
def set_python_build() -> None: ...

View File

@@ -3,16 +3,21 @@
from typing import IO, List, Optional, Tuple, Union
class TextFile:
def __init__(self, filename: Optional[str] = ...,
file: Optional[IO[str]] = ...,
*, strip_comments: bool = ...,
lstrip_ws: bool = ..., rstrip_ws: bool = ...,
skip_blanks: bool = ..., join_lines: bool = ...,
collapse_join: bool = ...) -> None: ...
def __init__(
self,
filename: Optional[str] = ...,
file: Optional[IO[str]] = ...,
*,
strip_comments: bool = ...,
lstrip_ws: bool = ...,
rstrip_ws: bool = ...,
skip_blanks: bool = ...,
join_lines: bool = ...,
collapse_join: bool = ...,
) -> None: ...
def open(self, filename: str) -> None: ...
def close(self) -> None: ...
def warn(self, msg: str,
line: Union[List[int], Tuple[int, int], int] = ...) -> None: ...
def warn(self, msg: str, line: Union[List[int], Tuple[int, int], int] = ...) -> None: ...
def readline(self) -> Optional[str]: ...
def readlines(self) -> List[str]: ...
def unreadline(self, line: str) -> str: ...

View File

@@ -2,5 +2,4 @@
from distutils.ccompiler import CCompiler
class UnixCCompiler(CCompiler): ...

View File

@@ -2,19 +2,24 @@
from typing import Any, Callable, List, Mapping, Optional, Tuple
def get_platform() -> str: ...
def convert_path(pathname: str) -> str: ...
def change_root(new_root: str, pathname: str) -> str: ...
def check_environ() -> None: ...
def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ...
def split_quoted(s: str) -> List[str]: ...
def execute(func: Callable[..., None], args: Tuple[Any, ...],
msg: Optional[str] = ..., verbose: bool = ...,
dry_run: bool = ...) -> None: ...
def execute(
func: Callable[..., None], args: Tuple[Any, ...], msg: Optional[str] = ..., verbose: bool = ..., dry_run: bool = ...
) -> None: ...
def strtobool(val: str) -> bool: ...
def byte_compile(py_files: List[str], optimize: int = ..., force: bool = ...,
prefix: Optional[str] = ..., base_dir: Optional[str] = ...,
verbose: bool = ..., dry_run: bool = ...,
direct: Optional[bool] = ...) -> None: ...
def byte_compile(
py_files: List[str],
optimize: int = ...,
force: bool = ...,
prefix: Optional[str] = ...,
base_dir: Optional[str] = ...,
verbose: bool = ...,
dry_run: bool = ...,
direct: Optional[bool] = ...,
) -> None: ...
def rfc822_escape(header: str) -> str: ...

View File

@@ -1,19 +1,17 @@
import sys
from abc import abstractmethod
from typing import Any, Optional, TypeVar, Union, Pattern, Text, Tuple
from typing import Any, Optional, Pattern, Text, Tuple, TypeVar, Union
_T = TypeVar('_T', bound=Version)
_T = TypeVar("_T", bound=Version)
class Version:
def __repr__(self) -> str: ...
if sys.version_info >= (3,):
def __eq__(self, other: object) -> bool: ...
def __lt__(self: _T, other: Union[_T, str]) -> bool: ...
def __le__(self: _T, other: Union[_T, str]) -> bool: ...
def __gt__(self: _T, other: Union[_T, str]) -> bool: ...
def __ge__(self: _T, other: Union[_T, str]) -> bool: ...
@abstractmethod
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
@abstractmethod
@@ -31,7 +29,6 @@ class StrictVersion(Version):
version_re: Pattern[str]
version: Tuple[int, int, int]
prerelease: Optional[Tuple[Text, int]]
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
def parse(self: _T, vstring: Text) -> _T: ...
def __str__(self) -> str: ...
@@ -44,7 +41,6 @@ class LooseVersion(Version):
component_re: Pattern[str]
vstring: Text
version: Tuple[Union[Text, int], ...]
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
def parse(self: _T, vstring: Text) -> _T: ...
def __str__(self) -> str: ...

View File

@@ -1,15 +1,16 @@
from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type, Union
import sys
import types
import unittest
from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type, Union
class TestResults(NamedTuple):
failed: int
attempted: int
OPTIONFLAGS_BY_NAME: Dict[str, int]
def register_optionflag(name: str) -> int: ...
DONT_ACCEPT_TRUE_FOR_1: int
DONT_ACCEPT_BLANKLINE: int
NORMALIZE_WHITESPACE: int
@@ -38,8 +39,15 @@ class Example:
lineno: int
indent: int
options: Dict[int, bool]
def __init__(self, source: str, want: str, exc_msg: Optional[str] = ..., lineno: int = ..., indent: int = ...,
options: Optional[Dict[int, bool]] = ...) -> None: ...
def __init__(
self,
source: str,
want: str,
exc_msg: Optional[str] = ...,
lineno: int = ...,
indent: int = ...,
options: Optional[Dict[int, bool]] = ...,
) -> None: ...
def __hash__(self) -> int: ...
class DocTest:
@@ -49,20 +57,37 @@ class DocTest:
filename: Optional[str]
lineno: Optional[int]
docstring: Optional[str]
def __init__(self, examples: List[Example], globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[int], docstring: Optional[str]) -> None: ...
def __init__(
self,
examples: List[Example],
globs: Dict[str, Any],
name: str,
filename: Optional[str],
lineno: Optional[int],
docstring: Optional[str],
) -> None: ...
def __hash__(self) -> int: ...
def __lt__(self, other: DocTest) -> bool: ...
class DocTestParser:
def parse(self, string: str, name: str = ...) -> List[Union[str, Example]]: ...
def get_doctest(self, string: str, globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[int]) -> DocTest: ...
def get_doctest(
self, string: str, globs: Dict[str, Any], name: str, filename: Optional[str], lineno: Optional[int]
) -> DocTest: ...
def get_examples(self, string: str, name: str = ...) -> List[Example]: ...
class DocTestFinder:
def __init__(self, verbose: bool = ..., parser: DocTestParser = ...,
recurse: bool = ..., exclude_empty: bool = ...) -> None: ...
def find(self, obj: object, name: Optional[str] = ..., module: Union[None, bool, types.ModuleType] = ...,
globs: Optional[Dict[str, Any]] = ..., extraglobs: Optional[Dict[str, Any]] = ...) -> List[DocTest]: ...
def __init__(
self, verbose: bool = ..., parser: DocTestParser = ..., recurse: bool = ..., exclude_empty: bool = ...
) -> None: ...
def find(
self,
obj: object,
name: Optional[str] = ...,
module: Union[None, bool, types.ModuleType] = ...,
globs: Optional[Dict[str, Any]] = ...,
extraglobs: Optional[Dict[str, Any]] = ...,
) -> List[DocTest]: ...
_Out = Callable[[str], Any]
_ExcInfo = Tuple[Type[BaseException], BaseException, types.TracebackType]
@@ -74,13 +99,14 @@ class DocTestRunner:
tries: int
failures: int
test: DocTest
def __init__(self, checker: Optional[OutputChecker] = ..., verbose: Optional[bool] = ..., optionflags: int = ...) -> None: ...
def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ...
def report_success(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ...
def report_failure(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ...
def report_unexpected_exception(self, out: _Out, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ...
def run(self, test: DocTest, compileflags: Optional[int] = ..., out: Optional[_Out] = ..., clear_globs: bool = ...) -> TestResults: ...
def run(
self, test: DocTest, compileflags: Optional[int] = ..., out: Optional[_Out] = ..., clear_globs: bool = ...
) -> TestResults: ...
def summarize(self, verbose: Optional[bool] = ...) -> TestResults: ...
def merge(self, other: DocTestRunner) -> None: ...
@@ -92,35 +118,62 @@ class DocTestFailure(Exception):
test: DocTest
example: Example
got: str
def __init__(self, test: DocTest, example: Example, got: str) -> None: ...
class UnexpectedException(Exception):
test: DocTest
example: Example
exc_info: _ExcInfo
def __init__(self, test: DocTest, example: Example, exc_info: _ExcInfo) -> None: ...
class DebugRunner(DocTestRunner): ...
master: Optional[DocTestRunner]
def testmod(m: Optional[types.ModuleType] = ..., name: Optional[str] = ..., globs: Optional[Dict[str, Any]] = ..., verbose: Optional[bool] = ...,
report: bool = ..., optionflags: int = ..., extraglobs: Optional[Dict[str, Any]] = ...,
raise_on_error: bool = ..., exclude_empty: bool = ...) -> TestResults: ...
def testfile(filename: str, module_relative: bool = ..., name: Optional[str] = ..., package: Union[None, str, types.ModuleType] = ...,
globs: Optional[Dict[str, Any]] = ..., verbose: Optional[bool] = ..., report: bool = ..., optionflags: int = ...,
extraglobs: Optional[Dict[str, Any]] = ..., raise_on_error: bool = ..., parser: DocTestParser = ...,
encoding: Optional[str] = ...) -> TestResults: ...
def run_docstring_examples(f: object, globs: Dict[str, Any], verbose: bool = ..., name: str = ...,
compileflags: Optional[int] = ..., optionflags: int = ...) -> None: ...
def testmod(
m: Optional[types.ModuleType] = ...,
name: Optional[str] = ...,
globs: Optional[Dict[str, Any]] = ...,
verbose: Optional[bool] = ...,
report: bool = ...,
optionflags: int = ...,
extraglobs: Optional[Dict[str, Any]] = ...,
raise_on_error: bool = ...,
exclude_empty: bool = ...,
) -> TestResults: ...
def testfile(
filename: str,
module_relative: bool = ...,
name: Optional[str] = ...,
package: Union[None, str, types.ModuleType] = ...,
globs: Optional[Dict[str, Any]] = ...,
verbose: Optional[bool] = ...,
report: bool = ...,
optionflags: int = ...,
extraglobs: Optional[Dict[str, Any]] = ...,
raise_on_error: bool = ...,
parser: DocTestParser = ...,
encoding: Optional[str] = ...,
) -> TestResults: ...
def run_docstring_examples(
f: object,
globs: Dict[str, Any],
verbose: bool = ...,
name: str = ...,
compileflags: Optional[int] = ...,
optionflags: int = ...,
) -> None: ...
def set_unittest_reportflags(flags: int) -> int: ...
class DocTestCase(unittest.TestCase):
def __init__(self, test: DocTest, optionflags: int = ..., setUp: Optional[Callable[[DocTest], Any]] = ...,
tearDown: Optional[Callable[[DocTest], Any]] = ...,
checker: Optional[OutputChecker] = ...) -> None: ...
def __init__(
self,
test: DocTest,
optionflags: int = ...,
setUp: Optional[Callable[[DocTest], Any]] = ...,
tearDown: Optional[Callable[[DocTest], Any]] = ...,
checker: Optional[OutputChecker] = ...,
) -> None: ...
def setUp(self) -> None: ...
def tearDown(self) -> None: ...
def runTest(self) -> None: ...
@@ -138,20 +191,31 @@ class SkipDocTestCase(DocTestCase):
if sys.version_info >= (3, 4):
class _DocTestSuite(unittest.TestSuite): ...
else:
_DocTestSuite = unittest.TestSuite
def DocTestSuite(module: Union[None, str, types.ModuleType] = ..., globs: Optional[Dict[str, Any]] = ...,
extraglobs: Optional[Dict[str, Any]] = ..., test_finder: Optional[DocTestFinder] = ...,
**options: Any) -> _DocTestSuite: ...
def DocTestSuite(
module: Union[None, str, types.ModuleType] = ...,
globs: Optional[Dict[str, Any]] = ...,
extraglobs: Optional[Dict[str, Any]] = ...,
test_finder: Optional[DocTestFinder] = ...,
**options: Any,
) -> _DocTestSuite: ...
class DocFileCase(DocTestCase):
def id(self) -> str: ...
def format_failure(self, err: str) -> str: ...
def DocFileTest(path: str, module_relative: bool = ..., package: Union[None, str, types.ModuleType] = ...,
globs: Optional[Dict[str, Any]] = ..., parser: DocTestParser = ...,
encoding: Optional[str] = ..., **options: Any) -> DocFileCase: ...
def DocFileTest(
path: str,
module_relative: bool = ...,
package: Union[None, str, types.ModuleType] = ...,
globs: Optional[Dict[str, Any]] = ...,
parser: DocTestParser = ...,
encoding: Optional[str] = ...,
**options: Any,
) -> DocFileCase: ...
def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ...
def script_from_examples(s: str) -> str: ...
def testsource(module: Union[None, str, types.ModuleType], name: str) -> str: ...

View File

@@ -1,3 +1,2 @@
from _dummy_threading import *
from _dummy_threading import __all__ as __all__

View File

@@ -1,10 +1,25 @@
from typing import Optional
import sys
from typing import Optional
def version() -> str: ...
if sys.version_info >= (3, 0):
def bootstrap(*, root: Optional[str] = ..., upgrade: bool = ..., user: bool = ..., altinstall: bool = ..., default_pip: bool = ..., verbosity: int = ...) -> None: ...
def bootstrap(
*,
root: Optional[str] = ...,
upgrade: bool = ...,
user: bool = ...,
altinstall: bool = ...,
default_pip: bool = ...,
verbosity: int = ...,
) -> None: ...
else:
def bootstrap(root: Optional[str] = ..., upgrade: bool = ..., user: bool = ..., altinstall: bool = ..., default_pip: bool = ..., verbosity: int = ...) -> None: ...
def bootstrap(
root: Optional[str] = ...,
upgrade: bool = ...,
user: bool = ...,
altinstall: bool = ...,
default_pip: bool = ...,
verbosity: int = ...,
) -> None: ...

View File

@@ -1,7 +1,7 @@
# Stubs for errno
from typing import Mapping
import sys
from typing import Mapping
errorcode: Mapping[int, str]

View File

@@ -1,6 +1,6 @@
# Stubs for filecmp (Python 2/3)
import sys
from typing import AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Tuple, Union, Text
from typing import AnyStr, Callable, Dict, Generic, Iterable, List, Optional, Sequence, Text, Tuple, Union
if sys.version_info >= (3, 6):
from os import PathLike
@@ -8,24 +8,35 @@ if sys.version_info >= (3, 6):
DEFAULT_IGNORES: List[str]
if sys.version_info >= (3, 6):
def cmp(f1: Union[bytes, Text, PathLike[AnyStr]], f2: Union[bytes, Text, PathLike[AnyStr]], shallow: Union[int, bool] = ...) -> bool: ...
def cmpfiles(a: Union[AnyStr, PathLike[AnyStr]], b: Union[AnyStr, PathLike[AnyStr]], common: Iterable[AnyStr],
shallow: Union[int, bool] = ...) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ...
def cmp(
f1: Union[bytes, Text, PathLike[AnyStr]], f2: Union[bytes, Text, PathLike[AnyStr]], shallow: Union[int, bool] = ...
) -> bool: ...
def cmpfiles(
a: Union[AnyStr, PathLike[AnyStr]],
b: Union[AnyStr, PathLike[AnyStr]],
common: Iterable[AnyStr],
shallow: Union[int, bool] = ...,
) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ...
else:
def cmp(f1: Union[bytes, Text], f2: Union[bytes, Text], shallow: Union[int, bool] = ...) -> bool: ...
def cmpfiles(a: AnyStr, b: AnyStr, common: Iterable[AnyStr],
shallow: Union[int, bool] = ...) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ...
def cmpfiles(
a: AnyStr, b: AnyStr, common: Iterable[AnyStr], shallow: Union[int, bool] = ...
) -> Tuple[List[AnyStr], List[AnyStr], List[AnyStr]]: ...
class dircmp(Generic[AnyStr]):
if sys.version_info >= (3, 6):
def __init__(self, a: Union[AnyStr, PathLike[AnyStr]], b: Union[AnyStr, PathLike[AnyStr]],
ignore: Optional[Sequence[AnyStr]] = ...,
hide: Optional[Sequence[AnyStr]] = ...) -> None: ...
def __init__(
self,
a: Union[AnyStr, PathLike[AnyStr]],
b: Union[AnyStr, PathLike[AnyStr]],
ignore: Optional[Sequence[AnyStr]] = ...,
hide: Optional[Sequence[AnyStr]] = ...,
) -> None: ...
else:
def __init__(self, a: AnyStr, b: AnyStr,
ignore: Optional[Sequence[AnyStr]] = ...,
hide: Optional[Sequence[AnyStr]] = ...) -> None: ...
def __init__(
self, a: AnyStr, b: AnyStr, ignore: Optional[Sequence[AnyStr]] = ..., hide: Optional[Sequence[AnyStr]] = ...
) -> None: ...
left: AnyStr
right: AnyStr
hide: Sequence[AnyStr]
@@ -44,11 +55,9 @@ class dircmp(Generic[AnyStr]):
right_only: List[AnyStr]
left_list: List[AnyStr]
right_list: List[AnyStr]
def report(self) -> None: ...
def report_partial_closure(self) -> None: ...
def report_full_closure(self) -> None: ...
methodmap: Dict[str, Callable[[], None]]
def phase0(self) -> None: ...
def phase1(self) -> None: ...

View File

@@ -1,6 +1,7 @@
from typing import Iterable, Callable, IO, AnyStr, Generic, Any, Union, Iterator, Optional
from _typeshed import AnyPath
import sys
from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator, Optional, Union
from _typeshed import AnyPath
if sys.version_info >= (3, 8):
def input(
@@ -11,6 +12,7 @@ if sys.version_info >= (3, 8):
mode: str = ...,
openhook: Callable[[AnyPath, str], IO[AnyStr]] = ...,
) -> FileInput[AnyStr]: ...
else:
def input(
files: Union[AnyPath, Iterable[AnyPath], None] = ...,
@@ -39,7 +41,7 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
backup: str = ...,
*,
mode: str = ...,
openhook: Callable[[AnyPath, str], IO[AnyStr]] = ...
openhook: Callable[[AnyPath, str], IO[AnyStr]] = ...,
) -> None: ...
else:
def __init__(
@@ -49,9 +51,8 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
backup: str = ...,
bufsize: int = ...,
mode: str = ...,
openhook: Callable[[AnyPath, str], IO[AnyStr]] = ...
openhook: Callable[[AnyPath, str], IO[AnyStr]] = ...,
) -> None: ...
def __del__(self) -> None: ...
def close(self) -> None: ...
if sys.version_info >= (3, 2):
@@ -70,7 +71,9 @@ class FileInput(Iterable[AnyStr], Generic[AnyStr]):
def isstdin(self) -> bool: ...
def hook_compressed(filename: AnyPath, mode: str) -> IO[Any]: ...
if sys.version_info >= (3, 6):
def hook_encoded(encoding: str, errors: Optional[str] = ...) -> Callable[[AnyPath, str], IO[Any]]: ...
else:
def hook_encoded(encoding: str) -> Callable[[AnyPath, str], IO[Any]]: ...

View File

@@ -1,6 +1,6 @@
# Source: https://hg.python.org/cpython/file/2.7/Lib/formatter.py
# and https://github.com/python/cpython/blob/master/Lib/formatter.py
from typing import Any, IO, List, Optional, Tuple, Iterable
from typing import IO, Any, Iterable, List, Optional, Tuple
AS_IS: None
_FontType = Tuple[str, bool, bool, bool]

View File

@@ -4,14 +4,13 @@
# Note: these stubs are incomplete. The more complex type
# signatures are currently omitted. Also see numbers.pyi.
from typing import Optional, TypeVar, Union, overload, Any, Tuple
from numbers import Real, Integral, Rational
from decimal import Decimal
import sys
from decimal import Decimal
from numbers import Integral, Rational, Real
from typing import Any, Optional, Tuple, TypeVar, Union, overload
_ComparableNum = Union[int, float, Decimal, Real]
if sys.version_info < (3, 9):
@overload
def gcd(a: int, b: int) -> int: ...
@@ -22,30 +21,24 @@ if sys.version_info < (3, 9):
@overload
def gcd(a: Integral, b: Integral) -> Integral: ...
class Fraction(Rational):
@overload
def __new__(cls,
numerator: Union[int, Rational] = ...,
denominator: Optional[Union[int, Rational]] = ...,
*,
_normalize: bool = ...) -> Fraction: ...
def __new__(
cls, numerator: Union[int, Rational] = ..., denominator: Optional[Union[int, Rational]] = ..., *, _normalize: bool = ...
) -> Fraction: ...
@overload
def __new__(cls, __value: Union[float, Decimal, str], *, _normalize: bool = ...) -> Fraction: ...
@classmethod
def from_float(cls, f: float) -> Fraction: ...
@classmethod
def from_decimal(cls, dec: Decimal) -> Fraction: ...
def limit_denominator(self, max_denominator: int = ...) -> Fraction: ...
if sys.version_info >= (3, 8):
def as_integer_ratio(self) -> Tuple[int, int]: ...
@property
def numerator(self) -> int: ...
@property
def denominator(self) -> int: ...
def __add__(self, other): ...
def __radd__(self, other): ...
def __sub__(self, other): ...
@@ -65,7 +58,6 @@ class Fraction(Rational):
def __rdivmod__(self, other): ...
def __pow__(self, other): ...
def __rpow__(self, other): ...
def __pos__(self) -> Fraction: ...
def __neg__(self) -> Fraction: ...
def __abs__(self) -> Fraction: ...
@@ -74,7 +66,6 @@ class Fraction(Rational):
def __floor__(self) -> int: ...
def __ceil__(self) -> int: ...
def __round__(self, ndigits: Optional[Any] = ...): ...
def __hash__(self) -> int: ...
def __eq__(self, other: object) -> bool: ...
def __lt__(self, other: _ComparableNum) -> bool: ...
@@ -85,7 +76,6 @@ class Fraction(Rational):
def __bool__(self) -> bool: ...
else:
def __nonzero__(self) -> bool: ...
# Not actually defined within fractions.py, but provides more useful
# overrides
@property

View File

@@ -1,4 +1,7 @@
import sys
from socket import socket
from ssl import SSLContext
from types import TracebackType
from typing import (
Any,
BinaryIO,
@@ -16,9 +19,7 @@ from typing import (
TypeVar,
Union,
)
from types import TracebackType
from socket import socket
from ssl import SSLContext
from _typeshed import SupportsRead, SupportsReadline
_T = TypeVar("_T")

View File

@@ -1,15 +1,19 @@
from typing import Sequence, AnyStr, Text, Union
import sys
from typing import AnyStr, Sequence, Text, Union
if sys.version_info >= (3, 0):
def commonprefix(m: Sequence[str]) -> str: ...
else:
def commonprefix(m: Sequence[AnyStr]) -> AnyStr: ...
if sys.version_info >= (3, 6):
from builtins import _PathLike
def exists(path: Union[AnyStr, _PathLike[AnyStr]]) -> bool: ...
else:
def exists(path: Text) -> bool: ...
def isfile(path: Text) -> bool: ...
def isdir(s: Text) -> bool: ...
def getsize(filename: Text) -> int: ...
@@ -17,7 +21,6 @@ def getmtime(filename: Text) -> float: ...
def getatime(filename: Text) -> float: ...
def getctime(filename: Text) -> float: ...
if sys.version_info >= (3, 4):
def samestat(s1: str, s2: str) -> int: ...
def samefile(f1: str, f2: str) -> int: ...

View File

@@ -1,8 +1,9 @@
# Stubs for hmac
from typing import Any, AnyStr, Callable, Optional, Union, overload
from types import ModuleType
import sys
from types import ModuleType
from typing import Any, AnyStr, Callable, Optional, Union, overload
from _typeshed import ReadableBuffer
_B = Union[bytes, bytearray]
@@ -20,12 +21,12 @@ if sys.version_info >= (3, 8):
def new(key: _B, msg: Optional[ReadableBuffer], digestmod: _DigestMod) -> HMAC: ...
@overload
def new(key: _B, *, digestmod: _DigestMod) -> HMAC: ...
elif sys.version_info >= (3, 4):
def new(key: _B, msg: Optional[ReadableBuffer] = ...,
digestmod: Optional[_DigestMod] = ...) -> HMAC: ...
def new(key: _B, msg: Optional[ReadableBuffer] = ..., digestmod: Optional[_DigestMod] = ...) -> HMAC: ...
else:
def new(key: _B, msg: Optional[ReadableBuffer] = ...,
digestmod: Optional[_DigestMod] = ...) -> HMAC: ...
def new(key: _B, msg: Optional[ReadableBuffer] = ..., digestmod: Optional[_DigestMod] = ...) -> HMAC: ...
class HMAC:
if sys.version_info >= (3,):

View File

@@ -2,8 +2,9 @@ import subprocess
import sys
import time
from socket import socket as _socket
from ssl import SSLSocket, SSLContext
from typing import Any, Callable, Dict, IO, List, Optional, Pattern, Text, Tuple, Type, Union
from ssl import SSLContext, SSLSocket
from typing import IO, Any, Callable, Dict, List, Optional, Pattern, Text, Tuple, Type, Union
from typing_extensions import Literal
# TODO: Commands should use their actual return types, not this type alias.
@@ -99,11 +100,28 @@ class IMAP4_SSL(IMAP4):
keyfile: str = ...
certfile: str = ...
if sys.version_info >= (3, 9):
def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ..., ssl_context: Optional[SSLContext] = ..., timeout: Optional[float] = ...) -> None: ...
def __init__(
self,
host: str = ...,
port: int = ...,
keyfile: Optional[str] = ...,
certfile: Optional[str] = ...,
ssl_context: Optional[SSLContext] = ...,
timeout: Optional[float] = ...,
) -> None: ...
elif sys.version_info >= (3, 3):
def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ..., ssl_context: Optional[SSLContext] = ...) -> None: ...
def __init__(
self,
host: str = ...,
port: int = ...,
keyfile: Optional[str] = ...,
certfile: Optional[str] = ...,
ssl_context: Optional[SSLContext] = ...,
) -> None: ...
else:
def __init__(self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...) -> None: ...
def __init__(
self, host: str = ..., port: int = ..., keyfile: Optional[str] = ..., certfile: Optional[str] = ...
) -> None: ...
host: str = ...
port: int = ...
sock: _socket = ...
@@ -120,7 +138,6 @@ class IMAP4_SSL(IMAP4):
def socket(self) -> _socket: ...
def ssl(self) -> SSLSocket: ...
class IMAP4_stream(IMAP4):
command: str = ...
def __init__(self, command: str) -> None: ...

View File

@@ -7,15 +7,14 @@ class _ReadableBinary(Protocol):
def read(self, size: int) -> bytes: ...
def seek(self, offset: int) -> Any: ...
if sys.version_info >= (3, 6):
_File = Union[Text, os.PathLike[Text], _ReadableBinary]
else:
_File = Union[Text, _ReadableBinary]
@overload
def what(file: _File, h: None = ...) -> Optional[str]: ...
@overload
def what(file: Any, h: bytes) -> Optional[str]: ...
tests: List[Callable[[bytes, Optional[BinaryIO]], Optional[str]]]

View File

@@ -2,6 +2,7 @@ import sys
from typing import Sequence, Text, Union
def iskeyword(s: Text) -> bool: ...
kwlist: Sequence[str]
if sys.version_info >= (3, 9):

View File

@@ -1,10 +1,9 @@
from _typeshed import StrPath
from typing import Any, IO, Iterable, Optional, Text
from logging import Logger
from lib2to3.pytree import _Convert, _NL
from lib2to3.pgen2.grammar import Grammar
from lib2to3.pytree import _NL, _Convert
from logging import Logger
from typing import IO, Any, Iterable, Optional, Text
from _typeshed import StrPath
class Driver:
grammar: Grammar
@@ -17,4 +16,6 @@ class Driver:
def parse_file(self, filename: StrPath, encoding: Optional[Text] = ..., debug: bool = ...) -> _NL: ...
def parse_string(self, text: Text, debug: bool = ...) -> _NL: ...
def load_grammar(gt: Text = ..., gp: Optional[Text] = ..., save: bool = ..., force: bool = ..., logger: Optional[Logger] = ...) -> Grammar: ...
def load_grammar(
gt: Text = ..., gp: Optional[Text] = ..., save: bool = ..., force: bool = ..., logger: Optional[Logger] = ...
) -> Grammar: ...

View File

@@ -1,7 +1,8 @@
from _typeshed import StrPath
from typing import Dict, List, Optional, Text, Tuple, TypeVar
_P = TypeVar('_P')
from _typeshed import StrPath
_P = TypeVar("_P")
_Label = Tuple[int, Optional[Text]]
_DFA = List[List[Tuple[int, int]]]
_DFAS = Tuple[_DFA, Dict[int, int]]

View File

@@ -1,9 +1,8 @@
# Stubs for lib2to3.pgen2.parse (Python 3.6)
from typing import Any, Dict, List, Optional, Sequence, Set, Text, Tuple
from lib2to3.pgen2.grammar import Grammar, _DFAS
from lib2to3.pgen2.grammar import _DFAS, Grammar
from lib2to3.pytree import _NL, _Convert, _RawNode
from typing import Any, Dict, List, Optional, Sequence, Set, Text, Tuple
_Context = Sequence[Any]

View File

@@ -1,10 +1,8 @@
from _typeshed import StrPath
from typing import (
Any, Dict, IO, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple
)
from lib2to3.pgen2 import grammar
from lib2to3.pgen2.tokenize import _TokenInfo
from typing import IO, Any, Dict, Iterable, Iterator, List, NoReturn, Optional, Text, Tuple
from _typeshed import StrPath
class PgenGrammar(grammar.Grammar): ...

View File

@@ -1,15 +1,13 @@
# Stubs for lib2to3.pgen2.tokenize (Python 3.6)
# NOTE: Only elements from __all__ are present.
from typing import Callable, Iterable, Iterator, List, Text, Tuple
from lib2to3.pgen2.token import * # noqa
from typing import Callable, Iterable, Iterator, List, Text, Tuple
_Coord = Tuple[int, int]
_TokenEater = Callable[[int, Text, _Coord, _Coord, Text], None]
_TokenInfo = Tuple[int, Text, _Coord, _Coord, Text]
class TokenError(Exception): ...
class StopTokenizing(Exception): ...
@@ -25,6 +23,4 @@ class Untokenizer:
def compat(self, token: Tuple[int, Text], iterable: Iterable[_TokenInfo]) -> None: ...
def untokenize(iterable: Iterable[_TokenInfo]) -> Text: ...
def generate_tokens(
readline: Callable[[], Text]
) -> Iterator[_TokenInfo]: ...
def generate_tokens(readline: Callable[[], Text]) -> Iterator[_TokenInfo]: ...

View File

@@ -1,7 +1,7 @@
# Stubs for lib2to3.pygram (Python 3.6)
from typing import Any
from lib2to3.pgen2.grammar import Grammar
from typing import Any
class Symbols:
def __init__(self, grammar: Grammar) -> None: ...

View File

@@ -1,11 +1,10 @@
# Stubs for lib2to3.pytree (Python 3.6)
import sys
from lib2to3.pgen2.grammar import Grammar
from typing import Any, Callable, Dict, Iterator, List, Optional, Text, Tuple, TypeVar, Union
from lib2to3.pgen2.grammar import Grammar
_P = TypeVar('_P')
_P = TypeVar("_P")
_NL = Union[Node, Leaf]
_Context = Tuple[Text, int, int]
_Results = Dict[Text, _NL]
@@ -45,7 +44,14 @@ class Base:
class Node(Base):
fixers_applied: List[Any]
def __init__(self, type: int, children: List[_NL], context: Optional[Any] = ..., prefix: Optional[Text] = ..., fixers_applied: Optional[List[Any]] = ...) -> None: ...
def __init__(
self,
type: int,
children: List[_NL],
context: Optional[Any] = ...,
prefix: Optional[Text] = ...,
fixers_applied: Optional[List[Any]] = ...,
) -> None: ...
def set_child(self, i: int, child: _NL) -> None: ...
def insert_child(self, i: int, child: _NL) -> None: ...
def append_child(self, child: _NL) -> None: ...
@@ -55,7 +61,14 @@ class Leaf(Base):
column: int
value: Text
fixers_applied: List[Any]
def __init__(self, type: int, value: Text, context: Optional[_Context] = ..., prefix: Optional[Text] = ..., fixers_applied: List[Any] = ...) -> None: ...
def __init__(
self,
type: int,
value: Text,
context: Optional[_Context] = ...,
prefix: Optional[Text] = ...,
fixers_applied: List[Any] = ...,
) -> None: ...
def convert(gr: Grammar, raw_node: _RawNode) -> _NL: ...

View File

@@ -8,5 +8,6 @@ def clearcache() -> None: ...
def getlines(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ...
def checkcache(filename: Optional[Text] = ...) -> None: ...
def updatecache(filename: Text, module_globals: Optional[_ModuleGlobals] = ...) -> List[str]: ...
if sys.version_info >= (3, 5):
def lazycache(filename: Text, module_globals: _ModuleGlobals) -> bool: ...

View File

@@ -1,8 +1,8 @@
# Stubs for locale
import sys
from decimal import Decimal
from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Sequence, Tuple, Union
import sys
# workaround for mypy#2010
if sys.version_info < (3,):
@@ -81,8 +81,7 @@ CHAR_MAX: int
class Error(Exception): ...
def setlocale(category: int,
locale: Union[_str, Iterable[_str], None] = ...) -> _str: ...
def setlocale(category: int, locale: Union[_str, Iterable[_str], None] = ...) -> _str: ...
def localeconv() -> Mapping[_str, Union[int, _str, List[int]]]: ...
def nl_langinfo(option: int) -> _str: ...
def getdefaultlocale(envvars: Tuple[_str, ...] = ...) -> Tuple[Optional[_str], Optional[_str]]: ...
@@ -92,18 +91,19 @@ def normalize(localename: _str) -> _str: ...
def resetlocale(category: int = ...) -> None: ...
def strcoll(string1: _str, string2: _str) -> int: ...
def strxfrm(string: _str) -> _str: ...
def format(percent: _str, value: Union[float, Decimal], grouping: bool = ...,
monetary: bool = ..., *additional: Any) -> _str: ...
def format(percent: _str, value: Union[float, Decimal], grouping: bool = ..., monetary: bool = ..., *additional: Any) -> _str: ...
if sys.version_info >= (3, 7):
def format_string(f: _str, val: Any,
grouping: bool = ..., monetary: bool = ...) -> _str: ...
def format_string(f: _str, val: Any, grouping: bool = ..., monetary: bool = ...) -> _str: ...
else:
def format_string(f: _str, val: Any,
grouping: bool = ...) -> _str: ...
def currency(val: Union[int, float, Decimal], symbol: bool = ..., grouping: bool = ...,
international: bool = ...) -> _str: ...
def format_string(f: _str, val: Any, grouping: bool = ...) -> _str: ...
def currency(val: Union[int, float, Decimal], symbol: bool = ..., grouping: bool = ..., international: bool = ...) -> _str: ...
if sys.version_info >= (3, 5):
def delocalize(string: _str) -> _str: ...
def atof(string: _str, func: Callable[[_str], float] = ...) -> float: ...
def atoi(string: _str) -> int: ...
def str(val: float) -> _str: ...

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,9 @@
from _typeshed import AnyPath, StrPath
from typing import Any, Callable, Dict, Optional, IO, Union
from threading import Thread
import sys
from threading import Thread
from typing import IO, Any, Callable, Dict, Optional, Union
from _typeshed import AnyPath, StrPath
if sys.version_info >= (3,):
from configparser import RawConfigParser
else:
@@ -12,17 +14,20 @@ if sys.version_info >= (3, 7):
else:
_Path = StrPath
def dictConfig(config: Dict[str, Any]) -> None: ...
if sys.version_info >= (3, 4):
def fileConfig(fname: Union[_Path, IO[str], RawConfigParser],
defaults: Optional[Dict[str, str]] = ...,
disable_existing_loggers: bool = ...) -> None: ...
def listen(port: int = ...,
verify: Optional[Callable[[bytes], Optional[bytes]]] = ...) -> Thread: ...
def fileConfig(
fname: Union[_Path, IO[str], RawConfigParser],
defaults: Optional[Dict[str, str]] = ...,
disable_existing_loggers: bool = ...,
) -> None: ...
def listen(port: int = ..., verify: Optional[Callable[[bytes], Optional[bytes]]] = ...) -> Thread: ...
else:
def fileConfig(fname: Union[str, IO[str]],
defaults: Optional[Dict[str, str]] = ...,
disable_existing_loggers: bool = ...) -> None: ...
def fileConfig(
fname: Union[str, IO[str]], defaults: Optional[Dict[str, str]] = ..., disable_existing_loggers: bool = ...
) -> None: ...
def listen(port: int = ...) -> Thread: ...
def stopListening() -> None: ...

View File

@@ -1,10 +1,12 @@
from _typeshed import StrPath
import datetime
from logging import Handler, FileHandler, LogRecord
from socket import SocketType
import ssl
import sys
from logging import FileHandler, Handler, LogRecord
from socket import SocketType
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, overload
from _typeshed import StrPath
if sys.version_info >= (3, 7):
from queue import SimpleQueue, Queue
elif sys.version_info >= (3,):
@@ -25,59 +27,84 @@ SYSLOG_TCP_PORT: int
class WatchedFileHandler(FileHandler):
dev: int
ino: int
def __init__(self, filename: StrPath, mode: str = ..., encoding: Optional[str] = ...,
delay: bool = ...) -> None: ...
def __init__(self, filename: StrPath, mode: str = ..., encoding: Optional[str] = ..., delay: bool = ...) -> None: ...
def _statstream(self) -> None: ...
if sys.version_info >= (3,):
class BaseRotatingHandler(FileHandler):
terminator: str
namer: Optional[Callable[[str], str]]
rotator: Optional[Callable[[str, str], None]]
def __init__(self, filename: StrPath, mode: str,
encoding: Optional[str] = ...,
delay: bool = ...) -> None: ...
def __init__(self, filename: StrPath, mode: str, encoding: Optional[str] = ..., delay: bool = ...) -> None: ...
def rotation_filename(self, default_name: str) -> None: ...
def rotate(self, source: str, dest: str) -> None: ...
if sys.version_info >= (3,):
class RotatingFileHandler(BaseRotatingHandler):
def __init__(self, filename: StrPath, mode: str = ..., maxBytes: int = ...,
backupCount: int = ..., encoding: Optional[str] = ...,
delay: bool = ...) -> None: ...
def doRollover(self) -> None: ...
else:
class RotatingFileHandler(Handler):
def __init__(self, filename: str, mode: str = ..., maxBytes: int = ...,
backupCount: int = ..., encoding: Optional[str] = ...,
delay: bool = ...) -> None: ...
def __init__(
self,
filename: StrPath,
mode: str = ...,
maxBytes: int = ...,
backupCount: int = ...,
encoding: Optional[str] = ...,
delay: bool = ...,
) -> None: ...
def doRollover(self) -> None: ...
else:
class RotatingFileHandler(Handler):
def __init__(
self,
filename: str,
mode: str = ...,
maxBytes: int = ...,
backupCount: int = ...,
encoding: Optional[str] = ...,
delay: bool = ...,
) -> None: ...
def doRollover(self) -> None: ...
if sys.version_info >= (3,):
class TimedRotatingFileHandler(BaseRotatingHandler):
if sys.version_info >= (3, 4):
def __init__(self, filename: StrPath, when: str = ...,
interval: int = ...,
backupCount: int = ..., encoding: Optional[str] = ...,
delay: bool = ..., utc: bool = ...,
atTime: Optional[datetime.datetime] = ...) -> None: ...
def __init__(
self,
filename: StrPath,
when: str = ...,
interval: int = ...,
backupCount: int = ...,
encoding: Optional[str] = ...,
delay: bool = ...,
utc: bool = ...,
atTime: Optional[datetime.datetime] = ...,
) -> None: ...
else:
def __init__(self,
filename: str, when: str = ..., interval: int = ...,
backupCount: int = ..., encoding: Optional[str] = ...,
delay: bool = ..., utc: bool = ...) -> None: ...
def doRollover(self) -> None: ...
else:
class TimedRotatingFileHandler(Handler):
def __init__(self,
filename: str, when: str = ..., interval: int = ...,
backupCount: int = ..., encoding: Optional[str] = ...,
delay: bool = ..., utc: bool = ...) -> None: ...
def __init__(
self,
filename: str,
when: str = ...,
interval: int = ...,
backupCount: int = ...,
encoding: Optional[str] = ...,
delay: bool = ...,
utc: bool = ...,
) -> None: ...
def doRollover(self) -> None: ...
else:
class TimedRotatingFileHandler(Handler):
def __init__(
self,
filename: str,
when: str = ...,
interval: int = ...,
backupCount: int = ...,
encoding: Optional[str] = ...,
delay: bool = ...,
utc: bool = ...,
) -> None: ...
def doRollover(self) -> None: ...
class SocketHandler(Handler):
retryStart: float
@@ -92,11 +119,9 @@ class SocketHandler(Handler):
def send(self, s: bytes) -> None: ...
def createSocket(self) -> None: ...
class DatagramHandler(SocketHandler):
def makeSocket(self) -> SocketType: ... # type: ignore
class SysLogHandler(Handler):
LOG_ALERT: int
LOG_CRIT: int
@@ -126,39 +151,44 @@ class SysLogHandler(Handler):
LOG_LOCAL5: int
LOG_LOCAL6: int
LOG_LOCAL7: int
def __init__(self, address: Union[Tuple[str, int], str] = ...,
facility: int = ..., socktype: Optional[_SocketKind] = ...) -> None: ...
def encodePriority(self, facility: Union[int, str],
priority: Union[int, str]) -> int: ...
def __init__(
self, address: Union[Tuple[str, int], str] = ..., facility: int = ..., socktype: Optional[_SocketKind] = ...
) -> None: ...
def encodePriority(self, facility: Union[int, str], priority: Union[int, str]) -> int: ...
def mapPriority(self, levelName: str) -> str: ...
class NTEventLogHandler(Handler):
def __init__(self, appname: str, dllname: Optional[str] = ...,
logtype: str = ...) -> None: ...
def __init__(self, appname: str, dllname: Optional[str] = ..., logtype: str = ...) -> None: ...
def getEventCategory(self, record: LogRecord) -> int: ...
# TODO correct return value?
def getEventType(self, record: LogRecord) -> int: ...
def getMessageID(self, record: LogRecord) -> int: ...
class SMTPHandler(Handler):
# TODO `secure` can also be an empty tuple
if sys.version_info >= (3,):
def __init__(self, mailhost: Union[str, Tuple[str, int]], fromaddr: str,
toaddrs: List[str], subject: str,
credentials: Optional[Tuple[str, str]] = ...,
secure: Union[Tuple[str], Tuple[str, str], None] = ...,
timeout: float = ...) -> None: ...
def __init__(
self,
mailhost: Union[str, Tuple[str, int]],
fromaddr: str,
toaddrs: List[str],
subject: str,
credentials: Optional[Tuple[str, str]] = ...,
secure: Union[Tuple[str], Tuple[str, str], None] = ...,
timeout: float = ...,
) -> None: ...
else:
def __init__(self,
mailhost: Union[str, Tuple[str, int]], fromaddr: str,
toaddrs: List[str], subject: str,
credentials: Optional[Tuple[str, str]] = ...,
secure: Union[Tuple[str], Tuple[str, str], None] = ...) -> None: ...
def __init__(
self,
mailhost: Union[str, Tuple[str, int]],
fromaddr: str,
toaddrs: List[str],
subject: str,
credentials: Optional[Tuple[str, str]] = ...,
secure: Union[Tuple[str], Tuple[str, str], None] = ...,
) -> None: ...
def getSubject(self, record: LogRecord) -> str: ...
class BufferingHandler(Handler):
buffer: List[LogRecord]
def __init__(self, capacity: int) -> None: ...
@@ -166,30 +196,32 @@ class BufferingHandler(Handler):
class MemoryHandler(BufferingHandler):
if sys.version_info >= (3, 6):
def __init__(self, capacity: int, flushLevel: int = ...,
target: Optional[Handler] = ..., flushOnClose: bool = ...) -> None: ...
def __init__(
self, capacity: int, flushLevel: int = ..., target: Optional[Handler] = ..., flushOnClose: bool = ...
) -> None: ...
else:
def __init__(self, capacity: int, flushLevel: int = ...,
target: Optional[Handler] = ...) -> None: ...
def __init__(self, capacity: int, flushLevel: int = ..., target: Optional[Handler] = ...) -> None: ...
def setTarget(self, target: Handler) -> None: ...
class HTTPHandler(Handler):
if sys.version_info >= (3, 5):
def __init__(self, host: str, url: str, method: str = ...,
secure: bool = ...,
credentials: Optional[Tuple[str, str]] = ...,
context: Optional[ssl.SSLContext] = ...) -> None: ...
def __init__(
self,
host: str,
url: str,
method: str = ...,
secure: bool = ...,
credentials: Optional[Tuple[str, str]] = ...,
context: Optional[ssl.SSLContext] = ...,
) -> None: ...
elif sys.version_info >= (3,):
def __init__(self,
host: str, url: str, method: str = ..., secure: bool = ...,
credentials: Optional[Tuple[str, str]] = ...) -> None: ...
def __init__(
self, host: str, url: str, method: str = ..., secure: bool = ..., credentials: Optional[Tuple[str, str]] = ...
) -> None: ...
else:
def __init__(self,
host: str, url: str, method: str = ...) -> None: ...
def __init__(self, host: str, url: str, method: str = ...) -> None: ...
def mapLogRecord(self, record: LogRecord) -> Dict[str, Any]: ...
if sys.version_info >= (3,):
class QueueHandler(Handler):
if sys.version_info >= (3, 7):
@@ -198,18 +230,15 @@ if sys.version_info >= (3,):
def __init__(self, queue: Queue[Any]) -> None: ...
def prepare(self, record: LogRecord) -> Any: ...
def enqueue(self, record: LogRecord) -> None: ...
class QueueListener:
if sys.version_info >= (3, 7):
def __init__(self, queue: Union[SimpleQueue[Any], Queue[Any]],
*handlers: Handler,
respect_handler_level: bool = ...) -> None: ...
def __init__(
self, queue: Union[SimpleQueue[Any], Queue[Any]], *handlers: Handler, respect_handler_level: bool = ...
) -> None: ...
elif sys.version_info >= (3, 5):
def __init__(self, queue: Queue[Any], *handlers: Handler,
respect_handler_level: bool = ...) -> None: ...
def __init__(self, queue: Queue[Any], *handlers: Handler, respect_handler_level: bool = ...) -> None: ...
else:
def __init__(self,
queue: Queue, *handlers: Handler) -> None: ...
def __init__(self, queue: Queue, *handlers: Handler) -> None: ...
def dequeue(self, block: bool) -> LogRecord: ...
def prepare(self, record: LogRecord) -> Any: ...
def start(self) -> None: ...

View File

@@ -3,11 +3,12 @@
import os
import sys
from typing import overload, List, Any, AnyStr, Sequence, Tuple, TypeVar, Union, Text, Callable, Optional
from _typeshed import StrPath, BytesPath, AnyPath
from typing import Any, AnyStr, Callable, List, Optional, Sequence, Text, Tuple, TypeVar, Union, overload
from _typeshed import AnyPath, BytesPath, StrPath
if sys.version_info < (3, 8):
_T = TypeVar('_T')
_T = TypeVar("_T")
if sys.version_info >= (3, 6):
from builtins import _PathLike
@@ -59,7 +60,6 @@ if sys.version_info < (3, 8):
def realpath(path: _PathLike[AnyStr]) -> AnyStr: ...
@overload
def realpath(path: AnyStr) -> AnyStr: ...
else:
def abspath(path: AnyStr) -> AnyStr: ...
def basename(s: AnyStr) -> AnyStr: ...
@@ -69,31 +69,26 @@ if sys.version_info < (3, 8):
def normcase(path: AnyStr) -> AnyStr: ...
def normpath(s: AnyStr) -> AnyStr: ...
def realpath(path: AnyStr) -> AnyStr: ...
# NOTE: Empty lists results in '' (str) regardless of contained type.
# Also, in Python 2 mixed sequences of Text and bytes results in either Text or bytes
# So, fall back to Any
def commonprefix(m: Sequence[AnyPath]) -> Any: ...
if sys.version_info >= (3, 3):
def exists(path: Union[AnyPath, int]) -> bool: ...
else:
def exists(path: AnyPath) -> bool: ...
def lexists(path: AnyPath) -> bool: ...
# These return float if os.stat_float_times() == True,
# but int is a subclass of float.
def getatime(filename: AnyPath) -> float: ...
def getmtime(filename: AnyPath) -> float: ...
def getctime(filename: AnyPath) -> float: ...
def getsize(filename: AnyPath) -> int: ...
def isabs(s: AnyPath) -> bool: ...
def isfile(path: AnyPath) -> bool: ...
def isdir(s: AnyPath) -> bool: ...
def islink(s: AnyPath) -> bool: ...
def ismount(s: AnyPath) -> bool: ...
if sys.version_info < (3, 0):
# Make sure signatures are disjunct, and allow combinations of bytes and unicode.
# (Since Python 2 allows that, too)
@@ -117,11 +112,9 @@ if sys.version_info < (3, 8):
def join(s: BytesPath, *paths: BytesPath) -> bytes: ...
else:
def join(s: AnyStr, *paths: AnyStr) -> AnyStr: ...
def samefile(f1: AnyPath, f2: AnyPath) -> bool: ...
def sameopenfile(fp1: int, fp2: int) -> bool: ...
def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ...
if sys.version_info >= (3, 6):
@overload
def split(s: _PathLike[AnyStr]) -> Tuple[AnyStr, AnyStr]: ...
@@ -139,6 +132,5 @@ if sys.version_info < (3, 8):
def split(s: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitdrive(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
def splitext(p: AnyStr) -> Tuple[AnyStr, AnyStr]: ...
if sys.version_info < (3,):
def walk(path: AnyStr, visit: Callable[[_T, AnyStr, List[AnyStr]], Any], arg: _T) -> None: ...

View File

@@ -1,9 +1,31 @@
from typing import Optional, Union, Text, AnyStr, Callable, IO, Any, Iterator, List, Tuple, TypeVar, Protocol, Dict, Sequence, Iterable, Generic, Type, Mapping, overload
from types import TracebackType
import email
from _typeshed import AnyPath
from types import TracebackType
from typing import (
IO,
Any,
AnyStr,
Callable,
Dict,
Generic,
Iterable,
Iterator,
List,
Mapping,
Optional,
Protocol,
Sequence,
Text,
Tuple,
Type,
TypeVar,
Union,
overload,
)
from typing_extensions import Literal
from _typeshed import AnyPath
_T = TypeVar("_T")
_MessageType = TypeVar("_MessageType", bound=Message)
_MessageData = Union[email.message.Message, bytes, str, IO[str], IO[bytes]]
@@ -20,7 +42,6 @@ class Mailbox(Generic[_MessageType]):
_path: Union[bytes, str] # undocumented
_factory: Optional[Callable[[IO[Any]], _MessageType]] # undocumented
def __init__(self, path: AnyPath, factory: Optional[Callable[[IO[Any]], _MessageType]] = ..., create: bool = ...) -> None: ...
def add(self, message: _MessageData) -> str: ...
def remove(self, key: str) -> None: ...
@@ -61,10 +82,10 @@ class Mailbox(Generic[_MessageType]):
class Maildir(Mailbox[MaildirMessage]):
colon: str
def __init__(self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], MaildirMessage]] = ..., create: bool = ...) -> None: ...
def __init__(
self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], MaildirMessage]] = ..., create: bool = ...
) -> None: ...
def get_file(self, key: str) -> _ProxyFile[bytes]: ...
def list_folders(self) -> List[str]: ...
def get_folder(self, folder: Text) -> Maildir: ...
def add_folder(self, folder: Text) -> Maildir: ...
@@ -75,22 +96,21 @@ class Maildir(Mailbox[MaildirMessage]):
class _singlefileMailbox(Mailbox[_MessageType]): ...
class _mboxMMDF(_singlefileMailbox[_MessageType]):
def get_file(self, key: str) -> _PartialFile[bytes]: ...
class mbox(_mboxMMDF[mboxMessage]):
def __init__(self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], mboxMessage]] = ..., create: bool = ...) -> None: ...
def __init__(
self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], mboxMessage]] = ..., create: bool = ...
) -> None: ...
class MMDF(_mboxMMDF[MMDFMessage]):
def __init__(self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], MMDFMessage]] = ..., create: bool = ...) -> None: ...
def __init__(
self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], MMDFMessage]] = ..., create: bool = ...
) -> None: ...
class MH(Mailbox[MHMessage]):
def __init__(self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], MHMessage]] = ..., create: bool = ...) -> None: ...
def get_file(self, key: str) -> _ProxyFile[bytes]: ...
def list_folders(self) -> List[str]: ...
def get_folder(self, folder: AnyPath) -> MH: ...
def add_folder(self, folder: AnyPath) -> MH: ...
@@ -100,18 +120,16 @@ class MH(Mailbox[MHMessage]):
def pack(self) -> None: ...
class Babyl(_singlefileMailbox[BabylMessage]):
def __init__(self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], BabylMessage]] = ..., create: bool = ...) -> None: ...
def __init__(
self, dirname: AnyPath, factory: Optional[Callable[[IO[Any]], BabylMessage]] = ..., create: bool = ...
) -> None: ...
def get_file(self, key: str) -> IO[bytes]: ...
def get_labels(self) -> List[str]: ...
class Message(email.message.Message):
def __init__(self, message: Optional[_MessageData] = ...) -> None: ...
class MaildirMessage(Message):
def get_subdir(self) -> str: ...
def set_subdir(self, subdir: Literal["new", "cur"]) -> None: ...
def get_flags(self) -> str: ...
@@ -124,9 +142,10 @@ class MaildirMessage(Message):
def set_info(self, info: str) -> None: ...
class _mboxMMDFMessage(Message):
def get_from(self) -> str: ...
def set_from(self, from_: str, time_: Optional[Union[bool, Tuple[int, int, int, int, int, int, int, int, int]]] = ...) -> None: ...
def set_from(
self, from_: str, time_: Optional[Union[bool, Tuple[int, int, int, int, int, int, int, int, int]]] = ...
) -> None: ...
def get_flags(self) -> str: ...
def set_flags(self, flags: Iterable[str]) -> None: ...
def add_flag(self, flag: str) -> None: ...
@@ -135,14 +154,12 @@ class _mboxMMDFMessage(Message):
class mboxMessage(_mboxMMDFMessage): ...
class MHMessage(Message):
def get_sequences(self) -> List[str]: ...
def set_sequences(self, sequences: Iterable[str]) -> None: ...
def add_sequence(self, sequence: str) -> None: ...
def remove_sequence(self, sequence: str) -> None: ...
class BabylMessage(Message):
def get_labels(self) -> List[str]: ...
def set_labels(self, labels: Iterable[str]) -> None: ...
def add_label(self, label: str) -> None: ...
@@ -154,7 +171,6 @@ class BabylMessage(Message):
class MMDFMessage(_mboxMMDFMessage): ...
class _ProxyFile(Generic[AnyStr]):
def __init__(self, f: IO[AnyStr], pos: Optional[int] = ...) -> None: ...
def read(self, size: Optional[int] = ...) -> AnyStr: ...
def read1(self, size: Optional[int] = ...) -> AnyStr: ...
@@ -165,7 +181,9 @@ class _ProxyFile(Generic[AnyStr]):
def seek(self, offset: int, whence: int = ...) -> None: ...
def close(self) -> None: ...
def __enter__(self) -> _ProxyFile[AnyStr]: ...
def __exit__(self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType]) -> None: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType]
) -> None: ...
def readable(self) -> bool: ...
def writable(self) -> bool: ...
def seekable(self) -> bool: ...
@@ -174,15 +192,10 @@ class _ProxyFile(Generic[AnyStr]):
def closed(self) -> bool: ...
class _PartialFile(_ProxyFile[AnyStr]):
def __init__(self, f: IO[AnyStr], start: Optional[int] = ..., stop: Optional[int] = ...) -> None: ...
class Error(Exception): ...
class NoSuchMailboxError(Error): ...
class NotEmptyError(Error): ...
class ExternalClashError(Error): ...
class FormatError(Error): ...

View File

@@ -1,7 +1,8 @@
from typing import Sequence, Dict, List, Union, Tuple, Optional, Mapping
from typing import Dict, List, Mapping, Optional, Sequence, Tuple, Union
_Cap = Dict[str, Union[str, int]]
def findmatch(caps: Mapping[str, List[_Cap]], MIMEtype: str, key: str = ..., filename: str = ..., plist: Sequence[str] = ...) -> Tuple[Optional[str], Optional[_Cap]]: ...
def findmatch(
caps: Mapping[str, List[_Cap]], MIMEtype: str, key: str = ..., filename: str = ..., plist: Sequence[str] = ...
) -> Tuple[Optional[str], Optional[_Cap]]: ...
def getcaps() -> Dict[str, List[_Cap]]: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, IO
from typing import IO, Any
version: int

View File

@@ -1,9 +1,8 @@
# Stubs for math
# See: http://docs.python.org/2/library/math.html
from typing import Tuple, Iterable, SupportsFloat, SupportsInt, overload
import sys
from typing import Iterable, SupportsFloat, SupportsInt, Tuple, overload
e: float
pi: float
@@ -20,61 +19,84 @@ def asinh(__x: SupportsFloat) -> float: ...
def atan(__x: SupportsFloat) -> float: ...
def atan2(__y: SupportsFloat, __x: SupportsFloat) -> float: ...
def atanh(__x: SupportsFloat) -> float: ...
if sys.version_info >= (3,):
def ceil(__x: SupportsFloat) -> int: ...
else:
def ceil(__x: SupportsFloat) -> float: ...
def copysign(__x: SupportsFloat, __y: SupportsFloat) -> float: ...
def cos(__x: SupportsFloat) -> float: ...
def cosh(__x: SupportsFloat) -> float: ...
def degrees(__x: SupportsFloat) -> float: ...
if sys.version_info >= (3, 8):
def dist(__p: Iterable[SupportsFloat], __q: Iterable[SupportsFloat]) -> float: ...
def erf(__x: SupportsFloat) -> float: ...
def erfc(__x: SupportsFloat) -> float: ...
def exp(__x: SupportsFloat) -> float: ...
def expm1(__x: SupportsFloat) -> float: ...
def fabs(__x: SupportsFloat) -> float: ...
def factorial(__x: SupportsInt) -> int: ...
if sys.version_info >= (3,):
def floor(__x: SupportsFloat) -> int: ...
else:
def floor(__x: SupportsFloat) -> float: ...
def fmod(__x: SupportsFloat, __y: SupportsFloat) -> float: ...
def frexp(__x: SupportsFloat) -> Tuple[float, int]: ...
def fsum(__seq: Iterable[float]) -> float: ...
def gamma(__x: SupportsFloat) -> float: ...
if sys.version_info >= (3, 5):
def gcd(__x: int, __y: int) -> int: ...
if sys.version_info >= (3, 8):
def hypot(*coordinates: SupportsFloat) -> float: ...
else:
def hypot(__x: SupportsFloat, __y: SupportsFloat) -> float: ...
if sys.version_info >= (3, 5):
def isclose(a: SupportsFloat, b: SupportsFloat, *, rel_tol: SupportsFloat = ..., abs_tol: SupportsFloat = ...) -> bool: ...
def isinf(__x: SupportsFloat) -> bool: ...
if sys.version_info >= (3,):
def isfinite(__x: SupportsFloat) -> bool: ...
def isnan(__x: SupportsFloat) -> bool: ...
if sys.version_info >= (3, 8):
def isqrt(__n: int) -> int: ...
def ldexp(__x: SupportsFloat, __i: int) -> float: ...
def lgamma(__x: SupportsFloat) -> float: ...
def log(x: SupportsFloat, base: SupportsFloat = ...) -> float: ...
def log10(__x: SupportsFloat) -> float: ...
def log1p(__x: SupportsFloat) -> float: ...
if sys.version_info >= (3, 3):
def log2(__x: SupportsFloat) -> float: ...
def modf(__x: SupportsFloat) -> Tuple[float, float]: ...
def pow(__x: SupportsFloat, __y: SupportsFloat) -> float: ...
if sys.version_info >= (3, 8):
@overload
def prod(__iterable: Iterable[int], *, start: int = ...) -> int: ... # type: ignore
@overload
def prod(__iterable: Iterable[SupportsFloat], *, start: SupportsFloat = ...) -> float: ...
def radians(__x: SupportsFloat) -> float: ...
if sys.version_info >= (3, 7):
def remainder(__x: SupportsFloat, __y: SupportsFloat) -> float: ...
def sin(__x: SupportsFloat) -> float: ...
def sinh(__x: SupportsFloat) -> float: ...
def sqrt(__x: SupportsFloat) -> float: ...

View File

@@ -1,19 +1,17 @@
# Stubs for mimetypes
from typing import Dict, IO, List, Optional, Sequence, Text, Tuple, AnyStr, Union
import sys
from typing import IO, AnyStr, Dict, List, Optional, Sequence, Text, Tuple, Union
if sys.version_info >= (3, 8):
from os import PathLike
def guess_type(url: Union[Text, PathLike[str]],
strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
def guess_type(url: Union[Text, PathLike[str]], strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
else:
def guess_type(url: Text,
strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
def guess_type(url: Text, strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
def guess_all_extensions(type: str, strict: bool = ...) -> List[str]: ...
def guess_extension(type: str, strict: bool = ...) -> Optional[str]: ...
def init(files: Optional[Sequence[str]] = ...) -> None: ...
def read_mime_types(filename: str) -> Optional[Dict[str, str]]: ...
def add_type(type: str, ext: str, strict: bool = ...) -> None: ...
@@ -30,15 +28,11 @@ class MimeTypes:
encodings_map: Dict[str, str]
types_map: Tuple[Dict[str, str], Dict[str, str]]
types_map_inv: Tuple[Dict[str, str], Dict[str, str]]
def __init__(self, filenames: Tuple[str, ...] = ...,
strict: bool = ...) -> None: ...
def guess_extension(self, type: str,
strict: bool = ...) -> Optional[str]: ...
def guess_type(self, url: str,
strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
def guess_all_extensions(self, type: str,
strict: bool = ...) -> List[str]: ...
def __init__(self, filenames: Tuple[str, ...] = ..., strict: bool = ...) -> None: ...
def guess_extension(self, type: str, strict: bool = ...) -> Optional[str]: ...
def guess_type(self, url: str, strict: bool = ...) -> Tuple[Optional[str], Optional[str]]: ...
def guess_all_extensions(self, type: str, strict: bool = ...) -> List[str]: ...
def read(self, filename: str, strict: bool = ...) -> None: ...
def readfp(self, fp: IO[str], strict: bool = ...) -> None: ...
if sys.platform == 'win32':
if sys.platform == "win32":
def read_windows_registry(self, strict: bool = ...) -> None: ...

View File

@@ -1,6 +1,6 @@
import sys
from typing import (Optional, Sequence, Union, Generic, overload,
Iterable, Iterator, Sized, ContextManager, AnyStr)
from typing import AnyStr, ContextManager, Generic, Iterable, Iterator, Optional, Sequence, Sized, Union, overload
from _typeshed import ReadableBuffer
ACCESS_DEFAULT: int
@@ -10,7 +10,7 @@ ACCESS_COPY: int
ALLOCATIONGRANULARITY: int
if sys.platform != 'win32':
if sys.platform != "win32":
MAP_ANON: int
MAP_ANONYMOUS: int
MAP_DENYWRITE: int
@@ -24,15 +24,14 @@ if sys.platform != 'win32':
PAGESIZE: int
class _mmap(Generic[AnyStr]):
if sys.platform == 'win32':
def __init__(self, fileno: int, length: int,
tagname: Optional[str] = ..., access: int = ...,
offset: int = ...) -> None: ...
if sys.platform == "win32":
def __init__(
self, fileno: int, length: int, tagname: Optional[str] = ..., access: int = ..., offset: int = ...
) -> None: ...
else:
def __init__(self,
fileno: int, length: int, flags: int = ...,
prot: int = ..., access: int = ...,
offset: int = ...) -> None: ...
def __init__(
self, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ...
) -> None: ...
def close(self) -> None: ...
if sys.version_info >= (3, 8):
def flush(self, offset: int = ..., size: int = ...) -> None: ...
@@ -72,6 +71,7 @@ if sys.version_info >= (3,):
# Doesn't actually exist, but the object is actually iterable because it has __getitem__ and
# __len__, so we claim that there is also an __iter__ to help type checkers.
def __iter__(self) -> Iterator[bytes]: ...
else:
class mmap(_mmap[bytes], Sequence[bytes]):
def find(self, string: bytes, start: int = ..., end: int = ...) -> int: ...

View File

@@ -1,6 +1,6 @@
import sys
from typing import Optional, Container, Dict, Sequence, Tuple, List, Any, Iterator, IO, Iterable
from types import CodeType
from typing import IO, Any, Container, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple
LOAD_CONST: int # undocumented
IMPORT_NAME: int # undocumented
@@ -10,12 +10,14 @@ STORE_OPS: Tuple[int, int] # undocumented
EXTENDED_ARG: int # undocumented
packagePathMap: Dict[str, List[str]] # undocumented
def AddPackagePath(packagename: str, path: str) -> None: ...
replacePackageMap: Dict[str, str] # undocumented
def ReplacePackage(oldname: str, newname: str) -> None: ...
class Module: # undocumented
def __init__(self, name: str, file: Optional[str] = ..., path: Optional[str] = ...) -> None: ...
def __repr__(self) -> str: ...
@@ -30,15 +32,29 @@ class ModuleFinder:
replace_paths: Sequence[Tuple[str, str]] # undocumented
if sys.version_info >= (3, 8):
def __init__(self, path: Optional[List[str]] = ..., debug: int = ..., excludes: Optional[Container[str]] = ..., replace_paths: Optional[Sequence[Tuple[str, str]]] = ...) -> None: ...
def __init__(
self,
path: Optional[List[str]] = ...,
debug: int = ...,
excludes: Optional[Container[str]] = ...,
replace_paths: Optional[Sequence[Tuple[str, str]]] = ...,
) -> None: ...
else:
def __init__(self, path: Optional[List[str]] = ..., debug: int = ..., excludes: Container[str] = ..., replace_paths: Sequence[Tuple[str, str]] = ...) -> None: ...
def __init__(
self,
path: Optional[List[str]] = ...,
debug: int = ...,
excludes: Container[str] = ...,
replace_paths: Sequence[Tuple[str, str]] = ...,
) -> None: ...
def msg(self, level: int, str: str, *args: Any) -> None: ... # undocumented
def msgin(self, *args: Any) -> None: ... # undocumented
def msgout(self, *args: Any) -> None: ... # undocumented
def run_script(self, pathname: str) -> None: ...
def load_file(self, pathname: str) -> None: ... # undocumented
def import_hook(self, name: str, caller: Optional[Module] = ..., fromlist: Optional[List[str]] = ..., level: int = ...) -> Optional[Module]: ... # undocumented
def import_hook(
self, name: str, caller: Optional[Module] = ..., fromlist: Optional[List[str]] = ..., level: int = ...
) -> Optional[Module]: ... # undocumented
def determine_parent(self, caller: Optional[Module], level: int = ...) -> Optional[Module]: ... # undocumented
def find_head_package(self, parent: Module, name: str) -> Tuple[Module, str]: ... # undocumented
def load_tail(self, q: Module, tail: str) -> Module: ... # undocumented
@@ -51,7 +67,9 @@ class ModuleFinder:
def scan_code(self, co: CodeType, m: Module) -> None: ... # undocumented
def load_package(self, fqname: str, pathname: str) -> Module: ... # undocumented
def add_module(self, fqname: str) -> Module: ... # undocumented
def find_module(self, name: str, path: Optional[str], parent: Optional[Module] = ...) -> Tuple[Optional[IO[Any]], Optional[str], Tuple[str, str, int]]: ... # undocumented
def find_module(
self, name: str, path: Optional[str], parent: Optional[Module] = ...
) -> Tuple[Optional[IO[Any]], Optional[str], Tuple[str, str, int]]: ... # undocumented
def report(self) -> None: ...
def any_missing(self) -> List[str]: ... # undocumented
def any_missing_maybe(self) -> Tuple[List[str], List[str]]: ... # undocumented

Some files were not shown because too many files have changed in this diff Show More