mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-17 11:17:17 +03:00
Updated typeshed stubs to the latest version.
This commit is contained in:
parent
6a25a7bf0b
commit
77dd71ff10
@ -1 +1 @@
|
||||
f28a4a1774eecca1d6e5e8699fb08c28951e7ea5
|
||||
03b4bb9ccecbabff7ebd7f98bd5c5239f2a33b97
|
||||
|
@ -69,6 +69,7 @@ _VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers.
|
||||
|
||||
@final
|
||||
class dict_keys(KeysView[_KT_co], Generic[_KT_co, _VT_co]): # undocumented
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
|
||||
@ -81,6 +82,7 @@ class dict_values(ValuesView[_VT_co], Generic[_KT_co, _VT_co]): # undocumented
|
||||
|
||||
@final
|
||||
class dict_items(ItemsView[_KT_co, _VT_co], Generic[_KT_co, _VT_co]): # undocumented
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ...
|
||||
|
@ -11,17 +11,20 @@ _T = TypeVar("_T")
|
||||
|
||||
@final
|
||||
class CallableProxyType(Generic[_C]): # "weakcallableproxy"
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __getattr__(self, attr: str) -> Any: ...
|
||||
__call__: _C
|
||||
|
||||
@final
|
||||
class ProxyType(Generic[_T]): # "weakproxy"
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __getattr__(self, attr: str) -> Any: ...
|
||||
|
||||
class ReferenceType(Generic[_T]):
|
||||
__callback__: Callable[[ReferenceType[_T]], Any]
|
||||
def __new__(cls, __o: _T, __callback: Callable[[ReferenceType[_T]], Any] | None = ...) -> Self: ...
|
||||
def __call__(self) -> _T | None: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
@ -70,6 +70,7 @@ class array(MutableSequence[_T], Generic[_T]):
|
||||
def __setitem__(self, __key: slice, __value: array[_T]) -> None: ...
|
||||
def __delitem__(self, __key: SupportsIndex | slice) -> None: ...
|
||||
def __add__(self, __value: array[_T]) -> array[_T]: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __ge__(self, __value: array[_T]) -> bool: ...
|
||||
def __gt__(self, __value: array[_T]) -> bool: ...
|
||||
def __iadd__(self, __value: array[_T]) -> Self: ... # type: ignore[override]
|
||||
|
@ -1,5 +1,4 @@
|
||||
# This only exists in 3.11+. See VERSIONS.
|
||||
|
||||
import sys
|
||||
from contextvars import Context
|
||||
from types import TracebackType
|
||||
from typing import TypeVar
|
||||
@ -8,7 +7,10 @@ from typing_extensions import Self
|
||||
from . import _CoroutineLike
|
||||
from .tasks import Task
|
||||
|
||||
__all__ = ["TaskGroup"]
|
||||
if sys.version_info >= (3, 12):
|
||||
__all__ = ("TaskGroup",)
|
||||
else:
|
||||
__all__ = ["TaskGroup"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
@ -874,6 +874,8 @@ class memoryview(Sequence[int]):
|
||||
def __contains__(self, __x: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __setitem__(self, __key: slice, __value: ReadableBuffer) -> None: ...
|
||||
@overload
|
||||
@ -941,6 +943,7 @@ class slice:
|
||||
def __init__(self, __stop: Any) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __start: Any, __stop: Any, __step: Any = ...) -> None: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def indices(self, __len: SupportsIndex) -> tuple[int, int, int]: ...
|
||||
|
||||
@ -957,6 +960,8 @@ class tuple(Sequence[_T_co], Generic[_T_co]):
|
||||
def __le__(self, __value: tuple[_T_co, ...]) -> bool: ...
|
||||
def __gt__(self, __value: tuple[_T_co, ...]) -> bool: ...
|
||||
def __ge__(self, __value: tuple[_T_co, ...]) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __add__(self, __value: tuple[_T_co, ...]) -> tuple[_T_co, ...]: ...
|
||||
@overload
|
||||
@ -1045,6 +1050,7 @@ class list(MutableSequence[_T], Generic[_T]):
|
||||
def __ge__(self, __value: list[_T]) -> bool: ...
|
||||
def __lt__(self, __value: list[_T]) -> bool: ...
|
||||
def __le__(self, __value: list[_T]) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
|
||||
|
||||
@ -1097,6 +1103,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __setitem__(self, __key: _KT, __value: _VT) -> None: ...
|
||||
def __delitem__(self, __key: _KT) -> None: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __reversed__(self) -> Iterator[_KT]: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
@ -1151,6 +1158,7 @@ class set(MutableSet[_T], Generic[_T]):
|
||||
def __lt__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __ge__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __gt__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
|
||||
@ -1179,6 +1187,8 @@ class frozenset(AbstractSet[_T_co], Generic[_T_co]):
|
||||
def __lt__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __ge__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __gt__(self, __value: AbstractSet[object]) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
|
||||
|
||||
@ -1204,6 +1214,8 @@ class range(Sequence[int]):
|
||||
def count(self, __value: int) -> int: ...
|
||||
def index(self, __value: int) -> int: ... # type: ignore[override]
|
||||
def __len__(self) -> int: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __contains__(self, __key: object) -> bool: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
@overload
|
||||
|
@ -153,6 +153,7 @@ class UserString(Sequence[UserString]):
|
||||
def __gt__(self, string: str | UserString) -> bool: ...
|
||||
def __ge__(self, string: str | UserString) -> bool: ...
|
||||
def __eq__(self, string: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __contains__(self, char: object) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, index: SupportsIndex | slice) -> Self: ...
|
||||
@ -257,6 +258,7 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
def __le__(self, __value: deque[_T]) -> bool: ...
|
||||
def __gt__(self, __value: deque[_T]) -> bool: ...
|
||||
def __ge__(self, __value: deque[_T]) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
|
||||
|
||||
@ -365,6 +367,7 @@ class OrderedDict(dict[_KT, _VT], Reversible[_KT], Generic[_KT, _VT]):
|
||||
def setdefault(self: OrderedDict[_KT, _T | None], key: _KT, default: None = None) -> _T | None: ...
|
||||
@overload
|
||||
def setdefault(self, key: _KT, default: _VT) -> _VT: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
|
||||
class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]):
|
||||
default_factory: Callable[[], _VT] | None
|
||||
|
@ -18,6 +18,7 @@ class ContextVar(Generic[_T]):
|
||||
def __init__(self, name: str) -> None: ...
|
||||
@overload
|
||||
def __init__(self, name: str, *, default: _T) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@overload
|
||||
@ -60,3 +61,4 @@ class Context(Mapping[ContextVar[Any], Any]):
|
||||
def __getitem__(self, __key: ContextVar[_T]) -> _T: ...
|
||||
def __iter__(self) -> Iterator[ContextVar[Any]]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
|
@ -36,6 +36,7 @@ class timezone(tzinfo):
|
||||
def utcoffset(self, __dt: datetime | None) -> timedelta: ...
|
||||
def dst(self, __dt: datetime | None) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
UTC: timezone
|
||||
@ -87,6 +88,7 @@ class date:
|
||||
def __lt__(self, __value: date) -> bool: ...
|
||||
def __ge__(self, __value: date) -> bool: ...
|
||||
def __gt__(self, __value: date) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __add__(self, __value: timedelta) -> Self: ...
|
||||
def __radd__(self, __value: timedelta) -> Self: ...
|
||||
@ -145,6 +147,7 @@ class time:
|
||||
def __lt__(self, __value: time) -> bool: ...
|
||||
def __ge__(self, __value: time) -> bool: ...
|
||||
def __gt__(self, __value: time) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def isoformat(self, timespec: str = ...) -> str: ...
|
||||
@classmethod
|
||||
@ -219,6 +222,7 @@ class timedelta:
|
||||
def __lt__(self, __value: timedelta) -> bool: ...
|
||||
def __ge__(self, __value: timedelta) -> bool: ...
|
||||
def __gt__(self, __value: timedelta) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
@ -310,6 +314,8 @@ class datetime(date):
|
||||
def __lt__(self, __value: datetime) -> bool: ... # type: ignore[override]
|
||||
def __ge__(self, __value: datetime) -> bool: ... # type: ignore[override]
|
||||
def __gt__(self, __value: datetime) -> bool: ... # type: ignore[override]
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@overload # type: ignore[override]
|
||||
def __sub__(self, __value: timedelta) -> Self: ...
|
||||
|
@ -19,11 +19,11 @@ class Charset:
|
||||
def get_body_encoding(self) -> str | Callable[[Message], None]: ...
|
||||
def get_output_charset(self) -> str | None: ...
|
||||
def header_encode(self, string: str) -> str: ...
|
||||
def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str]: ...
|
||||
def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str | None]: ...
|
||||
@overload
|
||||
def body_encode(self, string: None) -> None: ...
|
||||
@overload
|
||||
def body_encode(self, string: str) -> str: ...
|
||||
def body_encode(self, string: str | bytes) -> str: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, __value: object) -> bool: ...
|
||||
|
||||
|
@ -53,7 +53,7 @@ compat32: Compat32
|
||||
class EmailPolicy(Policy):
|
||||
utf8: bool
|
||||
refold_source: str
|
||||
header_factory: Callable[[str, str], str]
|
||||
header_factory: Callable[[str, Any], Any]
|
||||
content_manager: ContentManager
|
||||
def __init__(
|
||||
self,
|
||||
@ -70,9 +70,9 @@ class EmailPolicy(Policy):
|
||||
content_manager: ContentManager = ...,
|
||||
) -> None: ...
|
||||
def header_source_parse(self, sourcelines: list[str]) -> tuple[str, str]: ...
|
||||
def header_store_parse(self, name: str, value: str) -> tuple[str, str]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> str: ...
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
def header_store_parse(self, name: str, value: Any) -> tuple[str, Any]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> Any: ...
|
||||
def fold(self, name: str, value: str) -> Any: ...
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
|
||||
default: EmailPolicy
|
||||
|
@ -190,6 +190,7 @@ class Enum(metaclass=EnumMeta):
|
||||
# and in practice using `object` here has the same effect as using `Any`.
|
||||
def __new__(cls, value: object) -> Self: ...
|
||||
def __dir__(self) -> list[str]: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __format__(self, format_spec: str) -> str: ...
|
||||
def __reduce_ex__(self, proto: Unused) -> tuple[Any, ...]: ...
|
||||
|
||||
|
@ -148,3 +148,4 @@ class ExtensionFileLoader(importlib.abc.ExecutionLoader):
|
||||
def exec_module(self, module: types.ModuleType) -> None: ...
|
||||
def get_code(self, fullname: str) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
@ -66,6 +66,9 @@ class EntryPoint(_EntryPointBase):
|
||||
extras: list[str] = ...,
|
||||
) -> bool: ... # undocumented
|
||||
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
class EntryPoints(list[EntryPoint]): # use as list is deprecated since 3.10
|
||||
# int argument is deprecated since 3.10
|
||||
|
@ -354,6 +354,7 @@ class Signature:
|
||||
def from_callable(cls, obj: _IntrospectableCallable, *, follow_wrapped: bool = True) -> Self: ...
|
||||
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def get_annotations(
|
||||
@ -413,6 +414,7 @@ class Parameter:
|
||||
annotation: Any = ...,
|
||||
) -> Self: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class BoundArguments:
|
||||
arguments: OrderedDict[str, Any]
|
||||
|
@ -78,6 +78,7 @@ class _BaseNetwork(_IPAddressBase, Container[_A], Iterable[_A], Generic[_A]):
|
||||
def __getitem__(self, n: int) -> _A: ...
|
||||
def __iter__(self) -> Iterator[_A]: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __lt__(self, other: Self) -> bool: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __ge__(self, other: Self) -> bool: ...
|
||||
@ -148,7 +149,10 @@ class _BaseV4:
|
||||
|
||||
class IPv4Address(_BaseV4, _BaseAddress): ...
|
||||
class IPv4Network(_BaseV4, _BaseNetwork[IPv4Address]): ...
|
||||
class IPv4Interface(IPv4Address, _BaseInterface[IPv4Address, IPv4Network]): ...
|
||||
|
||||
class IPv4Interface(IPv4Address, _BaseInterface[IPv4Address, IPv4Network]):
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class _BaseV6:
|
||||
@property
|
||||
@ -169,11 +173,16 @@ class IPv6Address(_BaseV6, _BaseAddress):
|
||||
@property
|
||||
def scope_id(self) -> str | None: ...
|
||||
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
class IPv6Network(_BaseV6, _BaseNetwork[IPv6Address]):
|
||||
@property
|
||||
def is_site_local(self) -> bool: ...
|
||||
|
||||
class IPv6Interface(IPv6Address, _BaseInterface[IPv6Address, IPv6Network]): ...
|
||||
class IPv6Interface(IPv6Address, _BaseInterface[IPv6Address, IPv6Network]):
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
def v4_int_to_packed(address: int) -> bytes: ...
|
||||
def v6_int_to_packed(address: int) -> bytes: ...
|
||||
|
@ -1,4 +1,3 @@
|
||||
import sys
|
||||
from _typeshed import SupportsRead, SupportsWrite
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
@ -7,8 +6,6 @@ from .decoder import JSONDecodeError as JSONDecodeError, JSONDecoder as JSONDeco
|
||||
from .encoder import JSONEncoder as JSONEncoder
|
||||
|
||||
__all__ = ["dump", "dumps", "load", "loads", "JSONDecoder", "JSONDecodeError", "JSONEncoder"]
|
||||
if sys.version_info >= (3, 12):
|
||||
__all__ += ["AttrDict"]
|
||||
|
||||
def dumps(
|
||||
obj: Any,
|
||||
@ -62,9 +59,3 @@ def load(
|
||||
**kwds: Any,
|
||||
) -> Any: ...
|
||||
def detect_encoding(b: bytes | bytearray) -> str: ... # undocumented
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
class AttrDict(dict[str, Any]):
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
|
@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import Any, Protocol
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
@ -10,8 +11,7 @@ else:
|
||||
_ModuleGlobals: TypeAlias = dict[str, Any]
|
||||
_ModuleMetadata: TypeAlias = tuple[int, float | None, list[str], str]
|
||||
|
||||
class _SourceLoader(Protocol):
|
||||
def __call__(self) -> str | None: ...
|
||||
_SourceLoader: TypeAlias = tuple[Callable[[], str | None]]
|
||||
|
||||
cache: dict[str, _SourceLoader | _ModuleMetadata] # undocumented
|
||||
|
||||
|
@ -61,6 +61,7 @@ class Doc:
|
||||
def getdocloc(self, object: object, basedir: str = ...) -> str | None: ...
|
||||
|
||||
class HTMLRepr(Repr):
|
||||
def __init__(self) -> None: ...
|
||||
def escape(self, text: str) -> str: ...
|
||||
def repr(self, object: object) -> str: ...
|
||||
def repr1(self, x: object, level: complex) -> str: ...
|
||||
@ -148,6 +149,7 @@ class HTMLDoc(Doc):
|
||||
def filelink(self, url: str, path: str) -> str: ...
|
||||
|
||||
class TextRepr(Repr):
|
||||
def __init__(self) -> None: ...
|
||||
def repr1(self, x: object, level: complex) -> str: ...
|
||||
def repr_string(self, x: str, level: complex) -> str: ...
|
||||
def repr_str(self, x: str, level: complex) -> str: ...
|
||||
|
@ -175,6 +175,8 @@ class Pattern(Generic[AnyStr]):
|
||||
def subn(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = 0) -> tuple[AnyStr, int]: ...
|
||||
def __copy__(self) -> Pattern[AnyStr]: ...
|
||||
def __deepcopy__(self, __memo: Any) -> Pattern[AnyStr]: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
|
@ -196,6 +196,25 @@ if sys.version_info >= (3, 11):
|
||||
SQLITE_WARNING: int
|
||||
SQLITE_WARNING_AUTOINDEX: int
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
LEGACY_TRANSACTION_CONTROL: int
|
||||
SQLITE_DBCONFIG_DEFENSIVE: int
|
||||
SQLITE_DBCONFIG_DQS_DDL: int
|
||||
SQLITE_DBCONFIG_DQS_DML: int
|
||||
SQLITE_DBCONFIG_ENABLE_FKEY: int
|
||||
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER: int
|
||||
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION: int
|
||||
SQLITE_DBCONFIG_ENABLE_QPSG: int
|
||||
SQLITE_DBCONFIG_ENABLE_TRIGGER: int
|
||||
SQLITE_DBCONFIG_ENABLE_VIEW: int
|
||||
SQLITE_DBCONFIG_LEGACY_ALTER_TABLE: int
|
||||
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT: int
|
||||
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE: int
|
||||
SQLITE_DBCONFIG_RESET_DATABASE: int
|
||||
SQLITE_DBCONFIG_TRIGGER_EQP: int
|
||||
SQLITE_DBCONFIG_TRUSTED_SCHEMA: int
|
||||
SQLITE_DBCONFIG_WRITABLE_SCHEMA: int
|
||||
|
||||
# Can take or return anything depending on what's in the registry.
|
||||
@overload
|
||||
def adapt(__obj: Any, __proto: Any) -> Any: ...
|
||||
@ -214,8 +233,9 @@ def connect(
|
||||
) -> Connection: ...
|
||||
def enable_callback_tracebacks(__enable: bool) -> None: ...
|
||||
|
||||
# takes a pos-or-keyword argument because there is a C wrapper
|
||||
def enable_shared_cache(enable: int) -> None: ...
|
||||
if sys.version_info < (3, 12):
|
||||
# takes a pos-or-keyword argument because there is a C wrapper
|
||||
def enable_shared_cache(enable: int) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
def register_adapter(__type: type[_T], __adapter: _Adapter[_T]) -> None: ...
|
||||
@ -279,6 +299,11 @@ class Connection:
|
||||
isolation_level: str | None # one of '', 'DEFERRED', 'IMMEDIATE' or 'EXCLUSIVE'
|
||||
@property
|
||||
def total_changes(self) -> int: ...
|
||||
if sys.version_info >= (3, 12):
|
||||
@property
|
||||
def autocommit(self) -> int: ...
|
||||
@autocommit.setter
|
||||
def autocommit(self, val: int) -> None: ...
|
||||
row_factory: Any
|
||||
text_factory: Any
|
||||
def __init__(
|
||||
@ -356,6 +381,9 @@ class Connection:
|
||||
def getlimit(self, __category: int) -> int: ...
|
||||
def serialize(self, *, name: str = "main") -> bytes: ...
|
||||
def deserialize(self, __data: ReadableBuffer, *, name: str = "main") -> None: ...
|
||||
if sys.version_info >= (3, 12):
|
||||
def getconfig(self, __op: int) -> bool: ...
|
||||
def setconfig(self, __op: int, __enable: bool = True) -> bool: ...
|
||||
|
||||
def __call__(self, __sql: str) -> _Statement: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
|
@ -485,6 +485,7 @@ class SSLSession:
|
||||
def time(self) -> int: ...
|
||||
@property
|
||||
def timeout(self) -> int: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
|
||||
class SSLErrorNumber(enum.IntEnum):
|
||||
SSL_ERROR_EOF: int
|
||||
|
@ -500,7 +500,7 @@ class Misc:
|
||||
bbox = grid_bbox
|
||||
def grid_columnconfigure(
|
||||
self,
|
||||
index: _GridIndex,
|
||||
index: _GridIndex | list[int] | tuple[int, ...],
|
||||
cnf: _GridIndexInfo = {},
|
||||
*,
|
||||
minsize: _ScreenUnits = ...,
|
||||
@ -510,7 +510,7 @@ class Misc:
|
||||
) -> _GridIndexInfo | Any: ... # can be None but annoying to check
|
||||
def grid_rowconfigure(
|
||||
self,
|
||||
index: _GridIndex,
|
||||
index: _GridIndex | list[int] | tuple[int, ...],
|
||||
cnf: _GridIndexInfo = {},
|
||||
*,
|
||||
minsize: _ScreenUnits = ...,
|
||||
|
@ -961,7 +961,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
master: tkinter.Misc | None = None,
|
||||
*,
|
||||
class_: str = ...,
|
||||
columns: str | list[str] | tuple[str, ...] = ...,
|
||||
columns: str | list[str] | list[int] | list[str | int] | tuple[str | int, ...] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
displaycolumns: str | list[str] | tuple[str, ...] | list[int] | tuple[int, ...] = ...,
|
||||
height: int = ...,
|
||||
@ -983,7 +983,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
self,
|
||||
cnf: dict[str, Any] | None = None,
|
||||
*,
|
||||
columns: str | list[str] | tuple[str, ...] = ...,
|
||||
columns: str | list[str] | list[int] | list[str | int] | tuple[str | int, ...] = ...,
|
||||
cursor: tkinter._Cursor = ...,
|
||||
displaycolumns: str | list[str] | tuple[str, ...] | list[int] | tuple[int, ...] = ...,
|
||||
height: int = ...,
|
||||
|
@ -37,6 +37,7 @@ class Statistic:
|
||||
traceback: Traceback
|
||||
def __init__(self, traceback: Traceback, size: int, count: int) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class StatisticDiff:
|
||||
count: int
|
||||
@ -46,6 +47,7 @@ class StatisticDiff:
|
||||
traceback: Traceback
|
||||
def __init__(self, traceback: Traceback, size: int, size_diff: int, count: int, count_diff: int) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
_FrameTuple: TypeAlias = tuple[str, int]
|
||||
|
||||
@ -56,6 +58,7 @@ class Frame:
|
||||
def lineno(self) -> int: ...
|
||||
def __init__(self, frame: _FrameTuple) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __lt__(self, other: Frame) -> bool: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __gt__(self, other: Frame) -> bool: ...
|
||||
@ -80,6 +83,7 @@ class Trace:
|
||||
def traceback(self) -> Traceback: ...
|
||||
def __init__(self, trace: _TraceTuple) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class Traceback(Sequence[Frame]):
|
||||
if sys.version_info >= (3, 9):
|
||||
@ -97,6 +101,7 @@ class Traceback(Sequence[Frame]):
|
||||
def __contains__(self, frame: Frame) -> bool: ... # type: ignore[override]
|
||||
def __len__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __lt__(self, other: Traceback) -> bool: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __gt__(self, other: Traceback) -> bool: ...
|
||||
|
@ -71,6 +71,7 @@ class _Cell:
|
||||
if sys.version_info >= (3, 8):
|
||||
def __init__(self, __contents: object = ...) -> None: ...
|
||||
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
cell_contents: Any
|
||||
|
||||
@ -113,6 +114,8 @@ LambdaType = FunctionType
|
||||
|
||||
@final
|
||||
class CodeType:
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@property
|
||||
def co_argcount(self) -> int: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@ -326,6 +329,7 @@ class MappingProxyType(Mapping[_KT, _VT_co], Generic[_KT, _VT_co]):
|
||||
class SimpleNamespace:
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __getattribute__(self, __name: str) -> Any: ...
|
||||
def __setattr__(self, __name: str, __value: Any) -> None: ...
|
||||
def __delattr__(self, __name: str) -> None: ...
|
||||
@ -442,6 +446,8 @@ class MethodType:
|
||||
def __qualname__(self) -> str: ... # inherited from the added function
|
||||
def __init__(self, __func: Callable[..., Any], __obj: object) -> None: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
@final
|
||||
class BuiltinFunctionType:
|
||||
@ -452,6 +458,8 @@ class BuiltinFunctionType:
|
||||
@property
|
||||
def __qualname__(self) -> str: ...
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
BuiltinMethodType = BuiltinFunctionType
|
||||
|
||||
@ -479,6 +487,7 @@ class MethodWrapperType:
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __ne__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
@final
|
||||
class MethodDescriptorType:
|
||||
@ -603,6 +612,8 @@ if sys.version_info >= (3, 9):
|
||||
def __parameters__(self) -> tuple[Any, ...]: ...
|
||||
def __init__(self, origin: type, args: Any) -> None: ...
|
||||
def __getitem__(self, __typeargs: Any) -> GenericAlias: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
@property
|
||||
def __unpacked__(self) -> bool: ...
|
||||
@ -626,3 +637,5 @@ if sys.version_info >= (3, 10):
|
||||
def __args__(self) -> tuple[Any, ...]: ...
|
||||
def __or__(self, __value: Any) -> UnionType: ...
|
||||
def __ror__(self, __value: Any) -> UnionType: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
@ -226,12 +226,14 @@ if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def __origin__(self) -> ParamSpec: ...
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
@_final
|
||||
class ParamSpecKwargs:
|
||||
@property
|
||||
def __origin__(self) -> ParamSpec: ...
|
||||
def __init__(self, origin: ParamSpec) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
@_final
|
||||
class ParamSpec:
|
||||
@ -563,6 +565,7 @@ class AbstractSet(Collection[_T_co], Generic[_T_co]):
|
||||
def __or__(self, other: AbstractSet[_T]) -> AbstractSet[_T_co | _T]: ...
|
||||
def __sub__(self, other: AbstractSet[Any]) -> AbstractSet[_T_co]: ...
|
||||
def __xor__(self, other: AbstractSet[_T]) -> AbstractSet[_T_co | _T]: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def isdisjoint(self, other: Iterable[Any]) -> bool: ...
|
||||
|
||||
class MutableSet(AbstractSet[_T], Generic[_T]):
|
||||
|
@ -86,6 +86,7 @@ class TestCase:
|
||||
_testMethodDoc: str
|
||||
def __init__(self, methodName: str = "runTest") -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def setUp(self) -> None: ...
|
||||
def tearDown(self) -> None: ...
|
||||
@classmethod
|
||||
@ -304,6 +305,8 @@ class FunctionTestCase(TestCase):
|
||||
description: str | None = None,
|
||||
) -> None: ...
|
||||
def runTest(self) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
class _AssertRaisesContext(Generic[_E]):
|
||||
exception: _E
|
||||
|
@ -234,6 +234,8 @@ class _patch(Generic[_T]):
|
||||
def copy(self) -> _patch[_T]: ...
|
||||
@overload
|
||||
def __call__(self, func: _TT) -> _TT: ...
|
||||
# If new==DEFAULT, this should add a MagicMock parameter to the function
|
||||
# arguments. See the _patch_default_new class below for this functionality.
|
||||
@overload
|
||||
def __call__(self, func: Callable[_P, _R]) -> Callable[_P, _R]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@ -257,6 +259,22 @@ class _patch(Generic[_T]):
|
||||
def start(self) -> _T: ...
|
||||
def stop(self) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
_Mock: TypeAlias = MagicMock | AsyncMock
|
||||
else:
|
||||
_Mock: TypeAlias = MagicMock
|
||||
|
||||
# This class does not exist at runtime, it's a hack to make this work:
|
||||
# @patch("foo")
|
||||
# def bar(..., mock: MagicMock) -> None: ...
|
||||
class _patch_default_new(_patch[_Mock]):
|
||||
@overload
|
||||
def __call__(self, func: _TT) -> _TT: ...
|
||||
# Can't use the following as ParamSpec is only allowed as last parameter:
|
||||
# def __call__(self, func: Callable[_P, _R]) -> Callable[Concatenate[_P, MagicMock], _R]: ...
|
||||
@overload
|
||||
def __call__(self, func: Callable[..., _R]) -> Callable[..., _R]: ...
|
||||
|
||||
class _patch_dict:
|
||||
in_dict: Any
|
||||
values: Any
|
||||
@ -273,11 +291,8 @@ class _patch_dict:
|
||||
start: Any
|
||||
stop: Any
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
_Mock: TypeAlias = MagicMock | AsyncMock
|
||||
else:
|
||||
_Mock: TypeAlias = MagicMock
|
||||
|
||||
# This class does not exist at runtime, it's a hack to add methods to the
|
||||
# patch() function.
|
||||
class _patcher:
|
||||
TEST_PREFIX: str
|
||||
dict: type[_patch_dict]
|
||||
@ -307,7 +322,7 @@ class _patcher:
|
||||
autospec: Any | None = ...,
|
||||
new_callable: Any | None = ...,
|
||||
**kwargs: Any,
|
||||
) -> _patch[_Mock]: ...
|
||||
) -> _patch_default_new: ...
|
||||
@overload
|
||||
@staticmethod
|
||||
def object( # type: ignore[misc]
|
||||
|
@ -63,6 +63,7 @@ class UUID:
|
||||
def __le__(self, other: UUID) -> bool: ...
|
||||
def __gt__(self, other: UUID) -> bool: ...
|
||||
def __ge__(self, other: UUID) -> bool: ...
|
||||
def __hash__(self) -> builtins.int: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
def getnode() -> int: ...
|
||||
|
@ -45,6 +45,7 @@ class WeakMethod(ref[_CallableT], Generic[_CallableT]):
|
||||
def __call__(self) -> _CallableT | None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class WeakValueDictionary(MutableMapping[_KT, _VT]):
|
||||
@overload
|
||||
|
@ -98,3 +98,4 @@ if sys.platform == "win32":
|
||||
) -> bool | None: ...
|
||||
def Close(self) -> None: ...
|
||||
def Detach(self) -> int: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
@ -142,6 +142,7 @@ class QName:
|
||||
def __gt__(self, other: QName | str) -> bool: ...
|
||||
def __ge__(self, other: QName | str) -> bool: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class ElementTree:
|
||||
def __init__(self, element: Element | None = None, file: _FileRead | None = None) -> None: ...
|
||||
|
@ -3,7 +3,7 @@ from collections.abc import Callable, Iterable, Iterator, MutableMapping, Sequen
|
||||
from enum import IntEnum
|
||||
from pathlib import Path
|
||||
from typing import Any, ClassVar, Protocol, SupportsBytes
|
||||
from typing_extensions import Final, Literal, Self, TypeAlias, TypeGuard
|
||||
from typing_extensions import Literal, Self, TypeAlias, TypeGuard
|
||||
|
||||
from PIL.PyAccess import PyAccess
|
||||
|
||||
@ -39,7 +39,12 @@ class _Writeable(SupportsWrite[bytes], Protocol):
|
||||
class DecompressionBombWarning(RuntimeWarning): ...
|
||||
class DecompressionBombError(Exception): ...
|
||||
|
||||
MAX_IMAGE_PIXELS: Final[int]
|
||||
# Despite the ALL_CAPS spelling, Pillow's docs mention that this threshold can
|
||||
# be altered at runtime. See
|
||||
# https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.open
|
||||
# or the permalink
|
||||
# https://github.com/python-pillow/Pillow/blob/10.0.0/docs/reference/Image.rst?plain=1#L54-L55
|
||||
MAX_IMAGE_PIXELS: int | None
|
||||
|
||||
USE_CFFI_ACCESS: bool
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import ItemsView
|
||||
from typing import Any
|
||||
|
||||
def ignore_ref_siblings(schema) -> list[tuple[str, Any]] | ItemsView[str, Any]: ...
|
||||
def ignore_ref_siblings(schema) -> list[tuple[str, Incomplete]] | ItemsView[str, Incomplete]: ...
|
||||
def dependencies_draft3(validator, dependencies, instance, schema) -> None: ...
|
||||
def dependencies_draft4_draft6_draft7(validator, dependencies, instance, schema) -> None: ...
|
||||
def disallow_draft3(validator, disallow, instance, schema) -> None: ...
|
||||
|
@ -1,6 +1,5 @@
|
||||
from _typeshed import SupportsKeysAndGetItem
|
||||
from _typeshed import Incomplete, SupportsKeysAndGetItem
|
||||
from collections.abc import Generator, Iterable, Iterator, Mapping, MutableMapping, Sized
|
||||
from typing import Any
|
||||
|
||||
class URIDict(MutableMapping[str, str]):
|
||||
def normalize(self, uri: str) -> str: ...
|
||||
@ -16,11 +15,13 @@ class Unset: ...
|
||||
|
||||
def load_schema(name): ...
|
||||
def format_as_index(container: str, indices) -> str: ...
|
||||
def find_additional_properties(instance: Iterable[Any], schema: Mapping[Any, Any]) -> Generator[Any, None, None]: ...
|
||||
def extras_msg(extras: Iterable[Any] | Sized) -> str: ...
|
||||
def ensure_list(thing) -> list[Any]: ...
|
||||
def find_additional_properties(
|
||||
instance: Iterable[Incomplete], schema: Mapping[Incomplete, Incomplete]
|
||||
) -> Generator[Incomplete, None, None]: ...
|
||||
def extras_msg(extras: Iterable[Incomplete] | Sized) -> str: ...
|
||||
def ensure_list(thing) -> list[Incomplete]: ...
|
||||
def equal(one, two) -> bool: ...
|
||||
def unbool(element, true=..., false=...): ...
|
||||
def uniq(container) -> bool: ...
|
||||
def find_evaluated_item_indexes_by_schema(validator, instance, schema) -> list[Any]: ...
|
||||
def find_evaluated_property_keys_by_schema(validator, instance, schema) -> list[Any]: ...
|
||||
def find_evaluated_item_indexes_by_schema(validator, instance, schema) -> list[Incomplete]: ...
|
||||
def find_evaluated_property_keys_by_schema(validator, instance, schema) -> list[Incomplete]: ...
|
||||
|
@ -1,4 +1,4 @@
|
||||
from typing import Any
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class _CannotLoadFile(Exception): ...
|
||||
|
||||
@ -25,7 +25,7 @@ class _PlainFormatter:
|
||||
def validation_error(self, instance_path, error): ...
|
||||
def validation_success(self, instance_path): ...
|
||||
|
||||
parser: Any
|
||||
parser: Incomplete
|
||||
|
||||
def parse_args(args): ...
|
||||
def main(args=...) -> None: ...
|
||||
|
@ -1,7 +1,6 @@
|
||||
from _typeshed import Incomplete, SupportsRichComparison
|
||||
from collections import deque
|
||||
from collections.abc import Callable, Container, Iterable, Sequence
|
||||
from typing import Any
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
from jsonschema import _utils, protocols
|
||||
@ -21,9 +20,9 @@ class _Error(Exception):
|
||||
context: list[ValidationError] | None
|
||||
cause: Exception | None
|
||||
validator: protocols.Validator | None
|
||||
validator_value: Any
|
||||
instance: Any
|
||||
schema: Any
|
||||
validator_value: Incomplete
|
||||
instance: Incomplete
|
||||
schema: Incomplete
|
||||
parent: _Error | None
|
||||
def __init__(
|
||||
self,
|
||||
@ -33,8 +32,8 @@ class _Error(Exception):
|
||||
cause: Incomplete | None = None,
|
||||
context: Sequence[ValidationError] = (),
|
||||
validator_value=...,
|
||||
instance: Any = ...,
|
||||
schema: Any = ...,
|
||||
instance: Incomplete = ...,
|
||||
schema: Incomplete = ...,
|
||||
schema_path: Sequence[str | int] = (),
|
||||
parent: _Error | None = None,
|
||||
type_checker: _utils.Unset | TypeChecker = ...,
|
||||
@ -49,7 +48,7 @@ class _Error(Exception):
|
||||
def json_path(self) -> str: ...
|
||||
# TODO: this type could be made more precise using TypedDict to
|
||||
# enumerate the types of the members
|
||||
def _contents(self) -> dict[str, Any]: ...
|
||||
def _contents(self) -> dict[str, Incomplete]: ...
|
||||
|
||||
class ValidationError(_Error): ...
|
||||
class SchemaError(_Error): ...
|
||||
@ -58,22 +57,22 @@ class RefResolutionError(Exception):
|
||||
def __init__(self, cause: str) -> None: ...
|
||||
|
||||
class UndefinedTypeCheck(Exception):
|
||||
type: Any
|
||||
type: Incomplete
|
||||
def __init__(self, type) -> None: ...
|
||||
|
||||
class UnknownType(Exception):
|
||||
type: Any
|
||||
instance: Any
|
||||
schema: Any
|
||||
type: Incomplete
|
||||
instance: Incomplete
|
||||
schema: Incomplete
|
||||
def __init__(self, type, instance, schema) -> None: ...
|
||||
|
||||
class FormatError(Exception):
|
||||
message: Any
|
||||
cause: Any
|
||||
message: Incomplete
|
||||
cause: Incomplete
|
||||
def __init__(self, message, cause: Incomplete | None = None) -> None: ...
|
||||
|
||||
class ErrorTree:
|
||||
errors: Any
|
||||
errors: Incomplete
|
||||
def __init__(self, errors=()) -> None: ...
|
||||
def __contains__(self, index): ...
|
||||
def __getitem__(self, index): ...
|
||||
|
@ -1,5 +1,6 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Iterator, Mapping, Sequence
|
||||
from typing import Any, ClassVar, Protocol
|
||||
from typing import ClassVar, Protocol
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from jsonschema._format import FormatChecker
|
||||
@ -10,16 +11,19 @@ from jsonschema.validators import RefResolver
|
||||
_JsonParameter: TypeAlias = str | int | float | bool | None | Mapping[str, _JsonParameter] | Sequence[_JsonParameter]
|
||||
|
||||
class Validator(Protocol):
|
||||
META_SCHEMA: ClassVar[dict[Any, Any]]
|
||||
VALIDATORS: ClassVar[dict[Any, Any]]
|
||||
META_SCHEMA: ClassVar[dict[Incomplete, Incomplete]]
|
||||
VALIDATORS: ClassVar[dict[Incomplete, Incomplete]]
|
||||
TYPE_CHECKER: ClassVar[TypeChecker]
|
||||
FORMAT_CHECKER: ClassVar[FormatChecker]
|
||||
schema: dict[Any, Any] | bool
|
||||
schema: dict[Incomplete, Incomplete] | bool
|
||||
def __init__(
|
||||
self, schema: dict[Any, Any] | bool, resolver: RefResolver | None = None, format_checker: FormatChecker | None = None
|
||||
self,
|
||||
schema: dict[Incomplete, Incomplete] | bool,
|
||||
resolver: RefResolver | None = None,
|
||||
format_checker: FormatChecker | None = None,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def check_schema(cls, schema: dict[Any, Any]) -> None: ...
|
||||
def check_schema(cls, schema: dict[Incomplete, Incomplete]) -> None: ...
|
||||
def is_type(self, instance: _JsonParameter, type: str) -> bool: ...
|
||||
def is_valid(self, instance: _JsonParameter) -> bool: ...
|
||||
def iter_errors(self, instance: _JsonParameter) -> Iterator[ValidationError]: ...
|
||||
|
@ -19,28 +19,28 @@ _Schema: TypeAlias = Mapping[str, Any]
|
||||
# This class does not exist at runtime. Compatible classes are created at
|
||||
# runtime by create().
|
||||
class _Validator:
|
||||
VALIDATORS: ClassVar[dict[Any, Any]]
|
||||
META_SCHEMA: ClassVar[dict[Any, Any]]
|
||||
TYPE_CHECKER: ClassVar[Any]
|
||||
FORMAT_CHECKER: ClassVar[Any]
|
||||
VALIDATORS: ClassVar[dict[Incomplete, Incomplete]]
|
||||
META_SCHEMA: ClassVar[dict[Incomplete, Incomplete]]
|
||||
TYPE_CHECKER: ClassVar[Incomplete]
|
||||
FORMAT_CHECKER: ClassVar[Incomplete]
|
||||
@staticmethod
|
||||
def ID_OF(schema: _Schema) -> str: ...
|
||||
schema: _Schema
|
||||
resolver: Any
|
||||
format_checker: Any
|
||||
evolve: Any
|
||||
resolver: Incomplete
|
||||
format_checker: Incomplete
|
||||
evolve: Incomplete
|
||||
def __init__(self, schema: _Schema, resolver: Incomplete | None = ..., format_checker: Incomplete | None = ...) -> None: ...
|
||||
@classmethod
|
||||
def check_schema(cls, schema: _Schema, format_checker: FormatChecker | Unset = ...) -> None: ...
|
||||
def iter_errors(self, instance, _schema: _Schema | None = ...) -> Generator[Any, None, None]: ...
|
||||
def iter_errors(self, instance, _schema: _Schema | None = ...) -> Generator[Incomplete, None, None]: ...
|
||||
def descend(
|
||||
self, instance, schema: _Schema, path: Incomplete | None = ..., schema_path: Incomplete | None = ...
|
||||
) -> Generator[Any, None, None]: ...
|
||||
) -> Generator[Incomplete, None, None]: ...
|
||||
def validate(self, *args, **kwargs) -> None: ...
|
||||
def is_type(self, instance, type): ...
|
||||
def is_valid(self, instance, _schema: _Schema | None = ...) -> bool: ...
|
||||
|
||||
def validates(version: str) -> Callable[..., Any]: ...
|
||||
def validates(version: str) -> Callable[..., Incomplete]: ...
|
||||
def create(
|
||||
meta_schema: _Schema,
|
||||
validators: Mapping[str, _ValidatorCallback] | tuple[()] = (),
|
||||
@ -66,17 +66,17 @@ class Draft7Validator(_Validator): ...
|
||||
class Draft201909Validator(_Validator): ...
|
||||
class Draft202012Validator(_Validator): ...
|
||||
|
||||
_Handler: TypeAlias = Callable[[str], Any]
|
||||
_Handler: TypeAlias = Callable[[str], Incomplete]
|
||||
|
||||
class RefResolver:
|
||||
referrer: dict[str, Any]
|
||||
cache_remote: Any
|
||||
referrer: dict[str, Incomplete]
|
||||
cache_remote: Incomplete
|
||||
handlers: dict[str, _Handler]
|
||||
store: URIDict
|
||||
def __init__(
|
||||
self,
|
||||
base_uri: str,
|
||||
referrer: dict[str, Any],
|
||||
referrer: dict[str, Incomplete],
|
||||
store: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]] = ...,
|
||||
cache_remote: bool = True,
|
||||
handlers: SupportsKeysAndGetItem[str, _Handler] | Iterable[tuple[str, _Handler]] = (),
|
||||
|
@ -9,7 +9,7 @@ from re import Pattern
|
||||
from typing import IO, Any, ClassVar, Protocol, TypeVar, overload, type_check_only
|
||||
from typing_extensions import Literal, Self, TypeAlias
|
||||
|
||||
_Version: TypeAlias = Incomplete # from packaging.version
|
||||
from ._vendor.packaging import requirements as packaging_requirements, version as packaging_version
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_D = TypeVar("_D", bound=Distribution)
|
||||
@ -83,16 +83,14 @@ class Environment:
|
||||
|
||||
def parse_requirements(strs: str | Iterable[str]) -> Generator[Requirement, None, None]: ...
|
||||
|
||||
class Requirement:
|
||||
class RequirementParseError(packaging_requirements.InvalidRequirement): ...
|
||||
|
||||
class Requirement(packaging_requirements.Requirement):
|
||||
unsafe_name: str
|
||||
project_name: str
|
||||
key: str
|
||||
extras: tuple[str, ...]
|
||||
extras: tuple[str, ...] # type: ignore[assignment] # incompatible override of attribute on base class
|
||||
specs: list[tuple[str, str]]
|
||||
url: str | None
|
||||
# TODO: change this to packaging.markers.Marker | None once we can import
|
||||
# packaging.markers
|
||||
marker: Incomplete | None
|
||||
def __init__(self, requirement_string: str) -> None: ...
|
||||
@staticmethod
|
||||
def parse(s: str | Iterable[str]) -> Requirement: ...
|
||||
@ -268,7 +266,7 @@ class Distribution(NullProvider):
|
||||
@property
|
||||
def version(self) -> str: ...
|
||||
@property
|
||||
def parsed_version(self) -> tuple[str, ...]: ...
|
||||
def parsed_version(self) -> packaging_version.Version: ...
|
||||
py_version: str
|
||||
platform: str | None
|
||||
precedence: int
|
||||
@ -339,7 +337,7 @@ class FileMetadata(EmptyProvider):
|
||||
|
||||
class PEP440Warning(RuntimeWarning): ...
|
||||
|
||||
parse_version = _Version
|
||||
parse_version = packaging_version.Version
|
||||
|
||||
def yield_lines(iterable: _NestedStr) -> Generator[str, None, None]: ...
|
||||
def split_sections(s: _NestedStr) -> Generator[tuple[str | None, list[str]], None, None]: ...
|
||||
|
@ -0,0 +1,8 @@
|
||||
__title__: str
|
||||
__summary__: str
|
||||
__uri__: str
|
||||
__version__: str
|
||||
__author__: str
|
||||
__email__: str
|
||||
__license__: str
|
||||
__copyright__: str
|
@ -0,0 +1,13 @@
|
||||
__all__ = ["InvalidMarker", "UndefinedComparison", "UndefinedEnvironmentName", "Marker", "default_environment"]
|
||||
|
||||
class InvalidMarker(ValueError): ...
|
||||
class UndefinedComparison(ValueError): ...
|
||||
class UndefinedEnvironmentName(ValueError): ...
|
||||
|
||||
def default_environment() -> dict[str, str]: ...
|
||||
|
||||
class Marker:
|
||||
def __init__(self, marker: str) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def evaluate(self, environment: dict[str, str] | None = None) -> bool: ...
|
@ -0,0 +1,14 @@
|
||||
from .markers import Marker
|
||||
from .specifiers import SpecifierSet
|
||||
|
||||
class InvalidRequirement(ValueError): ...
|
||||
|
||||
class Requirement:
|
||||
name: str
|
||||
url: str | None
|
||||
extras: set[str]
|
||||
specifier: SpecifierSet
|
||||
marker: Marker | None
|
||||
def __init__(self, requirement_str: str) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
@ -0,0 +1,66 @@
|
||||
import abc
|
||||
from collections.abc import Iterable, Iterator
|
||||
from typing import TypeVar
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from .version import Version
|
||||
|
||||
# These exist at runtime, hence the public names
|
||||
UnparsedVersion: TypeAlias = Version | str
|
||||
UnparsedVersionVar = TypeVar("UnparsedVersionVar", bound=UnparsedVersion) # noqa: Y001
|
||||
|
||||
class InvalidSpecifier(ValueError): ...
|
||||
|
||||
class BaseSpecifier(metaclass=abc.ABCMeta):
|
||||
@abc.abstractmethod
|
||||
def __str__(self) -> str: ...
|
||||
@abc.abstractmethod
|
||||
def __hash__(self) -> int: ...
|
||||
@abc.abstractmethod
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
@property
|
||||
@abc.abstractmethod
|
||||
def prereleases(self) -> bool | None: ...
|
||||
@prereleases.setter
|
||||
def prereleases(self, value: bool) -> None: ...
|
||||
@abc.abstractmethod
|
||||
def contains(self, item: str, prereleases: bool | None = None) -> bool: ...
|
||||
@abc.abstractmethod
|
||||
def filter(self, iterable: Iterable[UnparsedVersionVar], prereleases: bool | None = None) -> Iterator[UnparsedVersionVar]: ...
|
||||
|
||||
class Specifier(BaseSpecifier):
|
||||
def __init__(self, spec: str = "", prereleases: bool | None = None) -> None: ...
|
||||
@property # type: ignore[override]
|
||||
def prereleases(self) -> bool: ...
|
||||
@prereleases.setter
|
||||
def prereleases(self, value: bool) -> None: ...
|
||||
@property
|
||||
def operator(self) -> str: ...
|
||||
@property
|
||||
def version(self) -> str: ...
|
||||
def __str__(self) -> str: ... # noqa: Y029 # needed as it's abstract on the superclass
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __contains__(self, item: Version | str) -> bool: ...
|
||||
def contains(self, item: UnparsedVersion, prereleases: bool | None = None) -> bool: ...
|
||||
def filter(self, iterable: Iterable[UnparsedVersionVar], prereleases: bool | None = None) -> Iterator[UnparsedVersionVar]: ...
|
||||
|
||||
class SpecifierSet(BaseSpecifier):
|
||||
def __init__(self, spec: str = "", prereleases: bool | None = None) -> None: ...
|
||||
@property
|
||||
def prereleases(self) -> bool | None: ...
|
||||
@prereleases.setter
|
||||
def prereleases(self, value: bool) -> None: ...
|
||||
@property
|
||||
def operator(self) -> str: ...
|
||||
@property
|
||||
def version(self) -> str: ...
|
||||
def __str__(self) -> str: ... # noqa: Y029 # needed as it's abstract on the superclass
|
||||
def __hash__(self) -> int: ...
|
||||
def __and__(self, other: SpecifierSet | str) -> SpecifierSet: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[Specifier]: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __contains__(self, item: UnparsedVersion) -> bool: ...
|
||||
def contains(self, item: UnparsedVersion, prereleases: bool | None = None, installed: bool | None = None) -> bool: ...
|
||||
def filter(self, iterable: Iterable[UnparsedVersionVar], prereleases: bool | None = None) -> Iterator[UnparsedVersionVar]: ...
|
@ -0,0 +1,49 @@
|
||||
from typing_extensions import Final
|
||||
|
||||
__all__ = ["VERSION_PATTERN", "parse", "Version", "InvalidVersion"]
|
||||
|
||||
def parse(version: str) -> Version: ...
|
||||
|
||||
class InvalidVersion(ValueError): ...
|
||||
|
||||
VERSION_PATTERN: Final[str]
|
||||
|
||||
class _BaseVersion:
|
||||
def __hash__(self) -> int: ...
|
||||
def __lt__(self, other: _BaseVersion) -> bool: ...
|
||||
def __le__(self, other: _BaseVersion) -> bool: ...
|
||||
def __ge__(self, other: _BaseVersion) -> bool: ...
|
||||
def __gt__(self, other: _BaseVersion) -> bool: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
|
||||
class Version(_BaseVersion):
|
||||
def __init__(self, version: str) -> None: ...
|
||||
@property
|
||||
def epoch(self) -> int: ...
|
||||
@property
|
||||
def release(self) -> tuple[int, ...]: ...
|
||||
@property
|
||||
def pre(self) -> tuple[str, int] | None: ...
|
||||
@property
|
||||
def post(self) -> int | None: ...
|
||||
@property
|
||||
def dev(self) -> int | None: ...
|
||||
@property
|
||||
def local(self) -> str | None: ...
|
||||
@property
|
||||
def public(self) -> str: ...
|
||||
@property
|
||||
def base_version(self) -> str: ...
|
||||
@property
|
||||
def is_prerelease(self) -> bool: ...
|
||||
@property
|
||||
def is_postrelease(self) -> bool: ...
|
||||
@property
|
||||
def is_devrelease(self) -> bool: ...
|
||||
@property
|
||||
def major(self) -> int: ...
|
||||
@property
|
||||
def minor(self) -> int: ...
|
||||
@property
|
||||
def micro(self) -> int: ...
|
@ -46,6 +46,7 @@ from stripe.api_resources.login_link import LoginLink as LoginLink
|
||||
from stripe.api_resources.mandate import Mandate as Mandate
|
||||
from stripe.api_resources.order import Order as Order
|
||||
from stripe.api_resources.payment_intent import PaymentIntent as PaymentIntent
|
||||
from stripe.api_resources.payment_link import PaymentLink as PaymentLink
|
||||
from stripe.api_resources.payment_method import PaymentMethod as PaymentMethod
|
||||
from stripe.api_resources.payout import Payout as Payout
|
||||
from stripe.api_resources.person import Person as Person
|
||||
|
@ -0,0 +1,24 @@
|
||||
from typing import overload
|
||||
|
||||
from stripe.api_resources.abstract import (
|
||||
CreateableAPIResource as CreateableAPIResource,
|
||||
ListableAPIResource as ListableAPIResource,
|
||||
UpdateableAPIResource as UpdateableAPIResource,
|
||||
)
|
||||
|
||||
class PaymentLink(CreateableAPIResource, ListableAPIResource, UpdateableAPIResource):
|
||||
OBJECT_NAME: str
|
||||
|
||||
@overload
|
||||
@classmethod
|
||||
def list_line_items(
|
||||
cls,
|
||||
payment_link: str,
|
||||
api_key: str | None = None,
|
||||
stripe_version: str | None = None,
|
||||
stripe_account: str | None = None,
|
||||
**params,
|
||||
): ...
|
||||
@overload
|
||||
@classmethod
|
||||
def list_line_items(cls, idempotency_key: str | None = None, **params): ...
|
Loading…
Reference in New Issue
Block a user