mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-10 23:45:54 +03:00
Updated typeshed to latest. Added commit.txt file to track the exact commit hash that was used.
This commit is contained in:
parent
18bee09129
commit
0b40310426
117
package-lock.json
generated
117
package-lock.json
generated
@ -42,6 +42,24 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@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",
|
||||
@ -1285,12 +1303,6 @@
|
||||
"@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",
|
||||
@ -1442,15 +1454,15 @@
|
||||
"dev": true
|
||||
},
|
||||
"acorn": {
|
||||
"version": "7.4.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz",
|
||||
"integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==",
|
||||
"version": "7.4.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
|
||||
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
|
||||
"dev": true
|
||||
},
|
||||
"acorn-jsx": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz",
|
||||
"integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==",
|
||||
"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==",
|
||||
"dev": true
|
||||
},
|
||||
"agent-base": {
|
||||
@ -1936,12 +1948,11 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
|
||||
"integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/color-name": "^1.1.1",
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
@ -2146,9 +2157,9 @@
|
||||
}
|
||||
},
|
||||
"commander": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-6.0.0.tgz",
|
||||
"integrity": "sha512-s7EA+hDtTYNhuXkTlhqew4txMZVdszBmKWSPEMxGr8ru8JXR7bLUFIAtPhcSuFdJQ0ILMxnJi8GkQL0yvDy/YA==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz",
|
||||
"integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==",
|
||||
"dev": true
|
||||
},
|
||||
"compare-func": {
|
||||
@ -2888,22 +2899,23 @@
|
||||
"dev": true
|
||||
},
|
||||
"eslint": {
|
||||
"version": "7.7.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz",
|
||||
"integrity": "sha512-1KUxLzos0ZVsyL81PnRN335nDtQ8/vZUD6uMtWbF+5zDtjKcsklIi78XoE0MVL93QvWTu+E5y44VyyCsOMBrIg==",
|
||||
"version": "7.11.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.11.0.tgz",
|
||||
"integrity": "sha512-G9+qtYVCHaDi1ZuWzBsOWo2wSwd70TXnU6UHA3cTYHp7gCTXZcpggWFoUVAMRarg68qtPoNfFbzPh+VdOgmwmw==",
|
||||
"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.0",
|
||||
"eslint-scope": "^5.1.1",
|
||||
"eslint-utils": "^2.1.0",
|
||||
"eslint-visitor-keys": "^1.3.0",
|
||||
"espree": "^7.2.0",
|
||||
"eslint-visitor-keys": "^2.0.0",
|
||||
"espree": "^7.3.0",
|
||||
"esquery": "^1.2.0",
|
||||
"esutils": "^2.0.2",
|
||||
"file-entry-cache": "^5.0.1",
|
||||
@ -2929,12 +2941,47 @@
|
||||
"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.11.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz",
|
||||
"integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==",
|
||||
"version": "6.12.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.12.0.tgz",
|
||||
"integrity": "sha512-9jWPlFlgNwRUYVoujvWTQ1aMO8o6648r+K7qU7K5Jmkbyqav1fuEZC0COYpGBxyiAJb65Ra9hrmFx19xRGwXWw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"get-stdin": "^6.0.0"
|
||||
@ -7076,13 +7123,13 @@
|
||||
}
|
||||
},
|
||||
"syncpack": {
|
||||
"version": "5.5.6",
|
||||
"resolved": "https://registry.npmjs.org/syncpack/-/syncpack-5.5.6.tgz",
|
||||
"integrity": "sha512-rTUbzX6iuKz7saOsj8dDMxgApaZ8Y4S6nudW59ikAALIGa1RNMKaVAIi9P5HMjx94y686UkXp6CmsuxNjNXG8Q==",
|
||||
"version": "5.6.10",
|
||||
"resolved": "https://registry.npmjs.org/syncpack/-/syncpack-5.6.10.tgz",
|
||||
"integrity": "sha512-7YjOACc9syvQVZfNSIhgZoZ2foqzQJ/r8tUPDKdfRgnBYNkDbbcjzYz1XH35oOm2vAllNhZYK2R8N5sAITMbqA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"chalk": "4.1.0",
|
||||
"commander": "6.0.0",
|
||||
"commander": "6.1.0",
|
||||
"cosmiconfig": "7.0.0",
|
||||
"expect-more": "0.8.0",
|
||||
"fs-extra": "9.0.1",
|
||||
@ -7387,9 +7434,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz",
|
||||
"integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==",
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.3.tgz",
|
||||
"integrity": "sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==",
|
||||
"dev": true
|
||||
},
|
||||
"uglify-js": {
|
||||
|
@ -21,12 +21,12 @@
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^3.10.1",
|
||||
"@typescript-eslint/parser": "^3.10.1",
|
||||
"eslint": "^7.7.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint": "^7.11.0",
|
||||
"eslint-config-prettier": "^6.12.0",
|
||||
"eslint-plugin-simple-import-sort": "^5.0.3",
|
||||
"lerna": "^3.22.1",
|
||||
"prettier": "2.1.1",
|
||||
"syncpack": "^5.5.6",
|
||||
"typescript": "^4.0.2"
|
||||
"syncpack": "^5.6.10",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
}
|
||||
|
995
packages/pyright-internal/package-lock.json
generated
995
packages/pyright-internal/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -30,14 +30,14 @@
|
||||
"devDependencies": {
|
||||
"@types/command-line-args": "^5.0.0",
|
||||
"@types/fs-extra": "^9.0.1",
|
||||
"@types/jest": "^26.0.0",
|
||||
"@types/node": "~12.12.54",
|
||||
"@types/jest": "^26.0.14",
|
||||
"@types/node": "^12.12.67",
|
||||
"@types/tmp": "^0.2.0",
|
||||
"fs-extra": "^9.0.1",
|
||||
"jest": "^26.0.1",
|
||||
"jest": "^26.5.2",
|
||||
"jest-junit": "^11.0.0",
|
||||
"shx": "^0.3.2",
|
||||
"ts-jest": "^26.1.0",
|
||||
"typescript": "^4.0.2"
|
||||
"ts-jest": "^26.4.1",
|
||||
"typescript": "^4.0.3"
|
||||
}
|
||||
}
|
||||
|
1
packages/pyright-internal/typeshed-fallback/commit.txt
Normal file
1
packages/pyright-internal/typeshed-fallback/commit.txt
Normal file
@ -0,0 +1 @@
|
||||
228f74d76a5df1b09fe0316d3eedd40cff285ec9
|
@ -155,7 +155,11 @@ class Event:
|
||||
def wait(self, timeout: Optional[float] = ...) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from _thread import ExceptHookArgs as _ExceptHookArgs, _ExceptHookArgs as ExceptHookArgs # don't ask
|
||||
import _thread
|
||||
|
||||
# don't ask...
|
||||
_ExceptHookArgs = _thread.ExceptHookArgs
|
||||
ExceptHookArgs = _thread._ExceptHookArgs
|
||||
|
||||
excepthook: Callable[[_ExceptHookArgs], Any]
|
||||
|
||||
|
@ -56,6 +56,7 @@ from typing import (
|
||||
Union,
|
||||
ValuesView,
|
||||
overload,
|
||||
runtime_checkable,
|
||||
)
|
||||
from typing_extensions import Literal
|
||||
|
||||
@ -82,7 +83,7 @@ _T3 = TypeVar("_T3")
|
||||
_T4 = TypeVar("_T4")
|
||||
_T5 = TypeVar("_T5")
|
||||
_TT = TypeVar("_TT", bound="type")
|
||||
_LT = TypeVar("_LT", bound=_SupportsLessThan)
|
||||
_SupportsLessThanT = TypeVar("_SupportsLessThanT", bound=_SupportsLessThan)
|
||||
_TBE = TypeVar("_TBE", bound="BaseException")
|
||||
|
||||
class object:
|
||||
@ -181,9 +182,9 @@ class super(object):
|
||||
|
||||
class int:
|
||||
@overload
|
||||
def __init__(self, x: Union[Text, bytes, SupportsInt, _SupportsIndex] = ...) -> None: ...
|
||||
def __new__(cls: Type[_T], x: Union[Text, bytes, SupportsInt, _SupportsIndex] = ...) -> _T: ...
|
||||
@overload
|
||||
def __init__(self, x: Union[Text, bytes, bytearray], base: int) -> None: ...
|
||||
def __new__(cls: Type[_T], x: Union[Text, bytes, bytearray], base: int) -> _T: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def as_integer_ratio(self) -> Tuple[int, Literal[1]]: ...
|
||||
@property
|
||||
@ -262,7 +263,7 @@ class int:
|
||||
def __index__(self) -> int: ...
|
||||
|
||||
class float:
|
||||
def __init__(self, x: Union[SupportsFloat, _SupportsIndex, Text, bytes, bytearray] = ...) -> None: ...
|
||||
def __new__(cls: Type[_T], x: Union[SupportsFloat, _SupportsIndex, Text, bytes, bytearray] = ...) -> _T: ...
|
||||
def as_integer_ratio(self) -> Tuple[int, int]: ...
|
||||
def hex(self) -> str: ...
|
||||
def is_integer(self) -> bool: ...
|
||||
@ -325,9 +326,9 @@ class float:
|
||||
|
||||
class complex:
|
||||
@overload
|
||||
def __init__(self, real: float = ..., imag: float = ...) -> None: ...
|
||||
def __new__(cls: Type[_T], real: float = ..., imag: float = ...) -> _T: ...
|
||||
@overload
|
||||
def __init__(self, real: Union[str, SupportsComplex, _SupportsIndex]) -> None: ...
|
||||
def __new__(cls: Type[_T], real: Union[str, SupportsComplex, _SupportsIndex]) -> _T: ...
|
||||
@property
|
||||
def real(self) -> float: ...
|
||||
@property
|
||||
@ -446,9 +447,9 @@ class _FormatMapMapping(Protocol):
|
||||
class str(Sequence[str], _str_base):
|
||||
if sys.version_info >= (3,):
|
||||
@overload
|
||||
def __init__(self, o: object = ...) -> None: ...
|
||||
def __new__(cls: Type[_T], o: object = ...) -> _T: ...
|
||||
@overload
|
||||
def __init__(self, o: bytes, encoding: str = ..., errors: str = ...) -> None: ...
|
||||
def __new__(cls: Type[_T], o: bytes, encoding: str = ..., errors: str = ...) -> _T: ...
|
||||
else:
|
||||
def __init__(self, o: object = ...) -> None: ...
|
||||
def capitalize(self) -> str: ...
|
||||
@ -596,15 +597,15 @@ class str(Sequence[str], _str_base):
|
||||
if sys.version_info >= (3,):
|
||||
class bytes(ByteString):
|
||||
@overload
|
||||
def __init__(self, ints: Iterable[int]) -> None: ...
|
||||
def __new__(cls: Type[_T], ints: Iterable[int]) -> _T: ...
|
||||
@overload
|
||||
def __init__(self, string: str, encoding: str, errors: str = ...) -> None: ...
|
||||
def __new__(cls: Type[_T], string: str, encoding: str, errors: str = ...) -> _T: ...
|
||||
@overload
|
||||
def __init__(self, length: int) -> None: ...
|
||||
def __new__(cls: Type[_T], length: int) -> _T: ...
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
def __new__(cls: Type[_T]) -> _T: ...
|
||||
@overload
|
||||
def __init__(self, o: SupportsBytes) -> None: ...
|
||||
def __new__(cls: Type[_T], o: SupportsBytes) -> _T: ...
|
||||
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: ...
|
||||
@ -870,7 +871,7 @@ class memoryview(Sized, Container[_mv_container_type]):
|
||||
def hex(self) -> str: ...
|
||||
|
||||
class bool(int):
|
||||
def __init__(self, o: object = ...) -> None: ...
|
||||
def __new__(cls: Type[_T], __o: object = ...) -> _T: ...
|
||||
@overload
|
||||
def __and__(self, x: bool) -> bool: ...
|
||||
@overload
|
||||
@ -962,7 +963,7 @@ class list(MutableSequence[_T], Generic[_T]):
|
||||
def reverse(self) -> None: ...
|
||||
if sys.version_info >= (3,):
|
||||
@overload
|
||||
def sort(self: List[_LT], *, key: None = ..., reverse: bool = ...) -> None: ...
|
||||
def sort(self: List[_SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> None: ...
|
||||
@overload
|
||||
def sort(self, *, key: Callable[[_T], _SupportsLessThan], reverse: bool = ...) -> None: ...
|
||||
else:
|
||||
@ -1211,7 +1212,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: ...
|
||||
|
||||
@ -1440,17 +1441,19 @@ else:
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
@overload
|
||||
def max(__arg1: _LT, __arg2: _LT, *_args: _LT, key: None = ...) -> _LT: ...
|
||||
def max(
|
||||
__arg1: _SupportsLessThanT, __arg2: _SupportsLessThanT, *_args: _SupportsLessThanT, key: None = ...
|
||||
) -> _SupportsLessThanT: ...
|
||||
@overload
|
||||
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _LT]) -> _T: ...
|
||||
def max(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
|
||||
@overload
|
||||
def max(__iterable: Iterable[_LT], *, key: None = ...) -> _LT: ...
|
||||
def max(__iterable: Iterable[_SupportsLessThanT], *, key: None = ...) -> _SupportsLessThanT: ...
|
||||
@overload
|
||||
def max(__iterable: Iterable[_T], *, key: Callable[[_T], _LT]) -> _T: ...
|
||||
def max(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
|
||||
@overload
|
||||
def max(__iterable: Iterable[_LT], *, key: None = ..., default: _T) -> Union[_LT, _T]: ...
|
||||
def max(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., default: _T) -> Union[_SupportsLessThanT, _T]: ...
|
||||
@overload
|
||||
def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], _LT], default: _T2) -> Union[_T1, _T2]: ...
|
||||
def max(__iterable: Iterable[_T1], *, key: Callable[[_T1], _SupportsLessThanT], default: _T2) -> Union[_T1, _T2]: ...
|
||||
|
||||
else:
|
||||
@overload
|
||||
@ -1460,17 +1463,19 @@ else:
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
@overload
|
||||
def min(__arg1: _LT, __arg2: _LT, *_args: _LT, key: None = ...) -> _LT: ...
|
||||
def min(
|
||||
__arg1: _SupportsLessThanT, __arg2: _SupportsLessThanT, *_args: _SupportsLessThanT, key: None = ...
|
||||
) -> _SupportsLessThanT: ...
|
||||
@overload
|
||||
def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _LT]) -> _T: ...
|
||||
def min(__arg1: _T, __arg2: _T, *_args: _T, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
|
||||
@overload
|
||||
def min(__iterable: Iterable[_LT], *, key: None = ...) -> _LT: ...
|
||||
def min(__iterable: Iterable[_SupportsLessThanT], *, key: None = ...) -> _SupportsLessThanT: ...
|
||||
@overload
|
||||
def min(__iterable: Iterable[_T], *, key: Callable[[_T], _LT]) -> _T: ...
|
||||
def min(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThanT]) -> _T: ...
|
||||
@overload
|
||||
def min(__iterable: Iterable[_LT], *, key: None = ..., default: _T) -> Union[_LT, _T]: ...
|
||||
def min(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., default: _T) -> Union[_SupportsLessThanT, _T]: ...
|
||||
@overload
|
||||
def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], _LT], default: _T2) -> Union[_T1, _T2]: ...
|
||||
def min(__iterable: Iterable[_T1], *, key: Callable[[_T1], _SupportsLessThanT], default: _T2) -> Union[_T1, _T2]: ...
|
||||
|
||||
else:
|
||||
@overload
|
||||
@ -1671,7 +1676,7 @@ def setattr(__obj: Any, __name: Text, __value: Any) -> None: ...
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
@overload
|
||||
def sorted(__iterable: Iterable[_LT], *, key: None = ..., reverse: bool = ...) -> List[_LT]: ...
|
||||
def sorted(__iterable: Iterable[_SupportsLessThanT], *, key: None = ..., reverse: bool = ...) -> List[_SupportsLessThanT]: ...
|
||||
@overload
|
||||
def sorted(__iterable: Iterable[_T], *, key: Callable[[_T], _SupportsLessThan], reverse: bool = ...) -> List[_T]: ...
|
||||
|
||||
|
@ -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 = ...) -> Dict[str, List[str]]: ...
|
||||
def parse_qsl(qs: str, keep_blank_values: bool = ..., strict_parsing: bool = ...) -> List[Tuple[str, str]]: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def parse_multipart(
|
||||
|
@ -1,27 +1,14 @@
|
||||
# ContextManager aliased here for backwards compatibility; TODO eventually remove this
|
||||
import sys
|
||||
from types import TracebackType
|
||||
from typing import (
|
||||
IO,
|
||||
Any,
|
||||
Callable,
|
||||
ContextManager as ContextManager,
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
Optional,
|
||||
Type,
|
||||
TypeVar,
|
||||
overload,
|
||||
)
|
||||
from typing import IO, Any, Callable, 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):
|
||||
from typing import ContextManager as AbstractContextManager
|
||||
AbstractContextManager = ContextManager
|
||||
if sys.version_info >= (3, 7):
|
||||
from typing import AsyncContextManager as AbstractAsyncContextManager
|
||||
AbstractAsyncContextManager = AsyncContextManager
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_T_io = TypeVar("_T_io", bound=Optional[IO[str]])
|
||||
|
@ -1,4 +1,4 @@
|
||||
from typing import Any, Callable, Iterable, Text
|
||||
from typing import Any, Text
|
||||
|
||||
DEBUG: int
|
||||
INFO: int
|
||||
@ -15,14 +15,11 @@ class Log:
|
||||
def error(self, msg: Text, *args: Any) -> None: ...
|
||||
def fatal(self, 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 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: ...
|
||||
def set_threshold(level: int) -> int: ...
|
||||
def set_verbosity(v: int) -> None: ...
|
||||
|
@ -4,6 +4,7 @@ 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]
|
||||
@ -150,3 +151,15 @@ 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
|
||||
|
@ -93,6 +93,8 @@ 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: ...
|
||||
|
||||
|
@ -3,8 +3,8 @@ import ssl
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from logging import FileHandler, Handler, LogRecord
|
||||
from socket import SocketType
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
from socket import SocketKind, SocketType
|
||||
from typing import Any, Callable, ClassVar, Dict, List, Optional, Tuple, Union
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
from queue import Queue, SimpleQueue
|
||||
@ -13,9 +13,6 @@ 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
|
||||
@ -158,8 +155,16 @@ 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: ...
|
||||
|
@ -55,7 +55,10 @@ def frexp(__x: SupportsFloat) -> Tuple[float, int]: ...
|
||||
def fsum(__seq: Iterable[float]) -> float: ...
|
||||
def gamma(__x: SupportsFloat) -> float: ...
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
if sys.version_info >= (3, 9):
|
||||
def gcd(*integers: int) -> int: ...
|
||||
|
||||
elif sys.version_info >= (3, 5):
|
||||
def gcd(__x: int, __y: int) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@ -77,6 +80,9 @@ 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: ...
|
||||
@ -87,6 +93,10 @@ 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):
|
||||
@ -106,3 +116,6 @@ 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: ...
|
||||
|
@ -1,7 +1,6 @@
|
||||
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
|
||||
|
||||
@ -9,6 +8,7 @@ _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
|
||||
|
@ -93,7 +93,7 @@ AI_NUMERICSERV: AddressInfo
|
||||
AI_PASSIVE: AddressInfo
|
||||
AI_V4MAPPED: AddressInfo
|
||||
AI_V4MAPPED_CFG: AddressInfo
|
||||
EAIEAI_ADDRFAMILY: int
|
||||
EAI_ADDRFAMILY: int
|
||||
EAI_AGAIN: int
|
||||
EAI_BADFLAGS: int
|
||||
EAI_BADHINTS: int
|
||||
|
@ -155,7 +155,11 @@ class Event:
|
||||
def wait(self, timeout: Optional[float] = ...) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from _thread import ExceptHookArgs as _ExceptHookArgs, _ExceptHookArgs as ExceptHookArgs # don't ask
|
||||
import _thread
|
||||
|
||||
# don't ask...
|
||||
_ExceptHookArgs = _thread.ExceptHookArgs
|
||||
ExceptHookArgs = _thread._ExceptHookArgs
|
||||
|
||||
excepthook: Callable[[_ExceptHookArgs], Any]
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from tracemalloc import _FrameTupleT, _TraceTupleT
|
||||
from typing import Optional, Sequence, Tuple
|
||||
|
||||
@ -8,5 +9,9 @@ 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: ...
|
||||
|
@ -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 = ...) -> str: ...
|
||||
def get_docstring(node: AST, clean: bool = ...) -> Optional[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]]: ...
|
||||
|
@ -1,8 +1,9 @@
|
||||
import sys
|
||||
from types import TracebackType
|
||||
from typing import Any, Awaitable, Callable, Generator, Optional, Type, TypeVar, Union
|
||||
from typing import Any, Awaitable, Callable, Deque, Generator, Optional, Type, TypeVar, Union
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
from .futures import Future
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@ -55,10 +56,13 @@ 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: ...
|
||||
|
@ -1,7 +1,7 @@
|
||||
import sys
|
||||
import typing
|
||||
from typing import (
|
||||
AbstractSet as Set,
|
||||
AbstractSet,
|
||||
Any,
|
||||
AsyncIterable as AsyncIterable,
|
||||
AsyncIterator as AsyncIterator,
|
||||
@ -36,6 +36,8 @@ from typing import (
|
||||
overload,
|
||||
)
|
||||
|
||||
Set = AbstractSet
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from typing import AsyncGenerator as AsyncGenerator, Collection as Collection
|
||||
|
||||
|
@ -1,8 +1,9 @@
|
||||
import sys
|
||||
import threading
|
||||
from abc import abstractmethod
|
||||
from logging import Logger
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, Generic, Iterable, Iterator, List, Optional, Set, Tuple, TypeVar
|
||||
from typing import Any, Callable, Container, Generic, Iterable, Iterator, List, Optional, Protocol, Set, Tuple, TypeVar
|
||||
|
||||
FIRST_COMPLETED: str
|
||||
FIRST_EXCEPTION: str
|
||||
@ -26,6 +27,15 @@ 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: ...
|
||||
@ -65,7 +75,7 @@ class Executor:
|
||||
|
||||
def as_completed(fs: Iterable[Future[_T]], timeout: Optional[float] = ...) -> Iterator[Future[_T]]: ...
|
||||
def wait(
|
||||
fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...
|
||||
fs: _Collection[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...
|
||||
) -> Tuple[Set[Future[_T]], Set[Future[_T]]]: ...
|
||||
|
||||
class _Waiter:
|
||||
|
@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from _typeshed import FileDescriptorLike
|
||||
from array import array
|
||||
from typing import Any, Union, overload
|
||||
@ -33,6 +34,10 @@ 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
|
||||
|
@ -51,9 +51,7 @@ else:
|
||||
WRAPPER_ASSIGNMENTS: Sequence[str]
|
||||
WRAPPER_UPDATES: Sequence[str]
|
||||
|
||||
def update_wrapper(
|
||||
wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...
|
||||
) -> _AnyCallable: ...
|
||||
def update_wrapper(wrapper: _T, wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> _T: ...
|
||||
def wraps(
|
||||
wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...
|
||||
) -> Callable[[_AnyCallable], _AnyCallable]: ...
|
||||
|
@ -33,6 +33,10 @@ 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: ...
|
||||
|
@ -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: List[str]) -> None: ... # type: ignore
|
||||
def writelines(self, __lines: Iterable[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: List[str]) -> None: ... # type: ignore
|
||||
def writelines(self, __lines: Iterable[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: ...
|
||||
|
@ -8,7 +8,7 @@ from _typeshed import (
|
||||
OpenBinaryModeWriting,
|
||||
OpenTextMode,
|
||||
)
|
||||
from builtins import OSError as error
|
||||
from builtins import OSError
|
||||
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper as _TextIOWrapper
|
||||
from posix import listdir as listdir, times_result
|
||||
from typing import (
|
||||
@ -25,7 +25,6 @@ from typing import (
|
||||
List,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
NamedTuple,
|
||||
NoReturn,
|
||||
Optional,
|
||||
Sequence,
|
||||
@ -46,6 +45,8 @@ _T = TypeVar("_T")
|
||||
|
||||
# ----- os variables -----
|
||||
|
||||
error = OSError
|
||||
|
||||
supports_bytes_environ: bool
|
||||
|
||||
supports_dir_fd: Set[Callable[..., Any]]
|
||||
@ -268,7 +269,9 @@ class stat_result:
|
||||
st_type: int
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
from builtins import _PathLike as PathLike # See comment in builtins
|
||||
from builtins import _PathLike
|
||||
|
||||
PathLike = _PathLike # See comment in builtins
|
||||
|
||||
_FdOrAnyPath = Union[int, AnyPath]
|
||||
|
||||
@ -300,9 +303,16 @@ 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(NamedTuple): # Unix only
|
||||
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
|
||||
|
||||
f_bsize: int
|
||||
f_frsize: int
|
||||
f_blocks: int
|
||||
@ -313,9 +323,13 @@ if sys.platform != "win32":
|
||||
f_favail: int
|
||||
f_flag: int
|
||||
f_namemax: int
|
||||
f_fsid: int
|
||||
f_fsid: int = ...
|
||||
else:
|
||||
class statvfs_result(NamedTuple): # Unix only
|
||||
class statvfs_result(_Tuple10Int): # Unix only
|
||||
n_fields: int
|
||||
n_sequence_fields: int
|
||||
n_unnamed_fields: int
|
||||
|
||||
f_bsize: int
|
||||
f_frsize: int
|
||||
f_blocks: int
|
||||
|
@ -3,7 +3,9 @@
|
||||
import sys
|
||||
|
||||
if sys.version_info < (3, 9):
|
||||
from os import devnull as DEV_NULL
|
||||
import os
|
||||
|
||||
DEV_NULL = os.devnull
|
||||
from typing import NamedTuple, Optional, Tuple
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
|
@ -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: Union[int, None] = ..., step: int = ...) -> int: ...
|
||||
def randrange(self, start: int, stop: Optional[int] = ..., 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: Union[Callable[[], float], None] = ...) -> None: ...
|
||||
def shuffle(self, x: MutableSequence[Any], random: Optional[Callable[[], float]] = ...) -> 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: Union[Callable[[], float], None] = ...) -> None: ...
|
||||
def shuffle(x: MutableSequence[Any], random: Optional[Callable[[], float]] = ...) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def sample(population: Union[Sequence[_T], AbstractSet[_T]], k: int, *, counts: Optional[Iterable[_T]] = ...) -> List[_T]: ...
|
||||
|
@ -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
|
||||
from typing import Any, Dict, FrozenSet, Iterable, List, Match, Optional, Pattern as _Pattern, Tuple, Union, overload
|
||||
|
||||
SPECIAL_CHARS: str
|
||||
REPEAT_CHARS: str
|
||||
@ -85,13 +85,20 @@ class Tokenizer:
|
||||
|
||||
def fix_flags(src: Union[str, bytes], flags: int) -> int: ...
|
||||
|
||||
_TemplateType = Tuple[List[Tuple[int, int]], List[str]]
|
||||
_TemplateType = Tuple[List[Tuple[int, int]], List[Optional[str]]]
|
||||
_TemplateByteType = Tuple[List[Tuple[int, int]], List[Optional[bytes]]]
|
||||
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: ...
|
||||
|
@ -281,7 +281,7 @@ class FrameType:
|
||||
f_lasti: int
|
||||
f_lineno: int
|
||||
f_locals: Dict[str, Any]
|
||||
f_trace: Callable[[], None]
|
||||
f_trace: Optional[Callable[[FrameType, str, Any], Any]]
|
||||
if sys.version_info >= (3, 7):
|
||||
f_trace_lines: bool
|
||||
f_trace_opcodes: bool
|
||||
|
@ -4,6 +4,7 @@ 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",
|
||||
@ -193,7 +194,7 @@ class _patch(Generic[_T]):
|
||||
kwargs: Mapping[str, Any],
|
||||
) -> None: ...
|
||||
def copy(self) -> _patch[_T]: ...
|
||||
def __call__(self, func: _F) -> _F: ...
|
||||
def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ...
|
||||
def decorate_class(self, klass: _TT) -> _TT: ...
|
||||
def decorate_callable(self, func: _F) -> _F: ...
|
||||
def get_original(self) -> Tuple[Any, bool]: ...
|
||||
|
@ -4,7 +4,24 @@ 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, Sequence, Tuple, TypeVar, Union, overload
|
||||
from typing import (
|
||||
IO,
|
||||
Any,
|
||||
Callable,
|
||||
ClassVar,
|
||||
Dict,
|
||||
List,
|
||||
Mapping,
|
||||
NoReturn,
|
||||
Optional,
|
||||
Pattern,
|
||||
Sequence,
|
||||
Tuple,
|
||||
TypeVar,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
from urllib.error import HTTPError
|
||||
from urllib.response import addinfourl
|
||||
|
||||
_T = TypeVar("_T")
|
||||
@ -65,12 +82,14 @@ 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]
|
||||
@ -79,9 +98,15 @@ 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): ...
|
||||
class HTTPDefaultErrorHandler(BaseHandler):
|
||||
def http_error_default(
|
||||
self, req: Request, fp: IO[bytes], code: int, msg: str, hdrs: Mapping[str, str]
|
||||
) -> HTTPError: ... # undocumented
|
||||
|
||||
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]: ...
|
||||
@ -101,14 +126,21 @@ 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: ...
|
||||
@ -122,15 +154,23 @@ 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]: ...
|
||||
@ -146,11 +186,13 @@ 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]: ...
|
||||
@ -173,17 +215,33 @@ 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: ...
|
||||
@ -222,6 +280,73 @@ 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
|
||||
|
@ -1,20 +0,0 @@
|
||||
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
|
@ -1,20 +0,0 @@
|
||||
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
|
@ -1,15 +0,0 @@
|
||||
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
|
@ -1,20 +0,0 @@
|
||||
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
|
@ -1,20 +0,0 @@
|
||||
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
|
@ -1,20 +0,0 @@
|
||||
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
|
@ -1,20 +0,0 @@
|
||||
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
|
@ -1,12 +0,0 @@
|
||||
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: ...
|
@ -1,13 +0,0 @@
|
||||
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: ...
|
@ -1,15 +0,0 @@
|
||||
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
|
@ -1,11 +0,0 @@
|
||||
# Names in __all__ with no definition:
|
||||
# AES
|
||||
# ARC2
|
||||
# ARC4
|
||||
# Blowfish
|
||||
# CAST
|
||||
# DES
|
||||
# DES3
|
||||
# PKCS1_OAEP
|
||||
# PKCS1_v1_5
|
||||
# XOR
|
@ -1,17 +0,0 @@
|
||||
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: ...
|
@ -1,16 +0,0 @@
|
||||
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] = ...): ...
|
@ -1,14 +0,0 @@
|
||||
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
|
@ -1,14 +0,0 @@
|
||||
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
|
@ -1,14 +0,0 @@
|
||||
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
|
@ -1,14 +0,0 @@
|
||||
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
|
@ -1,14 +0,0 @@
|
||||
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
|
@ -1,14 +0,0 @@
|
||||
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
|
@ -1,14 +0,0 @@
|
||||
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
|
@ -1,14 +0,0 @@
|
||||
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
|
@ -1,14 +0,0 @@
|
||||
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
|
@ -1,11 +0,0 @@
|
||||
# Names in __all__ with no definition:
|
||||
# HMAC
|
||||
# MD2
|
||||
# MD4
|
||||
# MD5
|
||||
# RIPEMD
|
||||
# SHA
|
||||
# SHA224
|
||||
# SHA256
|
||||
# SHA384
|
||||
# SHA512
|
@ -1,11 +0,0 @@
|
||||
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] = ...): ...
|
@ -1,10 +0,0 @@
|
||||
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): ...
|
@ -1,5 +0,0 @@
|
||||
__revision__: str
|
||||
|
||||
class Chaff:
|
||||
def __init__(self, factor: float = ..., blocksper: int = ...) -> None: ...
|
||||
def chaff(self, blocks): ...
|
@ -1,8 +0,0 @@
|
||||
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] = ...): ...
|
@ -1,4 +0,0 @@
|
||||
# Names in __all__ with no definition:
|
||||
# AllOrNothing
|
||||
# Chaffing
|
||||
# KDF
|
@ -1,28 +0,0 @@
|
||||
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
|
@ -1,19 +0,0 @@
|
||||
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): ...
|
@ -1,33 +0,0 @@
|
||||
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
|
@ -1,4 +0,0 @@
|
||||
# Names in __all__ with no definition:
|
||||
# DSA
|
||||
# ElGamal
|
||||
# RSA
|
@ -1,21 +0,0 @@
|
||||
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): ...
|
@ -1,25 +0,0 @@
|
||||
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): ...
|
@ -1,16 +0,0 @@
|
||||
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): ...
|
@ -1,13 +0,0 @@
|
||||
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] = ...): ...
|
@ -1 +0,0 @@
|
||||
__revision__: str
|
@ -1,5 +0,0 @@
|
||||
from .rng_base import BaseRNG
|
||||
|
||||
class PythonOSURandomRNG(BaseRNG):
|
||||
name: str
|
||||
def __init__(self) -> None: ...
|
@ -1,7 +0,0 @@
|
||||
from typing import Any, Optional
|
||||
|
||||
from .rng_base import BaseRNG
|
||||
|
||||
class DevURandomRNG(BaseRNG):
|
||||
name: str
|
||||
def __init__(self, devname: Optional[Any] = ...) -> None: ...
|
@ -1,11 +0,0 @@
|
||||
__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 = ...): ...
|
@ -1,5 +0,0 @@
|
||||
from typing import Any
|
||||
|
||||
def new(*args: Any, **kwargs: Any): ...
|
||||
def atfork() -> None: ...
|
||||
def get_random_bytes(n: int) -> bytes: ...
|
@ -1,19 +0,0 @@
|
||||
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]: ...
|
@ -1,9 +0,0 @@
|
||||
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] = ...): ...
|
@ -1,7 +0,0 @@
|
||||
class PKCS115_SigScheme:
|
||||
def __init__(self, key) -> None: ...
|
||||
def can_sign(self): ...
|
||||
def sign(self, mhash): ...
|
||||
def verify(self, mhash, S): ...
|
||||
|
||||
def new(key): ...
|
@ -1,3 +0,0 @@
|
||||
# Names in __all__ with no definition:
|
||||
# PKCS1_PSS
|
||||
# PKCS1_v1_5
|
@ -1,12 +0,0 @@
|
||||
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 = ...,
|
||||
): ...
|
@ -1,9 +0,0 @@
|
||||
from typing import Any
|
||||
|
||||
__revision__: str
|
||||
binary: Any
|
||||
|
||||
def key_to_english(key): ...
|
||||
def english_to_key(s): ...
|
||||
|
||||
wordlist: Any
|
@ -1,6 +0,0 @@
|
||||
# Names in __all__ with no definition:
|
||||
# RFC1751
|
||||
# asn1
|
||||
# number
|
||||
# randpool
|
||||
# strxor
|
@ -1,45 +0,0 @@
|
||||
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 = ...): ...
|
@ -1,22 +0,0 @@
|
||||
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
|
@ -1,18 +0,0 @@
|
||||
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 = ...): ...
|
@ -1,2 +0,0 @@
|
||||
def strxor(*args, **kwargs): ...
|
||||
def strxor_c(*args, **kwargs): ...
|
@ -1,7 +0,0 @@
|
||||
# Names in __all__ with no definition:
|
||||
# Cipher
|
||||
# Hash
|
||||
# Protocol
|
||||
# PublicKey
|
||||
# Signature
|
||||
# Util
|
@ -1,7 +0,0 @@
|
||||
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): ...
|
@ -4,7 +4,9 @@ from typing import Any
|
||||
if sys.version_info >= (3,):
|
||||
from base64 import encodebytes as encodebytes
|
||||
else:
|
||||
from base64 import encodestring as encodebytes
|
||||
from base64 import encodestring
|
||||
|
||||
encodebytes = encodestring
|
||||
|
||||
expanduser: Any
|
||||
|
||||
|
@ -2,7 +2,9 @@ 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 as ParamType
|
||||
from click.core import Context, Parameter, _ConvertibleType, _ParamType
|
||||
|
||||
ParamType = _ParamType
|
||||
|
||||
class BoolParamType(ParamType):
|
||||
def __call__(self, value: Optional[str], param: Optional[Parameter] = ..., ctx: Optional[Context] = ...) -> bool: ...
|
||||
|
@ -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: DHBackend) -> DHParameters: ...
|
||||
def parameters(self, backend: Optional[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: DHBackend) -> DHPrivateKey: ...
|
||||
def private_key(self, backend: Optional[DHBackend] = ...) -> DHPrivateKey: ...
|
||||
|
||||
class DHPublicKey(metaclass=ABCMeta):
|
||||
@property
|
||||
@ -74,4 +74,6 @@ class DHPublicNumbers(object):
|
||||
@property
|
||||
def y(self) -> int: ...
|
||||
def __init__(self, y: int, parameter_numbers: DHParameterNumbers) -> None: ...
|
||||
def public_key(self, backend: DHBackend) -> DHPublicKey: ...
|
||||
def public_key(self, backend: Optional[DHBackend] = ...) -> DHPublicKey: ...
|
||||
|
||||
def generate_parameters(generator: int, key_size: int, backend: Optional[DHBackend] = ...) -> DHParameters: ...
|
||||
|
@ -1,5 +1,5 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import Union
|
||||
from typing import Optional, 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: DSABackend) -> DSAParameters: ...
|
||||
def parameters(self, backend: Optional[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: DSABackend) -> DSAParameters: ...
|
||||
def generate_private_key(key_size: int, backend: DSABackend) -> DSAPrivateKey: ...
|
||||
def generate_parameters(key_size: int, backend: Optional[DSABackend] = ...) -> DSAParameters: ...
|
||||
def generate_private_key(key_size: int, backend: Optional[DSABackend] = ...) -> DSAPrivateKey: ...
|
||||
|
@ -1,5 +1,5 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import ClassVar, Union
|
||||
from typing import ClassVar, Optional, 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: EllipticCurveBackend) -> EllipticCurvePrivateKey: ...
|
||||
def private_key(self, backend: Optional[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: EllipticCurveBackend) -> EllipticCurvePublicKey: ...
|
||||
def public_key(self, backend: Optional[EllipticCurveBackend] = ...) -> EllipticCurvePublicKey: ...
|
||||
|
||||
class EllipticCurveSignatureAlgorithm(metaclass=ABCMeta):
|
||||
@property
|
||||
@ -189,6 +189,8 @@ class ECDSA(EllipticCurveSignatureAlgorithm):
|
||||
@property
|
||||
def algorithm(self) -> Union[HashAlgorithm, Prehashed]: ...
|
||||
|
||||
def derive_private_key(private_value: int, curve: EllipticCurve, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ...
|
||||
def generate_private_key(curve: EllipticCurve, backend: EllipticCurveBackend) -> EllipticCurvePrivateKey: ...
|
||||
def derive_private_key(
|
||||
private_value: int, curve: EllipticCurve, backend: Optional[EllipticCurveBackend] = ...
|
||||
) -> EllipticCurvePrivateKey: ...
|
||||
def generate_private_key(curve: EllipticCurve, backend: Optional[EllipticCurveBackend] = ...) -> EllipticCurvePrivateKey: ...
|
||||
def get_curve_for_oid(oid: ObjectIdentifier) -> EllipticCurve: ...
|
||||
|
@ -1,5 +1,5 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import Tuple, Union
|
||||
from typing import Optional, Tuple, Union
|
||||
|
||||
from cryptography.hazmat.backends.interfaces import RSABackend
|
||||
from cryptography.hazmat.primitives.asymmetric import AsymmetricVerificationContext
|
||||
@ -48,7 +48,9 @@ class RSAPublicKey(metaclass=ABCMeta):
|
||||
|
||||
RSAPublicKeyWithSerialization = RSAPublicKey
|
||||
|
||||
def generate_private_key(public_exponent: int, key_size: int, backend: RSABackend) -> RSAPrivateKeyWithSerialization: ...
|
||||
def generate_private_key(
|
||||
public_exponent: int, key_size: int, backend: Optional[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: ...
|
||||
@ -70,7 +72,7 @@ class RSAPrivateNumbers(object):
|
||||
def iqmp(self) -> int: ...
|
||||
@property
|
||||
def public_numbers(self) -> RSAPublicNumbers: ...
|
||||
def private_key(self, backend) -> RSAPrivateKey: ...
|
||||
def private_key(self, backend: Optional[RSABackend] = ...) -> RSAPrivateKey: ...
|
||||
|
||||
class RSAPublicNumbers(object):
|
||||
def __init__(self, e: int, n: int) -> None: ...
|
||||
@ -78,4 +80,4 @@ class RSAPublicNumbers(object):
|
||||
def e(self) -> int: ...
|
||||
@property
|
||||
def n(self) -> int: ...
|
||||
def public_key(self, backend) -> RSAPublicKey: ...
|
||||
def public_key(self, backend: Optional[RSABackend] = ...) -> RSAPublicKey: ...
|
||||
|
@ -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: CipherBackend) -> None: ...
|
||||
def __init__(self, algorithm: CipherAlgorithm, mode: Optional[Mode], backend: Optional[CipherBackend] = ...) -> None: ...
|
||||
def decryptor(self) -> CipherContext: ...
|
||||
def encryptor(self) -> CipherContext: ...
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
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: CMACBackend) -> None: ...
|
||||
def __init__(self, algorithm: BlockCipherAlgorithm, backend: Optional[CMACBackend] = ...) -> None: ...
|
||||
def copy(self) -> CMAC: ...
|
||||
def finalize(self) -> bytes: ...
|
||||
def update(self, data: bytes) -> None: ...
|
||||
|
@ -1,4 +1,5 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import Optional
|
||||
|
||||
from cryptography.hazmat.backends.interfaces import HashBackend
|
||||
|
||||
@ -37,7 +38,7 @@ class SHAKE256(HashAlgorithm):
|
||||
def __init__(self, digest_size: int) -> None: ...
|
||||
|
||||
class Hash(HashContext):
|
||||
def __init__(self, algorithm: HashAlgorithm, backend: HashBackend): ...
|
||||
def __init__(self, algorithm: HashAlgorithm, backend: Optional[HashBackend] = ...): ...
|
||||
def copy(self) -> Hash: ...
|
||||
def finalize(self) -> bytes: ...
|
||||
def update(self, data: bytes) -> None: ...
|
||||
|
@ -1,8 +1,10 @@
|
||||
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: HMACBackend) -> None: ...
|
||||
def __init__(self, key: bytes, algorithm: HashAlgorithm, backend: Optional[HMACBackend] = ...) -> None: ...
|
||||
def copy(self) -> HMAC: ...
|
||||
def finalize(self) -> bytes: ...
|
||||
def update(self, msg: bytes) -> None: ...
|
||||
|
@ -5,13 +5,20 @@ 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: HashBackend): ...
|
||||
def __init__(
|
||||
self, algorithm: HashAlgorithm, length: int, otherinfo: Optional[bytes], backend: Optional[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: HMACBackend
|
||||
self,
|
||||
algorithm: HashAlgorithm,
|
||||
length: int,
|
||||
salt: Optional[bytes],
|
||||
otherinfo: Optional[bytes],
|
||||
backend: Optional[HMACBackend] = ...,
|
||||
): ...
|
||||
def derive(self, key_material: bytes) -> bytes: ...
|
||||
def verify(self, key_material: bytes, expected_key: bytes) -> None: ...
|
||||
|
@ -6,12 +6,17 @@ from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
|
||||
|
||||
class HKDF(KeyDerivationFunction):
|
||||
def __init__(
|
||||
self, algorithm: HashAlgorithm, length: int, salt: Optional[bytes], info: Optional[bytes], backend: HMACBackend
|
||||
self,
|
||||
algorithm: HashAlgorithm,
|
||||
length: int,
|
||||
salt: Optional[bytes],
|
||||
info: Optional[bytes],
|
||||
backend: Optional[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: HMACBackend): ...
|
||||
def __init__(self, algorithm: HashAlgorithm, length: int, info: Optional[bytes], backend: Optional[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
Loading…
Reference in New Issue
Block a user