Revert "Updated typeshed to latest. Added commit.txt file to track the exact commit hash that was used."

This reverts commit 0b40310426.
This commit is contained in:
Eric Traut 2020-10-10 10:21:23 -07:00
parent 0b40310426
commit 1844bdfd58
161 changed files with 1718 additions and 2234 deletions

117
package-lock.json generated
View File

@ -42,24 +42,6 @@
}
}
},
"@eslint/eslintrc": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz",
"integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==",
"dev": true,
"requires": {
"ajv": "^6.12.4",
"debug": "^4.1.1",
"espree": "^7.3.0",
"globals": "^12.1.0",
"ignore": "^4.0.6",
"import-fresh": "^3.2.1",
"js-yaml": "^3.13.1",
"lodash": "^4.17.19",
"minimatch": "^3.0.4",
"strip-json-comments": "^3.1.1"
}
},
"@evocateur/libnpmaccess": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz",
@ -1303,6 +1285,12 @@
"@types/node": ">= 8"
}
},
"@types/color-name": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
"integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
"dev": true
},
"@types/eslint-visitor-keys": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
@ -1454,15 +1442,15 @@
"dev": true
},
"acorn": {
"version": "7.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz",
"integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==",
"dev": true
},
"acorn-jsx": {
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
"integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==",
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz",
"integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==",
"dev": true
},
"agent-base": {
@ -1948,11 +1936,12 @@
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
"dev": true,
"requires": {
"@types/color-name": "^1.1.1",
"color-convert": "^2.0.1"
}
},
@ -2157,9 +2146,9 @@
}
},
"commander": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz",
"integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==",
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-6.0.0.tgz",
"integrity": "sha512-s7EA+hDtTYNhuXkTlhqew4txMZVdszBmKWSPEMxGr8ru8JXR7bLUFIAtPhcSuFdJQ0ILMxnJi8GkQL0yvDy/YA==",
"dev": true
},
"compare-func": {
@ -2899,23 +2888,22 @@
"dev": true
},
"eslint": {
"version": "7.11.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.11.0.tgz",
"integrity": "sha512-G9+qtYVCHaDi1ZuWzBsOWo2wSwd70TXnU6UHA3cTYHp7gCTXZcpggWFoUVAMRarg68qtPoNfFbzPh+VdOgmwmw==",
"version": "7.7.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz",
"integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"@eslint/eslintrc": "^0.1.3",
"ajv": "^6.10.0",
"chalk": "^4.0.0",
"cross-spawn": "^7.0.2",
"debug": "^4.0.1",
"doctrine": "^3.0.0",
"enquirer": "^2.3.5",
"eslint-scope": "^5.1.1",
"eslint-scope": "^5.1.0",
"eslint-utils": "^2.1.0",
"eslint-visitor-keys": "^2.0.0",
"espree": "^7.3.0",
"eslint-visitor-keys": "^1.3.0",
"espree": "^7.2.0",
"esquery": "^1.2.0",
"esutils": "^2.0.2",
"file-entry-cache": "^5.0.1",
@ -2941,47 +2929,12 @@
"table": "^5.2.3",
"text-table": "^0.2.0",
"v8-compile-cache": "^2.0.3"
},
"dependencies": {
"eslint-scope": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz",
"integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==",
"dev": true,
"requires": {
"esrecurse": "^4.3.0",
"estraverse": "^4.1.1"
}
},
"eslint-visitor-keys": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
"integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
"dev": true
},
"esrecurse": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
"integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
"dev": true,
"requires": {
"estraverse": "^5.2.0"
},
"dependencies": {
"estraverse": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
"integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==",
"dev": true
}
}
}
}
},
"eslint-config-prettier": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz",
"integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz",
"integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==",
"dev": true,
"requires": {
"get-stdin": "^6.0.0"
@ -7123,13 +7076,13 @@
}
},
"syncpack": {
"version": "5.6.10",
"resolved": "https://registry.npmjs.org/syncpack/-/syncpack-5.6.10.tgz",
"integrity": "sha512-7YjOACc9syvQVZfNSIhgZoZ2foqzQJ/r8tUPDKdfRgnBYNkDbbcjzYz1XH35oOm2vAllNhZYK2R8N5sAITMbqA==",
"version": "5.5.6",
"resolved": "https://registry.npmjs.org/syncpack/-/syncpack-5.5.6.tgz",
"integrity": "sha512-rTUbzX6iuKz7saOsj8dDMxgApaZ8Y4S6nudW59ikAALIGa1RNMKaVAIi9P5HMjx94y686UkXp6CmsuxNjNXG8Q==",
"dev": true,
"requires": {
"chalk": "4.1.0",
"commander": "6.1.0",
"commander": "6.0.0",
"cosmiconfig": "7.0.0",
"expect-more": "0.8.0",
"fs-extra": "9.0.1",
@ -7434,9 +7387,9 @@
"dev": true
},
"typescript": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz",
"integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==",
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz",
"integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==",
"dev": true
},
"uglify-js": {

View File

@ -21,12 +21,12 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^3.10.1",
"@typescript-eslint/parser": "^3.10.1",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.12.0",
"eslint": "^7.7.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-simple-import-sort": "^5.0.3",
"lerna": "^3.22.1",
"prettier": "2.1.1",
"syncpack": "^5.6.10",
"typescript": "^4.0.3"
"syncpack": "^5.5.6",
"typescript": "^4.0.2"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -30,14 +30,14 @@
"devDependencies": {
"@types/command-line-args": "^5.0.0",
"@types/fs-extra": "^9.0.1",
"@types/jest": "^26.0.14",
"@types/node": "^12.12.67",
"@types/jest": "^26.0.0",
"@types/node": "~12.12.54",
"@types/tmp": "^0.2.0",
"fs-extra": "^9.0.1",
"jest": "^26.5.2",
"jest": "^26.0.1",
"jest-junit": "^11.0.0",
"shx": "^0.3.2",
"ts-jest": "^26.4.1",
"typescript": "^4.0.3"
"ts-jest": "^26.1.0",
"typescript": "^4.0.2"
}
}

View File

@ -1 +0,0 @@
228f74d76a5df1b09fe0316d3eedd40cff285ec9

View File

@ -155,11 +155,7 @@ class Event:
def wait(self, timeout: Optional[float] = ...) -> bool: ...
if sys.version_info >= (3, 8):
import _thread
# don't ask...
_ExceptHookArgs = _thread.ExceptHookArgs
ExceptHookArgs = _thread._ExceptHookArgs
from _thread import ExceptHookArgs as _ExceptHookArgs, _ExceptHookArgs as ExceptHookArgs # don't ask
excepthook: Callable[[_ExceptHookArgs], Any]

View File

@ -56,7 +56,6 @@ from typing import (
Union,
ValuesView,
overload,
runtime_checkable,
)
from typing_extensions import Literal
@ -83,7 +82,7 @@ _T3 = TypeVar("_T3")
_T4 = TypeVar("_T4")
_T5 = TypeVar("_T5")
_TT = TypeVar("_TT", bound="type")
_SupportsLessThanT = TypeVar("_SupportsLessThanT", bound=_SupportsLessThan)
_LT = TypeVar("_LT", bound=_SupportsLessThan)
_TBE = TypeVar("_TBE", bound="BaseException")
class object:
@ -182,9 +181,9 @@ class super(object):
class int:
@overload
def __new__(cls: Type[_T], x: Union[Text, bytes, SupportsInt, _SupportsIndex] = ...) -> _T: ...
def __init__(self, x: Union[Text, bytes, SupportsInt, _SupportsIndex] = ...) -> None: ...
@overload
def __new__(cls: Type[_T], x: Union[Text, bytes, bytearray], base: int) -> _T: ...
def __init__(self, x: Union[Text, bytes, bytearray], base: int) -> None: ...
if sys.version_info >= (3, 8):
def as_integer_ratio(self) -> Tuple[int, Literal[1]]: ...
@property
@ -263,7 +262,7 @@ class int:
def __index__(self) -> int: ...
class float:
def __new__(cls: Type[_T], x: Union[SupportsFloat, _SupportsIndex, Text, bytes, bytearray] = ...) -> _T: ...
def __init__(self, x: Union[SupportsFloat, _SupportsIndex, Text, bytes, bytearray] = ...) -> None: ...
def as_integer_ratio(self) -> Tuple[int, int]: ...
def hex(self) -> str: ...
def is_integer(self) -> bool: ...
@ -326,9 +325,9 @@ class float:
class complex:
@overload
def __new__(cls: Type[_T], real: float = ..., imag: float = ...) -> _T: ...
def __init__(self, real: float = ..., imag: float = ...) -> None: ...
@overload
def __new__(cls: Type[_T], real: Union[str, SupportsComplex, _SupportsIndex]) -> _T: ...
def __init__(self, real: Union[str, SupportsComplex, _SupportsIndex]) -> None: ...
@property
def real(self) -> float: ...
@property
@ -447,9 +446,9 @@ class _FormatMapMapping(Protocol):
class str(Sequence[str], _str_base):
if sys.version_info >= (3,):
@overload
def __new__(cls: Type[_T], o: object = ...) -> _T: ...
def __init__(self, o: object = ...) -> None: ...
@overload
def __new__(cls: Type[_T], o: bytes, encoding: str = ..., errors: str = ...) -> _T: ...
def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ...
else:
def __init__(self, o: object = ...) -> None: ...
def capitalize(self) -> str: ...
@ -597,15 +596,15 @@ class str(Sequence[str], _str_base):
if sys.version_info >= (3,):
class bytes(ByteString):
@overload
def __new__(cls: Type[_T], ints: Iterable[int]) -> _T: ...
def __init__(self, ints: Iterable[int]) -> None: ...
@overload
def __new__(cls: Type[_T], string: str, encoding: str, errors: str = ...) -> _T: ...
def __init__(self, string: str, encoding: str, errors: str = ...) -> None: ...
@overload
def __new__(cls: Type[_T], length: int) -> _T: ...
def __init__(self, length: int) -> None: ...
@overload
def __new__(cls: Type[_T]) -> _T: ...
def __init__(self) -> None: ...
@overload
def __new__(cls: Type[_T], o: SupportsBytes) -> _T: ...
def __init__(self, o: SupportsBytes) -> None: ...
def capitalize(self) -> bytes: ...
def center(self, __width: int, __fillchar: bytes = ...) -> bytes: ...
def count(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
@ -871,7 +870,7 @@ class memoryview(Sized, Container[_mv_container_type]):
def hex(self) -> str: ...
class bool(int):
def __new__(cls: Type[_T], __o: object = ...) -> _T: ...
def __init__(self, o: object = ...) -> None: ...
@overload
def __and__(self, x: bool) -> bool: ...
@overload
@ -963,7 +962,7 @@ class list(MutableSequence[_T], Generic[_T]):
def reverse(self) -> None: ...
if sys.version_info >= (3,):
@overload
def sort(self: List[_SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ...
def sort(self: List[_LT], *, key: None = ..., reverse: bool = ...) -> None: ...
@overload
def sort(self, *, key: Callable[[_T], _SupportsLessThan], reverse: bool = ...) -> None: ...
else:
@ -1212,7 +1211,7 @@ if sys.version_info < (3,):
# but we define it here as _PathLike to avoid import cycle issues.
# See https://github.com/python/typeshed/pull/991#issuecomment-288160993
_AnyStr_co = TypeVar("_AnyStr_co", str, bytes, covariant=True)
@runtime_checkable
class _PathLike(Protocol[_AnyStr_co]):
def __fspath__(self) -> _AnyStr_co: ...
@ -1441,19 +1440,17 @@ else:
if sys.version_info >= (3,):
@overload
def max(
__arg1: _SupportsLessThanT, __arg2: _SupportsLessThanT, *_args: _SupportsLessThanT, key: None = ...
) -> _SupportsLessThanT: ...
def max(__arg1: _LT, __arg2: _LT, *_args: _LT, key: None = ...) -> _LT: ...
@overload
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _LT]) -> _T: ...
@overload
def max(__iterable: Iterable[_SupportsLessThanT], *, key: None = ...) -> _SupportsLessThanT: ...
def max(__iterable: Iterable[_LT], *, key: None = ...) -> _LT: ...
@overload
def max(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
def max(__iterable: Iterable[_T], *, key: Callable[[_T], _LT]) -> _T: ...
@overload
def max(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., default: _T) -> Union[_SupportsLessThanT, _T]: ...
def max(__iterable: Iterable[_LT], *, key: None = ..., default: _T) -> Union[_LT, _T]: ...
@overload
def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], _SupportsLessThanT], default: _T2) -> Union[_T1, _T2]: ...
def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], _LT], default: _T2) -> Union[_T1, _T2]: ...
else:
@overload
@ -1463,19 +1460,17 @@ else:
if sys.version_info >= (3,):
@overload
def min(
__arg1: _SupportsLessThanT, __arg2: _SupportsLessThanT, *_args: _SupportsLessThanT, key: None = ...
) -> _SupportsLessThanT: ...
def min(__arg1: _LT, __arg2: _LT, *_args: _LT, key: None = ...) -> _LT: ...
@overload
def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _LT]) -> _T: ...
@overload
def min(__iterable: Iterable[_SupportsLessThanT], *, key: None = ...) -> _SupportsLessThanT: ...
def min(__iterable: Iterable[_LT], *, key: None = ...) -> _LT: ...
@overload
def min(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
def min(__iterable: Iterable[_T], *, key: Callable[[_T], _LT]) -> _T: ...
@overload
def min(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., default: _T) -> Union[_SupportsLessThanT, _T]: ...
def min(__iterable: Iterable[_LT], *, key: None = ..., default: _T) -> Union[_LT, _T]: ...
@overload
def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], _SupportsLessThanT], default: _T2) -> Union[_T1, _T2]: ...
def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], _LT], default: _T2) -> Union[_T1, _T2]: ...
else:
@overload
@ -1676,7 +1671,7 @@ def setattr(__obj: Any, __name: Text, __value: Any) -> None: ...
if sys.version_info >= (3,):
@overload
def sorted(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> List[_SupportsLessThanT]: ...
def sorted(__iterable: Iterable[_LT], *, key: None = ..., reverse: bool = ...) -> List[_LT]: ...
@overload
def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThan], reverse: bool = ...) -> List[_T]: ...

View File

@ -14,7 +14,7 @@ def parse(
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 = ...) -> List[Tuple[str, 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(

View File

@ -1,14 +1,27 @@
# ContextManager aliased here for backwards compatibility; TODO eventually remove this
import sys
from types import TracebackType
from typing import IO, Any, Callable, ContextManager, Generic, Iterable, Iterator, Optional, Type, TypeVar, overload
from typing import (
IO,
Any,
Callable,
ContextManager as ContextManager,
Generic,
Iterable,
Iterator,
Optional,
Type,
TypeVar,
overload,
)
if sys.version_info >= (3, 5):
from typing import AsyncContextManager, AsyncIterator
if sys.version_info >= (3, 6):
AbstractContextManager = ContextManager
from typing import ContextManager as AbstractContextManager
if sys.version_info >= (3, 7):
AbstractAsyncContextManager = AsyncContextManager
from typing import AsyncContextManager as AbstractAsyncContextManager
_T = TypeVar("_T")
_T_io = TypeVar("_T_io", bound=Optional[IO[str]])

View File

@ -1,4 +1,4 @@
from typing import Any, Text
from typing import Any, Callable, Iterable, Text
DEBUG: int
INFO: int
@ -15,11 +15,14 @@ class Log:
def error(self, msg: Text, *args: Any) -> None: ...
def fatal(self, msg: Text, *args: Any) -> None: ...
def log(level: int, msg: Text, *args: Any) -> None: ...
def debug(msg: Text, *args: Any) -> None: ...
def info(msg: Text, *args: Any) -> None: ...
def warn(msg: Text, *args: Any) -> None: ...
def error(msg: Text, *args: Any) -> None: ...
def fatal(msg: Text, *args: Any) -> None: ...
_LogFunc = Callable[[Text, Iterable[Any]], None]
log: Callable[[int, Text, Iterable[Any]], None]
debug: _LogFunc
info: _LogFunc
warn: _LogFunc
error: _LogFunc
fatal: _LogFunc
def set_threshold(level: int) -> int: ...
def set_verbosity(v: int) -> None: ...

View File

@ -4,7 +4,6 @@ from socket import socket
from ssl import SSLContext
from types import TracebackType
from typing import Any, BinaryIO, Callable, Dict, Iterable, Iterator, List, Optional, Text, TextIO, Tuple, Type, TypeVar, Union
from typing_extensions import Literal
_T = TypeVar("_T")
_IntOrStr = Union[int, Text]
@ -151,15 +150,3 @@ if sys.version_info < (3,):
def get_account(self, host: Text) -> Tuple[Optional[str], Optional[str], Optional[str]]: ...
def get_macros(self) -> List[str]: ...
def get_macro(self, macro: Text) -> Tuple[str, ...]: ...
def parse150(resp: str) -> Optional[int]: ... # undocumented
def parse227(resp: str) -> Tuple[str, int]: ... # undocumented
def parse229(resp: str, peer: Any) -> Tuple[str, int]: ... # undocumented
def parse257(resp: str) -> str: ... # undocumented
def ftpcp(
source: FTP,
sourcename: str,
target: FTP,
targetname: str = ...,
type: Literal["A", "I"] = ...,
) -> None: ... # undocumented

View File

@ -93,8 +93,6 @@ class IMAP4:
def thread(self, threading_algorithm: str, charset: str, *search_criteria: str) -> _CommandResults: ...
def uid(self, command: str, *args: str) -> _CommandResults: ...
def unsubscribe(self, mailbox: str) -> _CommandResults: ...
if sys.version_info >= (3, 9):
def unselect(self) -> _CommandResults: ...
def xatom(self, name: str, *args: str) -> _CommandResults: ...
def print_log(self) -> None: ...

View File

@ -3,8 +3,8 @@ import ssl
import sys
from _typeshed import StrPath
from logging import FileHandler, Handler, LogRecord
from socket import SocketKind, SocketType
from typing import Any, Callable, ClassVar, Dict, List, Optional, Tuple, Union
from socket import SocketType
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
if sys.version_info >= (3, 7):
from queue import Queue, SimpleQueue
@ -13,6 +13,9 @@ elif sys.version_info >= (3,):
else:
from Queue import Queue
# TODO update socket stubs to add SocketKind
_SocketKind = int
DEFAULT_TCP_LOGGING_PORT: int
DEFAULT_UDP_LOGGING_PORT: int
DEFAULT_HTTP_LOGGING_PORT: int
@ -155,16 +158,8 @@ class SysLogHandler(Handler):
LOG_LOCAL5: int
LOG_LOCAL6: int
LOG_LOCAL7: int
unixsocket: bool # undocumented
socktype: SocketKind # undocumented
if sys.version_info >= (3,):
ident: str # undocumented
facility: int # undocumented
priority_names: ClassVar[Dict[str, int]] # undocumented
facility_names: ClassVar[Dict[str, int]] # undocumented
priority_map: ClassVar[Dict[str, str]] # undocumented
def __init__(
self, address: Union[Tuple[str, int], str] = ..., facility: int = ..., socktype: Optional[SocketKind] = ...
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: ...

View File

@ -55,10 +55,7 @@ def frexp(__x: SupportsFloat) -> Tuple[float, int]: ...
def fsum(__seq: Iterable[float]) -> float: ...
def gamma(__x: SupportsFloat) -> float: ...
if sys.version_info >= (3, 9):
def gcd(*integers: int) -> int: ...
elif sys.version_info >= (3, 5):
if sys.version_info >= (3, 5):
def gcd(__x: int, __y: int) -> int: ...
if sys.version_info >= (3, 8):
@ -80,9 +77,6 @@ def isnan(__x: SupportsFloat) -> bool: ...
if sys.version_info >= (3, 8):
def isqrt(__n: int) -> int: ...
if sys.version_info >= (3, 9):
def lcm(*integers: int) -> int: ...
def ldexp(__x: SupportsFloat, __i: int) -> float: ...
def lgamma(__x: SupportsFloat) -> float: ...
def log(x: SupportsFloat, base: SupportsFloat = ...) -> float: ...
@ -93,10 +87,6 @@ if sys.version_info >= (3, 3):
def log2(__x: SupportsFloat) -> float: ...
def modf(__x: SupportsFloat) -> Tuple[float, float]: ...
if sys.version_info >= (3, 9):
def nextafter(__x: SupportsFloat, __y: SupportsFloat) -> float: ...
def pow(__x: SupportsFloat, __y: SupportsFloat) -> float: ...
if sys.version_info >= (3, 8):
@ -116,6 +106,3 @@ def sqrt(__x: SupportsFloat) -> float: ...
def tan(__x: SupportsFloat) -> float: ...
def tanh(__x: SupportsFloat) -> float: ...
def trunc(__x: SupportsFloat) -> int: ...
if sys.version_info >= (3, 9):
def ulp(__x: SupportsFloat) -> float: ...

View File

@ -1,6 +1,7 @@
import sys
from _typeshed import AnyPath
from cProfile import Profile as _cProfile
from enum import Enum
from profile import Profile
from typing import IO, Any, Dict, Iterable, List, Optional, Text, Tuple, TypeVar, Union, overload
@ -8,7 +9,6 @@ _Selector = Union[str, float, int]
_T = TypeVar("_T", bound=Stats)
if sys.version_info >= (3, 7):
from enum import Enum
class SortKey(str, Enum):
CALLS: str
CUMULATIVE: str

View File

@ -93,7 +93,7 @@ AI_NUMERICSERV: AddressInfo
AI_PASSIVE: AddressInfo
AI_V4MAPPED: AddressInfo
AI_V4MAPPED_CFG: AddressInfo
EAI_ADDRFAMILY: int
EAIEAI_ADDRFAMILY: int
EAI_AGAIN: int
EAI_BADFLAGS: int
EAI_BADHINTS: int

View File

@ -155,11 +155,7 @@ class Event:
def wait(self, timeout: Optional[float] = ...) -> bool: ...
if sys.version_info >= (3, 8):
import _thread
# don't ask...
_ExceptHookArgs = _thread.ExceptHookArgs
ExceptHookArgs = _thread._ExceptHookArgs
from _thread import ExceptHookArgs as _ExceptHookArgs, _ExceptHookArgs as ExceptHookArgs # don't ask
excepthook: Callable[[_ExceptHookArgs], Any]

View File

@ -1,4 +1,3 @@
import sys
from tracemalloc import _FrameTupleT, _TraceTupleT
from typing import Optional, Sequence, Tuple
@ -9,9 +8,5 @@ def get_traceback_limit() -> int: ...
def get_traced_memory() -> Tuple[int, int]: ...
def get_tracemalloc_memory() -> int: ...
def is_tracing() -> bool: ...
if sys.version_info >= (3, 9):
def reset_peak() -> None: ...
def start(__nframe: int = ...) -> None: ...
def stop() -> None: ...

View File

@ -191,7 +191,7 @@ else:
def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
def fix_missing_locations(node: _T) -> _T: ...
def get_docstring(node: AST, clean: bool = ...) -> Optional[str]: ...
def get_docstring(node: AST, clean: bool = ...) -> str: ...
def increment_lineno(node: _T, n: int = ...) -> _T: ...
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
def iter_fields(node: AST) -> Iterator[_typing.Tuple[str, Any]]: ...

View File

@ -1,9 +1,8 @@
import sys
from types import TracebackType
from typing import Any, Awaitable, Callable, Deque, Generator, Optional, Type, TypeVar, Union
from typing import Any, Awaitable, Callable, Generator, Optional, Type, TypeVar, Union
from .events import AbstractEventLoop
from .futures import Future
_T = TypeVar("_T")
@ -56,13 +55,10 @@ class Condition(_ContextManagerMixin):
def notify_all(self) -> None: ...
class Semaphore(_ContextManagerMixin):
_value: int
_waiters: Deque[Future[Any]]
def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ...
def locked(self) -> bool: ...
async def acquire(self) -> bool: ...
def release(self) -> None: ...
def _wake_up_next(self) -> None: ...
class BoundedSemaphore(Semaphore):
def __init__(self, value: int = ..., *, loop: Optional[AbstractEventLoop] = ...) -> None: ...

View File

@ -1,7 +1,7 @@
import sys
import typing
from typing import (
AbstractSet,
AbstractSet as Set,
Any,
AsyncIterable as AsyncIterable,
AsyncIterator as AsyncIterator,
@ -36,8 +36,6 @@ from typing import (
overload,
)
Set = AbstractSet
if sys.version_info >= (3, 6):
from typing import AsyncGenerator as AsyncGenerator, Collection as Collection

View File

@ -1,9 +1,8 @@
import sys
import threading
from abc import abstractmethod
from logging import Logger
from types import TracebackType
from typing import Any, Callable, Container, Generic, Iterable, Iterator, List, Optional, Protocol, Set, Tuple, TypeVar
from typing import Any, Callable, Generic, Iterable, Iterator, List, Optional, Set, Tuple, TypeVar
FIRST_COMPLETED: str
FIRST_EXCEPTION: str
@ -27,15 +26,6 @@ if sys.version_info >= (3, 7):
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
# Copied over Collection implementation as it does not exist in Python 2 and <3.6.
# Also to solve pytype issues with _Collection.
class _Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]):
# Implement Sized (but don't have it as a base class).
@abstractmethod
def __len__(self) -> int: ...
class Future(Generic[_T]):
def __init__(self) -> None: ...
def cancel(self) -> bool: ...
@ -75,7 +65,7 @@ class Executor:
def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ...
def wait(
fs: _Collection[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...
fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...
) -> Tuple[Set[Future[_T]], Set[Future[_T]]]: ...
class _Waiter:

View File

@ -1,4 +1,3 @@
import sys
from _typeshed import FileDescriptorLike
from array import array
from typing import Any, Union, overload
@ -34,10 +33,6 @@ F_SETLK: int
F_SETLK64: int
F_SETLKW: int
F_SETLKW64: int
if sys.version_info >= (3, 9) and sys.platform == "linux":
F_OFD_GETLK: int
F_OFD_SETLK: int
F_OFD_SETLKW: int
F_SETOWN: int
F_SETSIG: int
F_SHLCK: int

View File

@ -51,7 +51,9 @@ else:
WRAPPER_ASSIGNMENTS: Sequence[str]
WRAPPER_UPDATES: Sequence[str]
def update_wrapper(wrapper: _T, wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> _T: ...
def update_wrapper(
wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...
) -> _AnyCallable: ...
def wraps(
wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...
) -> Callable[[_AnyCallable], _AnyCallable]: ...

View File

@ -33,10 +33,6 @@ def get_referrers(*objs: Any) -> List[Any]: ...
def get_stats() -> List[Dict[str, Any]]: ...
def get_threshold() -> Tuple[int, int, int]: ...
def is_tracked(__obj: Any) -> bool: ...
if sys.version_info >= (3, 9):
def is_finalized(__obj: Any) -> bool: ...
def isenabled() -> bool: ...
def set_debug(__flags: int) -> None: ...
def set_threshold(threshold0: int, threshold1: int = ..., threshold2: int = ...) -> None: ...

View File

@ -128,7 +128,7 @@ class TextIOBase(IOBase):
def __next__(self) -> str: ... # type: ignore
def detach(self) -> BinaryIO: ...
def write(self, __s: str) -> int: ...
def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore
def writelines(self, __lines: List[str]) -> None: ... # type: ignore
def readline(self, __size: int = ...) -> str: ... # type: ignore
def readlines(self, __hint: int = ...) -> List[str]: ... # type: ignore
def read(self, __size: Optional[int] = ...) -> str: ...
@ -166,7 +166,7 @@ class TextIOWrapper(TextIOBase, TextIO):
def __enter__(self: _T) -> _T: ...
def __iter__(self) -> Iterator[str]: ... # type: ignore
def __next__(self) -> str: ... # type: ignore
def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore
def writelines(self, __lines: List[str]) -> None: ... # type: ignore
def readline(self, __size: int = ...) -> str: ... # type: ignore
def readlines(self, __hint: int = ...) -> List[str]: ... # type: ignore
def seek(self, __cookie: int, __whence: int = ...) -> int: ...

View File

@ -8,7 +8,7 @@ from _typeshed import (
OpenBinaryModeWriting,
OpenTextMode,
)
from builtins import OSError
from builtins import OSError as error
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper as _TextIOWrapper
from posix import listdir as listdir, times_result
from typing import (
@ -25,6 +25,7 @@ from typing import (
List,
Mapping,
MutableMapping,
NamedTuple,
NoReturn,
Optional,
Sequence,
@ -45,8 +46,6 @@ _T = TypeVar("_T")
# ----- os variables -----
error = OSError
supports_bytes_environ: bool
supports_dir_fd: Set[Callable[..., Any]]
@ -269,9 +268,7 @@ class stat_result:
st_type: int
if sys.version_info >= (3, 6):
from builtins import _PathLike
PathLike = _PathLike # See comment in builtins
from builtins import _PathLike as PathLike # See comment in builtins
_FdOrAnyPath = Union[int, AnyPath]
@ -303,16 +300,9 @@ else:
def stat(self, *, follow_symlinks: bool = ...) -> stat_result: ...
if sys.platform != "win32":
_Tuple10Int = Tuple[int, int, int, int, int, int, int, int, int, int]
_Tuple11Int = Tuple[int, int, int, int, int, int, int, int, int, int, int]
if sys.version_info >= (3, 7):
# f_fsid was added in https://github.com/python/cpython/pull/4571
class statvfs_result(_Tuple10Int): # Unix only
def __new__(cls, seq: Union[_Tuple10Int, _Tuple11Int], dict: Dict[str, int] = ...) -> statvfs_result: ...
n_fields: int
n_sequence_fields: int
n_unnamed_fields: int
class statvfs_result(NamedTuple): # Unix only
f_bsize: int
f_frsize: int
f_blocks: int
@ -323,13 +313,9 @@ if sys.platform != "win32":
f_favail: int
f_flag: int
f_namemax: int
f_fsid: int = ...
f_fsid: int
else:
class statvfs_result(_Tuple10Int): # Unix only
n_fields: int
n_sequence_fields: int
n_unnamed_fields: int
class statvfs_result(NamedTuple): # Unix only
f_bsize: int
f_frsize: int
f_blocks: int

View File

@ -3,9 +3,7 @@
import sys
if sys.version_info < (3, 9):
import os
DEV_NULL = os.devnull
from os import devnull as DEV_NULL
from typing import NamedTuple, Optional, Tuple
if sys.version_info >= (3, 8):

View File

@ -18,7 +18,7 @@ class Random(_random.Random):
def getstate(self) -> Tuple[Any, ...]: ...
def setstate(self, state: Tuple[Any, ...]) -> None: ...
def getrandbits(self, __k: int) -> int: ...
def randrange(self, start: int, stop: Optional[int] = ..., step: int = ...) -> int: ...
def randrange(self, start: int, stop: Union[int, None] = ..., step: int = ...) -> int: ...
def randint(self, a: int, b: int) -> int: ...
if sys.version_info >= (3, 9):
def randbytes(self, n: int) -> bytes: ...
@ -32,7 +32,7 @@ class Random(_random.Random):
cum_weights: Optional[Sequence[float]] = ...,
k: int = ...,
) -> List[_T]: ...
def shuffle(self, x: MutableSequence[Any], random: Optional[Callable[[], float]] = ...) -> None: ...
def shuffle(self, x: MutableSequence[Any], random: Union[Callable[[], float], None] = ...) -> None: ...
if sys.version_info >= (3, 9):
def sample(
self, population: Union[Sequence[_T], AbstractSet[_T]], k: int, *, counts: Optional[Iterable[_T]] = ...
@ -77,7 +77,7 @@ if sys.version_info >= (3, 6):
k: int = ...,
) -> List[_T]: ...
def shuffle(x: MutableSequence[Any], random: Optional[Callable[[], float]] = ...) -> None: ...
def shuffle(x: MutableSequence[Any], random: Union[Callable[[], float], None] = ...) -> None: ...
if sys.version_info >= (3, 9):
def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int, *, counts: Optional[Iterable[_T]] = ...) -> List[_T]: ...

View File

@ -2,7 +2,7 @@
import sys
from sre_constants import _NamedIntConstant as _NIC, error as _Error
from typing import Any, Dict, FrozenSet, Iterable, List, Match, Optional, Pattern as _Pattern, Tuple, Union, overload
from typing import Any, Dict, FrozenSet, Iterable, List, Match, Optional, Pattern as _Pattern, Tuple, Union
SPECIAL_CHARS: str
REPEAT_CHARS: str
@ -85,20 +85,13 @@ class Tokenizer:
def fix_flags(src: Union[str, bytes], flags: int) -> int: ...
_TemplateType = Tuple[List[Tuple[int, int]], List[Optional[str]]]
_TemplateByteType = Tuple[List[Tuple[int, int]], List[Optional[bytes]]]
_TemplateType = Tuple[List[Tuple[int, int]], List[str]]
if sys.version_info >= (3, 8):
def parse(str: str, flags: int = ..., state: Optional[State] = ...) -> SubPattern: ...
@overload
def parse_template(source: str, state: _Pattern[Any]) -> _TemplateType: ...
@overload
def parse_template(source: bytes, state: _Pattern[Any]) -> _TemplateByteType: ...
else:
def parse(str: str, flags: int = ..., pattern: Optional[Pattern] = ...) -> SubPattern: ...
@overload
def parse_template(source: str, pattern: _Pattern[Any]) -> _TemplateType: ...
@overload
def parse_template(source: bytes, pattern: _Pattern[Any]) -> _TemplateByteType: ...
def expand_template(template: _TemplateType, match: Match[Any]) -> str: ...

View File

@ -281,7 +281,7 @@ class FrameType:
f_lasti: int
f_lineno: int
f_locals: Dict[str, Any]
f_trace: Optional[Callable[[FrameType, str, Any], Any]]
f_trace: Callable[[], None]
if sys.version_info >= (3, 7):
f_trace_lines: bool
f_trace_opcodes: bool

View File

@ -4,7 +4,6 @@ from typing import Any, Callable, Generic, List, Mapping, Optional, Sequence, Te
_F = TypeVar("_F", bound=Callable[..., Any])
_T = TypeVar("_T")
_TT = TypeVar("_TT", bound=Type[Any])
_R = TypeVar("_R")
__all__ = [
"Mock",
@ -194,7 +193,7 @@ class _patch(Generic[_T]):
kwargs: Mapping[str, Any],
) -> None: ...
def copy(self) -> _patch[_T]: ...
def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ...
def __call__(self, func: _F) -> _F: ...
def decorate_class(self, klass: _TT) -> _TT: ...
def decorate_callable(self, func: _F) -> _F: ...
def get_original(self) -> Tuple[Any, bool]: ...

View File

@ -4,24 +4,7 @@ import sys
from email.message import Message
from http.client import HTTPMessage, HTTPResponse, _HTTPConnectionProtocol
from http.cookiejar import CookieJar
from typing import (
IO,
Any,
Callable,
ClassVar,
Dict,
List,
Mapping,
NoReturn,
Optional,
Pattern,
Sequence,
Tuple,
TypeVar,
Union,
overload,
)
from urllib.error import HTTPError
from typing import IO, Any, Callable, ClassVar, Dict, List, Mapping, NoReturn, Optional, Sequence, Tuple, TypeVar, Union, overload
from urllib.response import addinfourl
_T = TypeVar("_T")
@ -82,14 +65,12 @@ class Request:
@overload
def get_header(self, header_name: str, default: _T) -> Union[str, _T]: ...
def header_items(self) -> List[Tuple[str, str]]: ...
def has_proxy(self) -> bool: ...
class OpenerDirector:
addheaders: List[Tuple[str, str]]
def add_handler(self, handler: BaseHandler) -> None: ...
def open(self, fullurl: Union[str, Request], data: Optional[bytes] = ..., timeout: Optional[float] = ...) -> _UrlopenRet: ...
def error(self, proto: str, *args: Any) -> _UrlopenRet: ...
def close(self) -> None: ...
class BaseHandler:
handler_order: ClassVar[int]
@ -98,15 +79,9 @@ class BaseHandler:
def close(self) -> None: ...
def http_error_nnn(self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str]) -> _UrlopenRet: ...
class HTTPDefaultErrorHandler(BaseHandler):
def http_error_default(
self, req: Request, fp: IO[bytes], code: int, msg: str, hdrs: Mapping[str, str]
) -> HTTPError: ... # undocumented
class HTTPDefaultErrorHandler(BaseHandler): ...
class HTTPRedirectHandler(BaseHandler):
max_redirections: ClassVar[int] # undocumented
max_repeats: ClassVar[int] # undocumented
inf_msg: ClassVar[str] # undocumented
def redirect_request(
self, req: Request, fp: IO[str], code: int, msg: str, headers: Mapping[str, str], newurl: str
) -> Optional[Request]: ...
@ -126,21 +101,14 @@ class HTTPRedirectHandler(BaseHandler):
class HTTPCookieProcessor(BaseHandler):
cookiejar: CookieJar
def __init__(self, cookiejar: Optional[CookieJar] = ...) -> None: ...
def http_request(self, request: Request) -> Request: ... # undocumented
def http_response(self, request: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented
def https_request(self, request: Request) -> Request: ... # undocumented
def https_response(self, request: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented
class ProxyHandler(BaseHandler):
def __init__(self, proxies: Optional[Dict[str, str]] = ...) -> None: ...
def proxy_open(self, req: Request, proxy: str, type: str) -> Optional[_UrlopenRet]: ... # undocumented
# TODO add a method for every (common) proxy protocol
class HTTPPasswordMgr:
def add_password(self, realm: str, uri: Union[str, Sequence[str]], user: str, passwd: str) -> None: ...
def find_user_password(self, realm: str, authuri: str) -> Tuple[Optional[str], Optional[str]]: ...
def is_suburi(self, base: str, test: str) -> bool: ... # undocumented
def reduce_uri(self, uri: str, default_port: bool = ...) -> str: ... # undocumented
class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr):
def add_password(self, realm: Optional[str], uri: Union[str, Sequence[str]], user: str, passwd: str) -> None: ...
@ -154,23 +122,15 @@ class HTTPPasswordMgrWithPriorAuth(HTTPPasswordMgrWithDefaultRealm):
def is_authenticated(self, authuri: str) -> bool: ...
class AbstractBasicAuthHandler:
rx: ClassVar[Pattern] # undocumented
def __init__(self, password_mgr: Optional[HTTPPasswordMgr] = ...) -> None: ...
def http_error_auth_reqed(self, authreq: str, host: str, req: Request, headers: Mapping[str, str]) -> None: ...
def http_request(self, req: Request) -> Request: ... # undocumented
def http_response(self, req: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented
def https_request(self, req: Request) -> Request: ... # undocumented
def https_response(self, req: Request, response: HTTPResponse) -> HTTPResponse: ... # undocumented
def retry_http_basic_auth(self, host: str, req: Request, realm: str) -> Optional[_UrlopenRet]: ... # undocumented
class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):
auth_header: ClassVar[str] # undocumented
def http_error_401(
self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str]
) -> Optional[_UrlopenRet]: ...
class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):
auth_header: ClassVar[str]
def http_error_407(
self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str]
) -> Optional[_UrlopenRet]: ...
@ -186,13 +146,11 @@ class AbstractDigestAuthHandler:
def get_entity_digest(self, data: Optional[bytes], chal: Mapping[str, str]) -> Optional[str]: ...
class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
auth_header: ClassVar[str] # undocumented
def http_error_401(
self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str]
) -> Optional[_UrlopenRet]: ...
class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
auth_header: ClassVar[str] # undocumented
def http_error_407(
self, req: Request, fp: IO[str], code: int, msg: int, headers: Mapping[str, str]
) -> Optional[_UrlopenRet]: ...
@ -215,33 +173,17 @@ class HTTPSHandler(AbstractHTTPHandler):
def https_request(self, request: Request) -> Request: ... # undocumented
class FileHandler(BaseHandler):
names: ClassVar[Optional[Tuple[str, ...]]] # undocumented
def file_open(self, req: Request) -> addinfourl: ...
def get_names(self) -> Tuple[str, ...]: ... # undocumented
def open_local_file(self, req: Request) -> addinfourl: ... # undocumented
class DataHandler(BaseHandler):
def data_open(self, req: Request) -> addinfourl: ...
class ftpwrapper: # undocumented
def __init__(
self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: Optional[float] = ..., persistent: bool = ...
) -> None: ...
class FTPHandler(BaseHandler):
def ftp_open(self, req: Request) -> addinfourl: ...
def connect_ftp(
self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: float
) -> ftpwrapper: ... # undocumented
class CacheFTPHandler(FTPHandler):
def setTimeout(self, t: float) -> None: ...
def setMaxConns(self, m: int) -> None: ...
def check_cache(self) -> None: ... # undocumented
def clear_cache(self) -> None: ... # undocumented
def connect_ftp(
self, user: str, passwd: str, host: str, port: int, dirs: str, timeout: float
) -> ftpwrapper: ... # undocumented
class UnknownHandler(BaseHandler):
def unknown_open(self, req: Request) -> NoReturn: ...
@ -280,73 +222,6 @@ class URLopener:
reporthook: Optional[Callable[[int, int, int], None]] = ...,
data: Optional[bytes] = ...,
) -> Tuple[str, Optional[Message]]: ...
def addheader(self, *args: Tuple[str, str]) -> None: ... # undocumented
def cleanup(self) -> None: ... # undocumented
def close(self) -> None: ... # undocumented
def http_error(
self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] = ...
) -> _UrlopenRet: ... # undocumented
def http_error_default(
self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: Mapping[str, str]
) -> _UrlopenRet: ... # undocumented
def open_data(self, url: str, data: Optional[bytes] = ...) -> addinfourl: ... # undocumented
def open_file(self, url: str) -> addinfourl: ... # undocumented
def open_ftp(self, url: str) -> addinfourl: ... # undocumented
def open_http(self, url: str, data: Optional[bytes] = ...) -> _UrlopenRet: ... # undocumented
def open_https(self, url: str, data: Optional[bytes] = ...) -> _UrlopenRet: ... # undocumented
def open_local_file(self, url: str) -> addinfourl: ... # undocumented
def open_unknown_proxy(self, proxy: str, fullurl: str, data: Optional[bytes] = ...) -> None: ... # undocumented
class FancyURLopener(URLopener):
def prompt_user_passwd(self, host: str, realm: str) -> Tuple[str, str]: ...
def get_user_passwd(self, host: str, realm: str, clear_cache: int = ...) -> Tuple[str, str]: ... # undocumented
def http_error_301(
self, url: str, fp: IO[str], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] = ...
) -> Optional[Union[_UrlopenRet, addinfourl]]: ... # undocumented
def http_error_302(
self, url: str, fp: IO[str], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] = ...
) -> Optional[Union[_UrlopenRet, addinfourl]]: ... # undocumented
def http_error_303(
self, url: str, fp: IO[str], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] = ...
) -> Optional[Union[_UrlopenRet, addinfourl]]: ... # undocumented
def http_error_307(
self, url: str, fp: IO[str], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes] = ...
) -> Optional[Union[_UrlopenRet, addinfourl]]: ... # undocumented
def http_error_401(
self,
url: str,
fp: IO[str],
errcode: int,
errmsg: str,
headers: Mapping[str, str],
data: Optional[bytes] = ...,
retry: bool = ...,
) -> Optional[_UrlopenRet]: ... # undocumented
def http_error_407(
self,
url: str,
fp: IO[str],
errcode: int,
errmsg: str,
headers: Mapping[str, str],
data: Optional[bytes] = ...,
retry: bool = ...,
) -> Optional[_UrlopenRet]: ... # undocumented
def http_error_default(
self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: Mapping[str, str]
) -> addinfourl: ... # undocumented
def redirect_internal(
self, url: str, fp: IO[str], errcode: int, errmsg: str, headers: Mapping[str, str], data: Optional[bytes]
) -> Optional[_UrlopenRet]: ... # undocumented
def retry_http_basic_auth(
self, url: str, realm: str, data: Optional[bytes] = ...
) -> Optional[_UrlopenRet]: ... # undocumented
def retry_https_basic_auth(
self, url: str, realm: str, data: Optional[bytes] = ...
) -> Optional[_UrlopenRet]: ... # undocumented
def retry_proxy_http_basic_auth(
self, url: str, realm: str, data: Optional[bytes] = ...
) -> Optional[_UrlopenRet]: ... # undocumented
def retry_proxy_https_basic_auth(
self, url: str, realm: str, data: Optional[bytes] = ...
) -> Optional[_UrlopenRet]: ... # undocumented

View File

@ -0,0 +1,20 @@
from typing import Text, Union
from .blockalgo import BlockAlgo
__revision__: str
class AESCipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> AESCipher: ...
MODE_ECB: int
MODE_CBC: int
MODE_CFB: int
MODE_PGP: int
MODE_OFB: int
MODE_CTR: int
MODE_OPENPGP: int
block_size: int
key_size: int

View File

@ -0,0 +1,20 @@
from typing import Text, Union
from .blockalgo import BlockAlgo
__revision__: str
class RC2Cipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> RC2Cipher: ...
MODE_ECB: int
MODE_CBC: int
MODE_CFB: int
MODE_PGP: int
MODE_OFB: int
MODE_CTR: int
MODE_OPENPGP: int
block_size: int
key_size: int

View File

@ -0,0 +1,15 @@
from typing import Text, Union
__revision__: str
class ARC4Cipher:
block_size: int
key_size: int
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def encrypt(self, plaintext): ...
def decrypt(self, ciphertext): ...
def new(key: Union[bytes, Text], *args, **kwargs) -> ARC4Cipher: ...
block_size: int
key_size: int

View File

@ -0,0 +1,20 @@
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str
class BlowfishCipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> BlowfishCipher: ...
MODE_ECB: int
MODE_CBC: int
MODE_CFB: int
MODE_PGP: int
MODE_OFB: int
MODE_CTR: int
MODE_OPENPGP: int
block_size: int
key_size: Any

View File

@ -0,0 +1,20 @@
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str
class CAST128Cipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> CAST128Cipher: ...
MODE_ECB: int
MODE_CBC: int
MODE_CFB: int
MODE_PGP: int
MODE_OFB: int
MODE_CTR: int
MODE_OPENPGP: int
block_size: int
key_size: Any

View File

@ -0,0 +1,20 @@
from typing import Text, Union
from .blockalgo import BlockAlgo
__revision__: str
class DESCipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> DESCipher: ...
MODE_ECB: int
MODE_CBC: int
MODE_CFB: int
MODE_PGP: int
MODE_OFB: int
MODE_CTR: int
MODE_OPENPGP: int
block_size: int
key_size: int

View File

@ -0,0 +1,20 @@
from typing import Any, Text, Union
from .blockalgo import BlockAlgo
__revision__: str
class DES3Cipher(BlockAlgo):
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> DES3Cipher: ...
MODE_ECB: int
MODE_CBC: int
MODE_CFB: int
MODE_PGP: int
MODE_OFB: int
MODE_CTR: int
MODE_OPENPGP: int
block_size: int
key_size: Any

View File

@ -0,0 +1,12 @@
from typing import Any, Optional, Text, Union
from Crypto.PublicKey.RSA import _RSAobj
class PKCS1OAEP_Cipher:
def __init__(self, key: _RSAobj, hashAlgo: Any, mgfunc: Any, label: Any) -> None: ...
def can_encrypt(self): ...
def can_decrypt(self): ...
def encrypt(self, message: Union[bytes, Text]) -> bytes: ...
def decrypt(self, ct: bytes) -> bytes: ...
def new(key: _RSAobj, hashAlgo: Optional[Any] = ..., mgfunc: Optional[Any] = ..., label: Any = ...) -> PKCS1OAEP_Cipher: ...

View File

@ -0,0 +1,13 @@
from typing import Any, Text, Union
from Crypto.PublicKey.RSA import _RSAobj
class PKCS115_Cipher:
def __init__(self, key: _RSAobj) -> None: ...
def can_encrypt(self) -> bool: ...
def can_decrypt(self) -> bool: ...
rf: Any
def encrypt(self, message: Union[bytes, Text]) -> bytes: ...
def decrypt(self, ct: bytes, sentinel: Any) -> bytes: ...
def new(key: _RSAobj) -> PKCS115_Cipher: ...

View File

@ -0,0 +1,15 @@
from typing import Text, Union
__revision__: str
class XORCipher:
block_size: int
key_size: int
def __init__(self, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ...
def decrypt(self, ciphertext: bytes) -> bytes: ...
def new(key: Union[bytes, Text], *args, **kwargs) -> XORCipher: ...
block_size: int
key_size: int

View File

@ -0,0 +1,11 @@
# Names in __all__ with no definition:
# AES
# ARC2
# ARC4
# Blowfish
# CAST
# DES
# DES3
# PKCS1_OAEP
# PKCS1_v1_5
# XOR

View File

@ -0,0 +1,17 @@
from typing import Any, Text, Union
MODE_ECB: int
MODE_CBC: int
MODE_CFB: int
MODE_PGP: int
MODE_OFB: int
MODE_CTR: int
MODE_OPENPGP: int
class BlockAlgo:
mode: int
block_size: int
IV: Any
def __init__(self, factory: Any, key: Union[bytes, Text], *args, **kwargs) -> None: ...
def encrypt(self, plaintext: Union[bytes, Text]) -> bytes: ...
def decrypt(self, ciphertext: bytes) -> bytes: ...

View File

@ -0,0 +1,16 @@
from typing import Any, Optional
digest_size: Any
class HMAC:
digest_size: Any
digestmod: Any
outer: Any
inner: Any
def __init__(self, key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...) -> None: ...
def update(self, msg): ...
def copy(self): ...
def digest(self): ...
def hexdigest(self): ...
def new(key, msg: Optional[Any] = ..., digestmod: Optional[Any] = ...): ...

View File

@ -0,0 +1,14 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD2Hash(HashAlgo):
oid: Any
digest_size: int
block_size: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size: Any

View File

@ -0,0 +1,14 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD4Hash(HashAlgo):
oid: Any
digest_size: int
block_size: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size: Any

View File

@ -0,0 +1,14 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class MD5Hash(HashAlgo):
oid: Any
digest_size: int
block_size: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size: Any

View File

@ -0,0 +1,14 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class RIPEMD160Hash(HashAlgo):
oid: Any
digest_size: int
block_size: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size: Any

View File

@ -0,0 +1,14 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA1Hash(HashAlgo):
oid: Any
digest_size: int
block_size: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size: Any

View File

@ -0,0 +1,14 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA224Hash(HashAlgo):
oid: Any
digest_size: int
block_size: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size: Any

View File

@ -0,0 +1,14 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA256Hash(HashAlgo):
oid: Any
digest_size: int
block_size: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size: Any

View File

@ -0,0 +1,14 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA384Hash(HashAlgo):
oid: Any
digest_size: int
block_size: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size: Any

View File

@ -0,0 +1,14 @@
from typing import Any, Optional
from Crypto.Hash.hashalgo import HashAlgo
class SHA512Hash(HashAlgo):
oid: Any
digest_size: int
block_size: int
def __init__(self, data: Optional[Any] = ...) -> None: ...
def new(self, data: Optional[Any] = ...): ...
def new(data: Optional[Any] = ...): ...
digest_size: Any

View File

@ -0,0 +1,11 @@
# Names in __all__ with no definition:
# HMAC
# MD2
# MD4
# MD5
# RIPEMD
# SHA
# SHA224
# SHA256
# SHA384
# SHA512

View File

@ -0,0 +1,11 @@
from typing import Any, Optional
class HashAlgo:
digest_size: Any
block_size: Any
def __init__(self, hashFactory, data: Optional[Any] = ...) -> None: ...
def update(self, data): ...
def digest(self): ...
def hexdigest(self): ...
def copy(self): ...
def new(self, data: Optional[Any] = ...): ...

View File

@ -0,0 +1,10 @@
from typing import Any, Optional
__revision__: str
def isInt(x): ...
class AllOrNothing:
def __init__(self, ciphermodule, mode: Optional[Any] = ..., IV: Optional[Any] = ...) -> None: ...
def digest(self, text): ...
def undigest(self, blocks): ...

View File

@ -0,0 +1,5 @@
__revision__: str
class Chaff:
def __init__(self, factor: float = ..., blocksper: int = ...) -> None: ...
def chaff(self, blocks): ...

View File

@ -0,0 +1,8 @@
from typing import Any, Optional
from Crypto.Hash import SHA as SHA1
__revision__: str
def PBKDF1(password, salt, dkLen, count: int = ..., hashAlgo: Optional[Any] = ...): ...
def PBKDF2(password, salt, dkLen: int = ..., count: int = ..., prf: Optional[Any] = ...): ...

View File

@ -0,0 +1,4 @@
# Names in __all__ with no definition:
# AllOrNothing
# Chaffing
# KDF

View File

@ -0,0 +1,28 @@
from typing import Any, Optional
from .pubkey import pubkey
class _DSAobj(pubkey):
keydata: Any
implementation: Any
key: Any
def __init__(self, implementation, key) -> None: ...
def __getattr__(self, attrname): ...
def sign(self, M, K): ...
def verify(self, M, signature): ...
def has_private(self): ...
def size(self): ...
def can_blind(self): ...
def can_encrypt(self): ...
def can_sign(self): ...
def publickey(self): ...
class DSAImplementation:
error: Any
def __init__(self, **kwargs) -> None: ...
def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ...): ...
def construct(self, tup): ...
generate: Any
construct: Any
error: Any

View File

@ -0,0 +1,19 @@
from typing import Any, Optional
from Crypto.PublicKey.pubkey import * # noqa: F403
from Crypto.PublicKey.pubkey import pubkey
class error(Exception): ...
def generate(bits, randfunc, progress_func: Optional[Any] = ...): ...
def construct(tup): ...
class ElGamalobj(pubkey):
keydata: Any
def encrypt(self, plaintext, K): ...
def decrypt(self, ciphertext): ...
def sign(self, M, K): ...
def verify(self, M, signature): ...
def size(self): ...
def has_private(self): ...
def publickey(self): ...

View File

@ -0,0 +1,33 @@
from typing import Any, Optional, Text, Union
from .pubkey import pubkey
class _RSAobj(pubkey):
keydata: Any
implementation: Any
key: Any
def __init__(self, implementation, key, randfunc: Optional[Any] = ...) -> None: ...
def __getattr__(self, attrname): ...
def encrypt(self, plaintext, K): ...
def decrypt(self, ciphertext): ...
def sign(self, M, K): ...
def verify(self, M, signature): ...
def has_private(self): ...
def size(self): ...
def can_blind(self): ...
def can_encrypt(self): ...
def can_sign(self): ...
def publickey(self): ...
def exportKey(self, format: str = ..., passphrase: Optional[Any] = ..., pkcs: int = ...): ...
class RSAImplementation:
error: Any
def __init__(self, **kwargs) -> None: ...
def generate(self, bits, randfunc: Optional[Any] = ..., progress_func: Optional[Any] = ..., e: int = ...): ...
def construct(self, tup): ...
def importKey(self, externKey: Any, passphrase: Union[None, bytes, Text] = ...) -> _RSAobj: ...
generate: Any
construct: Any
importKey: Any
error: Any

View File

@ -0,0 +1,4 @@
# Names in __all__ with no definition:
# DSA
# ElGamal
# RSA

View File

@ -0,0 +1,21 @@
from Crypto.Util.number import * # noqa: F403
__revision__: str
class pubkey:
def __init__(self) -> None: ...
def encrypt(self, plaintext, K): ...
def decrypt(self, ciphertext): ...
def sign(self, M, K): ...
def verify(self, M, signature): ...
def validate(self, M, signature): ...
def blind(self, M, B): ...
def unblind(self, M, B): ...
def can_sign(self): ...
def can_encrypt(self): ...
def can_blind(self): ...
def size(self): ...
def has_private(self): ...
def publickey(self): ...
def __eq__(self, other): ...
def __ne__(self, other): ...

View File

@ -0,0 +1,25 @@
from typing import Any
__revision__: str
class FortunaPool:
digest_size: Any
def __init__(self) -> None: ...
def append(self, data): ...
def digest(self): ...
def hexdigest(self): ...
length: int
def reset(self): ...
def which_pools(r): ...
class FortunaAccumulator:
min_pool_size: int
reseed_interval: float
reseed_count: int
generator: Any
last_reseed: Any
pools: Any
def __init__(self) -> None: ...
def random_data(self, bytes): ...
def add_random_event(self, source_number, pool_number, data): ...

View File

@ -0,0 +1,16 @@
from typing import Any
__revision__: str
class AESGenerator:
block_size: Any
key_size: int
max_blocks_per_request: Any
counter: Any
key: Any
block_size_shift: Any
blocks_per_key: Any
max_bytes_per_request: Any
def __init__(self) -> None: ...
def reseed(self, seed): ...
def pseudo_random_data(self, bytes): ...

View File

@ -0,0 +1,13 @@
from typing import Any, Optional
class _SHAd256:
digest_size: Any
def __init__(self, internal_api_check, sha256_hash_obj) -> None: ...
def copy(self): ...
def digest(self): ...
def hexdigest(self): ...
def update(self, data): ...
digest_size: Any
def new(data: Optional[Any] = ...): ...

View File

@ -0,0 +1 @@
__revision__: str

View File

@ -0,0 +1,5 @@
from .rng_base import BaseRNG
class PythonOSURandomRNG(BaseRNG):
name: str
def __init__(self) -> None: ...

View File

@ -0,0 +1,7 @@
from typing import Any, Optional
from .rng_base import BaseRNG
class DevURandomRNG(BaseRNG):
name: str
def __init__(self, devname: Optional[Any] = ...) -> None: ...

View File

@ -0,0 +1,11 @@
__revision__: str
class BaseRNG:
closed: bool
def __init__(self) -> None: ...
def __del__(self): ...
def __enter__(self): ...
def __exit__(self): ...
def close(self): ...
def flush(self): ...
def read(self, N: int = ...): ...

View File

@ -0,0 +1,5 @@
from typing import Any
def new(*args: Any, **kwargs: Any): ...
def atfork() -> None: ...
def get_random_bytes(n: int) -> bytes: ...

View File

@ -0,0 +1,19 @@
from typing import Any, List, Optional, Sequence, TypeVar
_T = TypeVar("_T")
class StrongRandom:
def __init__(self, rng: Optional[Any] = ..., randfunc: Optional[Any] = ...) -> None: ...
def getrandbits(self, k: int) -> int: ...
def randrange(self, start: int, stop: int = ..., step: int = ...) -> int: ...
def randint(self, a: int, b: int) -> int: ...
def choice(self, seq: Sequence[_T]) -> _T: ...
def shuffle(self, x: Sequence[Any]): ...
def sample(self, population: Sequence[_T], k: int) -> List[_T]: ...
def getrandbits(k: int) -> int: ...
def randrange(start: int, stop: int = ..., step: int = ...) -> int: ...
def randint(a: int, b: int) -> int: ...
def choice(seq: Sequence[_T]) -> _T: ...
def shuffle(x: Sequence[Any]): ...
def sample(population: Sequence[_T], k: int) -> List[_T]: ...

View File

@ -0,0 +1,9 @@
from typing import Any, Optional
class PSS_SigScheme:
def __init__(self, key, mgfunc, saltLen) -> None: ...
def can_sign(self): ...
def sign(self, mhash): ...
def verify(self, mhash, S): ...
def new(key, mgfunc: Optional[Any] = ..., saltLen: Optional[Any] = ...): ...

View File

@ -0,0 +1,7 @@
class PKCS115_SigScheme:
def __init__(self, key) -> None: ...
def can_sign(self): ...
def sign(self, mhash): ...
def verify(self, mhash, S): ...
def new(key): ...

View File

@ -0,0 +1,3 @@
# Names in __all__ with no definition:
# PKCS1_PSS
# PKCS1_v1_5

View File

@ -0,0 +1,12 @@
from typing import Any
def new(
nbits,
prefix: Any = ...,
suffix: Any = ...,
initial_value: int = ...,
overflow: int = ...,
little_endian: bool = ...,
allow_wraparound: bool = ...,
disable_shortcut: bool = ...,
): ...

View File

@ -0,0 +1,9 @@
from typing import Any
__revision__: str
binary: Any
def key_to_english(key): ...
def english_to_key(s): ...
wordlist: Any

View File

@ -0,0 +1,6 @@
# Names in __all__ with no definition:
# RFC1751
# asn1
# number
# randpool
# strxor

View File

@ -0,0 +1,45 @@
from typing import Any, Optional
class DerObject:
typeTags: Any
typeTag: Any
payload: Any
def __init__(self, ASN1Type: Optional[Any] = ..., payload: Any = ...) -> None: ...
def isType(self, ASN1Type): ...
def encode(self): ...
def decode(self, derEle, noLeftOvers: int = ...): ...
class DerInteger(DerObject):
value: Any
def __init__(self, value: int = ...) -> None: ...
payload: Any
def encode(self): ...
def decode(self, derEle, noLeftOvers: int = ...): ...
class DerSequence(DerObject):
def __init__(self, startSeq: Optional[Any] = ...) -> None: ...
def __delitem__(self, n): ...
def __getitem__(self, n): ...
def __setitem__(self, key, value): ...
def __setslice__(self, i, j, sequence): ...
def __delslice__(self, i, j): ...
def __getslice__(self, i, j): ...
def __len__(self): ...
def append(self, item): ...
def hasInts(self): ...
def hasOnlyInts(self): ...
payload: Any
def encode(self): ...
def decode(self, derEle, noLeftOvers: int = ...): ...
class DerOctetString(DerObject):
payload: Any
def __init__(self, value: Any = ...) -> None: ...
def decode(self, derEle, noLeftOvers: int = ...): ...
class DerNull(DerObject):
def __init__(self) -> None: ...
class DerObjectId(DerObject):
def __init__(self) -> None: ...
def decode(self, derEle, noLeftOvers: int = ...): ...

View File

@ -0,0 +1,22 @@
from typing import Any, Optional
from warnings import warn as _warn
__revision__: str
bignum: Any
def size(N): ...
def getRandomNumber(N, randfunc: Optional[Any] = ...): ...
def getRandomInteger(N, randfunc: Optional[Any] = ...): ...
def getRandomRange(a, b, randfunc: Optional[Any] = ...): ...
def getRandomNBitInteger(N, randfunc: Optional[Any] = ...): ...
def GCD(x, y): ...
def inverse(u, v): ...
def getPrime(N, randfunc: Optional[Any] = ...): ...
def getStrongPrime(N, e: int = ..., false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ...
def isPrime(N, false_positive_prob: float = ..., randfunc: Optional[Any] = ...): ...
def long_to_bytes(n, blocksize: int = ...): ...
def bytes_to_long(s): ...
def long2str(n, blocksize: int = ...): ...
def str2long(s): ...
sieve_base: Any

View File

@ -0,0 +1,18 @@
from typing import Any, Optional
__revision__: str
class RandomPool:
bytes: Any
bits: Any
entropy: Any
def __init__(
self, numbytes: int = ..., cipher: Optional[Any] = ..., hash: Optional[Any] = ..., file: Optional[Any] = ...
) -> None: ...
def get_bytes(self, N): ...
def randomize(self, N: int = ...): ...
def stir(self, s: str = ...): ...
def stir_n(self, N: int = ...): ...
def add_event(self, s: str = ...): ...
def getBytes(self, N): ...
def addEvent(self, event, s: str = ...): ...

View File

@ -0,0 +1,2 @@
def strxor(*args, **kwargs): ...
def strxor_c(*args, **kwargs): ...

View File

@ -0,0 +1,7 @@
# Names in __all__ with no definition:
# Cipher
# Hash
# Protocol
# PublicKey
# Signature
# Util

View File

@ -0,0 +1,7 @@
class CryptoWarning(Warning): ...
class CryptoDeprecationWarning(DeprecationWarning, CryptoWarning): ...
class CryptoRuntimeWarning(RuntimeWarning, CryptoWarning): ...
class RandomPool_DeprecationWarning(CryptoDeprecationWarning): ...
class ClockRewindWarning(CryptoRuntimeWarning): ...
class GetRandomNumber_DeprecationWarning(CryptoDeprecationWarning): ...
class PowmInsecureWarning(CryptoRuntimeWarning): ...

View File

@ -4,9 +4,7 @@ from typing import Any
if sys.version_info >= (3,):
from base64 import encodebytes as encodebytes
else:
from base64 import encodestring
encodebytes = encodestring
from base64 import encodestring as encodebytes
expanduser: Any

View File

@ -2,9 +2,7 @@ import datetime
import uuid
from typing import IO, Any, Callable, Generic, Iterable, List, Optional, Tuple as _PyTuple, Type, TypeVar, Union
from click.core import Context, Parameter, _ConvertibleType, _ParamType
ParamType = _ParamType
from click.core import Context, Parameter, _ConvertibleType, _ParamType as ParamType
class BoolParamType(ParamType):
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> bool: ...

View File

@ -28,7 +28,7 @@ class DHParameterNumbers(object):
@property
def q(self) -> int: ...
def __init__(self, p: int, g: int, q: Optional[int]) -> None: ...
def parameters(self, backend: Optional[DHBackend] = ...) -> DHParameters: ...
def parameters(self, backend: DHBackend) -> DHParameters: ...
class DHPrivateKey(metaclass=ABCMeta):
key_size: int
@ -53,7 +53,7 @@ class DHPrivateNumbers(object):
@property
def x(self) -> int: ...
def __init__(self, x: int, public_numbers: DHPublicNumbers) -> None: ...
def private_key(self, backend: Optional[DHBackend] = ...) -> DHPrivateKey: ...
def private_key(self, backend: DHBackend) -> DHPrivateKey: ...
class DHPublicKey(metaclass=ABCMeta):
@property
@ -74,6 +74,4 @@ class DHPublicNumbers(object):
@property
def y(self) -> int: ...
def __init__(self, y: int, parameter_numbers: DHParameterNumbers) -> None: ...
def public_key(self, backend: Optional[DHBackend] = ...) -> DHPublicKey: ...
def generate_parameters(generator: int, key_size: int, backend: Optional[DHBackend] = ...) -> DHParameters: ...
def public_key(self, backend: DHBackend) -> DHPublicKey: ...

View File

@ -1,5 +1,5 @@
from abc import ABCMeta, abstractmethod
from typing import Optional, Union
from typing import Union
from cryptography.hazmat.backends.interfaces import DSABackend
from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext
@ -23,7 +23,7 @@ class DSAParameterNumbers(object):
@property
def g(self) -> int: ...
def __init__(self, p: int, q: int, g: int) -> None: ...
def parameters(self, backend: Optional[DSABackend] = ...) -> DSAParameters: ...
def parameters(self, backend: DSABackend) -> DSAParameters: ...
class DSAPrivateKey(metaclass=ABCMeta):
@property
@ -75,5 +75,5 @@ class DSAPublicNumbers(object):
def parameter_numbers(self) -> DSAParameterNumbers: ...
def __init__(self, y: int, parameter_numbers: DSAParameterNumbers) -> None: ...
def generate_parameters(key_size: int, backend: Optional[DSABackend] = ...) -> DSAParameters: ...
def generate_private_key(key_size: int, backend: Optional[DSABackend] = ...) -> DSAPrivateKey: ...
def generate_parameters(key_size: int, backend: DSABackend) -> DSAParameters: ...
def generate_private_key(key_size: int, backend: DSABackend) -> DSAPrivateKey: ...

View File

@ -1,5 +1,5 @@
from abc import ABCMeta, abstractmethod
from typing import ClassVar, Optional, Union
from typing import ClassVar, Union
from cryptography.hazmat.backends.interfaces import EllipticCurveBackend
from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext
@ -141,7 +141,7 @@ class EllipticCurvePrivateNumbers(object):
@property
def public_numbers(self) -> EllipticCurvePublicNumbers: ...
def __init__(self, private_value: int, public_numbers: EllipticCurvePublicNumbers) -> None: ...
def private_key(self, backend: Optional[EllipticCurveBackend] = ...) -> EllipticCurvePrivateKey: ...
def private_key(self, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ...
class EllipticCurvePublicKey(metaclass=ABCMeta):
@property
@ -175,7 +175,7 @@ class EllipticCurvePublicNumbers(object):
def __init__(self, x: int, y: int, curve: EllipticCurve) -> None: ...
@classmethod
def from_encoded_point(cls, curve: EllipticCurve, data: bytes) -> EllipticCurvePublicNumbers: ...
def public_key(self, backend: Optional[EllipticCurveBackend] = ...) -> EllipticCurvePublicKey: ...
def public_key(self, backend: EllipticCurveBackend) -> EllipticCurvePublicKey: ...
class EllipticCurveSignatureAlgorithm(metaclass=ABCMeta):
@property
@ -189,8 +189,6 @@ class ECDSA(EllipticCurveSignatureAlgorithm):
@property
def algorithm(self) -> Union[HashAlgorithm, Prehashed]: ...
def derive_private_key(
private_value: int, curve: EllipticCurve, backend: Optional[EllipticCurveBackend] = ...
) -> EllipticCurvePrivateKey: ...
def generate_private_key(curve: EllipticCurve, backend: Optional[EllipticCurveBackend] = ...) -> EllipticCurvePrivateKey: ...
def derive_private_key(private_value: int, curve: EllipticCurve, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ...
def generate_private_key(curve: EllipticCurve, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ...
def get_curve_for_oid(oid: ObjectIdentifier) -> EllipticCurve: ...

View File

@ -1,5 +1,5 @@
from abc import ABCMeta, abstractmethod
from typing import Optional, Tuple, Union
from typing import Tuple, Union
from cryptography.hazmat.backends.interfaces import RSABackend
from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext
@ -48,9 +48,7 @@ class RSAPublicKey(metaclass=ABCMeta):
RSAPublicKeyWithSerialization = RSAPublicKey
def generate_private_key(
public_exponent: int, key_size: int, backend: Optional[RSABackend] = ...
) -> RSAPrivateKeyWithSerialization: ...
def generate_private_key(public_exponent: int, key_size: int, backend: RSABackend) -> RSAPrivateKeyWithSerialization: ...
def rsa_crt_iqmp(p: int, q: int) -> int: ...
def rsa_crt_dmp1(private_exponent: int, p: int) -> int: ...
def rsa_crt_dmq1(private_exponent: int, q: int) -> int: ...
@ -72,7 +70,7 @@ class RSAPrivateNumbers(object):
def iqmp(self) -> int: ...
@property
def public_numbers(self) -> RSAPublicNumbers: ...
def private_key(self, backend: Optional[RSABackend] = ...) -> RSAPrivateKey: ...
def private_key(self, backend) -> RSAPrivateKey: ...
class RSAPublicNumbers(object):
def __init__(self, e: int, n: int) -> None: ...
@ -80,4 +78,4 @@ class RSAPublicNumbers(object):
def e(self) -> int: ...
@property
def n(self) -> int: ...
def public_key(self, backend: Optional[RSABackend] = ...) -> RSAPublicKey: ...
def public_key(self, backend) -> RSAPublicKey: ...

View File

@ -23,7 +23,7 @@ class BlockCipherAlgorithm(metaclass=ABCMeta):
def block_size(self) -> int: ...
class Cipher(object):
def __init__(self, algorithm: CipherAlgorithm, mode: Optional[Mode], backend: Optional[CipherBackend] = ...) -> None: ...
def __init__(self, algorithm: CipherAlgorithm, mode: Optional[Mode], backend: CipherBackend) -> None: ...
def decryptor(self) -> CipherContext: ...
def encryptor(self) -> CipherContext: ...

View File

@ -1,10 +1,8 @@
from typing import Optional
from cryptography.hazmat.backends.interfaces import CMACBackend
from cryptography.hazmat.primitives.ciphers import BlockCipherAlgorithm
class CMAC(object):
def __init__(self, algorithm: BlockCipherAlgorithm, backend: Optional[CMACBackend] = ...) -> None: ...
def __init__(self, algorithm: BlockCipherAlgorithm, backend: CMACBackend) -> None: ...
def copy(self) -> CMAC: ...
def finalize(self) -> bytes: ...
def update(self, data: bytes) -> None: ...

View File

@ -1,5 +1,4 @@
from abc import ABCMeta, abstractmethod
from typing import Optional
from cryptography.hazmat.backends.interfaces import HashBackend
@ -38,7 +37,7 @@ class SHAKE256(HashAlgorithm):
def __init__(self, digest_size: int) -> None: ...
class Hash(HashContext):
def __init__(self, algorithm: HashAlgorithm, backend: Optional[HashBackend] = ...): ...
def __init__(self, algorithm: HashAlgorithm, backend: HashBackend): ...
def copy(self) -> Hash: ...
def finalize(self) -> bytes: ...
def update(self, data: bytes) -> None: ...

View File

@ -1,10 +1,8 @@
from typing import Optional
from cryptography.hazmat.backends.interfaces import HMACBackend
from cryptography.hazmat.primitives.hashes import HashAlgorithm
class HMAC(object):
def __init__(self, key: bytes, algorithm: HashAlgorithm, backend: Optional[HMACBackend] = ...) -> None: ...
def __init__(self, key: bytes, algorithm: HashAlgorithm, backend: HMACBackend) -> None: ...
def copy(self) -> HMAC: ...
def finalize(self) -> bytes: ...
def update(self, msg: bytes) -> None: ...

View File

@ -5,20 +5,13 @@ from cryptography.hazmat.primitives.hashes import HashAlgorithm
from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
class ConcatKDFHash(KeyDerivationFunction):
def __init__(
self, algorithm: HashAlgorithm, length: int, otherinfo: Optional[bytes], backend: Optional[HashBackend] = ...
): ...
def __init__(self, algorithm: HashAlgorithm, length: int, otherinfo: Optional[bytes], backend: HashBackend): ...
def derive(self, key_material: bytes) -> bytes: ...
def verify(self, key_material: bytes, expected_key: bytes) -> None: ...
class ConcatKDFHMAC(KeyDerivationFunction):
def __init__(
self,
algorithm: HashAlgorithm,
length: int,
salt: Optional[bytes],
otherinfo: Optional[bytes],
backend: Optional[HMACBackend] = ...,
self, algorithm: HashAlgorithm, length: int, salt: Optional[bytes], otherinfo: Optional[bytes], backend: HMACBackend
): ...
def derive(self, key_material: bytes) -> bytes: ...
def verify(self, key_material: bytes, expected_key: bytes) -> None: ...

View File

@ -6,17 +6,12 @@ from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
class HKDF(KeyDerivationFunction):
def __init__(
self,
algorithm: HashAlgorithm,
length: int,
salt: Optional[bytes],
info: Optional[bytes],
backend: Optional[HMACBackend] = ...,
self, algorithm: HashAlgorithm, length: int, salt: Optional[bytes], info: Optional[bytes], backend: HMACBackend
): ...
def derive(self, key_material: bytes) -> bytes: ...
def verify(self, key_material: bytes, expected_key: bytes) -> None: ...
class HKDFExpand(KeyDerivationFunction):
def __init__(self, algorithm: HashAlgorithm, length: int, info: Optional[bytes], backend: Optional[HMACBackend] = ...): ...
def __init__(self, algorithm: HashAlgorithm, length: int, info: Optional[bytes], backend: HMACBackend): ...
def derive(self, key_material: bytes) -> bytes: ...
def verify(self, key_material: bytes, expected_key: bytes) -> None: ...

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