mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-25 13:21:11 +08:00
make sure typevars defined in stubs are private (#989)
And also a few type aliases I noticed in the process.
Found using 59f9cac095
This commit is contained in:
committed by
Guido van Rossum
parent
984307bf45
commit
eb07fd3c1a
@@ -815,12 +815,12 @@ class ellipsis: ...
|
||||
Ellipsis = ... # type: ellipsis
|
||||
|
||||
# TODO: buffer support is incomplete; e.g. some_string.startswith(some_buffer) doesn't type check.
|
||||
AnyBuffer = TypeVar('AnyBuffer', str, unicode, bytearray, buffer)
|
||||
_AnyBuffer = TypeVar('_AnyBuffer', str, unicode, bytearray, buffer)
|
||||
|
||||
class buffer(Sized):
|
||||
def __init__(self, object: AnyBuffer, offset: int = ..., size: int = ...) -> None: ...
|
||||
def __add__(self, other: AnyBuffer) -> str: ...
|
||||
def __cmp__(self, other: AnyBuffer) -> bool: ...
|
||||
def __init__(self, object: _AnyBuffer, offset: int = ..., size: int = ...) -> None: ...
|
||||
def __add__(self, other: _AnyBuffer) -> str: ...
|
||||
def __cmp__(self, other: _AnyBuffer) -> bool: ...
|
||||
def __getitem__(self, key: Union[int, slice]) -> str: ...
|
||||
def __getslice__(self, i: int, j: int) -> str: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
from typing import (Any, Generic, IO, Iterable, Sequence, TypeVar,
|
||||
Union, overload, Iterator, Tuple, BinaryIO, List)
|
||||
|
||||
T = TypeVar('T')
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class array(Generic[T]):
|
||||
def __init__(self, typecode: str, init: Iterable[T] = ...) -> None: ...
|
||||
def __add__(self, y: "array[T]") -> "array[T]": ...
|
||||
class array(Generic[_T]):
|
||||
def __init__(self, typecode: str, init: Iterable[_T] = ...) -> None: ...
|
||||
def __add__(self, y: "array[_T]") -> "array[_T]": ...
|
||||
def __contains__(self, y: Any) -> bool: ...
|
||||
def __copy__(self) -> "array[T]": ...
|
||||
def __copy__(self) -> "array[_T]": ...
|
||||
def __deepcopy__(self) -> "array": ...
|
||||
def __delitem__(self, y: Union[slice, int]) -> None: ...
|
||||
def __delslice__(self, i: int, j: int) -> None: ...
|
||||
@@ -17,39 +17,39 @@ class array(Generic[T]):
|
||||
def __getitem__(self, i: int) -> Any: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> "array": ...
|
||||
def __iadd__(self, y: "array[T]") -> "array[T]": ...
|
||||
def __imul__(self, y: int) -> "array[T]": ...
|
||||
def __iter__(self) -> Iterator[T]: ...
|
||||
def __iadd__(self, y: "array[_T]") -> "array[_T]": ...
|
||||
def __imul__(self, y: int) -> "array[_T]": ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __mul__(self, n: int) -> "array[T]": ...
|
||||
def __rmul__(self, n: int) -> "array[T]": ...
|
||||
def __mul__(self, n: int) -> "array[_T]": ...
|
||||
def __rmul__(self, n: int) -> "array[_T]": ...
|
||||
@overload
|
||||
def __setitem__(self, i: int, y: T) -> None: ...
|
||||
def __setitem__(self, i: int, y: _T) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, i: slice, y: "array[T]") -> None: ...
|
||||
def __setitem__(self, i: slice, y: "array[_T]") -> None: ...
|
||||
|
||||
def append(self, x: T) -> None: ...
|
||||
def append(self, x: _T) -> None: ...
|
||||
def buffer_info(self) -> Tuple[int, int]: ...
|
||||
def byteswap(self) -> None:
|
||||
raise RuntimeError()
|
||||
def count(self) -> int: ...
|
||||
def extend(self, x: Sequence[T]) -> None: ...
|
||||
def fromlist(self, list: List[T]) -> None:
|
||||
def extend(self, x: Sequence[_T]) -> None: ...
|
||||
def fromlist(self, list: List[_T]) -> None:
|
||||
raise EOFError()
|
||||
raise IOError()
|
||||
def fromfile(self, f: BinaryIO, n: int) -> None: ...
|
||||
def fromstring(self, s: str) -> None: ...
|
||||
def fromunicode(self, u: unicode) -> None: ...
|
||||
def index(self, x: T) -> int: ...
|
||||
def insert(self, i: int, x: T) -> None: ...
|
||||
def pop(self, i: int = ...) -> T: ...
|
||||
def index(self, x: _T) -> int: ...
|
||||
def insert(self, i: int, x: _T) -> None: ...
|
||||
def pop(self, i: int = ...) -> _T: ...
|
||||
def read(self, f: IO[str], n: int) -> None:
|
||||
raise DeprecationWarning()
|
||||
def remove(self, x: T) -> None: ...
|
||||
def remove(self, x: _T) -> None: ...
|
||||
def reverse(self) -> None: ...
|
||||
def tofile(self, f: BinaryIO) -> None:
|
||||
raise IOError()
|
||||
def tolist(self) -> List[T]: ...
|
||||
def tolist(self) -> List[_T]: ...
|
||||
def tostring(self) -> str: ...
|
||||
def tounicode(self) -> unicode: ...
|
||||
def write(self, f: IO[str]) -> None:
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
from typing import Any, Sequence, TypeVar
|
||||
|
||||
T = TypeVar('T')
|
||||
def bisect(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect_left(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect_right(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def insort(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
def insort_left(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
def insort_right(a: Sequence[T], x: T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
_T = TypeVar('_T')
|
||||
def bisect(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def bisect_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> int: ...
|
||||
def insort(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
def insort_left(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
def insort_right(a: Sequence[_T], x: _T, lo: int = ..., hi: int = ...) -> None: ...
|
||||
|
||||
@@ -4,7 +4,7 @@ from .coroutines import coroutine
|
||||
from .events import AbstractEventLoop
|
||||
from .futures import Future
|
||||
|
||||
T = TypeVar('T')
|
||||
_T = TypeVar('_T')
|
||||
|
||||
__all__ = ... # type: str
|
||||
|
||||
@@ -44,7 +44,7 @@ class Condition(_ContextManagerMixin):
|
||||
@coroutine
|
||||
def wait(self) -> Generator[Any, None, bool]: ...
|
||||
@coroutine
|
||||
def wait_for(self, predicate: Callable[[], T]) -> Generator[Any, None, T]: ...
|
||||
def wait_for(self, predicate: Callable[[], _T]) -> Generator[Any, None, _T]: ...
|
||||
def notify(self, n: int = 1) -> None: ...
|
||||
def notify_all(self) -> None: ...
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@ __all__ = ... # type: str
|
||||
class QueueEmpty(Exception): ...
|
||||
class QueueFull(Exception): ...
|
||||
|
||||
T = TypeVar('T')
|
||||
_T = TypeVar('_T')
|
||||
|
||||
class Queue(Generic[T]):
|
||||
class Queue(Generic[_T]):
|
||||
def __init__(self, maxsize: int = ..., *, loop: AbstractEventLoop = ...) -> None: ...
|
||||
def _init(self, maxsize: int) -> None: ...
|
||||
def _get(self) -> T: ...
|
||||
def _put(self, item: T) -> None: ...
|
||||
def _get(self) -> _T: ...
|
||||
def _put(self, item: _T) -> None: ...
|
||||
def __repr__(self) -> str: ...
|
||||
def __str__(self) -> str: ...
|
||||
def _format(self) -> str: ...
|
||||
@@ -28,11 +28,11 @@ class Queue(Generic[T]):
|
||||
def empty(self) -> bool: ...
|
||||
def full(self) -> bool: ...
|
||||
@coroutine
|
||||
def put(self, item: T) -> Generator[Any, None, None]: ...
|
||||
def put_nowait(self, item: T) -> None: ...
|
||||
def put(self, item: _T) -> Generator[Any, None, None]: ...
|
||||
def put_nowait(self, item: _T) -> None: ...
|
||||
@coroutine
|
||||
def get(self) -> Generator[Any, None, T]: ...
|
||||
def get_nowait(self) -> T: ...
|
||||
def get(self) -> Generator[Any, None, _T]: ...
|
||||
def get_nowait(self) -> _T: ...
|
||||
if sys.version_info >= (3, 4):
|
||||
@coroutine
|
||||
def join(self) -> Generator[Any, None, bool]: ...
|
||||
|
||||
@@ -9,7 +9,7 @@ def strip_leading_underscores(attribute_name: AnyStr) -> AnyStr: ...
|
||||
|
||||
NOTHING = Any
|
||||
|
||||
T = TypeVar('T')
|
||||
_T = TypeVar('_T')
|
||||
|
||||
def attributes(
|
||||
attrs: Sequence[Union[AnyStr, Attribute]],
|
||||
@@ -18,7 +18,7 @@ def attributes(
|
||||
apply_with_repr: bool = True,
|
||||
apply_immutable: bool = False,
|
||||
store_attributes: Optional[Callable[[type, Attribute], Any]] = None,
|
||||
**kw: Optional[dict]) -> Callable[[Type[T]], Type[T]]: ...
|
||||
**kw: Optional[dict]) -> Callable[[Type[_T]], Type[_T]]: ...
|
||||
|
||||
class Attribute:
|
||||
def __init__(
|
||||
|
||||
4
third_party/2and3/mypy_extensions.pyi
vendored
4
third_party/2and3/mypy_extensions.pyi
vendored
@@ -1,9 +1,9 @@
|
||||
from typing import Dict, Type, TypeVar, Union
|
||||
|
||||
T = TypeVar('T')
|
||||
_T = TypeVar('_T')
|
||||
|
||||
|
||||
def TypedDict(typename: str, fields: Dict[str, Type[T]]) -> Type[dict]: ...
|
||||
def TypedDict(typename: str, fields: Dict[str, Type[_T]]) -> Type[dict]: ...
|
||||
|
||||
# Return type that indicates a function does not return.
|
||||
# This type is equivalent to the None type, but the no-op Union is necessary to
|
||||
|
||||
10
third_party/3.6/click/core.pyi
vendored
10
third_party/3.6/click/core.pyi
vendored
@@ -239,8 +239,8 @@ class Command(BaseCommand):
|
||||
...
|
||||
|
||||
|
||||
T = TypeVar('T')
|
||||
Decorator = Callable[[T], T]
|
||||
_T = TypeVar('_T')
|
||||
_Decorator = Callable[[_T], _T]
|
||||
|
||||
|
||||
class MultiCommand(Command):
|
||||
@@ -264,7 +264,7 @@ class MultiCommand(Command):
|
||||
|
||||
def resultcallback(
|
||||
self, replace: bool = False
|
||||
) -> Decorator:
|
||||
) -> _Decorator:
|
||||
...
|
||||
|
||||
def format_commands(self, ctx: Context, formatter: HelpFormatter) -> None:
|
||||
@@ -293,10 +293,10 @@ class Group(MultiCommand):
|
||||
def add_command(self, cmd: Command, name: str = None):
|
||||
...
|
||||
|
||||
def command(self, *args, **kwargs) -> Decorator:
|
||||
def command(self, *args, **kwargs) -> _Decorator:
|
||||
...
|
||||
|
||||
def group(self, *args, **kwargs) -> Decorator:
|
||||
def group(self, *args, **kwargs) -> _Decorator:
|
||||
...
|
||||
|
||||
|
||||
|
||||
26
third_party/3.6/click/decorators.pyi
vendored
26
third_party/3.6/click/decorators.pyi
vendored
@@ -4,21 +4,21 @@ from typing import Any, Callable, Dict, List, TypeVar, Union
|
||||
from click.core import Command, Group, Argument, Option, Parameter, Context
|
||||
from click.types import ParamType
|
||||
|
||||
T = TypeVar('T')
|
||||
Decorator = Callable[[T], T]
|
||||
_T = TypeVar('_T')
|
||||
_Decorator = Callable[[_T], _T]
|
||||
|
||||
|
||||
def pass_context(T) -> T:
|
||||
def pass_context(_T) -> _T:
|
||||
...
|
||||
|
||||
|
||||
def pass_obj(T) -> T:
|
||||
def pass_obj(_T) -> _T:
|
||||
...
|
||||
|
||||
|
||||
def make_pass_decorator(
|
||||
object_type: type, ensure: bool = False
|
||||
) -> Callable[[T], T]:
|
||||
) -> Callable[[_T], _T]:
|
||||
...
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ def command(
|
||||
short_help: str = None,
|
||||
options_metavar: str = '[OPTIONS]',
|
||||
add_help_option: bool = True,
|
||||
) -> Decorator:
|
||||
) -> _Decorator:
|
||||
...
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ def group(
|
||||
short_help: str = None,
|
||||
options_metavar: str = '[OPTIONS]',
|
||||
add_help_option: bool = True,
|
||||
) -> Decorator:
|
||||
) -> _Decorator:
|
||||
...
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ def argument(
|
||||
expose_value: bool = True,
|
||||
is_eager: bool = False,
|
||||
envvar: Union[str, List[str]] = None
|
||||
) -> Decorator:
|
||||
) -> _Decorator:
|
||||
...
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ def option(
|
||||
expose_value: bool = True,
|
||||
is_eager: bool = False,
|
||||
envvar: Union[str, List[str]] = None
|
||||
) -> Decorator:
|
||||
) -> _Decorator:
|
||||
...
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ def confirmation_option(
|
||||
expose_value: bool = False,
|
||||
is_eager: bool = False,
|
||||
envvar: Union[str, List[str]] = None
|
||||
) -> Decorator:
|
||||
) -> _Decorator:
|
||||
...
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ def password_option(
|
||||
expose_value: bool = True,
|
||||
is_eager: bool = False,
|
||||
envvar: Union[str, List[str]] = None
|
||||
) -> Decorator:
|
||||
) -> _Decorator:
|
||||
...
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ def version_option(
|
||||
expose_value: bool = False,
|
||||
is_eager: bool = True,
|
||||
envvar: Union[str, List[str]] = None
|
||||
) -> Decorator:
|
||||
) -> _Decorator:
|
||||
...
|
||||
|
||||
|
||||
@@ -216,5 +216,5 @@ def help_option(
|
||||
expose_value: bool = False,
|
||||
is_eager: bool = True,
|
||||
envvar: Union[str, List[str]] = None
|
||||
) -> Decorator:
|
||||
) -> _Decorator:
|
||||
...
|
||||
|
||||
8
third_party/3.6/click/termui.pyi
vendored
8
third_party/3.6/click/termui.pyi
vendored
@@ -58,18 +58,18 @@ def echo_via_pager(text: str, color: bool = None) -> None:
|
||||
...
|
||||
|
||||
|
||||
T = TypeVar('T')
|
||||
_T = TypeVar('_T')
|
||||
|
||||
|
||||
@contextmanager
|
||||
def progressbar(
|
||||
iterable=Iterable[T],
|
||||
iterable=Iterable[_T],
|
||||
length: int = None,
|
||||
label: str = None,
|
||||
show_eta: bool = True,
|
||||
show_percent: bool = None,
|
||||
show_pos: bool = False,
|
||||
item_show_func: Callable[[T], str] = None,
|
||||
item_show_func: Callable[[_T], str] = None,
|
||||
fill_char: str = '#',
|
||||
empty_char: str = '-',
|
||||
bar_template: str = '%(label)s [%(bar)s] %(info)s',
|
||||
@@ -77,7 +77,7 @@ def progressbar(
|
||||
width: int = 36,
|
||||
file: IO = None,
|
||||
color: bool = None,
|
||||
) -> Generator[T, None, None]:
|
||||
) -> Generator[_T, None, None]:
|
||||
...
|
||||
|
||||
|
||||
|
||||
22
third_party/3.6/click/types.pyi
vendored
22
third_party/3.6/click/types.pyi
vendored
@@ -119,14 +119,14 @@ class File(ParamType):
|
||||
...
|
||||
|
||||
|
||||
F = TypeVar('F') # result of the function
|
||||
Func = Callable[[Optional[str]], F]
|
||||
_F = TypeVar('_F') # result of the function
|
||||
_Func = Callable[[Optional[str]], _F]
|
||||
|
||||
|
||||
class FuncParamType(ParamType):
|
||||
func: Func
|
||||
func: _Func
|
||||
|
||||
def __init__(self, func: Func) -> None:
|
||||
def __init__(self, func: _Func) -> None:
|
||||
...
|
||||
|
||||
def __call__(
|
||||
@@ -134,7 +134,7 @@ class FuncParamType(ParamType):
|
||||
value: Optional[str],
|
||||
param: Parameter = None,
|
||||
ctx: Context = None,
|
||||
) -> F:
|
||||
) -> _F:
|
||||
...
|
||||
|
||||
def convert(
|
||||
@@ -142,7 +142,7 @@ class FuncParamType(ParamType):
|
||||
value: str,
|
||||
param: Optional[Parameter],
|
||||
ctx: Optional[Context],
|
||||
) -> F:
|
||||
) -> _F:
|
||||
...
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ class IntRange(IntParamType):
|
||||
...
|
||||
|
||||
|
||||
PathType = TypeVar('PathType', str, bytes)
|
||||
_PathType = TypeVar('_PathType', str, bytes)
|
||||
|
||||
|
||||
class Path(ParamType):
|
||||
@@ -184,11 +184,11 @@ class Path(ParamType):
|
||||
readable: bool = True,
|
||||
resolve_path: bool = False,
|
||||
allow_dash: bool = False,
|
||||
path_type: PathType = None,
|
||||
path_type: _PathType = None,
|
||||
) -> None:
|
||||
...
|
||||
|
||||
def coerce_path_result(self, rv: Union[str, bytes]) -> PathType:
|
||||
def coerce_path_result(self, rv: Union[str, bytes]) -> _PathType:
|
||||
...
|
||||
|
||||
def __call__(
|
||||
@@ -196,7 +196,7 @@ class Path(ParamType):
|
||||
value: Optional[str],
|
||||
param: Parameter = None,
|
||||
ctx: Context = None,
|
||||
) -> PathType:
|
||||
) -> _PathType:
|
||||
...
|
||||
|
||||
def convert(
|
||||
@@ -204,7 +204,7 @@ class Path(ParamType):
|
||||
value: str,
|
||||
param: Optional[Parameter],
|
||||
ctx: Optional[Context],
|
||||
) -> PathType:
|
||||
) -> _PathType:
|
||||
...
|
||||
|
||||
class StringParamType(ParamType):
|
||||
|
||||
6
third_party/3.6/click/utils.pyi
vendored
6
third_party/3.6/click/utils.pyi
vendored
@@ -1,15 +1,15 @@
|
||||
from typing import Any, Callable, Iterator, IO, List, Optional, TypeVar, Union
|
||||
|
||||
|
||||
T = TypeVar('T')
|
||||
Decorator = Callable[[T], T]
|
||||
_T = TypeVar('_T')
|
||||
_Decorator = Callable[[_T], _T]
|
||||
|
||||
|
||||
def _posixify(name: str) -> str:
|
||||
...
|
||||
|
||||
|
||||
def safecall(func: T) -> T:
|
||||
def safecall(func: _T) -> _T:
|
||||
...
|
||||
|
||||
|
||||
|
||||
84
third_party/3/itsdangerous.pyi
vendored
84
third_party/3/itsdangerous.pyi
vendored
@@ -11,10 +11,10 @@ int_to_byte = Callable[[int], bytes]
|
||||
number_types = (int, float)
|
||||
izip = zip
|
||||
|
||||
bytes_like = Union[bytearray, bytes]
|
||||
str_like = Union[str, bytes]
|
||||
can_become_bytes = Union[str, bytes, bytearray]
|
||||
comparable_bytes = TypeVar('comparable_bytes', str, Union[bytes, bytearray])
|
||||
_bytes_like = Union[bytearray, bytes]
|
||||
_str_like = Union[str, bytes]
|
||||
_can_become_bytes = Union[str, bytes, bytearray]
|
||||
_comparable_bytes = TypeVar('_comparable_bytes', str, _bytes_like)
|
||||
|
||||
class _CompactJSON:
|
||||
def loads(self, payload: Text) -> Any: ...
|
||||
@@ -23,9 +23,9 @@ class _CompactJSON:
|
||||
compact_json = _CompactJSON
|
||||
EPOCH = ... # type: int
|
||||
|
||||
def want_bytes(s: can_become_bytes, encoding='', errors='') -> bytes: ...
|
||||
def want_bytes(s: _can_become_bytes, encoding='', errors='') -> bytes: ...
|
||||
def is_text_serializer(serializer: Any) -> bool: ...
|
||||
def constant_time_compare(val1: comparable_bytes, val2: comparable_bytes) -> bool: ...
|
||||
def constant_time_compare(val1: _comparable_bytes, val2: _comparable_bytes) -> bool: ...
|
||||
|
||||
class BadData(Exception):
|
||||
message = ... # type: str
|
||||
@@ -50,75 +50,75 @@ class BadHeader(BadSignature):
|
||||
|
||||
class SignatureExpired(BadTimeSignature): ...
|
||||
|
||||
def base64_encode(string: can_become_bytes) -> bytes: ...
|
||||
def base64_decode(string: can_become_bytes) -> bytes: ...
|
||||
def base64_encode(string: _can_become_bytes) -> bytes: ...
|
||||
def base64_decode(string: _can_become_bytes) -> bytes: ...
|
||||
def int_to_bytes(num: int) -> bytes: ...
|
||||
def bytes_to_int(bytestr: can_become_bytes) -> bytes: ...
|
||||
def bytes_to_int(bytestr: _can_become_bytes) -> bytes: ...
|
||||
|
||||
class SigningAlgorithm:
|
||||
def get_signature(self, key: bytes_like, value: bytes_like) -> bytes: ...
|
||||
def verify_signature(self, key: bytes_like, value: bytes_like, sig: can_become_bytes) -> bool: ...
|
||||
def get_signature(self, key: _bytes_like, value: _bytes_like) -> bytes: ...
|
||||
def verify_signature(self, key: _bytes_like, value: _bytes_like, sig: _can_become_bytes) -> bool: ...
|
||||
|
||||
class NoneAlgorithm(SigningAlgorithm):
|
||||
def get_signature(self, key: bytes_like, value: bytes_like) -> bytes: ...
|
||||
def get_signature(self, key: _bytes_like, value: _bytes_like) -> bytes: ...
|
||||
|
||||
class HMACAlgorithm(SigningAlgorithm):
|
||||
default_digest_method = ... # type: Callable
|
||||
digest_method = ... # type: Callable
|
||||
def __init__(self, digest_method: Optional[Callable]=None) -> None: ...
|
||||
def get_signature(self, key: bytes_like, value: bytes_like) -> bytes: ...
|
||||
def get_signature(self, key: _bytes_like, value: _bytes_like) -> bytes: ...
|
||||
|
||||
class Signer:
|
||||
default_digest_method = ... # type: Callable
|
||||
default_key_derivation = ... # type: str
|
||||
secret_key = ... # type: can_become_bytes
|
||||
sep = ... # type: can_become_bytes
|
||||
salt = ... # type: can_become_bytes
|
||||
secret_key = ... # type: _can_become_bytes
|
||||
sep = ... # type: _can_become_bytes
|
||||
salt = ... # type: _can_become_bytes
|
||||
key_derivation = ... # type: str
|
||||
digest_method = ... # type: Callable
|
||||
algorithm = ... # type: SigningAlgorithm
|
||||
def __init__(self, secret_key: can_become_bytes, salt: Optional[can_become_bytes]=None, sep: Optional[can_become_bytes]='',
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes]=None, sep: Optional[_can_become_bytes]='',
|
||||
key_derivation: Optional[str]=None,
|
||||
digest_method: Optional[Callable]=None,
|
||||
algorithm: Optional[SigningAlgorithm]=None) -> None: ...
|
||||
def derive_key(self) -> bytes: ...
|
||||
def get_signature(self, value: bytes_like) -> bytes: ...
|
||||
def sign(self, value: bytes_like) -> bytes: ...
|
||||
def verify_signature(self, value: bytes_like, sig: can_become_bytes) -> bool: ...
|
||||
def unsign(self, signed_value: can_become_bytes) -> str: ...
|
||||
def validate(self, signed_value: can_become_bytes) -> bool: ...
|
||||
def get_signature(self, value: _bytes_like) -> bytes: ...
|
||||
def sign(self, value: _bytes_like) -> bytes: ...
|
||||
def verify_signature(self, value: _bytes_like, sig: _can_become_bytes) -> bool: ...
|
||||
def unsign(self, signed_value: _can_become_bytes) -> str: ...
|
||||
def validate(self, signed_value: _can_become_bytes) -> bool: ...
|
||||
|
||||
class TimestampSigner(Signer):
|
||||
def get_timestamp(self) -> int: ...
|
||||
def timestamp_to_datetime(self, ts: int) -> datetime: ...
|
||||
def sign(self, value: bytes_like) -> bytes: ...
|
||||
def unsign(self, value: can_become_bytes, max_age: Optional[int]=None, return_timestamp=False) -> Any: ...
|
||||
def validate(self, signed_value: can_become_bytes, max_age: Optional[int]=None) -> bool: ...
|
||||
def sign(self, value: _bytes_like) -> bytes: ...
|
||||
def unsign(self, value: _can_become_bytes, max_age: Optional[int]=None, return_timestamp=False) -> Any: ...
|
||||
def validate(self, signed_value: _can_become_bytes, max_age: Optional[int]=None) -> bool: ...
|
||||
|
||||
class Serializer:
|
||||
default_serializer = ... # type: Any
|
||||
default_signer = ... # type: Callable[..., Signer]
|
||||
secret_key = ... # type: Any
|
||||
salt = ... # type: can_become_bytes
|
||||
salt = ... # type: _can_become_bytes
|
||||
serializer = ... # type: Any
|
||||
is_text_serializer = ... # type: bool
|
||||
signer = ... # type: Signer
|
||||
signer_kwargs = ... # type: MutableMapping
|
||||
def __init__(self, secret_key: can_become_bytes, salt: Optional[can_become_bytes]=b'', serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None) -> None: ...
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes]=b'', serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None) -> None: ...
|
||||
def load_payload(self, payload: Any, serializer=None) -> Any: ...
|
||||
def dump_payload(self, *args, **kwargs) -> bytes: ...
|
||||
def make_signer(self, salt: Optional[can_become_bytes]=None) -> Signer: ...
|
||||
def dumps(self, obj: Any, salt: Optional[can_become_bytes]=None) -> str_like: ...
|
||||
def dump(self, obj: Any, f: IO, salt: Optional[can_become_bytes]=None) -> None: ...
|
||||
def loads(self, s: can_become_bytes, salt: Optional[can_become_bytes]=None) -> Any: ...
|
||||
def load(self, f: IO, salt: Optional[can_become_bytes]=None): ...
|
||||
def loads_unsafe(self, s: can_become_bytes, salt: Optional[can_become_bytes]=None) -> Tuple[bool, Any]: ...
|
||||
def make_signer(self, salt: Optional[_can_become_bytes]=None) -> Signer: ...
|
||||
def dumps(self, obj: Any, salt: Optional[_can_become_bytes]=None) -> _str_like: ...
|
||||
def dump(self, obj: Any, f: IO, salt: Optional[_can_become_bytes]=None) -> None: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None) -> Any: ...
|
||||
def load(self, f: IO, salt: Optional[_can_become_bytes]=None): ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None) -> Tuple[bool, Any]: ...
|
||||
def load_unsafe(self, f: IO, *args, **kwargs) -> Tuple[bool, Any]: ...
|
||||
|
||||
class TimedSerializer(Serializer):
|
||||
default_signer = ... # type: Callable[..., TimestampSigner]
|
||||
def loads(self, s: can_become_bytes, salt: Optional[can_become_bytes]=None, max_age: Optional[int]=None, return_timestamp=False) -> Any: ...
|
||||
def loads_unsafe(self, s: can_become_bytes, salt: Optional[can_become_bytes]=None, max_age: Optional[int]=None) -> Tuple[bool, Any]: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, max_age: Optional[int]=None, return_timestamp=False) -> Any: ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, max_age: Optional[int]=None) -> Tuple[bool, Any]: ...
|
||||
|
||||
class JSONWebSignatureSerializer(Serializer):
|
||||
jws_algorithms = ... # type: MutableMapping[str, SigningAlgorithm]
|
||||
@@ -126,22 +126,22 @@ class JSONWebSignatureSerializer(Serializer):
|
||||
default_serializer = ... # type: Any
|
||||
algorithm_name = ... # type: str
|
||||
algorithm = ... # type: Any
|
||||
def __init__(self, secret_key: can_become_bytes, salt: Optional[can_become_bytes]=None, serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None, algorithm_name: Optional[str]=None) -> None: ...
|
||||
def __init__(self, secret_key: _can_become_bytes, salt: Optional[_can_become_bytes]=None, serializer=None, signer: Optional[Callable[..., Signer]]=None, signer_kwargs: Optional[MutableMapping]=None, algorithm_name: Optional[str]=None) -> None: ...
|
||||
def load_payload(self, payload: Any, return_header=False) -> Any: ...
|
||||
def dump_payload(self, *args, **kwargs) -> bytes: ...
|
||||
def make_algorithm(self, algorithm_name: str) -> SigningAlgorithm: ...
|
||||
def make_signer(self, salt: Optional[can_become_bytes]=None, algorithm_name: Optional[str]=None) -> Signer: ...
|
||||
def make_signer(self, salt: Optional[_can_become_bytes]=None, algorithm_name: Optional[str]=None) -> Signer: ...
|
||||
def make_header(self, header_fields=Optional[MutableMapping]) -> MutableMapping: ...
|
||||
def dumps(self, obj: Any, salt: Optional[can_become_bytes]=None, header_fields=Optional[MutableMapping]) -> str: ...
|
||||
def loads(self, s: can_become_bytes, salt: Optional[can_become_bytes]=None, return_header=False) -> Any: ...
|
||||
def loads_unsafe(self, s: can_become_bytes, salt: Optional[can_become_bytes]=None, return_header=False) -> Tuple[bool, Any]: ...
|
||||
def dumps(self, obj: Any, salt: Optional[_can_become_bytes]=None, header_fields=Optional[MutableMapping]) -> str: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, return_header=False) -> Any: ...
|
||||
def loads_unsafe(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, return_header=False) -> Tuple[bool, Any]: ...
|
||||
|
||||
class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer):
|
||||
DEFAULT_EXPIRES_IN = ... # type: int
|
||||
expires_in = ... # type: int
|
||||
def __init__(self, secret_key: can_become_bytes, expires_in: Optional[int]=None, **kwargs) -> None: ...
|
||||
def __init__(self, secret_key: _can_become_bytes, expires_in: Optional[int]=None, **kwargs) -> None: ...
|
||||
def make_header(self, header_fields=Optional[MutableMapping]) -> MutableMapping: ...
|
||||
def loads(self, s: can_become_bytes, salt: Optional[can_become_bytes]=None, return_header=False) -> Any: ...
|
||||
def loads(self, s: _can_become_bytes, salt: Optional[_can_become_bytes]=None, return_header=False) -> Any: ...
|
||||
def get_issue_date(self, header: MutableMapping) -> Optional[datetime]: ...
|
||||
def now(self) -> int: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user