mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 04:04:25 +08:00
56
third_party/2/enum.pyi
vendored
56
third_party/2/enum.pyi
vendored
@@ -29,13 +29,12 @@ class Enum(metaclass=EnumMeta):
|
||||
_value2member_map_: Dict[int, Enum] # undocumented
|
||||
if sys.version_info >= (3, 7):
|
||||
_ignore_: Union[str, List[str]]
|
||||
if sys.version_info >= (3, 6):
|
||||
_order_: str
|
||||
__order__: str
|
||||
@classmethod
|
||||
def _missing_(cls, value: object) -> Any: ...
|
||||
@staticmethod
|
||||
def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ...
|
||||
_order_: str
|
||||
__order__: str
|
||||
@classmethod
|
||||
def _missing_(cls, value: object) -> Any: ...
|
||||
@staticmethod
|
||||
def _generate_next_value_(name: str, start: int, count: int, last_values: List[Any]) -> Any: ...
|
||||
def __new__(cls: Type[_T], value: object) -> _T: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __str__(self) -> str: ...
|
||||
@@ -49,25 +48,26 @@ class IntEnum(int, Enum):
|
||||
|
||||
def unique(enumeration: _S) -> _S: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
_auto_null: Any
|
||||
_auto_null: Any
|
||||
|
||||
# subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto()
|
||||
class auto(IntFlag):
|
||||
value: Any
|
||||
class Flag(Enum):
|
||||
def __contains__(self: _T, other: _T) -> bool: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __or__(self: _T, other: _T) -> _T: ...
|
||||
def __and__(self: _T, other: _T) -> _T: ...
|
||||
def __xor__(self: _T, other: _T) -> _T: ...
|
||||
def __invert__(self: _T) -> _T: ...
|
||||
class IntFlag(int, Flag):
|
||||
def __or__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
def __and__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
def __xor__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
__ror__ = __or__
|
||||
__rand__ = __and__
|
||||
__rxor__ = __xor__
|
||||
# subclassing IntFlag so it picks up all implemented base functions, best modeling behavior of enum.auto()
|
||||
class auto(IntFlag):
|
||||
value: Any
|
||||
|
||||
class Flag(Enum):
|
||||
def __contains__(self: _T, other: _T) -> bool: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __or__(self: _T, other: _T) -> _T: ...
|
||||
def __and__(self: _T, other: _T) -> _T: ...
|
||||
def __xor__(self: _T, other: _T) -> _T: ...
|
||||
def __invert__(self: _T) -> _T: ...
|
||||
|
||||
class IntFlag(int, Flag):
|
||||
def __or__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
def __and__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
def __xor__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
__ror__ = __or__
|
||||
__rand__ = __and__
|
||||
__rxor__ = __xor__
|
||||
|
||||
2
third_party/2/tornado/web.pyi
vendored
2
third_party/2/tornado/web.pyi
vendored
@@ -8,7 +8,7 @@ MAX_SUPPORTED_SIGNED_VALUE_VERSION: Any
|
||||
DEFAULT_SIGNED_VALUE_VERSION: Any
|
||||
DEFAULT_SIGNED_VALUE_MIN_VERSION: Any
|
||||
|
||||
if sys.version_info[:2] >= (3, 5):
|
||||
if sys.version_info >= (3, 5):
|
||||
from typing import Awaitable
|
||||
|
||||
_MethodType = Callable[..., Optional[Awaitable[None]]]
|
||||
|
||||
2
third_party/2and3/jinja2/_compat.pyi
vendored
2
third_party/2and3/jinja2/_compat.pyi
vendored
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from typing import Any, Optional
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
if sys.version_info >= (3,):
|
||||
from urllib.parse import quote_from_bytes
|
||||
|
||||
url_quote = quote_from_bytes
|
||||
|
||||
11
third_party/3/jwt/algorithms.pyi
vendored
11
third_party/3/jwt/algorithms.pyi
vendored
@@ -44,11 +44,6 @@ class NoneAlgorithm(Algorithm[None]):
|
||||
class _HashAlg:
|
||||
def __call__(self, arg: Union[bytes, bytearray, memoryview] = ...) -> _Hash: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
_LoadsString = Union[str, bytes, bytearray]
|
||||
else:
|
||||
_LoadsString = str
|
||||
|
||||
class HMACAlgorithm(Algorithm[bytes]):
|
||||
SHA256: ClassVar[_HashAlg]
|
||||
SHA384: ClassVar[_HashAlg]
|
||||
@@ -59,7 +54,7 @@ class HMACAlgorithm(Algorithm[bytes]):
|
||||
@staticmethod
|
||||
def to_jwk(key_obj: Union[str, bytes]) -> str: ...
|
||||
@staticmethod
|
||||
def from_jwk(jwk: _LoadsString) -> bytes: ...
|
||||
def from_jwk(jwk: Union[str, bytes]) -> bytes: ...
|
||||
|
||||
# Only defined if cryptography is installed.
|
||||
class RSAAlgorithm(Algorithm[Any]):
|
||||
@@ -70,7 +65,7 @@ class RSAAlgorithm(Algorithm[Any]):
|
||||
def __init__(self, hash_alg: Union[HashAlgorithm, Prehashed]) -> None: ...
|
||||
def prepare_key(self, key: Union[bytes, str, RSAPrivateKey, RSAPublicKey]) -> Union[RSAPrivateKey, RSAPublicKey]: ...
|
||||
@staticmethod
|
||||
def from_jwk(jwk: Union[_LoadsString, Dict[str, Any]]) -> Union[RSAPrivateKey, RSAPublicKey]: ...
|
||||
def from_jwk(jwk: Union[str, bytes, Dict[str, Any]]) -> Union[RSAPrivateKey, RSAPublicKey]: ...
|
||||
def sign(self, msg: bytes, key: RSAPrivateKey) -> bytes: ...
|
||||
def verify(self, msg: bytes, key: RSAPublicKey, sig: bytes) -> bool: ...
|
||||
|
||||
@@ -87,7 +82,7 @@ class ECAlgorithm(Algorithm[Any]):
|
||||
@staticmethod
|
||||
def to_jwk(key_obj: Union[EllipticCurvePrivateKeyWithSerialization, EllipticCurvePublicKeyWithSerialization]) -> str: ...
|
||||
@staticmethod
|
||||
def from_jwk(jwk: _LoadsString) -> Union[EllipticCurvePrivateKey, EllipticCurvePublicKey]: ...
|
||||
def from_jwk(jwk: Union[str, bytes]) -> Union[EllipticCurvePrivateKey, EllipticCurvePublicKey]: ...
|
||||
def sign(self, msg: bytes, key: EllipticCurvePrivateKey) -> bytes: ...
|
||||
def verify(self, msg: bytes, key: EllipticCurvePublicKey, sig: bytes) -> bool: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user