diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/__future__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/__future__.pyi deleted file mode 100644 index a90cf1edda..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/__future__.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from typing_extensions import TypeAlias - -_VersionInfo: TypeAlias = tuple[int, int, int, str, int] - -class _Feature: - def __init__(self, optionalRelease: _VersionInfo, mandatoryRelease: _VersionInfo | None, compiler_flag: int) -> None: ... - def getOptionalRelease(self) -> _VersionInfo: ... - def getMandatoryRelease(self) -> _VersionInfo | None: ... - compiler_flag: int - -absolute_import: _Feature -division: _Feature -generators: _Feature -nested_scopes: _Feature -print_function: _Feature -unicode_literals: _Feature -with_statement: _Feature -barry_as_FLUFL: _Feature -generator_stop: _Feature -annotations: _Feature - -all_feature_names: list[str] # undocumented - -__all__ = [ - "all_feature_names", - "absolute_import", - "division", - "generators", - "nested_scopes", - "print_function", - "unicode_literals", - "with_statement", - "barry_as_FLUFL", - "generator_stop", - "annotations", -] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/__main__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/__main__.pyi deleted file mode 100644 index e27843e533..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/__main__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Any - -def __getattr__(name: str) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_ast.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_ast.pyi deleted file mode 100644 index bc0ebd9d8a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_ast.pyi +++ /dev/null @@ -1,138 +0,0 @@ -import sys -from ast import ( - AST as AST, - Add as Add, - And as And, - AnnAssign as AnnAssign, - Assert as Assert, - Assign as Assign, - AsyncFor as AsyncFor, - AsyncFunctionDef as AsyncFunctionDef, - AsyncWith as AsyncWith, - Attribute as Attribute, - AugAssign as AugAssign, - Await as Await, - BinOp as BinOp, - BitAnd as BitAnd, - BitOr as BitOr, - BitXor as BitXor, - BoolOp as BoolOp, - Break as Break, - Call as Call, - ClassDef as ClassDef, - Compare as Compare, - Constant as Constant, - Continue as Continue, - Del as Del, - Delete as Delete, - Dict as Dict, - DictComp as DictComp, - Div as Div, - Eq as Eq, - ExceptHandler as ExceptHandler, - Expr as Expr, - Expression as Expression, - FloorDiv as FloorDiv, - For as For, - FormattedValue as FormattedValue, - FunctionDef as FunctionDef, - FunctionType as FunctionType, - GeneratorExp as GeneratorExp, - Global as Global, - Gt as Gt, - GtE as GtE, - If as If, - IfExp as IfExp, - Import as Import, - ImportFrom as ImportFrom, - In as In, - Interactive as Interactive, - Invert as Invert, - Is as Is, - IsNot as IsNot, - JoinedStr as JoinedStr, - Lambda as Lambda, - List as List, - ListComp as ListComp, - Load as Load, - LShift as LShift, - Lt as Lt, - LtE as LtE, - MatMult as MatMult, - Mod as Mod, - Module as Module, - Mult as Mult, - Name as Name, - NamedExpr as NamedExpr, - Nonlocal as Nonlocal, - Not as Not, - NotEq as NotEq, - NotIn as NotIn, - Or as Or, - Pass as Pass, - Pow as Pow, - Raise as Raise, - Return as Return, - RShift as RShift, - Set as Set, - SetComp as SetComp, - Slice as Slice, - Starred as Starred, - Store as Store, - Sub as Sub, - Subscript as Subscript, - Try as Try, - Tuple as Tuple, - TypeIgnore as TypeIgnore, - UAdd as UAdd, - UnaryOp as UnaryOp, - USub as USub, - While as While, - With as With, - Yield as Yield, - YieldFrom as YieldFrom, - alias as alias, - arg as arg, - arguments as arguments, - boolop as boolop, - cmpop as cmpop, - comprehension as comprehension, - excepthandler as excepthandler, - expr as expr, - expr_context as expr_context, - keyword as keyword, - mod as mod, - operator as operator, - stmt as stmt, - type_ignore as type_ignore, - unaryop as unaryop, - withitem as withitem, -) -from typing import Literal - -if sys.version_info >= (3, 12): - from ast import ParamSpec as ParamSpec, TypeVar as TypeVar, TypeVarTuple as TypeVarTuple, type_param as type_param - -if sys.version_info >= (3, 11): - from ast import TryStar as TryStar - -if sys.version_info >= (3, 10): - from ast import ( - MatchAs as MatchAs, - MatchClass as MatchClass, - MatchMapping as MatchMapping, - MatchOr as MatchOr, - MatchSequence as MatchSequence, - MatchSingleton as MatchSingleton, - MatchStar as MatchStar, - MatchValue as MatchValue, - match_case as match_case, - pattern as pattern, - ) - -PyCF_ALLOW_TOP_LEVEL_AWAIT: Literal[8192] -PyCF_ONLY_AST: Literal[1024] -PyCF_TYPE_COMMENTS: Literal[4096] - -if sys.version_info >= (3, 13): - PyCF_OPTIMIZED_AST: Literal[33792] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_asyncio.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_asyncio.pyi deleted file mode 100644 index be486fddb1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_asyncio.pyi +++ /dev/null @@ -1,105 +0,0 @@ -import sys -from asyncio.events import AbstractEventLoop -from collections.abc import Awaitable, Callable, Coroutine, Generator -from contextvars import Context -from types import FrameType, GenericAlias -from typing import Any, Literal, TextIO, TypeVar -from typing_extensions import Self, TypeAlias - -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True) -_TaskYieldType: TypeAlias = Future[object] | None - -class Future(Awaitable[_T]): - _state: str - @property - def _exception(self) -> BaseException | None: ... - _blocking: bool - @property - def _log_traceback(self) -> bool: ... - @_log_traceback.setter - def _log_traceback(self, val: Literal[False]) -> None: ... - _asyncio_future_blocking: bool # is a part of duck-typing contract for `Future` - def __init__(self, *, loop: AbstractEventLoop | None = ...) -> None: ... - def __del__(self) -> None: ... - def get_loop(self) -> AbstractEventLoop: ... - @property - def _callbacks(self) -> list[tuple[Callable[[Self], Any], Context]]: ... - def add_done_callback(self, fn: Callable[[Self], object], /, *, context: Context | None = None) -> None: ... - def cancel(self, msg: Any | None = None) -> bool: ... - def cancelled(self) -> bool: ... - def done(self) -> bool: ... - def result(self) -> _T: ... - def exception(self) -> BaseException | None: ... - def remove_done_callback(self, fn: Callable[[Self], object], /) -> int: ... - def set_result(self, result: _T, /) -> None: ... - def set_exception(self, exception: type | BaseException, /) -> None: ... - def __iter__(self) -> Generator[Any, None, _T]: ... - def __await__(self) -> Generator[Any, None, _T]: ... - @property - def _loop(self) -> AbstractEventLoop: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -if sys.version_info >= (3, 12): - _TaskCompatibleCoro: TypeAlias = Coroutine[Any, Any, _T_co] -else: - _TaskCompatibleCoro: TypeAlias = Generator[_TaskYieldType, None, _T_co] | Coroutine[Any, Any, _T_co] - -# mypy and pyright complain that a subclass of an invariant class shouldn't be covariant. -# While this is true in general, here it's sort-of okay to have a covariant subclass, -# since the only reason why `asyncio.Future` is invariant is the `set_result()` method, -# and `asyncio.Task.set_result()` always raises. -class Task(Future[_T_co]): # type: ignore[type-var] # pyright: ignore[reportInvalidTypeArguments] - if sys.version_info >= (3, 12): - def __init__( - self, - coro: _TaskCompatibleCoro[_T_co], - *, - loop: AbstractEventLoop | None = None, - name: str | None = ..., - context: Context | None = None, - eager_start: bool = False, - ) -> None: ... - elif sys.version_info >= (3, 11): - def __init__( - self, - coro: _TaskCompatibleCoro[_T_co], - *, - loop: AbstractEventLoop | None = None, - name: str | None = ..., - context: Context | None = None, - ) -> None: ... - else: - def __init__( - self, coro: _TaskCompatibleCoro[_T_co], *, loop: AbstractEventLoop | None = None, name: str | None = ... - ) -> None: ... - - if sys.version_info >= (3, 12): - def get_coro(self) -> _TaskCompatibleCoro[_T_co] | None: ... - else: - def get_coro(self) -> _TaskCompatibleCoro[_T_co]: ... - - def get_name(self) -> str: ... - def set_name(self, value: object, /) -> None: ... - if sys.version_info >= (3, 12): - def get_context(self) -> Context: ... - - def get_stack(self, *, limit: int | None = None) -> list[FrameType]: ... - def print_stack(self, *, limit: int | None = None, file: TextIO | None = None) -> None: ... - if sys.version_info >= (3, 11): - def cancelling(self) -> int: ... - def uncancel(self) -> int: ... - - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -def get_event_loop() -> AbstractEventLoop: ... -def get_running_loop() -> AbstractEventLoop: ... -def _set_running_loop(loop: AbstractEventLoop | None, /) -> None: ... -def _get_running_loop() -> AbstractEventLoop: ... -def _register_task(task: Task[Any]) -> None: ... -def _unregister_task(task: Task[Any]) -> None: ... -def _enter_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ... -def _leave_task(loop: AbstractEventLoop, task: Task[Any]) -> None: ... - -if sys.version_info >= (3, 12): - def current_task(loop: AbstractEventLoop | None = None) -> Task[Any] | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_bisect.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_bisect.pyi deleted file mode 100644 index 58488e3d15..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_bisect.pyi +++ /dev/null @@ -1,84 +0,0 @@ -import sys -from _typeshed import SupportsLenAndGetItem, SupportsRichComparisonT -from collections.abc import Callable, MutableSequence -from typing import TypeVar, overload - -_T = TypeVar("_T") - -if sys.version_info >= (3, 10): - @overload - def bisect_left( - a: SupportsLenAndGetItem[SupportsRichComparisonT], - x: SupportsRichComparisonT, - lo: int = 0, - hi: int | None = None, - *, - key: None = None, - ) -> int: ... - @overload - def bisect_left( - a: SupportsLenAndGetItem[_T], - x: SupportsRichComparisonT, - lo: int = 0, - hi: int | None = None, - *, - key: Callable[[_T], SupportsRichComparisonT], - ) -> int: ... - @overload - def bisect_right( - a: SupportsLenAndGetItem[SupportsRichComparisonT], - x: SupportsRichComparisonT, - lo: int = 0, - hi: int | None = None, - *, - key: None = None, - ) -> int: ... - @overload - def bisect_right( - a: SupportsLenAndGetItem[_T], - x: SupportsRichComparisonT, - lo: int = 0, - hi: int | None = None, - *, - key: Callable[[_T], SupportsRichComparisonT], - ) -> int: ... - @overload - def insort_left( - a: MutableSequence[SupportsRichComparisonT], - x: SupportsRichComparisonT, - lo: int = 0, - hi: int | None = None, - *, - key: None = None, - ) -> None: ... - @overload - def insort_left( - a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] - ) -> None: ... - @overload - def insort_right( - a: MutableSequence[SupportsRichComparisonT], - x: SupportsRichComparisonT, - lo: int = 0, - hi: int | None = None, - *, - key: None = None, - ) -> None: ... - @overload - def insort_right( - a: MutableSequence[_T], x: _T, lo: int = 0, hi: int | None = None, *, key: Callable[[_T], SupportsRichComparisonT] - ) -> None: ... - -else: - def bisect_left( - a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None - ) -> int: ... - def bisect_right( - a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None - ) -> int: ... - def insort_left( - a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None - ) -> None: ... - def insort_right( - a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_blake2.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_blake2.pyi deleted file mode 100644 index d578df55c2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_blake2.pyi +++ /dev/null @@ -1,76 +0,0 @@ -from _typeshed import ReadableBuffer -from typing import ClassVar, final -from typing_extensions import Self - -BLAKE2B_MAX_DIGEST_SIZE: int = 64 -BLAKE2B_MAX_KEY_SIZE: int = 64 -BLAKE2B_PERSON_SIZE: int = 16 -BLAKE2B_SALT_SIZE: int = 16 -BLAKE2S_MAX_DIGEST_SIZE: int = 32 -BLAKE2S_MAX_KEY_SIZE: int = 32 -BLAKE2S_PERSON_SIZE: int = 8 -BLAKE2S_SALT_SIZE: int = 8 - -@final -class blake2b: - MAX_DIGEST_SIZE: ClassVar[int] = 64 - MAX_KEY_SIZE: ClassVar[int] = 64 - PERSON_SIZE: ClassVar[int] = 16 - SALT_SIZE: ClassVar[int] = 16 - block_size: int - digest_size: int - name: str - def __new__( - cls, - data: ReadableBuffer = b"", - /, - *, - digest_size: int = 64, - key: ReadableBuffer = b"", - salt: ReadableBuffer = b"", - person: ReadableBuffer = b"", - fanout: int = 1, - depth: int = 1, - leaf_size: int = 0, - node_offset: int = 0, - node_depth: int = 0, - inner_size: int = 0, - last_node: bool = False, - usedforsecurity: bool = True, - ) -> Self: ... - def copy(self) -> Self: ... - def digest(self) -> bytes: ... - def hexdigest(self) -> str: ... - def update(self, data: ReadableBuffer, /) -> None: ... - -@final -class blake2s: - MAX_DIGEST_SIZE: ClassVar[int] = 32 - MAX_KEY_SIZE: ClassVar[int] = 32 - PERSON_SIZE: ClassVar[int] = 8 - SALT_SIZE: ClassVar[int] = 8 - block_size: int - digest_size: int - name: str - def __new__( - cls, - data: ReadableBuffer = b"", - /, - *, - digest_size: int = 32, - key: ReadableBuffer = b"", - salt: ReadableBuffer = b"", - person: ReadableBuffer = b"", - fanout: int = 1, - depth: int = 1, - leaf_size: int = 0, - node_offset: int = 0, - node_depth: int = 0, - inner_size: int = 0, - last_node: bool = False, - usedforsecurity: bool = True, - ) -> Self: ... - def copy(self) -> Self: ... - def digest(self) -> bytes: ... - def hexdigest(self) -> str: ... - def update(self, data: ReadableBuffer, /) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_bootlocale.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_bootlocale.pyi deleted file mode 100644 index 233d4934f3..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_bootlocale.pyi +++ /dev/null @@ -1 +0,0 @@ -def getpreferredencoding(do_setlocale: bool = True) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_bz2.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_bz2.pyi deleted file mode 100644 index fdad932ca2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_bz2.pyi +++ /dev/null @@ -1,24 +0,0 @@ -import sys -from _typeshed import ReadableBuffer -from typing import final -from typing_extensions import Self - -@final -class BZ2Compressor: - if sys.version_info >= (3, 12): - def __new__(cls, compresslevel: int = 9, /) -> Self: ... - else: - def __init__(self, compresslevel: int = 9, /) -> None: ... - - def compress(self, data: ReadableBuffer, /) -> bytes: ... - def flush(self) -> bytes: ... - -@final -class BZ2Decompressor: - def decompress(self, data: ReadableBuffer, max_length: int = -1) -> bytes: ... - @property - def eof(self) -> bool: ... - @property - def needs_input(self) -> bool: ... - @property - def unused_data(self) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_codecs.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_codecs.pyi deleted file mode 100644 index 89f97edb9b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_codecs.pyi +++ /dev/null @@ -1,122 +0,0 @@ -import codecs -import sys -from _typeshed import ReadableBuffer -from collections.abc import Callable -from typing import Literal, final, overload, type_check_only -from typing_extensions import TypeAlias - -# This type is not exposed; it is defined in unicodeobject.c -# At runtime it calls itself builtins.EncodingMap -@final -@type_check_only -class _EncodingMap: - def size(self) -> int: ... - -_CharMap: TypeAlias = dict[int, int] | _EncodingMap -_Handler: TypeAlias = Callable[[UnicodeError], tuple[str | bytes, int]] -_SearchFunction: TypeAlias = Callable[[str], codecs.CodecInfo | None] - -def register(search_function: _SearchFunction, /) -> None: ... - -if sys.version_info >= (3, 10): - def unregister(search_function: _SearchFunction, /) -> None: ... - -def register_error(errors: str, handler: _Handler, /) -> None: ... -def lookup_error(name: str, /) -> _Handler: ... - -# The type ignore on `encode` and `decode` is to avoid issues with overlapping overloads, for more details, see #300 -# https://docs.python.org/3/library/codecs.html#binary-transforms -_BytesToBytesEncoding: TypeAlias = Literal[ - "base64", - "base_64", - "base64_codec", - "bz2", - "bz2_codec", - "hex", - "hex_codec", - "quopri", - "quotedprintable", - "quoted_printable", - "quopri_codec", - "uu", - "uu_codec", - "zip", - "zlib", - "zlib_codec", -] -# https://docs.python.org/3/library/codecs.html#text-transforms -_StrToStrEncoding: TypeAlias = Literal["rot13", "rot_13"] - -@overload -def encode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = "strict") -> bytes: ... -@overload -def encode(obj: str, encoding: _StrToStrEncoding, errors: str = "strict") -> str: ... # type: ignore[overload-overlap] -@overload -def encode(obj: str, encoding: str = "utf-8", errors: str = "strict") -> bytes: ... -@overload -def decode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = "strict") -> bytes: ... # type: ignore[overload-overlap] -@overload -def decode(obj: str, encoding: _StrToStrEncoding, errors: str = "strict") -> str: ... - -# these are documented as text encodings but in practice they also accept str as input -@overload -def decode( - obj: str, - encoding: Literal["unicode_escape", "unicode-escape", "raw_unicode_escape", "raw-unicode-escape"], - errors: str = "strict", -) -> str: ... - -# hex is officially documented as a bytes to bytes encoding, but it appears to also work with str -@overload -def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = "strict") -> bytes: ... -@overload -def decode(obj: ReadableBuffer, encoding: str = "utf-8", errors: str = "strict") -> str: ... -def lookup(encoding: str, /) -> codecs.CodecInfo: ... -def charmap_build(map: str, /) -> _CharMap: ... -def ascii_decode(data: ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ... -def ascii_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... -def charmap_decode(data: ReadableBuffer, errors: str | None = None, mapping: _CharMap | None = None, /) -> tuple[str, int]: ... -def charmap_encode(str: str, errors: str | None = None, mapping: _CharMap | None = None, /) -> tuple[bytes, int]: ... -def escape_decode(data: str | ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ... -def escape_encode(data: bytes, errors: str | None = None, /) -> tuple[bytes, int]: ... -def latin_1_decode(data: ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ... -def latin_1_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... -def raw_unicode_escape_decode( - data: str | ReadableBuffer, errors: str | None = None, final: bool = True, / -) -> tuple[str, int]: ... -def raw_unicode_escape_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... -def readbuffer_encode(data: str | ReadableBuffer, errors: str | None = None, /) -> tuple[bytes, int]: ... -def unicode_escape_decode(data: str | ReadableBuffer, errors: str | None = None, final: bool = True, /) -> tuple[str, int]: ... -def unicode_escape_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... -def utf_16_be_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... -def utf_16_be_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... -def utf_16_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... -def utf_16_encode(str: str, errors: str | None = None, byteorder: int = 0, /) -> tuple[bytes, int]: ... -def utf_16_ex_decode( - data: ReadableBuffer, errors: str | None = None, byteorder: int = 0, final: bool = False, / -) -> tuple[str, int, int]: ... -def utf_16_le_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... -def utf_16_le_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... -def utf_32_be_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... -def utf_32_be_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... -def utf_32_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... -def utf_32_encode(str: str, errors: str | None = None, byteorder: int = 0, /) -> tuple[bytes, int]: ... -def utf_32_ex_decode( - data: ReadableBuffer, errors: str | None = None, byteorder: int = 0, final: bool = False, / -) -> tuple[str, int, int]: ... -def utf_32_le_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... -def utf_32_le_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... -def utf_7_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... -def utf_7_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... -def utf_8_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... -def utf_8_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - -if sys.platform == "win32": - def mbcs_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - def mbcs_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - def code_page_decode( - codepage: int, data: ReadableBuffer, errors: str | None = None, final: bool = False, / - ) -> tuple[str, int]: ... - def code_page_encode(code_page: int, str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - def oem_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - def oem_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_collections_abc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_collections_abc.pyi deleted file mode 100644 index b099bdd98f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_collections_abc.pyi +++ /dev/null @@ -1,107 +0,0 @@ -import sys -from abc import abstractmethod -from types import MappingProxyType -from typing import ( # noqa: Y022,Y038,UP035 - AbstractSet as Set, - AsyncGenerator as AsyncGenerator, - AsyncIterable as AsyncIterable, - AsyncIterator as AsyncIterator, - Awaitable as Awaitable, - Callable as Callable, - ClassVar, - Collection as Collection, - Container as Container, - Coroutine as Coroutine, - Generator as Generator, - Generic, - Hashable as Hashable, - ItemsView as ItemsView, - Iterable as Iterable, - Iterator as Iterator, - KeysView as KeysView, - Mapping as Mapping, - MappingView as MappingView, - MutableMapping as MutableMapping, - MutableSequence as MutableSequence, - MutableSet as MutableSet, - Protocol, - Reversible as Reversible, - Sequence as Sequence, - Sized as Sized, - TypeVar, - ValuesView as ValuesView, - final, - runtime_checkable, -) - -__all__ = [ - "Awaitable", - "Coroutine", - "AsyncIterable", - "AsyncIterator", - "AsyncGenerator", - "Hashable", - "Iterable", - "Iterator", - "Generator", - "Reversible", - "Sized", - "Container", - "Callable", - "Collection", - "Set", - "MutableSet", - "Mapping", - "MutableMapping", - "MappingView", - "KeysView", - "ItemsView", - "ValuesView", - "Sequence", - "MutableSequence", -] -if sys.version_info < (3, 14): - from typing import ByteString as ByteString # noqa: Y057,UP035 - - __all__ += ["ByteString"] - -if sys.version_info >= (3, 12): - __all__ += ["Buffer"] - -_KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers. -_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: ... - def __reversed__(self) -> Iterator[_KT_co]: ... - __hash__: ClassVar[None] # type: ignore[assignment] - if sys.version_info >= (3, 13): - def isdisjoint(self, other: Iterable[_KT_co], /) -> bool: ... - if sys.version_info >= (3, 10): - @property - def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ... - -@final -class dict_values(ValuesView[_VT_co], Generic[_KT_co, _VT_co]): # undocumented - def __reversed__(self) -> Iterator[_VT_co]: ... - if sys.version_info >= (3, 10): - @property - def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ... - -@final -class dict_items(ItemsView[_KT_co, _VT_co]): # undocumented - def __eq__(self, value: object, /) -> bool: ... - def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ... - __hash__: ClassVar[None] # type: ignore[assignment] - if sys.version_info >= (3, 13): - def isdisjoint(self, other: Iterable[tuple[_KT_co, _VT_co]], /) -> bool: ... - if sys.version_info >= (3, 10): - @property - def mapping(self) -> MappingProxyType[_KT_co, _VT_co]: ... - -if sys.version_info >= (3, 12): - @runtime_checkable - class Buffer(Protocol): - @abstractmethod - def __buffer__(self, flags: int, /) -> memoryview: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_compat_pickle.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_compat_pickle.pyi deleted file mode 100644 index 50fb22442c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_compat_pickle.pyi +++ /dev/null @@ -1,8 +0,0 @@ -IMPORT_MAPPING: dict[str, str] -NAME_MAPPING: dict[tuple[str, str], tuple[str, str]] -PYTHON2_EXCEPTIONS: tuple[str, ...] -MULTIPROCESSING_EXCEPTIONS: tuple[str, ...] -REVERSE_IMPORT_MAPPING: dict[str, str] -REVERSE_NAME_MAPPING: dict[tuple[str, str], tuple[str, str]] -PYTHON3_OSERROR_EXCEPTIONS: tuple[str, ...] -PYTHON3_IMPORTERROR_EXCEPTIONS: tuple[str, ...] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_compression.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_compression.pyi deleted file mode 100644 index a41a8142cc..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_compression.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from _typeshed import WriteableBuffer -from collections.abc import Callable -from io import DEFAULT_BUFFER_SIZE, BufferedIOBase, RawIOBase -from typing import Any, Protocol - -BUFFER_SIZE = DEFAULT_BUFFER_SIZE - -class _Reader(Protocol): - def read(self, n: int, /) -> bytes: ... - def seekable(self) -> bool: ... - def seek(self, n: int, /) -> Any: ... - -class BaseStream(BufferedIOBase): ... - -class DecompressReader(RawIOBase): - def __init__( - self, - fp: _Reader, - decomp_factory: Callable[..., object], - trailing_error: type[Exception] | tuple[type[Exception], ...] = (), - **decomp_args: Any, - ) -> None: ... - def readinto(self, b: WriteableBuffer) -> int: ... - def read(self, size: int = -1) -> bytes: ... - def seek(self, offset: int, whence: int = 0) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_contextvars.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_contextvars.pyi deleted file mode 100644 index 33df799a76..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_contextvars.pyi +++ /dev/null @@ -1,58 +0,0 @@ -from collections.abc import Callable, Iterator, Mapping -from types import GenericAlias -from typing import Any, ClassVar, Generic, TypeVar, final, overload -from typing_extensions import ParamSpec, Self - -_T = TypeVar("_T") -_D = TypeVar("_D") -_P = ParamSpec("_P") - -@final -class ContextVar(Generic[_T]): - @overload - def __new__(cls, name: str) -> Self: ... - @overload - def __new__(cls, name: str, *, default: _T) -> Self: ... - def __hash__(self) -> int: ... - @property - def name(self) -> str: ... - @overload - def get(self) -> _T: ... - @overload - def get(self, default: _T, /) -> _T: ... - @overload - def get(self, default: _D, /) -> _D | _T: ... - def set(self, value: _T, /) -> Token[_T]: ... - def reset(self, token: Token[_T], /) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -@final -class Token(Generic[_T]): - @property - def var(self) -> ContextVar[_T]: ... - @property - def old_value(self) -> Any: ... # returns either _T or MISSING, but that's hard to express - MISSING: ClassVar[object] - __hash__: ClassVar[None] # type: ignore[assignment] - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -def copy_context() -> Context: ... - -# It doesn't make sense to make this generic, because for most Contexts each ContextVar will have -# a different value. -@final -class Context(Mapping[ContextVar[Any], Any]): - def __init__(self) -> None: ... - @overload - def get(self, key: ContextVar[_T], default: None = None, /) -> _T | None: ... - @overload - def get(self, key: ContextVar[_T], default: _T, /) -> _T: ... - @overload - def get(self, key: ContextVar[_T], default: _D, /) -> _T | _D: ... - def run(self, callable: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> _T: ... - def copy(self) -> Context: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __getitem__(self, key: ContextVar[_T], /) -> _T: ... - def __iter__(self) -> Iterator[ContextVar[Any]]: ... - def __len__(self) -> int: ... - def __eq__(self, value: object, /) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_csv.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_csv.pyi deleted file mode 100644 index aa9fc53841..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_csv.pyi +++ /dev/null @@ -1,132 +0,0 @@ -import csv -import sys -from _typeshed import SupportsWrite -from collections.abc import Iterable -from typing import Any, Final, type_check_only -from typing_extensions import Self, TypeAlias - -__version__: Final[str] - -QUOTE_ALL: Final = 1 -QUOTE_MINIMAL: Final = 0 -QUOTE_NONE: Final = 3 -QUOTE_NONNUMERIC: Final = 2 -if sys.version_info >= (3, 12): - QUOTE_STRINGS: Final = 4 - QUOTE_NOTNULL: Final = 5 - -# Ideally this would be `QUOTE_ALL | QUOTE_MINIMAL | QUOTE_NONE | QUOTE_NONNUMERIC` -# However, using literals in situations like these can cause false-positives (see #7258) -_QuotingType: TypeAlias = int - -class Error(Exception): ... - -_DialectLike: TypeAlias = str | Dialect | csv.Dialect | type[Dialect | csv.Dialect] - -class Dialect: - delimiter: str - quotechar: str | None - escapechar: str | None - doublequote: bool - skipinitialspace: bool - lineterminator: str - quoting: _QuotingType - strict: bool - def __new__( - cls, - dialect: _DialectLike | None = ..., - delimiter: str = ",", - doublequote: bool = True, - escapechar: str | None = None, - lineterminator: str = "\r\n", - quotechar: str | None = '"', - quoting: _QuotingType = 0, - skipinitialspace: bool = False, - strict: bool = False, - ) -> Self: ... - -if sys.version_info >= (3, 10): - # This class calls itself _csv.reader. - class Reader: - @property - def dialect(self) -> Dialect: ... - line_num: int - def __iter__(self) -> Self: ... - def __next__(self) -> list[str]: ... - - # This class calls itself _csv.writer. - class Writer: - @property - def dialect(self) -> Dialect: ... - if sys.version_info >= (3, 13): - def writerow(self, row: Iterable[Any], /) -> Any: ... - def writerows(self, rows: Iterable[Iterable[Any]], /) -> None: ... - else: - def writerow(self, row: Iterable[Any]) -> Any: ... - def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ... - - # For the return types below. - # These aliases can be removed when typeshed drops support for 3.9. - _reader = Reader - _writer = Writer -else: - # This class is not exposed. It calls itself _csv.reader. - @type_check_only - class _reader: - @property - def dialect(self) -> Dialect: ... - line_num: int - def __iter__(self) -> Self: ... - def __next__(self) -> list[str]: ... - - # This class is not exposed. It calls itself _csv.writer. - @type_check_only - class _writer: - @property - def dialect(self) -> Dialect: ... - def writerow(self, row: Iterable[Any]) -> Any: ... - def writerows(self, rows: Iterable[Iterable[Any]]) -> None: ... - -def writer( - csvfile: SupportsWrite[str], - dialect: _DialectLike = "excel", - *, - delimiter: str = ",", - quotechar: str | None = '"', - escapechar: str | None = None, - doublequote: bool = True, - skipinitialspace: bool = False, - lineterminator: str = "\r\n", - quoting: _QuotingType = 0, - strict: bool = False, -) -> _writer: ... -def reader( - csvfile: Iterable[str], - dialect: _DialectLike = "excel", - *, - delimiter: str = ",", - quotechar: str | None = '"', - escapechar: str | None = None, - doublequote: bool = True, - skipinitialspace: bool = False, - lineterminator: str = "\r\n", - quoting: _QuotingType = 0, - strict: bool = False, -) -> _reader: ... -def register_dialect( - name: str, - dialect: type[Dialect | csv.Dialect] = ..., - *, - delimiter: str = ",", - quotechar: str | None = '"', - escapechar: str | None = None, - doublequote: bool = True, - skipinitialspace: bool = False, - lineterminator: str = "\r\n", - quoting: _QuotingType = 0, - strict: bool = False, -) -> None: ... -def unregister_dialect(name: str) -> None: ... -def get_dialect(name: str) -> Dialect: ... -def list_dialects() -> list[str]: ... -def field_size_limit(new_limit: int = ...) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_ctypes.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_ctypes.pyi deleted file mode 100644 index 4cbb030bb1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_ctypes.pyi +++ /dev/null @@ -1,331 +0,0 @@ -import _typeshed -import sys -from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer -from abc import abstractmethod -from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence -from ctypes import CDLL, ArgumentError as ArgumentError, c_void_p -from types import GenericAlias -from typing import Any, ClassVar, Generic, TypeVar, final, overload, type_check_only -from typing_extensions import Self, TypeAlias - -_T = TypeVar("_T") -_CT = TypeVar("_CT", bound=_CData) - -FUNCFLAG_CDECL: int -FUNCFLAG_PYTHONAPI: int -FUNCFLAG_USE_ERRNO: int -FUNCFLAG_USE_LASTERROR: int -RTLD_GLOBAL: int -RTLD_LOCAL: int - -if sys.version_info >= (3, 11): - CTYPES_MAX_ARGCOUNT: int - -if sys.version_info >= (3, 12): - SIZEOF_TIME_T: int - -if sys.platform == "win32": - # Description, Source, HelpFile, HelpContext, scode - _COMError_Details: TypeAlias = tuple[str | None, str | None, str | None, int | None, int | None] - - class COMError(Exception): - hresult: int - text: str | None - details: _COMError_Details - - def __init__(self, hresult: int, text: str | None, details: _COMError_Details) -> None: ... - - def CopyComPointer(src: _PointerLike, dst: _PointerLike | _CArgObject) -> int: ... - - FUNCFLAG_HRESULT: int - FUNCFLAG_STDCALL: int - - def FormatError(code: int = ...) -> str: ... - def get_last_error() -> int: ... - def set_last_error(value: int) -> int: ... - def LoadLibrary(name: str, load_flags: int = 0, /) -> int: ... - def FreeLibrary(handle: int, /) -> None: ... - -else: - def dlclose(handle: int, /) -> None: ... - # The default for flag is RTLD_GLOBAL|RTLD_LOCAL, which is platform dependent. - def dlopen(name: StrOrBytesPath, flag: int = ..., /) -> int: ... - def dlsym(handle: int, name: str, /) -> int: ... - -if sys.version_info >= (3, 13): - # This class is not exposed. It calls itself _ctypes.CType_Type. - @type_check_only - class _CType_Type(type): - # By default mypy complains about the following two methods, because strictly speaking cls - # might not be a Type[_CT]. However this doesn't happen because this is only a - # metaclass for subclasses of _CData. - def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - - _CTypeBaseType = _CType_Type - -else: - _CTypeBaseType = type - -# This class is not exposed. -@type_check_only -class _CData: - _b_base_: int - _b_needsfree_: bool - _objects: Mapping[Any, int] | None - def __buffer__(self, flags: int, /) -> memoryview: ... - def __ctypes_from_outparam__(self, /) -> Self: ... - -# this is a union of all the subclasses of _CData, which is useful because of -# the methods that are present on each of those subclasses which are not present -# on _CData itself. -_CDataType: TypeAlias = _SimpleCData[Any] | _Pointer[Any] | CFuncPtr | Union | Structure | Array[Any] - -# This class is not exposed. It calls itself _ctypes.PyCSimpleType. -@type_check_only -class _PyCSimpleType(_CTypeBaseType): - def from_address(self: type[_typeshed.Self], value: int, /) -> _typeshed.Self: ... - def from_buffer(self: type[_typeshed.Self], obj: WriteableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_buffer_copy(self: type[_typeshed.Self], buffer: ReadableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_param(self: type[_typeshed.Self], value: Any, /) -> _typeshed.Self | _CArgObject: ... - def in_dll(self: type[_typeshed.Self], dll: CDLL, name: str, /) -> _typeshed.Self: ... - if sys.version_info < (3, 13): - # Inherited from CType_Type starting on 3.13 - def __mul__(self: type[_CT], value: int, /) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __rmul__(self: type[_CT], value: int, /) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - -class _SimpleCData(_CData, Generic[_T], metaclass=_PyCSimpleType): - value: _T - # The TypeVar can be unsolved here, - # but we can't use overloads without creating many, many mypy false-positive errors - def __init__(self, value: _T = ...) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] - def __ctypes_from_outparam__(self, /) -> _T: ... # type: ignore[override] - -class _CanCastTo(_CData): ... -class _PointerLike(_CanCastTo): ... - -# This type is not exposed. It calls itself _ctypes.PyCPointerType. -@type_check_only -class _PyCPointerType(_CTypeBaseType): - def from_address(self: type[_typeshed.Self], value: int, /) -> _typeshed.Self: ... - def from_buffer(self: type[_typeshed.Self], obj: WriteableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_buffer_copy(self: type[_typeshed.Self], buffer: ReadableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_param(self: type[_typeshed.Self], value: Any, /) -> _typeshed.Self | _CArgObject: ... - def in_dll(self: type[_typeshed.Self], dll: CDLL, name: str, /) -> _typeshed.Self: ... - def set_type(self, type: Any, /) -> None: ... - if sys.version_info < (3, 13): - # Inherited from CType_Type starting on 3.13 - def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - -class _Pointer(_PointerLike, _CData, Generic[_CT], metaclass=_PyCPointerType): - _type_: type[_CT] - contents: _CT - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, arg: _CT) -> None: ... - @overload - def __getitem__(self, key: int, /) -> Any: ... - @overload - def __getitem__(self, key: slice, /) -> list[Any]: ... - def __setitem__(self, key: int, value: Any, /) -> None: ... - -@overload -def POINTER(type: None, /) -> type[c_void_p]: ... -@overload -def POINTER(type: type[_CT], /) -> type[_Pointer[_CT]]: ... -def pointer(obj: _CT, /) -> _Pointer[_CT]: ... - -# This class is not exposed. It calls itself _ctypes.CArgObject. -@final -@type_check_only -class _CArgObject: ... - -def byref(obj: _CData | _CDataType, offset: int = ...) -> _CArgObject: ... - -_ECT: TypeAlias = Callable[[_CData | _CDataType | None, CFuncPtr, tuple[_CData | _CDataType, ...]], _CDataType] -_PF: TypeAlias = tuple[int] | tuple[int, str | None] | tuple[int, str | None, Any] - -# This class is not exposed. It calls itself _ctypes.PyCFuncPtrType. -@type_check_only -class _PyCFuncPtrType(_CTypeBaseType): - def from_address(self: type[_typeshed.Self], value: int, /) -> _typeshed.Self: ... - def from_buffer(self: type[_typeshed.Self], obj: WriteableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_buffer_copy(self: type[_typeshed.Self], buffer: ReadableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_param(self: type[_typeshed.Self], value: Any, /) -> _typeshed.Self | _CArgObject: ... - def in_dll(self: type[_typeshed.Self], dll: CDLL, name: str, /) -> _typeshed.Self: ... - if sys.version_info < (3, 13): - # Inherited from CType_Type starting on 3.13 - def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - -class CFuncPtr(_PointerLike, _CData, metaclass=_PyCFuncPtrType): - restype: type[_CDataType] | Callable[[int], Any] | None - argtypes: Sequence[type[_CDataType]] - errcheck: _ECT - # Abstract attribute that must be defined on subclasses - _flags_: ClassVar[int] - @overload - def __new__(cls) -> Self: ... - @overload - def __new__(cls, address: int, /) -> Self: ... - @overload - def __new__(cls, callable: Callable[..., Any], /) -> Self: ... - @overload - def __new__(cls, func_spec: tuple[str | int, CDLL], paramflags: tuple[_PF, ...] | None = ..., /) -> Self: ... - if sys.platform == "win32": - @overload - def __new__( - cls, vtbl_index: int, name: str, paramflags: tuple[_PF, ...] | None = ..., iid: _CData | _CDataType | None = ..., / - ) -> Self: ... - - def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - -_GetT = TypeVar("_GetT") -_SetT = TypeVar("_SetT") - -# This class is not exposed. It calls itself _ctypes.CField. -@final -@type_check_only -class _CField(Generic[_CT, _GetT, _SetT]): - offset: int - size: int - if sys.version_info >= (3, 10): - @overload - def __get__(self, instance: None, owner: type[Any] | None = None, /) -> Self: ... - @overload - def __get__(self, instance: Any, owner: type[Any] | None = None, /) -> _GetT: ... - else: - @overload - def __get__(self, instance: None, owner: type[Any] | None, /) -> Self: ... - @overload - def __get__(self, instance: Any, owner: type[Any] | None, /) -> _GetT: ... - - def __set__(self, instance: Any, value: _SetT, /) -> None: ... - -# This class is not exposed. It calls itself _ctypes.UnionType. -@type_check_only -class _UnionType(_CTypeBaseType): - def from_address(self: type[_typeshed.Self], value: int, /) -> _typeshed.Self: ... - def from_buffer(self: type[_typeshed.Self], obj: WriteableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_buffer_copy(self: type[_typeshed.Self], buffer: ReadableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_param(self: type[_typeshed.Self], value: Any, /) -> _typeshed.Self | _CArgObject: ... - def in_dll(self: type[_typeshed.Self], dll: CDLL, name: str, /) -> _typeshed.Self: ... - # At runtime, various attributes are created on a Union subclass based - # on its _fields_. This method doesn't exist, but represents those - # dynamically created attributes. - def __getattr__(self, name: str) -> _CField[Any, Any, Any]: ... - if sys.version_info < (3, 13): - # Inherited from CType_Type starting on 3.13 - def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - -class Union(_CData, metaclass=_UnionType): - _fields_: ClassVar[Sequence[tuple[str, type[_CDataType]] | tuple[str, type[_CDataType], int]]] - _pack_: ClassVar[int] - _anonymous_: ClassVar[Sequence[str]] - if sys.version_info >= (3, 13): - _align_: ClassVar[int] - - def __init__(self, *args: Any, **kw: Any) -> None: ... - def __getattr__(self, name: str) -> Any: ... - def __setattr__(self, name: str, value: Any) -> None: ... - -# This class is not exposed. It calls itself _ctypes.PyCStructType. -@type_check_only -class _PyCStructType(_CTypeBaseType): - def from_address(self: type[_typeshed.Self], value: int, /) -> _typeshed.Self: ... - def from_buffer(self: type[_typeshed.Self], obj: WriteableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_buffer_copy(self: type[_typeshed.Self], buffer: ReadableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_param(self: type[_typeshed.Self], value: Any, /) -> _typeshed.Self | _CArgObject: ... - def in_dll(self: type[_typeshed.Self], dll: CDLL, name: str, /) -> _typeshed.Self: ... - # At runtime, various attributes are created on a Structure subclass based - # on its _fields_. This method doesn't exist, but represents those - # dynamically created attributes. - def __getattr__(self, name: str) -> _CField[Any, Any, Any]: ... - if sys.version_info < (3, 13): - # Inherited from CType_Type starting on 3.13 - def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - -class Structure(_CData, metaclass=_PyCStructType): - _fields_: ClassVar[Sequence[tuple[str, type[_CDataType]] | tuple[str, type[_CDataType], int]]] - _pack_: ClassVar[int] - _anonymous_: ClassVar[Sequence[str]] - if sys.version_info >= (3, 13): - _align_: ClassVar[int] - - def __init__(self, *args: Any, **kw: Any) -> None: ... - def __getattr__(self, name: str) -> Any: ... - def __setattr__(self, name: str, value: Any) -> None: ... - -# This class is not exposed. It calls itself _ctypes.PyCArrayType. -@type_check_only -class _PyCArrayType(_CTypeBaseType): - def from_address(self: type[_typeshed.Self], value: int, /) -> _typeshed.Self: ... - def from_buffer(self: type[_typeshed.Self], obj: WriteableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_buffer_copy(self: type[_typeshed.Self], buffer: ReadableBuffer, offset: int = 0, /) -> _typeshed.Self: ... - def from_param(self: type[_typeshed.Self], value: Any, /) -> _typeshed.Self | _CArgObject: ... - def in_dll(self: type[_typeshed.Self], dll: CDLL, name: str, /) -> _typeshed.Self: ... - if sys.version_info < (3, 13): - # Inherited from CType_Type starting on 3.13 - def __mul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - -class Array(_CData, Generic[_CT], metaclass=_PyCArrayType): - @property - @abstractmethod - def _length_(self) -> int: ... - @_length_.setter - def _length_(self, value: int) -> None: ... - @property - @abstractmethod - def _type_(self) -> type[_CT]: ... - @_type_.setter - def _type_(self, value: type[_CT]) -> None: ... - # Note: only available if _CT == c_char - @property - def raw(self) -> bytes: ... - @raw.setter - def raw(self, value: ReadableBuffer) -> None: ... - value: Any # Note: bytes if _CT == c_char, str if _CT == c_wchar, unavailable otherwise - # TODO: These methods cannot be annotated correctly at the moment. - # All of these "Any"s stand for the array's element type, but it's not possible to use _CT - # here, because of a special feature of ctypes. - # By default, when accessing an element of an Array[_CT], the returned object has type _CT. - # However, when _CT is a "simple type" like c_int, ctypes automatically "unboxes" the object - # and converts it to the corresponding Python primitive. For example, when accessing an element - # of an Array[c_int], a Python int object is returned, not a c_int. - # This behavior does *not* apply to subclasses of "simple types". - # If MyInt is a subclass of c_int, then accessing an element of an Array[MyInt] returns - # a MyInt, not an int. - # This special behavior is not easy to model in a stub, so for now all places where - # the array element type would belong are annotated with Any instead. - def __init__(self, *args: Any) -> None: ... - @overload - def __getitem__(self, key: int, /) -> Any: ... - @overload - def __getitem__(self, key: slice, /) -> list[Any]: ... - @overload - def __setitem__(self, key: int, value: Any, /) -> None: ... - @overload - def __setitem__(self, key: slice, value: Iterable[Any], /) -> None: ... - def __iter__(self) -> Iterator[Any]: ... - # Can't inherit from Sized because the metaclass conflict between - # Sized and _CData prevents using _CDataMeta. - def __len__(self) -> int: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -def addressof(obj: _CData | _CDataType, /) -> int: ... -def alignment(obj_or_type: _CData | _CDataType | type[_CData | _CDataType], /) -> int: ... -def get_errno() -> int: ... -def resize(obj: _CData | _CDataType, size: int, /) -> None: ... -def set_errno(value: int, /) -> int: ... -def sizeof(obj_or_type: _CData | _CDataType | type[_CData | _CDataType], /) -> int: ... -def PyObj_FromPtr(address: int, /) -> Any: ... -def Py_DECREF(o: _T, /) -> _T: ... -def Py_INCREF(o: _T, /) -> _T: ... -def buffer_info(o: _CData | _CDataType | type[_CData | _CDataType], /) -> tuple[str, int, tuple[int, ...]]: ... -def call_cdeclfunction(address: int, arguments: tuple[Any, ...], /) -> Any: ... -def call_function(address: int, arguments: tuple[Any, ...], /) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_curses.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_curses.pyi deleted file mode 100644 index d7820c72c0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_curses.pyi +++ /dev/null @@ -1,548 +0,0 @@ -import sys -from _typeshed import ReadOnlyBuffer, SupportsRead, SupportsWrite -from curses import _ncurses_version -from typing import Any, final, overload -from typing_extensions import TypeAlias - -# NOTE: This module is ordinarily only available on Unix, but the windows-curses -# package makes it available on Windows as well with the same contents. - -# Handled by PyCurses_ConvertToChtype in _cursesmodule.c. -_ChType: TypeAlias = str | bytes | int - -# ACS codes are only initialized after initscr is called -ACS_BBSS: int -ACS_BLOCK: int -ACS_BOARD: int -ACS_BSBS: int -ACS_BSSB: int -ACS_BSSS: int -ACS_BTEE: int -ACS_BULLET: int -ACS_CKBOARD: int -ACS_DARROW: int -ACS_DEGREE: int -ACS_DIAMOND: int -ACS_GEQUAL: int -ACS_HLINE: int -ACS_LANTERN: int -ACS_LARROW: int -ACS_LEQUAL: int -ACS_LLCORNER: int -ACS_LRCORNER: int -ACS_LTEE: int -ACS_NEQUAL: int -ACS_PI: int -ACS_PLMINUS: int -ACS_PLUS: int -ACS_RARROW: int -ACS_RTEE: int -ACS_S1: int -ACS_S3: int -ACS_S7: int -ACS_S9: int -ACS_SBBS: int -ACS_SBSB: int -ACS_SBSS: int -ACS_SSBB: int -ACS_SSBS: int -ACS_SSSB: int -ACS_SSSS: int -ACS_STERLING: int -ACS_TTEE: int -ACS_UARROW: int -ACS_ULCORNER: int -ACS_URCORNER: int -ACS_VLINE: int -ALL_MOUSE_EVENTS: int -A_ALTCHARSET: int -A_ATTRIBUTES: int -A_BLINK: int -A_BOLD: int -A_CHARTEXT: int -A_COLOR: int -A_DIM: int -A_HORIZONTAL: int -A_INVIS: int -A_ITALIC: int -A_LEFT: int -A_LOW: int -A_NORMAL: int -A_PROTECT: int -A_REVERSE: int -A_RIGHT: int -A_STANDOUT: int -A_TOP: int -A_UNDERLINE: int -A_VERTICAL: int -BUTTON1_CLICKED: int -BUTTON1_DOUBLE_CLICKED: int -BUTTON1_PRESSED: int -BUTTON1_RELEASED: int -BUTTON1_TRIPLE_CLICKED: int -BUTTON2_CLICKED: int -BUTTON2_DOUBLE_CLICKED: int -BUTTON2_PRESSED: int -BUTTON2_RELEASED: int -BUTTON2_TRIPLE_CLICKED: int -BUTTON3_CLICKED: int -BUTTON3_DOUBLE_CLICKED: int -BUTTON3_PRESSED: int -BUTTON3_RELEASED: int -BUTTON3_TRIPLE_CLICKED: int -BUTTON4_CLICKED: int -BUTTON4_DOUBLE_CLICKED: int -BUTTON4_PRESSED: int -BUTTON4_RELEASED: int -BUTTON4_TRIPLE_CLICKED: int -# Darwin ncurses doesn't provide BUTTON5_* constants prior to 3.12.10 and 3.13.3 -if sys.version_info >= (3, 10): - if sys.version_info >= (3, 12) or sys.platform != "darwin": - BUTTON5_PRESSED: int - BUTTON5_RELEASED: int - BUTTON5_CLICKED: int - BUTTON5_DOUBLE_CLICKED: int - BUTTON5_TRIPLE_CLICKED: int -BUTTON_ALT: int -BUTTON_CTRL: int -BUTTON_SHIFT: int -COLOR_BLACK: int -COLOR_BLUE: int -COLOR_CYAN: int -COLOR_GREEN: int -COLOR_MAGENTA: int -COLOR_RED: int -COLOR_WHITE: int -COLOR_YELLOW: int -ERR: int -KEY_A1: int -KEY_A3: int -KEY_B2: int -KEY_BACKSPACE: int -KEY_BEG: int -KEY_BREAK: int -KEY_BTAB: int -KEY_C1: int -KEY_C3: int -KEY_CANCEL: int -KEY_CATAB: int -KEY_CLEAR: int -KEY_CLOSE: int -KEY_COMMAND: int -KEY_COPY: int -KEY_CREATE: int -KEY_CTAB: int -KEY_DC: int -KEY_DL: int -KEY_DOWN: int -KEY_EIC: int -KEY_END: int -KEY_ENTER: int -KEY_EOL: int -KEY_EOS: int -KEY_EXIT: int -KEY_F0: int -KEY_F1: int -KEY_F10: int -KEY_F11: int -KEY_F12: int -KEY_F13: int -KEY_F14: int -KEY_F15: int -KEY_F16: int -KEY_F17: int -KEY_F18: int -KEY_F19: int -KEY_F2: int -KEY_F20: int -KEY_F21: int -KEY_F22: int -KEY_F23: int -KEY_F24: int -KEY_F25: int -KEY_F26: int -KEY_F27: int -KEY_F28: int -KEY_F29: int -KEY_F3: int -KEY_F30: int -KEY_F31: int -KEY_F32: int -KEY_F33: int -KEY_F34: int -KEY_F35: int -KEY_F36: int -KEY_F37: int -KEY_F38: int -KEY_F39: int -KEY_F4: int -KEY_F40: int -KEY_F41: int -KEY_F42: int -KEY_F43: int -KEY_F44: int -KEY_F45: int -KEY_F46: int -KEY_F47: int -KEY_F48: int -KEY_F49: int -KEY_F5: int -KEY_F50: int -KEY_F51: int -KEY_F52: int -KEY_F53: int -KEY_F54: int -KEY_F55: int -KEY_F56: int -KEY_F57: int -KEY_F58: int -KEY_F59: int -KEY_F6: int -KEY_F60: int -KEY_F61: int -KEY_F62: int -KEY_F63: int -KEY_F7: int -KEY_F8: int -KEY_F9: int -KEY_FIND: int -KEY_HELP: int -KEY_HOME: int -KEY_IC: int -KEY_IL: int -KEY_LEFT: int -KEY_LL: int -KEY_MARK: int -KEY_MAX: int -KEY_MESSAGE: int -KEY_MIN: int -KEY_MOUSE: int -KEY_MOVE: int -KEY_NEXT: int -KEY_NPAGE: int -KEY_OPEN: int -KEY_OPTIONS: int -KEY_PPAGE: int -KEY_PREVIOUS: int -KEY_PRINT: int -KEY_REDO: int -KEY_REFERENCE: int -KEY_REFRESH: int -KEY_REPLACE: int -KEY_RESET: int -KEY_RESIZE: int -KEY_RESTART: int -KEY_RESUME: int -KEY_RIGHT: int -KEY_SAVE: int -KEY_SBEG: int -KEY_SCANCEL: int -KEY_SCOMMAND: int -KEY_SCOPY: int -KEY_SCREATE: int -KEY_SDC: int -KEY_SDL: int -KEY_SELECT: int -KEY_SEND: int -KEY_SEOL: int -KEY_SEXIT: int -KEY_SF: int -KEY_SFIND: int -KEY_SHELP: int -KEY_SHOME: int -KEY_SIC: int -KEY_SLEFT: int -KEY_SMESSAGE: int -KEY_SMOVE: int -KEY_SNEXT: int -KEY_SOPTIONS: int -KEY_SPREVIOUS: int -KEY_SPRINT: int -KEY_SR: int -KEY_SREDO: int -KEY_SREPLACE: int -KEY_SRESET: int -KEY_SRIGHT: int -KEY_SRSUME: int -KEY_SSAVE: int -KEY_SSUSPEND: int -KEY_STAB: int -KEY_SUNDO: int -KEY_SUSPEND: int -KEY_UNDO: int -KEY_UP: int -OK: int -REPORT_MOUSE_POSITION: int -_C_API: Any -version: bytes - -def baudrate() -> int: ... -def beep() -> None: ... -def can_change_color() -> bool: ... -def cbreak(flag: bool = True, /) -> None: ... -def color_content(color_number: int, /) -> tuple[int, int, int]: ... -def color_pair(pair_number: int, /) -> int: ... -def curs_set(visibility: int, /) -> int: ... -def def_prog_mode() -> None: ... -def def_shell_mode() -> None: ... -def delay_output(ms: int, /) -> None: ... -def doupdate() -> None: ... -def echo(flag: bool = True, /) -> None: ... -def endwin() -> None: ... -def erasechar() -> bytes: ... -def filter() -> None: ... -def flash() -> None: ... -def flushinp() -> None: ... -def get_escdelay() -> int: ... -def get_tabsize() -> int: ... -def getmouse() -> tuple[int, int, int, int, int]: ... -def getsyx() -> tuple[int, int]: ... -def getwin(file: SupportsRead[bytes], /) -> window: ... -def halfdelay(tenths: int, /) -> None: ... -def has_colors() -> bool: ... - -if sys.version_info >= (3, 10): - def has_extended_color_support() -> bool: ... - -def has_ic() -> bool: ... -def has_il() -> bool: ... -def has_key(key: int, /) -> bool: ... -def init_color(color_number: int, r: int, g: int, b: int, /) -> None: ... -def init_pair(pair_number: int, fg: int, bg: int, /) -> None: ... -def initscr() -> window: ... -def intrflush(flag: bool, /) -> None: ... -def is_term_resized(nlines: int, ncols: int, /) -> bool: ... -def isendwin() -> bool: ... -def keyname(key: int, /) -> bytes: ... -def killchar() -> bytes: ... -def longname() -> bytes: ... -def meta(yes: bool, /) -> None: ... -def mouseinterval(interval: int, /) -> None: ... -def mousemask(newmask: int, /) -> tuple[int, int]: ... -def napms(ms: int, /) -> int: ... -def newpad(nlines: int, ncols: int, /) -> window: ... -def newwin(nlines: int, ncols: int, begin_y: int = ..., begin_x: int = ..., /) -> window: ... -def nl(flag: bool = True, /) -> None: ... -def nocbreak() -> None: ... -def noecho() -> None: ... -def nonl() -> None: ... -def noqiflush() -> None: ... -def noraw() -> None: ... -def pair_content(pair_number: int, /) -> tuple[int, int]: ... -def pair_number(attr: int, /) -> int: ... -def putp(string: ReadOnlyBuffer, /) -> None: ... -def qiflush(flag: bool = True, /) -> None: ... -def raw(flag: bool = True, /) -> None: ... -def reset_prog_mode() -> None: ... -def reset_shell_mode() -> None: ... -def resetty() -> None: ... -def resize_term(nlines: int, ncols: int, /) -> None: ... -def resizeterm(nlines: int, ncols: int, /) -> None: ... -def savetty() -> None: ... -def set_escdelay(ms: int, /) -> None: ... -def set_tabsize(size: int, /) -> None: ... -def setsyx(y: int, x: int, /) -> None: ... -def setupterm(term: str | None = None, fd: int = -1) -> None: ... -def start_color() -> None: ... -def termattrs() -> int: ... -def termname() -> bytes: ... -def tigetflag(capname: str, /) -> int: ... -def tigetnum(capname: str, /) -> int: ... -def tigetstr(capname: str, /) -> bytes | None: ... -def tparm( - str: ReadOnlyBuffer, - i1: int = 0, - i2: int = 0, - i3: int = 0, - i4: int = 0, - i5: int = 0, - i6: int = 0, - i7: int = 0, - i8: int = 0, - i9: int = 0, - /, -) -> bytes: ... -def typeahead(fd: int, /) -> None: ... -def unctrl(ch: _ChType, /) -> bytes: ... -def unget_wch(ch: int | str, /) -> None: ... -def ungetch(ch: _ChType, /) -> None: ... -def ungetmouse(id: int, x: int, y: int, z: int, bstate: int, /) -> None: ... -def update_lines_cols() -> None: ... -def use_default_colors() -> None: ... -def use_env(flag: bool, /) -> None: ... - -class error(Exception): ... - -@final -class window: # undocumented - encoding: str - @overload - def addch(self, ch: _ChType, attr: int = ...) -> None: ... - @overload - def addch(self, y: int, x: int, ch: _ChType, attr: int = ...) -> None: ... - @overload - def addnstr(self, str: str, n: int, attr: int = ...) -> None: ... - @overload - def addnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ... - @overload - def addstr(self, str: str, attr: int = ...) -> None: ... - @overload - def addstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ... - def attroff(self, attr: int, /) -> None: ... - def attron(self, attr: int, /) -> None: ... - def attrset(self, attr: int, /) -> None: ... - def bkgd(self, ch: _ChType, attr: int = ..., /) -> None: ... - def bkgdset(self, ch: _ChType, attr: int = ..., /) -> None: ... - def border( - self, - ls: _ChType = ..., - rs: _ChType = ..., - ts: _ChType = ..., - bs: _ChType = ..., - tl: _ChType = ..., - tr: _ChType = ..., - bl: _ChType = ..., - br: _ChType = ..., - ) -> None: ... - @overload - def box(self) -> None: ... - @overload - def box(self, vertch: _ChType = ..., horch: _ChType = ...) -> None: ... - @overload - def chgat(self, attr: int) -> None: ... - @overload - def chgat(self, num: int, attr: int) -> None: ... - @overload - def chgat(self, y: int, x: int, attr: int) -> None: ... - @overload - def chgat(self, y: int, x: int, num: int, attr: int) -> None: ... - def clear(self) -> None: ... - def clearok(self, yes: int) -> None: ... - def clrtobot(self) -> None: ... - def clrtoeol(self) -> None: ... - def cursyncup(self) -> None: ... - @overload - def delch(self) -> None: ... - @overload - def delch(self, y: int, x: int) -> None: ... - def deleteln(self) -> None: ... - @overload - def derwin(self, begin_y: int, begin_x: int) -> window: ... - @overload - def derwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> window: ... - def echochar(self, ch: _ChType, attr: int = ..., /) -> None: ... - def enclose(self, y: int, x: int, /) -> bool: ... - def erase(self) -> None: ... - def getbegyx(self) -> tuple[int, int]: ... - def getbkgd(self) -> tuple[int, int]: ... - @overload - def getch(self) -> int: ... - @overload - def getch(self, y: int, x: int) -> int: ... - @overload - def get_wch(self) -> int | str: ... - @overload - def get_wch(self, y: int, x: int) -> int | str: ... - @overload - def getkey(self) -> str: ... - @overload - def getkey(self, y: int, x: int) -> str: ... - def getmaxyx(self) -> tuple[int, int]: ... - def getparyx(self) -> tuple[int, int]: ... - @overload - def getstr(self) -> bytes: ... - @overload - def getstr(self, n: int) -> bytes: ... - @overload - def getstr(self, y: int, x: int) -> bytes: ... - @overload - def getstr(self, y: int, x: int, n: int) -> bytes: ... - def getyx(self) -> tuple[int, int]: ... - @overload - def hline(self, ch: _ChType, n: int) -> None: ... - @overload - def hline(self, y: int, x: int, ch: _ChType, n: int) -> None: ... - def idcok(self, flag: bool) -> None: ... - def idlok(self, yes: bool) -> None: ... - def immedok(self, flag: bool) -> None: ... - @overload - def inch(self) -> int: ... - @overload - def inch(self, y: int, x: int) -> int: ... - @overload - def insch(self, ch: _ChType, attr: int = ...) -> None: ... - @overload - def insch(self, y: int, x: int, ch: _ChType, attr: int = ...) -> None: ... - def insdelln(self, nlines: int) -> None: ... - def insertln(self) -> None: ... - @overload - def insnstr(self, str: str, n: int, attr: int = ...) -> None: ... - @overload - def insnstr(self, y: int, x: int, str: str, n: int, attr: int = ...) -> None: ... - @overload - def insstr(self, str: str, attr: int = ...) -> None: ... - @overload - def insstr(self, y: int, x: int, str: str, attr: int = ...) -> None: ... - @overload - def instr(self, n: int = ...) -> bytes: ... - @overload - def instr(self, y: int, x: int, n: int = ...) -> bytes: ... - def is_linetouched(self, line: int, /) -> bool: ... - def is_wintouched(self) -> bool: ... - def keypad(self, yes: bool, /) -> None: ... - def leaveok(self, yes: bool) -> None: ... - def move(self, new_y: int, new_x: int) -> None: ... - def mvderwin(self, y: int, x: int) -> None: ... - def mvwin(self, new_y: int, new_x: int) -> None: ... - def nodelay(self, yes: bool) -> None: ... - def notimeout(self, yes: bool) -> None: ... - @overload - def noutrefresh(self) -> None: ... - @overload - def noutrefresh(self, pminrow: int, pmincol: int, sminrow: int, smincol: int, smaxrow: int, smaxcol: int) -> None: ... - @overload - def overlay(self, destwin: window) -> None: ... - @overload - def overlay( - self, destwin: window, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int - ) -> None: ... - @overload - def overwrite(self, destwin: window) -> None: ... - @overload - def overwrite( - self, destwin: window, sminrow: int, smincol: int, dminrow: int, dmincol: int, dmaxrow: int, dmaxcol: int - ) -> None: ... - def putwin(self, file: SupportsWrite[bytes], /) -> None: ... - def redrawln(self, beg: int, num: int, /) -> None: ... - def redrawwin(self) -> None: ... - @overload - def refresh(self) -> None: ... - @overload - def refresh(self, pminrow: int, pmincol: int, sminrow: int, smincol: int, smaxrow: int, smaxcol: int) -> None: ... - def resize(self, nlines: int, ncols: int) -> None: ... - def scroll(self, lines: int = ...) -> None: ... - def scrollok(self, flag: bool) -> None: ... - def setscrreg(self, top: int, bottom: int, /) -> None: ... - def standend(self) -> None: ... - def standout(self) -> None: ... - @overload - def subpad(self, begin_y: int, begin_x: int) -> window: ... - @overload - def subpad(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> window: ... - @overload - def subwin(self, begin_y: int, begin_x: int) -> window: ... - @overload - def subwin(self, nlines: int, ncols: int, begin_y: int, begin_x: int) -> window: ... - def syncdown(self) -> None: ... - def syncok(self, flag: bool) -> None: ... - def syncup(self) -> None: ... - def timeout(self, delay: int) -> None: ... - def touchline(self, start: int, count: int, changed: bool = ...) -> None: ... - def touchwin(self) -> None: ... - def untouchwin(self) -> None: ... - @overload - def vline(self, ch: _ChType, n: int) -> None: ... - @overload - def vline(self, y: int, x: int, ch: _ChType, n: int) -> None: ... - -ncurses_version: _ncurses_version diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_curses_panel.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_curses_panel.pyi deleted file mode 100644 index ddec22236b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_curses_panel.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from _curses import window -from typing import final - -__version__: str -version: str - -class error(Exception): ... - -@final -class panel: - def above(self) -> panel: ... - def below(self) -> panel: ... - def bottom(self) -> None: ... - def hidden(self) -> bool: ... - def hide(self) -> None: ... - def move(self, y: int, x: int, /) -> None: ... - def replace(self, win: window, /) -> None: ... - def set_userptr(self, obj: object, /) -> None: ... - def show(self) -> None: ... - def top(self) -> None: ... - def userptr(self) -> object: ... - def window(self) -> window: ... - -def bottom_panel() -> panel: ... -def new_panel(win: window, /) -> panel: ... -def top_panel() -> panel: ... -def update_panels() -> panel: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_dbm.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_dbm.pyi deleted file mode 100644 index 7e53cca3c7..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_dbm.pyi +++ /dev/null @@ -1,44 +0,0 @@ -import sys -from _typeshed import ReadOnlyBuffer, StrOrBytesPath -from types import TracebackType -from typing import TypeVar, final, overload, type_check_only -from typing_extensions import Self, TypeAlias - -if sys.platform != "win32": - _T = TypeVar("_T") - _KeyType: TypeAlias = str | ReadOnlyBuffer - _ValueType: TypeAlias = str | ReadOnlyBuffer - - class error(OSError): ... - library: str - - # Actual typename dbm, not exposed by the implementation - @final - @type_check_only - class _dbm: - def close(self) -> None: ... - if sys.version_info >= (3, 13): - def clear(self) -> None: ... - - def __getitem__(self, item: _KeyType) -> bytes: ... - def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ... - def __delitem__(self, key: _KeyType) -> None: ... - def __len__(self) -> int: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - @overload - def get(self, k: _KeyType, /) -> bytes | None: ... - @overload - def get(self, k: _KeyType, default: _T, /) -> bytes | _T: ... - def keys(self) -> list[bytes]: ... - def setdefault(self, k: _KeyType, default: _ValueType = ..., /) -> bytes: ... - # This isn't true, but the class can't be instantiated. See #13024 - __new__: None # type: ignore[assignment] - __init__: None # type: ignore[assignment] - - if sys.version_info >= (3, 11): - def open(filename: StrOrBytesPath, flags: str = "r", mode: int = 0o666, /) -> _dbm: ... - else: - def open(filename: str, flags: str = "r", mode: int = 0o666, /) -> _dbm: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_decimal.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_decimal.pyi deleted file mode 100644 index 06c0197dcf..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_decimal.pyi +++ /dev/null @@ -1,67 +0,0 @@ -import sys -from decimal import ( - Clamped as Clamped, - Context as Context, - ConversionSyntax as ConversionSyntax, - Decimal as Decimal, - DecimalException as DecimalException, - DecimalTuple as DecimalTuple, - DivisionByZero as DivisionByZero, - DivisionImpossible as DivisionImpossible, - DivisionUndefined as DivisionUndefined, - FloatOperation as FloatOperation, - Inexact as Inexact, - InvalidContext as InvalidContext, - InvalidOperation as InvalidOperation, - Overflow as Overflow, - Rounded as Rounded, - Subnormal as Subnormal, - Underflow as Underflow, - _ContextManager, -) -from typing import Final -from typing_extensions import TypeAlias - -_TrapType: TypeAlias = type[DecimalException] - -__version__: Final[str] -__libmpdec_version__: Final[str] - -ROUND_DOWN: Final = "ROUND_DOWN" -ROUND_HALF_UP: Final = "ROUND_HALF_UP" -ROUND_HALF_EVEN: Final = "ROUND_HALF_EVEN" -ROUND_CEILING: Final = "ROUND_CEILING" -ROUND_FLOOR: Final = "ROUND_FLOOR" -ROUND_UP: Final = "ROUND_UP" -ROUND_HALF_DOWN: Final = "ROUND_HALF_DOWN" -ROUND_05UP: Final = "ROUND_05UP" -HAVE_CONTEXTVAR: Final[bool] -HAVE_THREADS: Final[bool] -MAX_EMAX: Final[int] -MAX_PREC: Final[int] -MIN_EMIN: Final[int] -MIN_ETINY: Final[int] - -def setcontext(context: Context, /) -> None: ... -def getcontext() -> Context: ... - -if sys.version_info >= (3, 11): - def localcontext( - ctx: Context | None = None, - *, - prec: int | None = ..., - rounding: str | None = ..., - Emin: int | None = ..., - Emax: int | None = ..., - capitals: int | None = ..., - clamp: int | None = ..., - traps: dict[_TrapType, bool] | None = ..., - flags: dict[_TrapType, bool] | None = ..., - ) -> _ContextManager: ... - -else: - def localcontext(ctx: Context | None = None) -> _ContextManager: ... - -DefaultContext: Context -BasicContext: Context -ExtendedContext: Context diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_frozen_importlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_frozen_importlib.pyi deleted file mode 100644 index 3dbc8c6b52..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_frozen_importlib.pyi +++ /dev/null @@ -1,113 +0,0 @@ -import importlib.abc -import importlib.machinery -import sys -import types -from _typeshed.importlib import LoaderProtocol -from collections.abc import Mapping, Sequence -from types import ModuleType -from typing import Any, ClassVar - -# Signature of `builtins.__import__` should be kept identical to `importlib.__import__` -def __import__( - name: str, - globals: Mapping[str, object] | None = None, - locals: Mapping[str, object] | None = None, - fromlist: Sequence[str] = (), - level: int = 0, -) -> ModuleType: ... -def spec_from_loader( - name: str, loader: LoaderProtocol | None, *, origin: str | None = None, is_package: bool | None = None -) -> importlib.machinery.ModuleSpec | None: ... -def module_from_spec(spec: importlib.machinery.ModuleSpec) -> types.ModuleType: ... -def _init_module_attrs( - spec: importlib.machinery.ModuleSpec, module: types.ModuleType, *, override: bool = False -) -> types.ModuleType: ... - -class ModuleSpec: - def __init__( - self, - name: str, - loader: importlib.abc.Loader | None, - *, - origin: str | None = None, - loader_state: Any = None, - is_package: bool | None = None, - ) -> None: ... - name: str - loader: importlib.abc.Loader | None - origin: str | None - submodule_search_locations: list[str] | None - loader_state: Any - cached: str | None - @property - def parent(self) -> str | None: ... - has_location: bool - def __eq__(self, other: object) -> bool: ... - __hash__: ClassVar[None] # type: ignore[assignment] - -class BuiltinImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): - # MetaPathFinder - if sys.version_info < (3, 12): - @classmethod - def find_module(cls, fullname: str, path: Sequence[str] | None = None) -> importlib.abc.Loader | None: ... - - @classmethod - def find_spec( - cls, fullname: str, path: Sequence[str] | None = None, target: types.ModuleType | None = None - ) -> ModuleSpec | None: ... - # InspectLoader - @classmethod - def is_package(cls, fullname: str) -> bool: ... - @classmethod - def load_module(cls, fullname: str) -> types.ModuleType: ... - @classmethod - def get_code(cls, fullname: str) -> None: ... - @classmethod - def get_source(cls, fullname: str) -> None: ... - # Loader - if sys.version_info < (3, 12): - @staticmethod - def module_repr(module: types.ModuleType) -> str: ... - if sys.version_info >= (3, 10): - @staticmethod - def create_module(spec: ModuleSpec) -> types.ModuleType | None: ... - @staticmethod - def exec_module(module: types.ModuleType) -> None: ... - else: - @classmethod - def create_module(cls, spec: ModuleSpec) -> types.ModuleType | None: ... - @classmethod - def exec_module(cls, module: types.ModuleType) -> None: ... - -class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader): - # MetaPathFinder - if sys.version_info < (3, 12): - @classmethod - def find_module(cls, fullname: str, path: Sequence[str] | None = None) -> importlib.abc.Loader | None: ... - - @classmethod - def find_spec( - cls, fullname: str, path: Sequence[str] | None = None, target: types.ModuleType | None = None - ) -> ModuleSpec | None: ... - # InspectLoader - @classmethod - def is_package(cls, fullname: str) -> bool: ... - @classmethod - def load_module(cls, fullname: str) -> types.ModuleType: ... - @classmethod - def get_code(cls, fullname: str) -> None: ... - @classmethod - def get_source(cls, fullname: str) -> None: ... - # Loader - if sys.version_info < (3, 12): - @staticmethod - def module_repr(m: types.ModuleType) -> str: ... - if sys.version_info >= (3, 10): - @staticmethod - def create_module(spec: ModuleSpec) -> types.ModuleType | None: ... - else: - @classmethod - def create_module(cls, spec: ModuleSpec) -> types.ModuleType | None: ... - - @staticmethod - def exec_module(module: types.ModuleType) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_frozen_importlib_external.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_frozen_importlib_external.pyi deleted file mode 100644 index 386cf20808..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_frozen_importlib_external.pyi +++ /dev/null @@ -1,178 +0,0 @@ -import _ast -import _io -import importlib.abc -import importlib.machinery -import sys -import types -from _typeshed import ReadableBuffer, StrOrBytesPath, StrPath -from _typeshed.importlib import LoaderProtocol -from collections.abc import Callable, Iterable, Iterator, Mapping, MutableSequence, Sequence -from importlib.machinery import ModuleSpec -from importlib.metadata import DistributionFinder, PathDistribution -from typing import Any, Literal -from typing_extensions import Self, deprecated - -if sys.version_info >= (3, 10): - import importlib.readers - -if sys.platform == "win32": - path_separators: Literal["\\/"] - path_sep: Literal["\\"] - path_sep_tuple: tuple[Literal["\\"], Literal["/"]] -else: - path_separators: Literal["/"] - path_sep: Literal["/"] - path_sep_tuple: tuple[Literal["/"]] - -MAGIC_NUMBER: bytes - -def cache_from_source(path: StrPath, debug_override: bool | None = None, *, optimization: Any | None = None) -> str: ... -def source_from_cache(path: StrPath) -> str: ... -def decode_source(source_bytes: ReadableBuffer) -> str: ... -def spec_from_file_location( - name: str, - location: StrOrBytesPath | None = None, - *, - loader: LoaderProtocol | None = None, - submodule_search_locations: list[str] | None = ..., -) -> importlib.machinery.ModuleSpec | None: ... - -class WindowsRegistryFinder(importlib.abc.MetaPathFinder): - if sys.version_info < (3, 12): - @classmethod - def find_module(cls, fullname: str, path: Sequence[str] | None = None) -> importlib.abc.Loader | None: ... - - @classmethod - def find_spec( - cls, fullname: str, path: Sequence[str] | None = None, target: types.ModuleType | None = None - ) -> ModuleSpec | None: ... - -class PathFinder(importlib.abc.MetaPathFinder): - if sys.version_info >= (3, 10): - @staticmethod - def invalidate_caches() -> None: ... - else: - @classmethod - def invalidate_caches(cls) -> None: ... - if sys.version_info >= (3, 10): - @staticmethod - def find_distributions(context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ... - else: - @classmethod - def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ... - - @classmethod - def find_spec( - cls, fullname: str, path: Sequence[str] | None = None, target: types.ModuleType | None = None - ) -> ModuleSpec | None: ... - if sys.version_info < (3, 12): - @classmethod - def find_module(cls, fullname: str, path: Sequence[str] | None = None) -> importlib.abc.Loader | None: ... - -SOURCE_SUFFIXES: list[str] -DEBUG_BYTECODE_SUFFIXES: list[str] -OPTIMIZED_BYTECODE_SUFFIXES: list[str] -BYTECODE_SUFFIXES: list[str] -EXTENSION_SUFFIXES: list[str] - -class FileFinder(importlib.abc.PathEntryFinder): - path: str - def __init__(self, path: str, *loader_details: tuple[type[importlib.abc.Loader], list[str]]) -> None: ... - @classmethod - def path_hook( - cls, *loader_details: tuple[type[importlib.abc.Loader], list[str]] - ) -> Callable[[str], importlib.abc.PathEntryFinder]: ... - -class _LoaderBasics: - def is_package(self, fullname: str) -> bool: ... - def create_module(self, spec: ModuleSpec) -> types.ModuleType | None: ... - def exec_module(self, module: types.ModuleType) -> None: ... - def load_module(self, fullname: str) -> types.ModuleType: ... - -class SourceLoader(_LoaderBasics): - def path_mtime(self, path: str) -> float: ... - def set_data(self, path: str, data: bytes) -> None: ... - def get_source(self, fullname: str) -> str | None: ... - def path_stats(self, path: str) -> Mapping[str, Any]: ... - def source_to_code( - self, data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: ReadableBuffer | StrPath - ) -> types.CodeType: ... - def get_code(self, fullname: str) -> types.CodeType | None: ... - -class FileLoader: - name: str - path: str - def __init__(self, fullname: str, path: str) -> None: ... - def get_data(self, path: str) -> bytes: ... - def get_filename(self, name: str | None = None) -> str: ... - def load_module(self, name: str | None = None) -> types.ModuleType: ... - if sys.version_info >= (3, 10): - def get_resource_reader(self, name: str | None = None) -> importlib.readers.FileReader: ... - else: - def get_resource_reader(self, name: str | None = None) -> Self | None: ... - def open_resource(self, resource: str) -> _io.FileIO: ... - def resource_path(self, resource: str) -> str: ... - def is_resource(self, name: str) -> bool: ... - def contents(self) -> Iterator[str]: ... - -class SourceFileLoader(importlib.abc.FileLoader, FileLoader, importlib.abc.SourceLoader, SourceLoader): # type: ignore[misc] # incompatible method arguments in base classes - def set_data(self, path: str, data: ReadableBuffer, *, _mode: int = 0o666) -> None: ... - def path_stats(self, path: str) -> Mapping[str, Any]: ... - -class SourcelessFileLoader(importlib.abc.FileLoader, FileLoader, _LoaderBasics): - def get_code(self, fullname: str) -> types.CodeType | None: ... - def get_source(self, fullname: str) -> None: ... - -class ExtensionFileLoader(FileLoader, _LoaderBasics, importlib.abc.ExecutionLoader): - def __init__(self, name: str, path: str) -> None: ... - def get_filename(self, name: str | None = None) -> str: ... - def get_source(self, fullname: str) -> None: ... - def create_module(self, spec: ModuleSpec) -> types.ModuleType: ... - 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: ... - -if sys.version_info >= (3, 11): - class NamespaceLoader(importlib.abc.InspectLoader): - def __init__( - self, name: str, path: MutableSequence[str], path_finder: Callable[[str, tuple[str, ...]], ModuleSpec] - ) -> None: ... - def is_package(self, fullname: str) -> Literal[True]: ... - def get_source(self, fullname: str) -> Literal[""]: ... - def get_code(self, fullname: str) -> types.CodeType: ... - def create_module(self, spec: ModuleSpec) -> None: ... - def exec_module(self, module: types.ModuleType) -> None: ... - @deprecated("load_module() is deprecated; use exec_module() instead") - def load_module(self, fullname: str) -> types.ModuleType: ... - def get_resource_reader(self, module: types.ModuleType) -> importlib.readers.NamespaceReader: ... - if sys.version_info < (3, 12): - @staticmethod - @deprecated("module_repr() is deprecated, and has been removed in Python 3.12") - def module_repr(module: types.ModuleType) -> str: ... - - _NamespaceLoader = NamespaceLoader -else: - class _NamespaceLoader: - def __init__( - self, name: str, path: MutableSequence[str], path_finder: Callable[[str, tuple[str, ...]], ModuleSpec] - ) -> None: ... - def is_package(self, fullname: str) -> Literal[True]: ... - def get_source(self, fullname: str) -> Literal[""]: ... - def get_code(self, fullname: str) -> types.CodeType: ... - def create_module(self, spec: ModuleSpec) -> None: ... - def exec_module(self, module: types.ModuleType) -> None: ... - @deprecated("load_module() is deprecated; use exec_module() instead") - def load_module(self, fullname: str) -> types.ModuleType: ... - if sys.version_info >= (3, 10): - @staticmethod - @deprecated("module_repr() is deprecated, and has been removed in Python 3.12") - def module_repr(module: types.ModuleType) -> str: ... - def get_resource_reader(self, module: types.ModuleType) -> importlib.readers.NamespaceReader: ... - else: - @classmethod - @deprecated("module_repr() is deprecated, and has been removed in Python 3.12") - def module_repr(cls, module: types.ModuleType) -> str: ... - -if sys.version_info >= (3, 13): - class AppleFrameworkLoader(ExtensionFileLoader, importlib.abc.ExecutionLoader): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_gdbm.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_gdbm.pyi deleted file mode 100644 index 1d1d541f54..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_gdbm.pyi +++ /dev/null @@ -1,47 +0,0 @@ -import sys -from _typeshed import ReadOnlyBuffer, StrOrBytesPath -from types import TracebackType -from typing import TypeVar, overload -from typing_extensions import Self, TypeAlias - -if sys.platform != "win32": - _T = TypeVar("_T") - _KeyType: TypeAlias = str | ReadOnlyBuffer - _ValueType: TypeAlias = str | ReadOnlyBuffer - - open_flags: str - - class error(OSError): ... - # Actual typename gdbm, not exposed by the implementation - class _gdbm: - def firstkey(self) -> bytes | None: ... - def nextkey(self, key: _KeyType) -> bytes | None: ... - def reorganize(self) -> None: ... - def sync(self) -> None: ... - def close(self) -> None: ... - if sys.version_info >= (3, 13): - def clear(self) -> None: ... - - def __getitem__(self, item: _KeyType) -> bytes: ... - def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ... - def __delitem__(self, key: _KeyType) -> None: ... - def __contains__(self, key: _KeyType) -> bool: ... - def __len__(self) -> int: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - @overload - def get(self, k: _KeyType) -> bytes | None: ... - @overload - def get(self, k: _KeyType, default: _T) -> bytes | _T: ... - def keys(self) -> list[bytes]: ... - def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ... - # Don't exist at runtime - __new__: None # type: ignore[assignment] - __init__: None # type: ignore[assignment] - - if sys.version_info >= (3, 11): - def open(filename: StrOrBytesPath, flags: str = "r", mode: int = 0o666, /) -> _gdbm: ... - else: - def open(filename: str, flags: str = "r", mode: int = 0o666, /) -> _gdbm: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_hashlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_hashlib.pyi deleted file mode 100644 index 746b1657e2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_hashlib.pyi +++ /dev/null @@ -1,82 +0,0 @@ -import sys -from _typeshed import ReadableBuffer -from collections.abc import Callable -from types import ModuleType -from typing import AnyStr, Protocol, final, overload, type_check_only -from typing_extensions import Self, TypeAlias - -_DigestMod: TypeAlias = str | Callable[[], _HashObject] | ModuleType | None - -openssl_md_meth_names: frozenset[str] - -@type_check_only -class _HashObject(Protocol): - @property - def digest_size(self) -> int: ... - @property - def block_size(self) -> int: ... - @property - def name(self) -> str: ... - def copy(self) -> Self: ... - def digest(self) -> bytes: ... - def hexdigest(self) -> str: ... - def update(self, obj: ReadableBuffer, /) -> None: ... - -class HASH: - @property - def digest_size(self) -> int: ... - @property - def block_size(self) -> int: ... - @property - def name(self) -> str: ... - def copy(self) -> Self: ... - def digest(self) -> bytes: ... - def hexdigest(self) -> str: ... - def update(self, obj: ReadableBuffer, /) -> None: ... - -if sys.version_info >= (3, 10): - class UnsupportedDigestmodError(ValueError): ... - -class HASHXOF(HASH): - def digest(self, length: int) -> bytes: ... # type: ignore[override] - def hexdigest(self, length: int) -> str: ... # type: ignore[override] - -@final -class HMAC: - @property - def digest_size(self) -> int: ... - @property - def block_size(self) -> int: ... - @property - def name(self) -> str: ... - def copy(self) -> Self: ... - def digest(self) -> bytes: ... - def hexdigest(self) -> str: ... - def update(self, msg: ReadableBuffer) -> None: ... - -@overload -def compare_digest(a: ReadableBuffer, b: ReadableBuffer, /) -> bool: ... -@overload -def compare_digest(a: AnyStr, b: AnyStr, /) -> bool: ... -def get_fips_mode() -> int: ... -def hmac_new(key: bytes | bytearray, msg: ReadableBuffer = b"", digestmod: _DigestMod = None) -> HMAC: ... -def new(name: str, string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_md5(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_sha1(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_sha224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_sha256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_sha384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_sha512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_sha3_224(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_sha3_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_sha3_384(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_sha3_512(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASH: ... -def openssl_shake_128(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ... -def openssl_shake_256(string: ReadableBuffer = b"", *, usedforsecurity: bool = True) -> HASHXOF: ... -def hmac_digest(key: bytes | bytearray, msg: ReadableBuffer, digest: str) -> bytes: ... -def pbkdf2_hmac( - hash_name: str, password: ReadableBuffer, salt: ReadableBuffer, iterations: int, dklen: int | None = None -) -> bytes: ... -def scrypt( - password: ReadableBuffer, *, salt: ReadableBuffer, n: int, r: int, p: int, maxmem: int = 0, dklen: int = 64 -) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_heapq.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_heapq.pyi deleted file mode 100644 index 9f731bf91e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_heapq.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from typing import Any, Final, TypeVar - -_T = TypeVar("_T") - -__about__: Final[str] - -def heapify(heap: list[Any], /) -> None: ... -def heappop(heap: list[_T], /) -> _T: ... -def heappush(heap: list[_T], item: _T, /) -> None: ... -def heappushpop(heap: list[_T], item: _T, /) -> _T: ... -def heapreplace(heap: list[_T], item: _T, /) -> _T: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_imp.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_imp.pyi deleted file mode 100644 index de3549a91d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_imp.pyi +++ /dev/null @@ -1,28 +0,0 @@ -import sys -import types -from _typeshed import ReadableBuffer -from importlib.machinery import ModuleSpec -from typing import Any - -check_hash_based_pycs: str - -def source_hash(key: int, source: ReadableBuffer) -> bytes: ... -def create_builtin(spec: ModuleSpec, /) -> types.ModuleType: ... -def create_dynamic(spec: ModuleSpec, file: Any = None, /) -> types.ModuleType: ... -def acquire_lock() -> None: ... -def exec_builtin(mod: types.ModuleType, /) -> int: ... -def exec_dynamic(mod: types.ModuleType, /) -> int: ... -def extension_suffixes() -> list[str]: ... -def init_frozen(name: str, /) -> types.ModuleType: ... -def is_builtin(name: str, /) -> int: ... -def is_frozen(name: str, /) -> bool: ... -def is_frozen_package(name: str, /) -> bool: ... -def lock_held() -> bool: ... -def release_lock() -> None: ... - -if sys.version_info >= (3, 11): - def find_frozen(name: str, /, *, withdata: bool = False) -> tuple[memoryview | None, bool, str | None] | None: ... - def get_frozen_object(name: str, data: ReadableBuffer | None = None, /) -> types.CodeType: ... - -else: - def get_frozen_object(name: str, /) -> types.CodeType: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_interpchannels.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_interpchannels.pyi deleted file mode 100644 index c03496044d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_interpchannels.pyi +++ /dev/null @@ -1,86 +0,0 @@ -from _typeshed import structseq -from typing import Any, Final, Literal, SupportsIndex, final -from typing_extensions import Buffer, Self - -class ChannelError(RuntimeError): ... -class ChannelClosedError(ChannelError): ... -class ChannelEmptyError(ChannelError): ... -class ChannelNotEmptyError(ChannelError): ... -class ChannelNotFoundError(ChannelError): ... - -# Mark as final, since instantiating ChannelID is not supported. -@final -class ChannelID: - @property - def end(self) -> Literal["send", "recv", "both"]: ... - @property - def send(self) -> Self: ... - @property - def recv(self) -> Self: ... - def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: ChannelID) -> bool: ... - def __gt__(self, other: ChannelID) -> bool: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __int__(self) -> int: ... - def __le__(self, other: ChannelID) -> bool: ... - def __lt__(self, other: ChannelID) -> bool: ... - def __ne__(self, other: object) -> bool: ... - -@final -class ChannelInfo(structseq[int], tuple[bool, bool, bool, int, int, int, int, int]): - __match_args__: Final = ( - "open", - "closing", - "closed", - "count", - "num_interp_send", - "num_interp_send_released", - "num_interp_recv", - "num_interp_recv_released", - ) - @property - def open(self) -> bool: ... - @property - def closing(self) -> bool: ... - @property - def closed(self) -> bool: ... - @property - def count(self) -> int: ... # type: ignore[override] - @property - def num_interp_send(self) -> int: ... - @property - def num_interp_send_released(self) -> int: ... - @property - def num_interp_recv(self) -> int: ... - @property - def num_interp_recv_released(self) -> int: ... - @property - def num_interp_both(self) -> int: ... - @property - def num_interp_both_recv_released(self) -> int: ... - @property - def num_interp_both_send_released(self) -> int: ... - @property - def num_interp_both_released(self) -> int: ... - @property - def recv_associated(self) -> bool: ... - @property - def recv_released(self) -> bool: ... - @property - def send_associated(self) -> bool: ... - @property - def send_released(self) -> bool: ... - -def create(unboundop: Literal[1, 2, 3]) -> ChannelID: ... -def destroy(cid: SupportsIndex) -> None: ... -def list_all() -> list[ChannelID]: ... -def list_interpreters(cid: SupportsIndex, *, send: bool) -> list[int]: ... -def send(cid: SupportsIndex, obj: object, *, blocking: bool = True, timeout: float | None = None) -> None: ... -def send_buffer(cid: SupportsIndex, obj: Buffer, *, blocking: bool = True, timeout: float | None = None) -> None: ... -def recv(cid: SupportsIndex, default: object = ...) -> tuple[Any, Literal[1, 2, 3]]: ... -def close(cid: SupportsIndex, *, send: bool = False, recv: bool = False) -> None: ... -def get_count(cid: SupportsIndex) -> int: ... -def get_info(cid: SupportsIndex) -> ChannelInfo: ... -def get_channel_defaults(cid: SupportsIndex) -> Literal[1, 2, 3]: ... -def release(cid: SupportsIndex, *, send: bool = False, recv: bool = False, force: bool = False) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_interpqueues.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_interpqueues.pyi deleted file mode 100644 index c9323b106f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_interpqueues.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Any, Literal, SupportsIndex -from typing_extensions import TypeAlias - -_UnboundOp: TypeAlias = Literal[1, 2, 3] - -class QueueError(RuntimeError): ... -class QueueNotFoundError(QueueError): ... - -def bind(qid: SupportsIndex) -> None: ... -def create(maxsize: SupportsIndex, fmt: SupportsIndex, unboundop: _UnboundOp) -> int: ... -def destroy(qid: SupportsIndex) -> None: ... -def get(qid: SupportsIndex) -> tuple[Any, int, _UnboundOp | None]: ... -def get_count(qid: SupportsIndex) -> int: ... -def get_maxsize(qid: SupportsIndex) -> int: ... -def get_queue_defaults(qid: SupportsIndex) -> tuple[int, _UnboundOp]: ... -def is_full(qid: SupportsIndex) -> bool: ... -def list_all() -> list[tuple[int, int, _UnboundOp]]: ... -def put(qid: SupportsIndex, obj: Any, fmt: SupportsIndex, unboundop: _UnboundOp) -> None: ... -def release(qid: SupportsIndex) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_interpreters.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_interpreters.pyi deleted file mode 100644 index caa1115e9d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_interpreters.pyi +++ /dev/null @@ -1,52 +0,0 @@ -import types -from collections.abc import Callable, Mapping -from typing import Final, Literal, SupportsIndex -from typing_extensions import TypeAlias - -_Configs: TypeAlias = Literal["default", "isolated", "legacy", "empty", ""] - -class InterpreterError(Exception): ... -class InterpreterNotFoundError(InterpreterError): ... -class NotShareableError(ValueError): ... - -class CrossInterpreterBufferView: - def __buffer__(self, flags: int, /) -> memoryview: ... - -def new_config(name: _Configs = "isolated", /, **overides: object) -> types.SimpleNamespace: ... -def create(config: types.SimpleNamespace | _Configs | None = "isolated", *, reqrefs: bool = False) -> int: ... -def destroy(id: SupportsIndex, *, restrict: bool = False) -> None: ... -def list_all(*, require_ready: bool) -> list[tuple[int, int]]: ... -def get_current() -> tuple[int, int]: ... -def get_main() -> tuple[int, int]: ... -def is_running(id: SupportsIndex, *, restrict: bool = False) -> bool: ... -def get_config(id: SupportsIndex, *, restrict: bool = False) -> types.SimpleNamespace: ... -def whence(id: SupportsIndex) -> int: ... -def exec( - id: SupportsIndex, code: str | types.CodeType | Callable[[], object], shared: bool | None = None, *, restrict: bool = False -) -> None | types.SimpleNamespace: ... -def call( - id: SupportsIndex, - callable: Callable[..., object], - args: tuple[object, ...] | None = None, - kwargs: dict[str, object] | None = None, - *, - restrict: bool = False, -) -> object: ... -def run_string( - id: SupportsIndex, script: str | types.CodeType | Callable[[], object], shared: bool | None = None, *, restrict: bool = False -) -> None: ... -def run_func( - id: SupportsIndex, func: types.CodeType | Callable[[], object], shared: bool | None = None, *, restrict: bool = False -) -> None: ... -def set___main___attrs(id: SupportsIndex, updates: Mapping[str, object], *, restrict: bool = False) -> None: ... -def incref(id: SupportsIndex, *, implieslink: bool = False, restrict: bool = False) -> None: ... -def decref(id: SupportsIndex, *, restrict: bool = False) -> None: ... -def is_shareable(obj: object) -> bool: ... -def capture_exception(exc: BaseException | None = None) -> types.SimpleNamespace: ... - -WHENCE_UNKNOWN: Final = 0 -WHENCE_RUNTIME: Final = 1 -WHENCE_LEGACY_CAPI: Final = 2 -WHENCE_CAPI: Final = 3 -WHENCE_XI: Final = 4 -WHENCE_STDLIB: Final = 5 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_io.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_io.pyi deleted file mode 100644 index 54efd31997..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_io.pyi +++ /dev/null @@ -1,216 +0,0 @@ -import builtins -import codecs -import sys -from _typeshed import FileDescriptorOrPath, MaybeNone, ReadableBuffer, WriteableBuffer -from collections.abc import Callable, Iterable, Iterator -from io import BufferedIOBase, RawIOBase, TextIOBase, UnsupportedOperation as UnsupportedOperation -from os import _Opener -from types import TracebackType -from typing import IO, Any, BinaryIO, Final, Generic, Literal, Protocol, TextIO, TypeVar, overload, type_check_only -from typing_extensions import Self - -_T = TypeVar("_T") - -DEFAULT_BUFFER_SIZE: Final = 8192 - -open = builtins.open - -def open_code(path: str) -> IO[bytes]: ... - -BlockingIOError = builtins.BlockingIOError - -class _IOBase: - def __iter__(self) -> Iterator[bytes]: ... - def __next__(self) -> bytes: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - def close(self) -> None: ... - def fileno(self) -> int: ... - def flush(self) -> None: ... - def isatty(self) -> bool: ... - def readable(self) -> bool: ... - read: Callable[..., Any] - def readlines(self, hint: int = -1, /) -> list[bytes]: ... - def seek(self, offset: int, whence: int = 0, /) -> int: ... - def seekable(self) -> bool: ... - def tell(self) -> int: ... - def truncate(self, size: int | None = None, /) -> int: ... - def writable(self) -> bool: ... - write: Callable[..., Any] - def writelines(self, lines: Iterable[ReadableBuffer], /) -> None: ... - def readline(self, size: int | None = -1, /) -> bytes: ... - def __del__(self) -> None: ... - @property - def closed(self) -> bool: ... - def _checkClosed(self) -> None: ... # undocumented - -class _RawIOBase(_IOBase): - def readall(self) -> bytes: ... - # The following methods can return None if the file is in non-blocking mode - # and no data is available. - def readinto(self, buffer: WriteableBuffer, /) -> int | MaybeNone: ... - def write(self, b: ReadableBuffer, /) -> int | MaybeNone: ... - def read(self, size: int = -1, /) -> bytes | MaybeNone: ... - -class _BufferedIOBase(_IOBase): - def detach(self) -> RawIOBase: ... - def readinto(self, buffer: WriteableBuffer, /) -> int: ... - def write(self, buffer: ReadableBuffer, /) -> int: ... - def readinto1(self, buffer: WriteableBuffer, /) -> int: ... - def read(self, size: int | None = -1, /) -> bytes: ... - def read1(self, size: int = -1, /) -> bytes: ... - -class FileIO(RawIOBase, _RawIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes - mode: str - # The type of "name" equals the argument passed in to the constructor, - # but that can make FileIO incompatible with other I/O types that assume - # "name" is a str. In the future, making FileIO generic might help. - name: Any - def __init__( - self, file: FileDescriptorOrPath, mode: str = "r", closefd: bool = True, opener: _Opener | None = None - ) -> None: ... - @property - def closefd(self) -> bool: ... - def seek(self, pos: int, whence: int = 0, /) -> int: ... - def read(self, size: int | None = -1, /) -> bytes | MaybeNone: ... - -class BytesIO(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes - def __init__(self, initial_bytes: ReadableBuffer = b"") -> None: ... - # BytesIO does not contain a "name" field. This workaround is necessary - # to allow BytesIO sub-classes to add this field, as it is defined - # as a read-only property on IO[]. - name: Any - def getvalue(self) -> bytes: ... - def getbuffer(self) -> memoryview: ... - def read1(self, size: int | None = -1, /) -> bytes: ... - def readlines(self, size: int | None = None, /) -> list[bytes]: ... - def seek(self, pos: int, whence: int = 0, /) -> int: ... - -class BufferedReader(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes - raw: RawIOBase - def __init__(self, raw: RawIOBase, buffer_size: int = 8192) -> None: ... - def peek(self, size: int = 0, /) -> bytes: ... - def seek(self, target: int, whence: int = 0, /) -> int: ... - def truncate(self, pos: int | None = None, /) -> int: ... - -class BufferedWriter(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of writelines in the base classes - raw: RawIOBase - def __init__(self, raw: RawIOBase, buffer_size: int = 8192) -> None: ... - def write(self, buffer: ReadableBuffer, /) -> int: ... - def seek(self, target: int, whence: int = 0, /) -> int: ... - def truncate(self, pos: int | None = None, /) -> int: ... - -class BufferedRandom(BufferedIOBase, _BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible definitions of methods in the base classes - mode: str - name: Any - raw: RawIOBase - def __init__(self, raw: RawIOBase, buffer_size: int = 8192) -> None: ... - def seek(self, target: int, whence: int = 0, /) -> int: ... # stubtest needs this - def peek(self, size: int = 0, /) -> bytes: ... - def truncate(self, pos: int | None = None, /) -> int: ... - -class BufferedRWPair(BufferedIOBase, _BufferedIOBase): - def __init__(self, reader: RawIOBase, writer: RawIOBase, buffer_size: int = 8192, /) -> None: ... - def peek(self, size: int = 0, /) -> bytes: ... - -class _TextIOBase(_IOBase): - encoding: str - errors: str | None - newlines: str | tuple[str, ...] | None - def __iter__(self) -> Iterator[str]: ... # type: ignore[override] - def __next__(self) -> str: ... # type: ignore[override] - def detach(self) -> BinaryIO: ... - def write(self, s: str, /) -> int: ... - def writelines(self, lines: Iterable[str], /) -> None: ... # type: ignore[override] - def readline(self, size: int = -1, /) -> str: ... # type: ignore[override] - def readlines(self, hint: int = -1, /) -> list[str]: ... # type: ignore[override] - def read(self, size: int | None = -1, /) -> str: ... - -@type_check_only -class _WrappedBuffer(Protocol): - # "name" is wrapped by TextIOWrapper. Its type is inconsistent between - # the various I/O types, see the comments on TextIOWrapper.name and - # TextIO.name. - @property - def name(self) -> Any: ... - @property - def closed(self) -> bool: ... - def read(self, size: int = ..., /) -> ReadableBuffer: ... - # Optional: def read1(self, size: int, /) -> ReadableBuffer: ... - def write(self, b: bytes, /) -> object: ... - def flush(self) -> object: ... - def close(self) -> object: ... - def seekable(self) -> bool: ... - def readable(self) -> bool: ... - def writable(self) -> bool: ... - def truncate(self, size: int, /) -> int: ... - def fileno(self) -> int: ... - def isatty(self) -> bool: ... - # Optional: Only needs to be present if seekable() returns True. - # def seek(self, offset: Literal[0], whence: Literal[2]) -> int: ... - # def tell(self) -> int: ... - -_BufferT_co = TypeVar("_BufferT_co", bound=_WrappedBuffer, default=_WrappedBuffer, covariant=True) - -class TextIOWrapper(TextIOBase, _TextIOBase, TextIO, Generic[_BufferT_co]): # type: ignore[misc] # incompatible definitions of write in the base classes - def __init__( - self, - buffer: _BufferT_co, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - line_buffering: bool = False, - write_through: bool = False, - ) -> None: ... - # Equals the "buffer" argument passed in to the constructor. - @property - def buffer(self) -> _BufferT_co: ... # type: ignore[override] - @property - def line_buffering(self) -> bool: ... - @property - def write_through(self) -> bool: ... - def reconfigure( - self, - *, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - line_buffering: bool | None = None, - write_through: bool | None = None, - ) -> None: ... - def readline(self, size: int = -1, /) -> str: ... # type: ignore[override] - # Equals the "buffer" argument passed in to the constructor. - def detach(self) -> _BufferT_co: ... # type: ignore[override] - # TextIOWrapper's version of seek only supports a limited subset of - # operations. - def seek(self, cookie: int, whence: int = 0, /) -> int: ... - def truncate(self, pos: int | None = None, /) -> int: ... - -class StringIO(TextIOBase, _TextIOBase, TextIO): # type: ignore[misc] # incompatible definitions of write in the base classes - def __init__(self, initial_value: str | None = "", newline: str | None = "\n") -> None: ... - # StringIO does not contain a "name" field. This workaround is necessary - # to allow StringIO sub-classes to add this field, as it is defined - # as a read-only property on IO[]. - name: Any - def getvalue(self) -> str: ... - @property - def line_buffering(self) -> bool: ... - def seek(self, pos: int, whence: int = 0, /) -> int: ... - def truncate(self, pos: int | None = None, /) -> int: ... - -class IncrementalNewlineDecoder: - def __init__(self, decoder: codecs.IncrementalDecoder | None, translate: bool, errors: str = "strict") -> None: ... - def decode(self, input: ReadableBuffer | str, final: bool = False) -> str: ... - @property - def newlines(self) -> str | tuple[str, ...] | None: ... - def getstate(self) -> tuple[bytes, int]: ... - def reset(self) -> None: ... - def setstate(self, state: tuple[bytes, int], /) -> None: ... - -if sys.version_info >= (3, 10): - @overload - def text_encoding(encoding: None, stacklevel: int = 2, /) -> Literal["locale", "utf-8"]: ... - @overload - def text_encoding(encoding: _T, stacklevel: int = 2, /) -> _T: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_json.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_json.pyi deleted file mode 100644 index 5296b8e62a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_json.pyi +++ /dev/null @@ -1,51 +0,0 @@ -from collections.abc import Callable -from typing import Any, final -from typing_extensions import Self - -@final -class make_encoder: - @property - def sort_keys(self) -> bool: ... - @property - def skipkeys(self) -> bool: ... - @property - def key_separator(self) -> str: ... - @property - def indent(self) -> int | None: ... - @property - def markers(self) -> dict[int, Any] | None: ... - @property - def default(self) -> Callable[[Any], Any]: ... - @property - def encoder(self) -> Callable[[str], str]: ... - @property - def item_separator(self) -> str: ... - def __new__( - cls, - markers: dict[int, Any] | None, - default: Callable[[Any], Any], - encoder: Callable[[str], str], - indent: int | None, - key_separator: str, - item_separator: str, - sort_keys: bool, - skipkeys: bool, - allow_nan: bool, - ) -> Self: ... - def __call__(self, obj: object, _current_indent_level: int) -> Any: ... - -@final -class make_scanner: - object_hook: Any - object_pairs_hook: Any - parse_int: Any - parse_constant: Any - parse_float: Any - strict: bool - # TODO: 'context' needs the attrs above (ducktype), but not __call__. - def __new__(cls, context: make_scanner) -> Self: ... - def __call__(self, string: str, index: int) -> tuple[Any, int]: ... - -def encode_basestring(s: str, /) -> str: ... -def encode_basestring_ascii(s: str, /) -> str: ... -def scanstring(string: str, end: int, strict: bool = ...) -> tuple[str, int]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_locale.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_locale.pyi deleted file mode 100644 index ccce7a0d9d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_locale.pyi +++ /dev/null @@ -1,121 +0,0 @@ -import sys -from _typeshed import StrPath -from typing import Final, Literal, TypedDict, type_check_only - -@type_check_only -class _LocaleConv(TypedDict): - decimal_point: str - grouping: list[int] - thousands_sep: str - int_curr_symbol: str - currency_symbol: str - p_cs_precedes: Literal[0, 1, 127] - n_cs_precedes: Literal[0, 1, 127] - p_sep_by_space: Literal[0, 1, 127] - n_sep_by_space: Literal[0, 1, 127] - mon_decimal_point: str - frac_digits: int - int_frac_digits: int - mon_thousands_sep: str - mon_grouping: list[int] - positive_sign: str - negative_sign: str - p_sign_posn: Literal[0, 1, 2, 3, 4, 127] - n_sign_posn: Literal[0, 1, 2, 3, 4, 127] - -LC_CTYPE: Final[int] -LC_COLLATE: Final[int] -LC_TIME: Final[int] -LC_MONETARY: Final[int] -LC_NUMERIC: Final[int] -LC_ALL: Final[int] -CHAR_MAX: Final = 127 - -def setlocale(category: int, locale: str | None = None, /) -> str: ... -def localeconv() -> _LocaleConv: ... - -if sys.version_info >= (3, 11): - def getencoding() -> str: ... - -def strcoll(os1: str, os2: str, /) -> int: ... -def strxfrm(string: str, /) -> str: ... - -# native gettext functions -# https://docs.python.org/3/library/locale.html#access-to-message-catalogs -# https://github.com/python/cpython/blob/f4c03484da59049eb62a9bf7777b963e2267d187/Modules/_localemodule.c#L626 -if sys.platform != "win32": - LC_MESSAGES: int - - ABDAY_1: Final[int] - ABDAY_2: Final[int] - ABDAY_3: Final[int] - ABDAY_4: Final[int] - ABDAY_5: Final[int] - ABDAY_6: Final[int] - ABDAY_7: Final[int] - - ABMON_1: Final[int] - ABMON_2: Final[int] - ABMON_3: Final[int] - ABMON_4: Final[int] - ABMON_5: Final[int] - ABMON_6: Final[int] - ABMON_7: Final[int] - ABMON_8: Final[int] - ABMON_9: Final[int] - ABMON_10: Final[int] - ABMON_11: Final[int] - ABMON_12: Final[int] - - DAY_1: Final[int] - DAY_2: Final[int] - DAY_3: Final[int] - DAY_4: Final[int] - DAY_5: Final[int] - DAY_6: Final[int] - DAY_7: Final[int] - - ERA: Final[int] - ERA_D_T_FMT: Final[int] - ERA_D_FMT: Final[int] - ERA_T_FMT: Final[int] - - MON_1: Final[int] - MON_2: Final[int] - MON_3: Final[int] - MON_4: Final[int] - MON_5: Final[int] - MON_6: Final[int] - MON_7: Final[int] - MON_8: Final[int] - MON_9: Final[int] - MON_10: Final[int] - MON_11: Final[int] - MON_12: Final[int] - - CODESET: Final[int] - D_T_FMT: Final[int] - D_FMT: Final[int] - T_FMT: Final[int] - T_FMT_AMPM: Final[int] - AM_STR: Final[int] - PM_STR: Final[int] - - RADIXCHAR: Final[int] - THOUSEP: Final[int] - YESEXPR: Final[int] - NOEXPR: Final[int] - CRNCYSTR: Final[int] - ALT_DIGITS: Final[int] - - def nl_langinfo(key: int, /) -> str: ... - - # This is dependent on `libintl.h` which is a part of `gettext` - # system dependency. These functions might be missing. - # But, we always say that they are present. - def gettext(msg: str, /) -> str: ... - def dgettext(domain: str | None, msg: str, /) -> str: ... - def dcgettext(domain: str | None, msg: str, category: int, /) -> str: ... - def textdomain(domain: str | None, /) -> str: ... - def bindtextdomain(domain: str, dir: StrPath | None, /) -> str: ... - def bind_textdomain_codeset(domain: str, codeset: str | None, /) -> str | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_lsprof.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_lsprof.pyi deleted file mode 100644 index 8a6934162c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_lsprof.pyi +++ /dev/null @@ -1,35 +0,0 @@ -import sys -from _typeshed import structseq -from collections.abc import Callable -from types import CodeType -from typing import Any, Final, final - -class Profiler: - def __init__( - self, timer: Callable[[], float] | None = None, timeunit: float = 0.0, subcalls: bool = True, builtins: bool = True - ) -> None: ... - def getstats(self) -> list[profiler_entry]: ... - def enable(self, subcalls: bool = True, builtins: bool = True) -> None: ... - def disable(self) -> None: ... - def clear(self) -> None: ... - -@final -class profiler_entry(structseq[Any], tuple[CodeType | str, int, int, float, float, list[profiler_subentry]]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("code", "callcount", "reccallcount", "totaltime", "inlinetime", "calls") - code: CodeType | str - callcount: int - reccallcount: int - totaltime: float - inlinetime: float - calls: list[profiler_subentry] - -@final -class profiler_subentry(structseq[Any], tuple[CodeType | str, int, int, float, float]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("code", "callcount", "reccallcount", "totaltime", "inlinetime") - code: CodeType | str - callcount: int - reccallcount: int - totaltime: float - inlinetime: float diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_lzma.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_lzma.pyi deleted file mode 100644 index 1a27c7428e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_lzma.pyi +++ /dev/null @@ -1,71 +0,0 @@ -import sys -from _typeshed import ReadableBuffer -from collections.abc import Mapping, Sequence -from typing import Any, Final, final -from typing_extensions import Self, TypeAlias - -_FilterChain: TypeAlias = Sequence[Mapping[str, Any]] - -FORMAT_AUTO: Final = 0 -FORMAT_XZ: Final = 1 -FORMAT_ALONE: Final = 2 -FORMAT_RAW: Final = 3 -CHECK_NONE: Final = 0 -CHECK_CRC32: Final = 1 -CHECK_CRC64: Final = 4 -CHECK_SHA256: Final = 10 -CHECK_ID_MAX: Final = 15 -CHECK_UNKNOWN: Final = 16 -FILTER_LZMA1: int # v big number -FILTER_LZMA2: Final = 33 -FILTER_DELTA: Final = 3 -FILTER_X86: Final = 4 -FILTER_IA64: Final = 6 -FILTER_ARM: Final = 7 -FILTER_ARMTHUMB: Final = 8 -FILTER_SPARC: Final = 9 -FILTER_POWERPC: Final = 5 -MF_HC3: Final = 3 -MF_HC4: Final = 4 -MF_BT2: Final = 18 -MF_BT3: Final = 19 -MF_BT4: Final = 20 -MODE_FAST: Final = 1 -MODE_NORMAL: Final = 2 -PRESET_DEFAULT: Final = 6 -PRESET_EXTREME: int # v big number - -@final -class LZMADecompressor: - if sys.version_info >= (3, 12): - def __new__(cls, format: int | None = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> Self: ... - else: - def __init__(self, format: int | None = ..., memlimit: int | None = ..., filters: _FilterChain | None = ...) -> None: ... - - def decompress(self, data: ReadableBuffer, max_length: int = -1) -> bytes: ... - @property - def check(self) -> int: ... - @property - def eof(self) -> bool: ... - @property - def unused_data(self) -> bytes: ... - @property - def needs_input(self) -> bool: ... - -@final -class LZMACompressor: - if sys.version_info >= (3, 12): - def __new__( - cls, format: int | None = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ... - ) -> Self: ... - else: - def __init__( - self, format: int | None = ..., check: int = ..., preset: int | None = ..., filters: _FilterChain | None = ... - ) -> None: ... - - def compress(self, data: ReadableBuffer, /) -> bytes: ... - def flush(self) -> bytes: ... - -class LZMAError(Exception): ... - -def is_check_supported(check_id: int, /) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_markupbase.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_markupbase.pyi deleted file mode 100644 index 62bad25e5c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_markupbase.pyi +++ /dev/null @@ -1,16 +0,0 @@ -import sys -from typing import Any - -class ParserBase: - def reset(self) -> None: ... - def getpos(self) -> tuple[int, int]: ... - def unknown_decl(self, data: str) -> None: ... - def parse_comment(self, i: int, report: int = 1) -> int: ... # undocumented - def parse_declaration(self, i: int) -> int: ... # undocumented - def parse_marked_section(self, i: int, report: int = 1) -> int: ... # undocumented - def updatepos(self, i: int, j: int) -> int: ... # undocumented - if sys.version_info < (3, 10): - # Removed from ParserBase: https://bugs.python.org/issue31844 - def error(self, message: str) -> Any: ... # undocumented - lineno: int # undocumented - offset: int # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_msi.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_msi.pyi deleted file mode 100644 index 779fda3b67..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_msi.pyi +++ /dev/null @@ -1,92 +0,0 @@ -import sys - -if sys.platform == "win32": - class MSIError(Exception): ... - # Actual typename View, not exposed by the implementation - class _View: - def Execute(self, params: _Record | None = ...) -> None: ... - def GetColumnInfo(self, kind: int) -> _Record: ... - def Fetch(self) -> _Record: ... - def Modify(self, mode: int, record: _Record) -> None: ... - def Close(self) -> None: ... - # Don't exist at runtime - __new__: None # type: ignore[assignment] - __init__: None # type: ignore[assignment] - - # Actual typename SummaryInformation, not exposed by the implementation - class _SummaryInformation: - def GetProperty(self, field: int) -> int | bytes | None: ... - def GetPropertyCount(self) -> int: ... - def SetProperty(self, field: int, value: int | str) -> None: ... - def Persist(self) -> None: ... - # Don't exist at runtime - __new__: None # type: ignore[assignment] - __init__: None # type: ignore[assignment] - - # Actual typename Database, not exposed by the implementation - class _Database: - def OpenView(self, sql: str) -> _View: ... - def Commit(self) -> None: ... - def GetSummaryInformation(self, updateCount: int) -> _SummaryInformation: ... - def Close(self) -> None: ... - # Don't exist at runtime - __new__: None # type: ignore[assignment] - __init__: None # type: ignore[assignment] - - # Actual typename Record, not exposed by the implementation - class _Record: - def GetFieldCount(self) -> int: ... - def GetInteger(self, field: int) -> int: ... - def GetString(self, field: int) -> str: ... - def SetString(self, field: int, str: str) -> None: ... - def SetStream(self, field: int, stream: str) -> None: ... - def SetInteger(self, field: int, int: int) -> None: ... - def ClearData(self) -> None: ... - # Don't exist at runtime - __new__: None # type: ignore[assignment] - __init__: None # type: ignore[assignment] - - def UuidCreate() -> str: ... - def FCICreate(cabname: str, files: list[str], /) -> None: ... - def OpenDatabase(path: str, persist: int, /) -> _Database: ... - def CreateRecord(count: int, /) -> _Record: ... - - MSICOLINFO_NAMES: int - MSICOLINFO_TYPES: int - MSIDBOPEN_CREATE: int - MSIDBOPEN_CREATEDIRECT: int - MSIDBOPEN_DIRECT: int - MSIDBOPEN_PATCHFILE: int - MSIDBOPEN_READONLY: int - MSIDBOPEN_TRANSACT: int - MSIMODIFY_ASSIGN: int - MSIMODIFY_DELETE: int - MSIMODIFY_INSERT: int - MSIMODIFY_INSERT_TEMPORARY: int - MSIMODIFY_MERGE: int - MSIMODIFY_REFRESH: int - MSIMODIFY_REPLACE: int - MSIMODIFY_SEEK: int - MSIMODIFY_UPDATE: int - MSIMODIFY_VALIDATE: int - MSIMODIFY_VALIDATE_DELETE: int - MSIMODIFY_VALIDATE_FIELD: int - MSIMODIFY_VALIDATE_NEW: int - - PID_APPNAME: int - PID_AUTHOR: int - PID_CHARCOUNT: int - PID_CODEPAGE: int - PID_COMMENTS: int - PID_CREATE_DTM: int - PID_KEYWORDS: int - PID_LASTAUTHOR: int - PID_LASTPRINTED: int - PID_LASTSAVE_DTM: int - PID_PAGECOUNT: int - PID_REVNUMBER: int - PID_SECURITY: int - PID_SUBJECT: int - PID_TEMPLATE: int - PID_TITLE: int - PID_WORDCOUNT: int diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_multibytecodec.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_multibytecodec.pyi deleted file mode 100644 index 7e408f2aa3..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_multibytecodec.pyi +++ /dev/null @@ -1,44 +0,0 @@ -from _typeshed import ReadableBuffer -from codecs import _ReadableStream, _WritableStream -from collections.abc import Iterable -from typing import final, type_check_only - -# This class is not exposed. It calls itself _multibytecodec.MultibyteCodec. -@final -@type_check_only -class _MultibyteCodec: - def decode(self, input: ReadableBuffer, errors: str | None = None) -> str: ... - def encode(self, input: str, errors: str | None = None) -> bytes: ... - -class MultibyteIncrementalDecoder: - errors: str - def __init__(self, errors: str = "strict") -> None: ... - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - def getstate(self) -> tuple[bytes, int]: ... - def reset(self) -> None: ... - def setstate(self, state: tuple[bytes, int], /) -> None: ... - -class MultibyteIncrementalEncoder: - errors: str - def __init__(self, errors: str = "strict") -> None: ... - def encode(self, input: str, final: bool = False) -> bytes: ... - def getstate(self) -> int: ... - def reset(self) -> None: ... - def setstate(self, state: int, /) -> None: ... - -class MultibyteStreamReader: - errors: str - stream: _ReadableStream - def __init__(self, stream: _ReadableStream, errors: str = "strict") -> None: ... - def read(self, sizeobj: int | None = None, /) -> str: ... - def readline(self, sizeobj: int | None = None, /) -> str: ... - def readlines(self, sizehintobj: int | None = None, /) -> list[str]: ... - def reset(self) -> None: ... - -class MultibyteStreamWriter: - errors: str - stream: _WritableStream - def __init__(self, stream: _WritableStream, errors: str = "strict") -> None: ... - def reset(self) -> None: ... - def write(self, strobj: str, /) -> None: ... - def writelines(self, lines: Iterable[str], /) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_operator.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_operator.pyi deleted file mode 100644 index 967215d8fa..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_operator.pyi +++ /dev/null @@ -1,115 +0,0 @@ -import sys -from _typeshed import SupportsGetItem -from collections.abc import Callable, Container, Iterable, MutableMapping, MutableSequence, Sequence -from operator import attrgetter as attrgetter, itemgetter as itemgetter, methodcaller as methodcaller -from typing import Any, AnyStr, Protocol, SupportsAbs, SupportsIndex, TypeVar, overload -from typing_extensions import ParamSpec, TypeAlias, TypeIs - -_R = TypeVar("_R") -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True) -_K = TypeVar("_K") -_V = TypeVar("_V") -_P = ParamSpec("_P") - -# The following protocols return "Any" instead of bool, since the comparison -# operators can be overloaded to return an arbitrary object. For example, -# the numpy.array comparison dunders return another numpy.array. - -class _SupportsDunderLT(Protocol): - def __lt__(self, other: Any, /) -> Any: ... - -class _SupportsDunderGT(Protocol): - def __gt__(self, other: Any, /) -> Any: ... - -class _SupportsDunderLE(Protocol): - def __le__(self, other: Any, /) -> Any: ... - -class _SupportsDunderGE(Protocol): - def __ge__(self, other: Any, /) -> Any: ... - -_SupportsComparison: TypeAlias = _SupportsDunderLE | _SupportsDunderGE | _SupportsDunderGT | _SupportsDunderLT - -class _SupportsInversion(Protocol[_T_co]): - def __invert__(self) -> _T_co: ... - -class _SupportsNeg(Protocol[_T_co]): - def __neg__(self) -> _T_co: ... - -class _SupportsPos(Protocol[_T_co]): - def __pos__(self) -> _T_co: ... - -# All four comparison functions must have the same signature, or we get false-positive errors -def lt(a: _SupportsComparison, b: _SupportsComparison, /) -> Any: ... -def le(a: _SupportsComparison, b: _SupportsComparison, /) -> Any: ... -def eq(a: object, b: object, /) -> Any: ... -def ne(a: object, b: object, /) -> Any: ... -def ge(a: _SupportsComparison, b: _SupportsComparison, /) -> Any: ... -def gt(a: _SupportsComparison, b: _SupportsComparison, /) -> Any: ... -def not_(a: object, /) -> bool: ... -def truth(a: object, /) -> bool: ... -def is_(a: object, b: object, /) -> bool: ... -def is_not(a: object, b: object, /) -> bool: ... -def abs(a: SupportsAbs[_T], /) -> _T: ... -def add(a: Any, b: Any, /) -> Any: ... -def and_(a: Any, b: Any, /) -> Any: ... -def floordiv(a: Any, b: Any, /) -> Any: ... -def index(a: SupportsIndex, /) -> int: ... -def inv(a: _SupportsInversion[_T_co], /) -> _T_co: ... -def invert(a: _SupportsInversion[_T_co], /) -> _T_co: ... -def lshift(a: Any, b: Any, /) -> Any: ... -def mod(a: Any, b: Any, /) -> Any: ... -def mul(a: Any, b: Any, /) -> Any: ... -def matmul(a: Any, b: Any, /) -> Any: ... -def neg(a: _SupportsNeg[_T_co], /) -> _T_co: ... -def or_(a: Any, b: Any, /) -> Any: ... -def pos(a: _SupportsPos[_T_co], /) -> _T_co: ... -def pow(a: Any, b: Any, /) -> Any: ... -def rshift(a: Any, b: Any, /) -> Any: ... -def sub(a: Any, b: Any, /) -> Any: ... -def truediv(a: Any, b: Any, /) -> Any: ... -def xor(a: Any, b: Any, /) -> Any: ... -def concat(a: Sequence[_T], b: Sequence[_T], /) -> Sequence[_T]: ... -def contains(a: Container[object], b: object, /) -> bool: ... -def countOf(a: Iterable[object], b: object, /) -> int: ... -@overload -def delitem(a: MutableSequence[Any], b: SupportsIndex, /) -> None: ... -@overload -def delitem(a: MutableSequence[Any], b: slice, /) -> None: ... -@overload -def delitem(a: MutableMapping[_K, Any], b: _K, /) -> None: ... -@overload -def getitem(a: Sequence[_T], b: slice, /) -> Sequence[_T]: ... -@overload -def getitem(a: SupportsGetItem[_K, _V], b: _K, /) -> _V: ... -def indexOf(a: Iterable[_T], b: _T, /) -> int: ... -@overload -def setitem(a: MutableSequence[_T], b: SupportsIndex, c: _T, /) -> None: ... -@overload -def setitem(a: MutableSequence[_T], b: slice, c: Sequence[_T], /) -> None: ... -@overload -def setitem(a: MutableMapping[_K, _V], b: _K, c: _V, /) -> None: ... -def length_hint(obj: object, default: int = 0, /) -> int: ... -def iadd(a: Any, b: Any, /) -> Any: ... -def iand(a: Any, b: Any, /) -> Any: ... -def iconcat(a: Any, b: Any, /) -> Any: ... -def ifloordiv(a: Any, b: Any, /) -> Any: ... -def ilshift(a: Any, b: Any, /) -> Any: ... -def imod(a: Any, b: Any, /) -> Any: ... -def imul(a: Any, b: Any, /) -> Any: ... -def imatmul(a: Any, b: Any, /) -> Any: ... -def ior(a: Any, b: Any, /) -> Any: ... -def ipow(a: Any, b: Any, /) -> Any: ... -def irshift(a: Any, b: Any, /) -> Any: ... -def isub(a: Any, b: Any, /) -> Any: ... -def itruediv(a: Any, b: Any, /) -> Any: ... -def ixor(a: Any, b: Any, /) -> Any: ... - -if sys.version_info >= (3, 11): - def call(obj: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs) -> _R: ... - -def _compare_digest(a: AnyStr, b: AnyStr, /) -> bool: ... - -if sys.version_info >= (3, 14): - def is_none(a: object, /) -> TypeIs[None]: ... - def is_not_none(a: _T | None, /) -> TypeIs[_T]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_osx_support.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_osx_support.pyi deleted file mode 100644 index fb00e6986d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_osx_support.pyi +++ /dev/null @@ -1,34 +0,0 @@ -from collections.abc import Iterable, Sequence -from typing import Final, TypeVar - -_T = TypeVar("_T") -_K = TypeVar("_K") -_V = TypeVar("_V") - -__all__ = ["compiler_fixup", "customize_config_vars", "customize_compiler", "get_platform_osx"] - -_UNIVERSAL_CONFIG_VARS: Final[tuple[str, ...]] # undocumented -_COMPILER_CONFIG_VARS: Final[tuple[str, ...]] # undocumented -_INITPRE: Final[str] # undocumented - -def _find_executable(executable: str, path: str | None = None) -> str | None: ... # undocumented -def _read_output(commandstring: str, capture_stderr: bool = False) -> str | None: ... # undocumented -def _find_build_tool(toolname: str) -> str: ... # undocumented - -_SYSTEM_VERSION: Final[str | None] # undocumented - -def _get_system_version() -> str: ... # undocumented -def _remove_original_values(_config_vars: dict[str, str]) -> None: ... # undocumented -def _save_modified_value(_config_vars: dict[str, str], cv: str, newvalue: str) -> None: ... # undocumented -def _supports_universal_builds() -> bool: ... # undocumented -def _find_appropriate_compiler(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented -def _remove_universal_flags(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented -def _remove_unsupported_archs(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented -def _override_all_archs(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented -def _check_for_unavailable_sdk(_config_vars: dict[str, str]) -> dict[str, str]: ... # undocumented -def compiler_fixup(compiler_so: Iterable[str], cc_args: Sequence[str]) -> list[str]: ... -def customize_config_vars(_config_vars: dict[str, str]) -> dict[str, str]: ... -def customize_compiler(_config_vars: dict[str, str]) -> dict[str, str]: ... -def get_platform_osx( - _config_vars: dict[str, str], osname: _T, release: _K, machine: _V -) -> tuple[str | _T, str | _K, str | _V]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_pickle.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_pickle.pyi deleted file mode 100644 index 8e8afb600e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_pickle.pyi +++ /dev/null @@ -1,104 +0,0 @@ -from _typeshed import ReadableBuffer, SupportsWrite -from collections.abc import Callable, Iterable, Iterator, Mapping -from pickle import PickleBuffer as PickleBuffer -from typing import Any, Protocol, type_check_only -from typing_extensions import TypeAlias - -class _ReadableFileobj(Protocol): - def read(self, n: int, /) -> bytes: ... - def readline(self) -> bytes: ... - -_BufferCallback: TypeAlias = Callable[[PickleBuffer], Any] | None - -_ReducedType: TypeAlias = ( - str - | tuple[Callable[..., Any], tuple[Any, ...]] - | tuple[Callable[..., Any], tuple[Any, ...], Any] - | tuple[Callable[..., Any], tuple[Any, ...], Any, Iterator[Any] | None] - | tuple[Callable[..., Any], tuple[Any, ...], Any, Iterator[Any] | None, Iterator[Any] | None] -) - -def dump( - obj: Any, - file: SupportsWrite[bytes], - protocol: int | None = None, - *, - fix_imports: bool = True, - buffer_callback: _BufferCallback = None, -) -> None: ... -def dumps( - obj: Any, protocol: int | None = None, *, fix_imports: bool = True, buffer_callback: _BufferCallback = None -) -> bytes: ... -def load( - file: _ReadableFileobj, - *, - fix_imports: bool = True, - encoding: str = "ASCII", - errors: str = "strict", - buffers: Iterable[Any] | None = (), -) -> Any: ... -def loads( - data: ReadableBuffer, - /, - *, - fix_imports: bool = True, - encoding: str = "ASCII", - errors: str = "strict", - buffers: Iterable[Any] | None = (), -) -> Any: ... - -class PickleError(Exception): ... -class PicklingError(PickleError): ... -class UnpicklingError(PickleError): ... - -@type_check_only -class PicklerMemoProxy: - def clear(self, /) -> None: ... - def copy(self, /) -> dict[int, tuple[int, Any]]: ... - -class Pickler: - fast: bool - dispatch_table: Mapping[type, Callable[[Any], _ReducedType]] - reducer_override: Callable[[Any], Any] - bin: bool # undocumented - def __init__( - self, - file: SupportsWrite[bytes], - protocol: int | None = None, - fix_imports: bool = True, - buffer_callback: _BufferCallback = None, - ) -> None: ... - @property - def memo(self) -> PicklerMemoProxy: ... - @memo.setter - def memo(self, value: PicklerMemoProxy | dict[int, tuple[int, Any]]) -> None: ... - def dump(self, obj: Any, /) -> None: ... - def clear_memo(self) -> None: ... - - # this method has no default implementation for Python < 3.13 - def persistent_id(self, obj: Any, /) -> Any: ... - -@type_check_only -class UnpicklerMemoProxy: - def clear(self, /) -> None: ... - def copy(self, /) -> dict[int, tuple[int, Any]]: ... - -class Unpickler: - def __init__( - self, - file: _ReadableFileobj, - *, - fix_imports: bool = True, - encoding: str = "ASCII", - errors: str = "strict", - buffers: Iterable[Any] | None = (), - ) -> None: ... - @property - def memo(self) -> UnpicklerMemoProxy: ... - @memo.setter - def memo(self, value: UnpicklerMemoProxy | dict[int, tuple[int, Any]]) -> None: ... - def load(self) -> Any: ... - def find_class(self, module_name: str, global_name: str, /) -> Any: ... - - # this method has no default implementation for Python < 3.13 - def persistent_load(self, pid: Any, /) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_posixsubprocess.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_posixsubprocess.pyi deleted file mode 100644 index df05dcd80b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_posixsubprocess.pyi +++ /dev/null @@ -1,32 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from collections.abc import Callable, Sequence -from typing import SupportsIndex - -if sys.platform != "win32": - def fork_exec( - args: Sequence[StrOrBytesPath] | None, - executable_list: Sequence[bytes], - close_fds: bool, - pass_fds: tuple[int, ...], - cwd: str, - env: Sequence[bytes] | None, - p2cread: int, - p2cwrite: int, - c2pread: int, - c2pwrite: int, - errread: int, - errwrite: int, - errpipe_read: int, - errpipe_write: int, - restore_signals: int, - call_setsid: int, - pgid_to_set: int, - gid: SupportsIndex | None, - extra_groups: list[int] | None, - uid: SupportsIndex | None, - child_umask: int, - preexec_fn: Callable[[], None], - allow_vfork: bool, - /, - ) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_py_abc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_py_abc.pyi deleted file mode 100644 index 1260717489..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_py_abc.pyi +++ /dev/null @@ -1,14 +0,0 @@ -import _typeshed -from typing import Any, NewType, TypeVar - -_T = TypeVar("_T") - -_CacheToken = NewType("_CacheToken", int) - -def get_cache_token() -> _CacheToken: ... - -class ABCMeta(type): - def __new__( - mcls: type[_typeshed.Self], name: str, bases: tuple[type[Any], ...], namespace: dict[str, Any], / - ) -> _typeshed.Self: ... - def register(cls, subclass: type[_T]) -> type[_T]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_pydecimal.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_pydecimal.pyi deleted file mode 100644 index faff626ac0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_pydecimal.pyi +++ /dev/null @@ -1,43 +0,0 @@ -# This is a slight lie, the implementations aren't exactly identical -# However, in all likelihood, the differences are inconsequential -from _decimal import * - -__all__ = [ - "Decimal", - "Context", - "DecimalTuple", - "DefaultContext", - "BasicContext", - "ExtendedContext", - "DecimalException", - "Clamped", - "InvalidOperation", - "DivisionByZero", - "Inexact", - "Rounded", - "Subnormal", - "Overflow", - "Underflow", - "FloatOperation", - "DivisionImpossible", - "InvalidContext", - "ConversionSyntax", - "DivisionUndefined", - "ROUND_DOWN", - "ROUND_HALF_UP", - "ROUND_HALF_EVEN", - "ROUND_CEILING", - "ROUND_FLOOR", - "ROUND_UP", - "ROUND_HALF_DOWN", - "ROUND_05UP", - "setcontext", - "getcontext", - "localcontext", - "MAX_PREC", - "MAX_EMAX", - "MIN_EMIN", - "MIN_ETINY", - "HAVE_THREADS", - "HAVE_CONTEXTVAR", -] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_queue.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_queue.pyi deleted file mode 100644 index f98397b132..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_queue.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from types import GenericAlias -from typing import Any, Generic, TypeVar - -_T = TypeVar("_T") - -class Empty(Exception): ... - -class SimpleQueue(Generic[_T]): - def __init__(self) -> None: ... - def empty(self) -> bool: ... - def get(self, block: bool = True, timeout: float | None = None) -> _T: ... - def get_nowait(self) -> _T: ... - def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ... - def put_nowait(self, item: _T) -> None: ... - def qsize(self) -> int: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_random.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_random.pyi deleted file mode 100644 index 4082344ade..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_random.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from typing_extensions import TypeAlias - -# Actually Tuple[(int,) * 625] -_State: TypeAlias = tuple[int, ...] - -class Random: - def __init__(self, seed: object = ...) -> None: ... - def seed(self, n: object = None, /) -> None: ... - def getstate(self) -> _State: ... - def setstate(self, state: _State, /) -> None: ... - def random(self) -> float: ... - def getrandbits(self, k: int, /) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_sitebuiltins.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_sitebuiltins.pyi deleted file mode 100644 index eb6c811294..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_sitebuiltins.pyi +++ /dev/null @@ -1,17 +0,0 @@ -import sys -from collections.abc import Iterable -from typing import ClassVar, Literal, NoReturn - -class Quitter: - name: str - eof: str - def __init__(self, name: str, eof: str) -> None: ... - def __call__(self, code: sys._ExitCode = None) -> NoReturn: ... - -class _Printer: - MAXLINES: ClassVar[Literal[23]] - def __init__(self, name: str, data: str, files: Iterable[str] = (), dirs: Iterable[str] = ()) -> None: ... - def __call__(self) -> None: ... - -class _Helper: - def __call__(self, request: object = ...) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_socket.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_socket.pyi deleted file mode 100644 index 5399f4edf0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_socket.pyi +++ /dev/null @@ -1,834 +0,0 @@ -import sys -from _typeshed import ReadableBuffer, WriteableBuffer -from collections.abc import Iterable -from socket import error as error, gaierror as gaierror, herror as herror, timeout as timeout -from typing import Any, SupportsIndex, overload -from typing_extensions import CapsuleType, TypeAlias - -_CMSG: TypeAlias = tuple[int, int, bytes] -_CMSGArg: TypeAlias = tuple[int, int, ReadableBuffer] - -# Addresses can be either tuples of varying lengths (AF_INET, AF_INET6, -# AF_NETLINK, AF_TIPC) or strings/buffers (AF_UNIX). -# See getsockaddrarg() in socketmodule.c. -_Address: TypeAlias = tuple[Any, ...] | str | ReadableBuffer -_RetAddress: TypeAlias = Any - -# ===== Constants ===== -# This matches the order in the CPython documentation -# https://docs.python.org/3/library/socket.html#constants - -if sys.platform != "win32": - AF_UNIX: int - -AF_INET: int -AF_INET6: int - -AF_UNSPEC: int - -SOCK_STREAM: int -SOCK_DGRAM: int -SOCK_RAW: int -SOCK_RDM: int -SOCK_SEQPACKET: int - -if sys.platform == "linux": - # Availability: Linux >= 2.6.27 - SOCK_CLOEXEC: int - SOCK_NONBLOCK: int - -# -------------------- -# Many constants of these forms, documented in the Unix documentation on -# sockets and/or the IP protocol, are also defined in the socket module. -# SO_* -# socket.SOMAXCONN -# MSG_* -# SOL_* -# SCM_* -# IPPROTO_* -# IPPORT_* -# INADDR_* -# IP_* -# IPV6_* -# EAI_* -# AI_* -# NI_* -# TCP_* -# -------------------- - -SO_ACCEPTCONN: int -SO_BROADCAST: int -SO_DEBUG: int -SO_DONTROUTE: int -SO_ERROR: int -SO_KEEPALIVE: int -SO_LINGER: int -SO_OOBINLINE: int -SO_RCVBUF: int -SO_RCVLOWAT: int -SO_RCVTIMEO: int -SO_REUSEADDR: int -SO_SNDBUF: int -SO_SNDLOWAT: int -SO_SNDTIMEO: int -SO_TYPE: int -if sys.platform != "linux": - SO_USELOOPBACK: int -if sys.platform == "win32": - SO_EXCLUSIVEADDRUSE: int -if sys.platform != "win32": - SO_REUSEPORT: int - if sys.platform != "darwin" or sys.version_info >= (3, 13): - SO_BINDTODEVICE: int - -if sys.platform != "win32" and sys.platform != "darwin": - SO_DOMAIN: int - SO_MARK: int - SO_PASSCRED: int - SO_PASSSEC: int - SO_PEERCRED: int - SO_PEERSEC: int - SO_PRIORITY: int - SO_PROTOCOL: int -if sys.platform != "win32" and sys.platform != "darwin" and sys.platform != "linux": - SO_SETFIB: int -if sys.platform == "linux" and sys.version_info >= (3, 13): - SO_BINDTOIFINDEX: int - -SOMAXCONN: int - -MSG_CTRUNC: int -MSG_DONTROUTE: int -MSG_OOB: int -MSG_PEEK: int -MSG_TRUNC: int -MSG_WAITALL: int -if sys.platform != "win32": - MSG_DONTWAIT: int - MSG_EOR: int - MSG_NOSIGNAL: int # Sometimes this exists on darwin, sometimes not -if sys.platform != "darwin": - MSG_ERRQUEUE: int -if sys.platform == "win32": - MSG_BCAST: int - MSG_MCAST: int -if sys.platform != "win32" and sys.platform != "darwin": - MSG_CMSG_CLOEXEC: int - MSG_CONFIRM: int - MSG_FASTOPEN: int - MSG_MORE: int -if sys.platform != "win32" and sys.platform != "linux": - MSG_EOF: int -if sys.platform != "win32" and sys.platform != "linux" and sys.platform != "darwin": - MSG_NOTIFICATION: int - MSG_BTAG: int # Not FreeBSD either - MSG_ETAG: int # Not FreeBSD either - -SOL_IP: int -SOL_SOCKET: int -SOL_TCP: int -SOL_UDP: int -if sys.platform != "win32" and sys.platform != "darwin": - # Defined in socket.h for Linux, but these aren't always present for - # some reason. - SOL_ATALK: int - SOL_AX25: int - SOL_HCI: int - SOL_IPX: int - SOL_NETROM: int - SOL_ROSE: int - -if sys.platform != "win32": - SCM_RIGHTS: int -if sys.platform != "win32" and sys.platform != "darwin": - SCM_CREDENTIALS: int -if sys.platform != "win32" and sys.platform != "linux": - SCM_CREDS: int - -IPPROTO_ICMP: int -IPPROTO_IP: int -IPPROTO_RAW: int -IPPROTO_TCP: int -IPPROTO_UDP: int -IPPROTO_AH: int -IPPROTO_DSTOPTS: int -IPPROTO_EGP: int -IPPROTO_ESP: int -IPPROTO_FRAGMENT: int -IPPROTO_HOPOPTS: int -IPPROTO_ICMPV6: int -IPPROTO_IDP: int -IPPROTO_IGMP: int -IPPROTO_IPV6: int -IPPROTO_NONE: int -IPPROTO_PIM: int -IPPROTO_PUP: int -IPPROTO_ROUTING: int -IPPROTO_SCTP: int -if sys.platform != "linux": - IPPROTO_GGP: int - IPPROTO_IPV4: int - IPPROTO_MAX: int - IPPROTO_ND: int -if sys.platform == "win32": - IPPROTO_CBT: int - IPPROTO_ICLFXBM: int - IPPROTO_IGP: int - IPPROTO_L2TP: int - IPPROTO_PGM: int - IPPROTO_RDP: int - IPPROTO_ST: int -if sys.platform != "win32": - IPPROTO_GRE: int - IPPROTO_IPIP: int - IPPROTO_RSVP: int - IPPROTO_TP: int -if sys.platform != "win32" and sys.platform != "linux": - IPPROTO_EON: int - IPPROTO_HELLO: int - IPPROTO_IPCOMP: int - IPPROTO_XTP: int -if sys.platform != "win32" and sys.platform != "darwin" and sys.platform != "linux": - IPPROTO_BIP: int # Not FreeBSD either - IPPROTO_MOBILE: int # Not FreeBSD either - IPPROTO_VRRP: int # Not FreeBSD either -if sys.platform == "linux": - # Availability: Linux >= 2.6.20, FreeBSD >= 10.1 - IPPROTO_UDPLITE: int -if sys.version_info >= (3, 10) and sys.platform == "linux": - IPPROTO_MPTCP: int - -IPPORT_RESERVED: int -IPPORT_USERRESERVED: int - -INADDR_ALLHOSTS_GROUP: int -INADDR_ANY: int -INADDR_BROADCAST: int -INADDR_LOOPBACK: int -INADDR_MAX_LOCAL_GROUP: int -INADDR_NONE: int -INADDR_UNSPEC_GROUP: int - -IP_ADD_MEMBERSHIP: int -IP_DROP_MEMBERSHIP: int -IP_HDRINCL: int -IP_MULTICAST_IF: int -IP_MULTICAST_LOOP: int -IP_MULTICAST_TTL: int -IP_OPTIONS: int -if sys.platform != "linux": - IP_RECVDSTADDR: int -if sys.version_info >= (3, 10): - IP_RECVTOS: int -IP_TOS: int -IP_TTL: int -if sys.platform != "win32": - IP_DEFAULT_MULTICAST_LOOP: int - IP_DEFAULT_MULTICAST_TTL: int - IP_MAX_MEMBERSHIPS: int - IP_RECVOPTS: int - IP_RECVRETOPTS: int - IP_RETOPTS: int -if sys.platform != "win32" and sys.platform != "darwin": - IP_TRANSPARENT: int -if sys.platform != "win32" and sys.platform != "darwin" and sys.version_info >= (3, 11): - IP_BIND_ADDRESS_NO_PORT: int -if sys.version_info >= (3, 12): - IP_ADD_SOURCE_MEMBERSHIP: int - IP_BLOCK_SOURCE: int - IP_DROP_SOURCE_MEMBERSHIP: int - IP_PKTINFO: int - IP_UNBLOCK_SOURCE: int - -IPV6_CHECKSUM: int -IPV6_JOIN_GROUP: int -IPV6_LEAVE_GROUP: int -IPV6_MULTICAST_HOPS: int -IPV6_MULTICAST_IF: int -IPV6_MULTICAST_LOOP: int -IPV6_RECVTCLASS: int -IPV6_TCLASS: int -IPV6_UNICAST_HOPS: int -IPV6_V6ONLY: int -IPV6_DONTFRAG: int -IPV6_HOPLIMIT: int -IPV6_HOPOPTS: int -IPV6_PKTINFO: int -IPV6_RECVRTHDR: int -IPV6_RTHDR: int -if sys.platform != "win32": - IPV6_RTHDR_TYPE_0: int - IPV6_DSTOPTS: int - IPV6_NEXTHOP: int - IPV6_PATHMTU: int - IPV6_RECVDSTOPTS: int - IPV6_RECVHOPLIMIT: int - IPV6_RECVHOPOPTS: int - IPV6_RECVPATHMTU: int - IPV6_RECVPKTINFO: int - IPV6_RTHDRDSTOPTS: int - -if sys.platform != "win32" and sys.platform != "linux": - IPV6_USE_MIN_MTU: int - -EAI_AGAIN: int -EAI_BADFLAGS: int -EAI_FAIL: int -EAI_FAMILY: int -EAI_MEMORY: int -EAI_NODATA: int -EAI_NONAME: int -EAI_SERVICE: int -EAI_SOCKTYPE: int -if sys.platform != "win32": - EAI_ADDRFAMILY: int - EAI_OVERFLOW: int - EAI_SYSTEM: int -if sys.platform != "win32" and sys.platform != "linux": - EAI_BADHINTS: int - EAI_MAX: int - EAI_PROTOCOL: int - -AI_ADDRCONFIG: int -AI_ALL: int -AI_CANONNAME: int -AI_NUMERICHOST: int -AI_NUMERICSERV: int -AI_PASSIVE: int -AI_V4MAPPED: int -if sys.platform != "win32" and sys.platform != "linux": - AI_DEFAULT: int - AI_MASK: int - AI_V4MAPPED_CFG: int - -NI_DGRAM: int -NI_MAXHOST: int -NI_MAXSERV: int -NI_NAMEREQD: int -NI_NOFQDN: int -NI_NUMERICHOST: int -NI_NUMERICSERV: int -if sys.platform == "linux" and sys.version_info >= (3, 13): - NI_IDN: int - -TCP_FASTOPEN: int -TCP_KEEPCNT: int -TCP_KEEPINTVL: int -TCP_MAXSEG: int -TCP_NODELAY: int -if sys.platform != "win32": - TCP_NOTSENT_LOWAT: int -if sys.platform != "darwin": - TCP_KEEPIDLE: int -if sys.version_info >= (3, 10) and sys.platform == "darwin": - TCP_KEEPALIVE: int -if sys.version_info >= (3, 11) and sys.platform == "darwin": - TCP_CONNECTION_INFO: int - -if sys.platform != "win32" and sys.platform != "darwin": - TCP_CONGESTION: int - TCP_CORK: int - TCP_DEFER_ACCEPT: int - TCP_INFO: int - TCP_LINGER2: int - TCP_QUICKACK: int - TCP_SYNCNT: int - TCP_USER_TIMEOUT: int - TCP_WINDOW_CLAMP: int -if sys.platform == "linux" and sys.version_info >= (3, 12): - TCP_CC_INFO: int - TCP_FASTOPEN_CONNECT: int - TCP_FASTOPEN_KEY: int - TCP_FASTOPEN_NO_COOKIE: int - TCP_INQ: int - TCP_MD5SIG: int - TCP_MD5SIG_EXT: int - TCP_QUEUE_SEQ: int - TCP_REPAIR: int - TCP_REPAIR_OPTIONS: int - TCP_REPAIR_QUEUE: int - TCP_REPAIR_WINDOW: int - TCP_SAVED_SYN: int - TCP_SAVE_SYN: int - TCP_THIN_DUPACK: int - TCP_THIN_LINEAR_TIMEOUTS: int - TCP_TIMESTAMP: int - TCP_TX_DELAY: int - TCP_ULP: int - TCP_ZEROCOPY_RECEIVE: int - -# -------------------- -# Specifically documented constants -# -------------------- - -if sys.platform == "linux": - # Availability: Linux >= 2.6.25, NetBSD >= 8 - AF_CAN: int - PF_CAN: int - SOL_CAN_BASE: int - SOL_CAN_RAW: int - CAN_EFF_FLAG: int - CAN_EFF_MASK: int - CAN_ERR_FLAG: int - CAN_ERR_MASK: int - CAN_RAW: int - CAN_RAW_FILTER: int - CAN_RAW_LOOPBACK: int - CAN_RAW_RECV_OWN_MSGS: int - CAN_RTR_FLAG: int - CAN_SFF_MASK: int - if sys.version_info < (3, 11): - CAN_RAW_ERR_FILTER: int - -if sys.platform == "linux": - # Availability: Linux >= 2.6.25 - CAN_BCM: int - CAN_BCM_TX_SETUP: int - CAN_BCM_TX_DELETE: int - CAN_BCM_TX_READ: int - CAN_BCM_TX_SEND: int - CAN_BCM_RX_SETUP: int - CAN_BCM_RX_DELETE: int - CAN_BCM_RX_READ: int - CAN_BCM_TX_STATUS: int - CAN_BCM_TX_EXPIRED: int - CAN_BCM_RX_STATUS: int - CAN_BCM_RX_TIMEOUT: int - CAN_BCM_RX_CHANGED: int - CAN_BCM_SETTIMER: int - CAN_BCM_STARTTIMER: int - CAN_BCM_TX_COUNTEVT: int - CAN_BCM_TX_ANNOUNCE: int - CAN_BCM_TX_CP_CAN_ID: int - CAN_BCM_RX_FILTER_ID: int - CAN_BCM_RX_CHECK_DLC: int - CAN_BCM_RX_NO_AUTOTIMER: int - CAN_BCM_RX_ANNOUNCE_RESUME: int - CAN_BCM_TX_RESET_MULTI_IDX: int - CAN_BCM_RX_RTR_FRAME: int - CAN_BCM_CAN_FD_FRAME: int - -if sys.platform == "linux": - # Availability: Linux >= 3.6 - CAN_RAW_FD_FRAMES: int - # Availability: Linux >= 4.1 - CAN_RAW_JOIN_FILTERS: int - # Availability: Linux >= 2.6.25 - CAN_ISOTP: int - # Availability: Linux >= 5.4 - CAN_J1939: int - - J1939_MAX_UNICAST_ADDR: int - J1939_IDLE_ADDR: int - J1939_NO_ADDR: int - J1939_NO_NAME: int - J1939_PGN_REQUEST: int - J1939_PGN_ADDRESS_CLAIMED: int - J1939_PGN_ADDRESS_COMMANDED: int - J1939_PGN_PDU1_MAX: int - J1939_PGN_MAX: int - J1939_NO_PGN: int - - SO_J1939_FILTER: int - SO_J1939_PROMISC: int - SO_J1939_SEND_PRIO: int - SO_J1939_ERRQUEUE: int - - SCM_J1939_DEST_ADDR: int - SCM_J1939_DEST_NAME: int - SCM_J1939_PRIO: int - SCM_J1939_ERRQUEUE: int - - J1939_NLA_PAD: int - J1939_NLA_BYTES_ACKED: int - J1939_EE_INFO_NONE: int - J1939_EE_INFO_TX_ABORT: int - J1939_FILTER_MAX: int - -if sys.version_info >= (3, 12) and sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin": - # Availability: FreeBSD >= 14.0 - AF_DIVERT: int - PF_DIVERT: int - -if sys.platform == "linux": - # Availability: Linux >= 2.2 - AF_PACKET: int - PF_PACKET: int - PACKET_BROADCAST: int - PACKET_FASTROUTE: int - PACKET_HOST: int - PACKET_LOOPBACK: int - PACKET_MULTICAST: int - PACKET_OTHERHOST: int - PACKET_OUTGOING: int - -if sys.version_info >= (3, 12) and sys.platform == "linux": - ETH_P_ALL: int - -if sys.platform == "linux": - # Availability: Linux >= 2.6.30 - AF_RDS: int - PF_RDS: int - SOL_RDS: int - # These are present in include/linux/rds.h but don't always show up - # here. - RDS_CANCEL_SENT_TO: int - RDS_CMSG_RDMA_ARGS: int - RDS_CMSG_RDMA_DEST: int - RDS_CMSG_RDMA_MAP: int - RDS_CMSG_RDMA_STATUS: int - RDS_CONG_MONITOR: int - RDS_FREE_MR: int - RDS_GET_MR: int - RDS_GET_MR_FOR_DEST: int - RDS_RDMA_DONTWAIT: int - RDS_RDMA_FENCE: int - RDS_RDMA_INVALIDATE: int - RDS_RDMA_NOTIFY_ME: int - RDS_RDMA_READWRITE: int - RDS_RDMA_SILENT: int - RDS_RDMA_USE_ONCE: int - RDS_RECVERR: int - - # This is supported by CPython but doesn't seem to be a real thing. - # The closest existing constant in rds.h is RDS_CMSG_CONG_UPDATE - # RDS_CMSG_RDMA_UPDATE: int - -if sys.platform == "win32": - SIO_RCVALL: int - SIO_KEEPALIVE_VALS: int - SIO_LOOPBACK_FAST_PATH: int - RCVALL_MAX: int - RCVALL_OFF: int - RCVALL_ON: int - RCVALL_SOCKETLEVELONLY: int - -if sys.platform == "linux": - AF_TIPC: int - SOL_TIPC: int - TIPC_ADDR_ID: int - TIPC_ADDR_NAME: int - TIPC_ADDR_NAMESEQ: int - TIPC_CFG_SRV: int - TIPC_CLUSTER_SCOPE: int - TIPC_CONN_TIMEOUT: int - TIPC_CRITICAL_IMPORTANCE: int - TIPC_DEST_DROPPABLE: int - TIPC_HIGH_IMPORTANCE: int - TIPC_IMPORTANCE: int - TIPC_LOW_IMPORTANCE: int - TIPC_MEDIUM_IMPORTANCE: int - TIPC_NODE_SCOPE: int - TIPC_PUBLISHED: int - TIPC_SRC_DROPPABLE: int - TIPC_SUBSCR_TIMEOUT: int - TIPC_SUB_CANCEL: int - TIPC_SUB_PORTS: int - TIPC_SUB_SERVICE: int - TIPC_TOP_SRV: int - TIPC_WAIT_FOREVER: int - TIPC_WITHDRAWN: int - TIPC_ZONE_SCOPE: int - -if sys.platform == "linux": - # Availability: Linux >= 2.6.38 - AF_ALG: int - SOL_ALG: int - ALG_OP_DECRYPT: int - ALG_OP_ENCRYPT: int - ALG_OP_SIGN: int - ALG_OP_VERIFY: int - ALG_SET_AEAD_ASSOCLEN: int - ALG_SET_AEAD_AUTHSIZE: int - ALG_SET_IV: int - ALG_SET_KEY: int - ALG_SET_OP: int - ALG_SET_PUBKEY: int - -if sys.platform == "linux": - # Availability: Linux >= 4.8 (or maybe 3.9, CPython docs are confusing) - AF_VSOCK: int - IOCTL_VM_SOCKETS_GET_LOCAL_CID: int - VMADDR_CID_ANY: int - VMADDR_CID_HOST: int - VMADDR_PORT_ANY: int - SO_VM_SOCKETS_BUFFER_MAX_SIZE: int - SO_VM_SOCKETS_BUFFER_SIZE: int - SO_VM_SOCKETS_BUFFER_MIN_SIZE: int - VM_SOCKETS_INVALID_VERSION: int # undocumented - -# Documented as only available on BSD, macOS, but empirically sometimes -# available on Windows -if sys.platform != "linux": - AF_LINK: int - -has_ipv6: bool - -if sys.platform != "darwin" and sys.platform != "linux": - BDADDR_ANY: str - BDADDR_LOCAL: str - -if sys.platform != "win32" and sys.platform != "darwin" and sys.platform != "linux": - HCI_FILTER: int # not in NetBSD or DragonFlyBSD - HCI_TIME_STAMP: int # not in FreeBSD, NetBSD, or DragonFlyBSD - HCI_DATA_DIR: int # not in FreeBSD, NetBSD, or DragonFlyBSD - -if sys.platform == "linux": - AF_QIPCRTR: int # Availability: Linux >= 4.7 - -if sys.version_info >= (3, 11) and sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin": - # FreeBSD - SCM_CREDS2: int - LOCAL_CREDS: int - LOCAL_CREDS_PERSISTENT: int - -if sys.version_info >= (3, 11) and sys.platform == "linux": - SO_INCOMING_CPU: int # Availability: Linux >= 3.9 - -if sys.version_info >= (3, 12) and sys.platform == "win32": - # Availability: Windows - AF_HYPERV: int - HV_PROTOCOL_RAW: int - HVSOCKET_CONNECT_TIMEOUT: int - HVSOCKET_CONNECT_TIMEOUT_MAX: int - HVSOCKET_CONNECTED_SUSPEND: int - HVSOCKET_ADDRESS_FLAG_PASSTHRU: int - HV_GUID_ZERO: str - HV_GUID_WILDCARD: str - HV_GUID_BROADCAST: str - HV_GUID_CHILDREN: str - HV_GUID_LOOPBACK: str - HV_GUID_PARENT: str - -if sys.version_info >= (3, 12): - if sys.platform != "win32": - # Availability: Linux, FreeBSD, macOS - ETHERTYPE_ARP: int - ETHERTYPE_IP: int - ETHERTYPE_IPV6: int - ETHERTYPE_VLAN: int - -# -------------------- -# Semi-documented constants -# These are alluded to under the "Socket families" section in the docs -# https://docs.python.org/3/library/socket.html#socket-families -# -------------------- - -if sys.platform == "linux": - # Netlink is defined by Linux - AF_NETLINK: int - NETLINK_CRYPTO: int - NETLINK_DNRTMSG: int - NETLINK_FIREWALL: int - NETLINK_IP6_FW: int - NETLINK_NFLOG: int - NETLINK_ROUTE: int - NETLINK_USERSOCK: int - NETLINK_XFRM: int - # Technically still supported by CPython - # NETLINK_ARPD: int # linux 2.0 to 2.6.12 (EOL August 2005) - # NETLINK_ROUTE6: int # linux 2.2 to 2.6.12 (EOL August 2005) - # NETLINK_SKIP: int # linux 2.0 to 2.6.12 (EOL August 2005) - # NETLINK_TAPBASE: int # linux 2.2 to 2.6.12 (EOL August 2005) - # NETLINK_TCPDIAG: int # linux 2.6.0 to 2.6.13 (EOL December 2005) - # NETLINK_W1: int # linux 2.6.13 to 2.6.17 (EOL October 2006) - -if sys.platform == "darwin": - PF_SYSTEM: int - SYSPROTO_CONTROL: int - -if sys.platform != "darwin" and sys.platform != "linux": - AF_BLUETOOTH: int - -if sys.platform != "win32" and sys.platform != "darwin" and sys.platform != "linux": - # Linux and some BSD support is explicit in the docs - # Windows and macOS do not support in practice - BTPROTO_HCI: int - BTPROTO_L2CAP: int - BTPROTO_SCO: int # not in FreeBSD -if sys.platform != "darwin" and sys.platform != "linux": - BTPROTO_RFCOMM: int - -if sys.platform == "linux": - UDPLITE_RECV_CSCOV: int - UDPLITE_SEND_CSCOV: int - -# -------------------- -# Documented under socket.shutdown -# -------------------- -SHUT_RD: int -SHUT_RDWR: int -SHUT_WR: int - -# -------------------- -# Undocumented constants -# -------------------- - -# Undocumented address families -AF_APPLETALK: int -AF_DECnet: int -AF_IPX: int -AF_SNA: int - -if sys.platform != "win32": - AF_ROUTE: int - -if sys.platform == "darwin": - AF_SYSTEM: int - -if sys.platform != "darwin": - AF_IRDA: int - -if sys.platform != "win32" and sys.platform != "darwin": - AF_ASH: int - AF_ATMPVC: int - AF_ATMSVC: int - AF_AX25: int - AF_BRIDGE: int - AF_ECONET: int - AF_KEY: int - AF_LLC: int - AF_NETBEUI: int - AF_NETROM: int - AF_PPPOX: int - AF_ROSE: int - AF_SECURITY: int - AF_WANPIPE: int - AF_X25: int - -# Miscellaneous undocumented - -if sys.platform != "win32" and sys.platform != "linux": - LOCAL_PEERCRED: int - -if sys.platform != "win32" and sys.platform != "darwin": - # Defined in linux socket.h, but this isn't always present for - # some reason. - IPX_TYPE: int - -# ===== Classes ===== - -class socket: - @property - def family(self) -> int: ... - @property - def type(self) -> int: ... - @property - def proto(self) -> int: ... - # F811: "Redefinition of unused `timeout`" - @property - def timeout(self) -> float | None: ... # noqa: F811 - if sys.platform == "win32": - def __init__( - self, family: int = ..., type: int = ..., proto: int = ..., fileno: SupportsIndex | bytes | None = ... - ) -> None: ... - else: - def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: SupportsIndex | None = ...) -> None: ... - - def bind(self, address: _Address, /) -> None: ... - def close(self) -> None: ... - def connect(self, address: _Address, /) -> None: ... - def connect_ex(self, address: _Address, /) -> int: ... - def detach(self) -> int: ... - def fileno(self) -> int: ... - def getpeername(self) -> _RetAddress: ... - def getsockname(self) -> _RetAddress: ... - @overload - def getsockopt(self, level: int, optname: int, /) -> int: ... - @overload - def getsockopt(self, level: int, optname: int, buflen: int, /) -> bytes: ... - def getblocking(self) -> bool: ... - def gettimeout(self) -> float | None: ... - if sys.platform == "win32": - def ioctl(self, control: int, option: int | tuple[int, int, int] | bool, /) -> None: ... - - def listen(self, backlog: int = ..., /) -> None: ... - def recv(self, bufsize: int, flags: int = ..., /) -> bytes: ... - def recvfrom(self, bufsize: int, flags: int = ..., /) -> tuple[bytes, _RetAddress]: ... - if sys.platform != "win32": - def recvmsg(self, bufsize: int, ancbufsize: int = ..., flags: int = ..., /) -> tuple[bytes, list[_CMSG], int, Any]: ... - def recvmsg_into( - self, buffers: Iterable[WriteableBuffer], ancbufsize: int = ..., flags: int = ..., / - ) -> tuple[int, list[_CMSG], int, Any]: ... - - def recvfrom_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ... - def recv_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> int: ... - def send(self, data: ReadableBuffer, flags: int = ..., /) -> int: ... - def sendall(self, data: ReadableBuffer, flags: int = ..., /) -> None: ... - @overload - def sendto(self, data: ReadableBuffer, address: _Address, /) -> int: ... - @overload - def sendto(self, data: ReadableBuffer, flags: int, address: _Address, /) -> int: ... - if sys.platform != "win32": - def sendmsg( - self, - buffers: Iterable[ReadableBuffer], - ancdata: Iterable[_CMSGArg] = ..., - flags: int = ..., - address: _Address | None = ..., - /, - ) -> int: ... - if sys.platform == "linux": - def sendmsg_afalg( - self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... - ) -> int: ... - - def setblocking(self, flag: bool, /) -> None: ... - def settimeout(self, value: float | None, /) -> None: ... - @overload - def setsockopt(self, level: int, optname: int, value: int | ReadableBuffer, /) -> None: ... - @overload - def setsockopt(self, level: int, optname: int, value: None, optlen: int, /) -> None: ... - if sys.platform == "win32": - def share(self, process_id: int, /) -> bytes: ... - - def shutdown(self, how: int, /) -> None: ... - -SocketType = socket - -# ===== Functions ===== - -def close(fd: SupportsIndex, /) -> None: ... -def dup(fd: SupportsIndex, /) -> int: ... - -# the 5th tuple item is an address -def getaddrinfo( - host: bytes | str | None, - port: bytes | str | int | None, - family: int = ..., - type: int = ..., - proto: int = ..., - flags: int = ..., -) -> list[tuple[int, int, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]: ... -def gethostbyname(hostname: str, /) -> str: ... -def gethostbyname_ex(hostname: str, /) -> tuple[str, list[str], list[str]]: ... -def gethostname() -> str: ... -def gethostbyaddr(ip_address: str, /) -> tuple[str, list[str], list[str]]: ... -def getnameinfo(sockaddr: tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes], flags: int, /) -> tuple[str, str]: ... -def getprotobyname(protocolname: str, /) -> int: ... -def getservbyname(servicename: str, protocolname: str = ..., /) -> int: ... -def getservbyport(port: int, protocolname: str = ..., /) -> str: ... -def ntohl(x: int, /) -> int: ... # param & ret val are 32-bit ints -def ntohs(x: int, /) -> int: ... # param & ret val are 16-bit ints -def htonl(x: int, /) -> int: ... # param & ret val are 32-bit ints -def htons(x: int, /) -> int: ... # param & ret val are 16-bit ints -def inet_aton(ip_addr: str, /) -> bytes: ... # ret val 4 bytes in length -def inet_ntoa(packed_ip: ReadableBuffer, /) -> str: ... -def inet_pton(address_family: int, ip_string: str, /) -> bytes: ... -def inet_ntop(address_family: int, packed_ip: ReadableBuffer, /) -> str: ... -def getdefaulttimeout() -> float | None: ... - -# F811: "Redefinition of unused `timeout`" -def setdefaulttimeout(timeout: float | None, /) -> None: ... # noqa: F811 - -if sys.platform != "win32": - def sethostname(name: str, /) -> None: ... - def CMSG_LEN(length: int, /) -> int: ... - def CMSG_SPACE(length: int, /) -> int: ... - def socketpair(family: int = ..., type: int = ..., proto: int = ..., /) -> tuple[socket, socket]: ... - -def if_nameindex() -> list[tuple[int, str]]: ... -def if_nametoindex(oname: str, /) -> int: ... -def if_indextoname(index: int, /) -> str: ... - -CAPI: CapsuleType diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_sqlite3.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_sqlite3.pyi deleted file mode 100644 index 6f06542c1b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_sqlite3.pyi +++ /dev/null @@ -1,312 +0,0 @@ -import sys -from _typeshed import ReadableBuffer, StrOrBytesPath -from collections.abc import Callable -from sqlite3 import ( - Connection as Connection, - Cursor as Cursor, - DatabaseError as DatabaseError, - DataError as DataError, - Error as Error, - IntegrityError as IntegrityError, - InterfaceError as InterfaceError, - InternalError as InternalError, - NotSupportedError as NotSupportedError, - OperationalError as OperationalError, - PrepareProtocol as PrepareProtocol, - ProgrammingError as ProgrammingError, - Row as Row, - Warning as Warning, -) -from typing import Any, Final, Literal, TypeVar, overload -from typing_extensions import TypeAlias - -if sys.version_info >= (3, 11): - from sqlite3 import Blob as Blob - -_T = TypeVar("_T") -_ConnectionT = TypeVar("_ConnectionT", bound=Connection) -_SqliteData: TypeAlias = str | ReadableBuffer | int | float | None -_Adapter: TypeAlias = Callable[[_T], _SqliteData] -_Converter: TypeAlias = Callable[[bytes], Any] - -PARSE_COLNAMES: Final[int] -PARSE_DECLTYPES: Final[int] -SQLITE_ALTER_TABLE: Final[int] -SQLITE_ANALYZE: Final[int] -SQLITE_ATTACH: Final[int] -SQLITE_CREATE_INDEX: Final[int] -SQLITE_CREATE_TABLE: Final[int] -SQLITE_CREATE_TEMP_INDEX: Final[int] -SQLITE_CREATE_TEMP_TABLE: Final[int] -SQLITE_CREATE_TEMP_TRIGGER: Final[int] -SQLITE_CREATE_TEMP_VIEW: Final[int] -SQLITE_CREATE_TRIGGER: Final[int] -SQLITE_CREATE_VIEW: Final[int] -SQLITE_CREATE_VTABLE: Final[int] -SQLITE_DELETE: Final[int] -SQLITE_DENY: Final[int] -SQLITE_DETACH: Final[int] -SQLITE_DONE: Final[int] -SQLITE_DROP_INDEX: Final[int] -SQLITE_DROP_TABLE: Final[int] -SQLITE_DROP_TEMP_INDEX: Final[int] -SQLITE_DROP_TEMP_TABLE: Final[int] -SQLITE_DROP_TEMP_TRIGGER: Final[int] -SQLITE_DROP_TEMP_VIEW: Final[int] -SQLITE_DROP_TRIGGER: Final[int] -SQLITE_DROP_VIEW: Final[int] -SQLITE_DROP_VTABLE: Final[int] -SQLITE_FUNCTION: Final[int] -SQLITE_IGNORE: Final[int] -SQLITE_INSERT: Final[int] -SQLITE_OK: Final[int] -SQLITE_PRAGMA: Final[int] -SQLITE_READ: Final[int] -SQLITE_RECURSIVE: Final[int] -SQLITE_REINDEX: Final[int] -SQLITE_SAVEPOINT: Final[int] -SQLITE_SELECT: Final[int] -SQLITE_TRANSACTION: Final[int] -SQLITE_UPDATE: Final[int] -adapters: dict[tuple[type[Any], type[Any]], _Adapter[Any]] -converters: dict[str, _Converter] -sqlite_version: str - -if sys.version_info < (3, 12): - version: str - -if sys.version_info >= (3, 12): - LEGACY_TRANSACTION_CONTROL: Final[int] - SQLITE_DBCONFIG_DEFENSIVE: Final[int] - SQLITE_DBCONFIG_DQS_DDL: Final[int] - SQLITE_DBCONFIG_DQS_DML: Final[int] - SQLITE_DBCONFIG_ENABLE_FKEY: Final[int] - SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER: Final[int] - SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION: Final[int] - SQLITE_DBCONFIG_ENABLE_QPSG: Final[int] - SQLITE_DBCONFIG_ENABLE_TRIGGER: Final[int] - SQLITE_DBCONFIG_ENABLE_VIEW: Final[int] - SQLITE_DBCONFIG_LEGACY_ALTER_TABLE: Final[int] - SQLITE_DBCONFIG_LEGACY_FILE_FORMAT: Final[int] - SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE: Final[int] - SQLITE_DBCONFIG_RESET_DATABASE: Final[int] - SQLITE_DBCONFIG_TRIGGER_EQP: Final[int] - SQLITE_DBCONFIG_TRUSTED_SCHEMA: Final[int] - SQLITE_DBCONFIG_WRITABLE_SCHEMA: Final[int] - -if sys.version_info >= (3, 11): - SQLITE_ABORT: Final[int] - SQLITE_ABORT_ROLLBACK: Final[int] - SQLITE_AUTH: Final[int] - SQLITE_AUTH_USER: Final[int] - SQLITE_BUSY: Final[int] - SQLITE_BUSY_RECOVERY: Final[int] - SQLITE_BUSY_SNAPSHOT: Final[int] - SQLITE_BUSY_TIMEOUT: Final[int] - SQLITE_CANTOPEN: Final[int] - SQLITE_CANTOPEN_CONVPATH: Final[int] - SQLITE_CANTOPEN_DIRTYWAL: Final[int] - SQLITE_CANTOPEN_FULLPATH: Final[int] - SQLITE_CANTOPEN_ISDIR: Final[int] - SQLITE_CANTOPEN_NOTEMPDIR: Final[int] - SQLITE_CANTOPEN_SYMLINK: Final[int] - SQLITE_CONSTRAINT: Final[int] - SQLITE_CONSTRAINT_CHECK: Final[int] - SQLITE_CONSTRAINT_COMMITHOOK: Final[int] - SQLITE_CONSTRAINT_FOREIGNKEY: Final[int] - SQLITE_CONSTRAINT_FUNCTION: Final[int] - SQLITE_CONSTRAINT_NOTNULL: Final[int] - SQLITE_CONSTRAINT_PINNED: Final[int] - SQLITE_CONSTRAINT_PRIMARYKEY: Final[int] - SQLITE_CONSTRAINT_ROWID: Final[int] - SQLITE_CONSTRAINT_TRIGGER: Final[int] - SQLITE_CONSTRAINT_UNIQUE: Final[int] - SQLITE_CONSTRAINT_VTAB: Final[int] - SQLITE_CORRUPT: Final[int] - SQLITE_CORRUPT_INDEX: Final[int] - SQLITE_CORRUPT_SEQUENCE: Final[int] - SQLITE_CORRUPT_VTAB: Final[int] - SQLITE_EMPTY: Final[int] - SQLITE_ERROR: Final[int] - SQLITE_ERROR_MISSING_COLLSEQ: Final[int] - SQLITE_ERROR_RETRY: Final[int] - SQLITE_ERROR_SNAPSHOT: Final[int] - SQLITE_FORMAT: Final[int] - SQLITE_FULL: Final[int] - SQLITE_INTERNAL: Final[int] - SQLITE_INTERRUPT: Final[int] - SQLITE_IOERR: Final[int] - SQLITE_IOERR_ACCESS: Final[int] - SQLITE_IOERR_AUTH: Final[int] - SQLITE_IOERR_BEGIN_ATOMIC: Final[int] - SQLITE_IOERR_BLOCKED: Final[int] - SQLITE_IOERR_CHECKRESERVEDLOCK: Final[int] - SQLITE_IOERR_CLOSE: Final[int] - SQLITE_IOERR_COMMIT_ATOMIC: Final[int] - SQLITE_IOERR_CONVPATH: Final[int] - SQLITE_IOERR_CORRUPTFS: Final[int] - SQLITE_IOERR_DATA: Final[int] - SQLITE_IOERR_DELETE: Final[int] - SQLITE_IOERR_DELETE_NOENT: Final[int] - SQLITE_IOERR_DIR_CLOSE: Final[int] - SQLITE_IOERR_DIR_FSYNC: Final[int] - SQLITE_IOERR_FSTAT: Final[int] - SQLITE_IOERR_FSYNC: Final[int] - SQLITE_IOERR_GETTEMPPATH: Final[int] - SQLITE_IOERR_LOCK: Final[int] - SQLITE_IOERR_MMAP: Final[int] - SQLITE_IOERR_NOMEM: Final[int] - SQLITE_IOERR_RDLOCK: Final[int] - SQLITE_IOERR_READ: Final[int] - SQLITE_IOERR_ROLLBACK_ATOMIC: Final[int] - SQLITE_IOERR_SEEK: Final[int] - SQLITE_IOERR_SHMLOCK: Final[int] - SQLITE_IOERR_SHMMAP: Final[int] - SQLITE_IOERR_SHMOPEN: Final[int] - SQLITE_IOERR_SHMSIZE: Final[int] - SQLITE_IOERR_SHORT_READ: Final[int] - SQLITE_IOERR_TRUNCATE: Final[int] - SQLITE_IOERR_UNLOCK: Final[int] - SQLITE_IOERR_VNODE: Final[int] - SQLITE_IOERR_WRITE: Final[int] - SQLITE_LIMIT_ATTACHED: Final[int] - SQLITE_LIMIT_COLUMN: Final[int] - SQLITE_LIMIT_COMPOUND_SELECT: Final[int] - SQLITE_LIMIT_EXPR_DEPTH: Final[int] - SQLITE_LIMIT_FUNCTION_ARG: Final[int] - SQLITE_LIMIT_LENGTH: Final[int] - SQLITE_LIMIT_LIKE_PATTERN_LENGTH: Final[int] - SQLITE_LIMIT_SQL_LENGTH: Final[int] - SQLITE_LIMIT_TRIGGER_DEPTH: Final[int] - SQLITE_LIMIT_VARIABLE_NUMBER: Final[int] - SQLITE_LIMIT_VDBE_OP: Final[int] - SQLITE_LIMIT_WORKER_THREADS: Final[int] - SQLITE_LOCKED: Final[int] - SQLITE_LOCKED_SHAREDCACHE: Final[int] - SQLITE_LOCKED_VTAB: Final[int] - SQLITE_MISMATCH: Final[int] - SQLITE_MISUSE: Final[int] - SQLITE_NOLFS: Final[int] - SQLITE_NOMEM: Final[int] - SQLITE_NOTADB: Final[int] - SQLITE_NOTFOUND: Final[int] - SQLITE_NOTICE: Final[int] - SQLITE_NOTICE_RECOVER_ROLLBACK: Final[int] - SQLITE_NOTICE_RECOVER_WAL: Final[int] - SQLITE_OK_LOAD_PERMANENTLY: Final[int] - SQLITE_OK_SYMLINK: Final[int] - SQLITE_PERM: Final[int] - SQLITE_PROTOCOL: Final[int] - SQLITE_RANGE: Final[int] - SQLITE_READONLY: Final[int] - SQLITE_READONLY_CANTINIT: Final[int] - SQLITE_READONLY_CANTLOCK: Final[int] - SQLITE_READONLY_DBMOVED: Final[int] - SQLITE_READONLY_DIRECTORY: Final[int] - SQLITE_READONLY_RECOVERY: Final[int] - SQLITE_READONLY_ROLLBACK: Final[int] - SQLITE_ROW: Final[int] - SQLITE_SCHEMA: Final[int] - SQLITE_TOOBIG: Final[int] - SQLITE_WARNING: Final[int] - SQLITE_WARNING_AUTOINDEX: Final[int] - threadsafety: Final[int] - -# Can take or return anything depending on what's in the registry. -@overload -def adapt(obj: Any, proto: Any, /) -> Any: ... -@overload -def adapt(obj: Any, proto: Any, alt: _T, /) -> Any | _T: ... -def complete_statement(statement: str) -> bool: ... - -if sys.version_info >= (3, 12): - @overload - def connect( - database: StrOrBytesPath, - timeout: float = 5.0, - detect_types: int = 0, - isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None = "DEFERRED", - check_same_thread: bool = True, - cached_statements: int = 128, - uri: bool = False, - *, - autocommit: bool = ..., - ) -> Connection: ... - @overload - def connect( - database: StrOrBytesPath, - timeout: float, - detect_types: int, - isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None, - check_same_thread: bool, - factory: type[_ConnectionT], - cached_statements: int = 128, - uri: bool = False, - *, - autocommit: bool = ..., - ) -> _ConnectionT: ... - @overload - def connect( - database: StrOrBytesPath, - timeout: float = 5.0, - detect_types: int = 0, - isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None = "DEFERRED", - check_same_thread: bool = True, - *, - factory: type[_ConnectionT], - cached_statements: int = 128, - uri: bool = False, - autocommit: bool = ..., - ) -> _ConnectionT: ... - -else: - @overload - def connect( - database: StrOrBytesPath, - timeout: float = 5.0, - detect_types: int = 0, - isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None = "DEFERRED", - check_same_thread: bool = True, - cached_statements: int = 128, - uri: bool = False, - ) -> Connection: ... - @overload - def connect( - database: StrOrBytesPath, - timeout: float, - detect_types: int, - isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None, - check_same_thread: bool, - factory: type[_ConnectionT], - cached_statements: int = 128, - uri: bool = False, - ) -> _ConnectionT: ... - @overload - def connect( - database: StrOrBytesPath, - timeout: float = 5.0, - detect_types: int = 0, - isolation_level: Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None = "DEFERRED", - check_same_thread: bool = True, - *, - factory: type[_ConnectionT], - cached_statements: int = 128, - uri: bool = False, - ) -> _ConnectionT: ... - -def enable_callback_tracebacks(enable: bool, /) -> None: ... - -if sys.version_info < (3, 12): - # takes a pos-or-keyword argument because there is a C wrapper - def enable_shared_cache(do_enable: int) -> None: ... - -if sys.version_info >= (3, 10): - def register_adapter(type: type[_T], adapter: _Adapter[_T], /) -> None: ... - def register_converter(typename: str, converter: _Converter, /) -> None: ... - -else: - def register_adapter(type: type[_T], caster: _Adapter[_T], /) -> None: ... - def register_converter(name: str, converter: _Converter, /) -> None: ... - -if sys.version_info < (3, 10): - OptimizedUnicode = str diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_ssl.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_ssl.pyi deleted file mode 100644 index e39ab5eb6d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_ssl.pyi +++ /dev/null @@ -1,291 +0,0 @@ -import sys -from _typeshed import ReadableBuffer, StrOrBytesPath -from collections.abc import Callable -from ssl import ( - SSLCertVerificationError as SSLCertVerificationError, - SSLContext, - SSLEOFError as SSLEOFError, - SSLError as SSLError, - SSLObject, - SSLSyscallError as SSLSyscallError, - SSLWantReadError as SSLWantReadError, - SSLWantWriteError as SSLWantWriteError, - SSLZeroReturnError as SSLZeroReturnError, -) -from typing import Any, ClassVar, Literal, TypedDict, final, overload -from typing_extensions import NotRequired, Self, TypeAlias - -_PasswordType: TypeAlias = Callable[[], str | bytes | bytearray] | str | bytes | bytearray -_PCTRTT: TypeAlias = tuple[tuple[str, str], ...] -_PCTRTTT: TypeAlias = tuple[_PCTRTT, ...] -_PeerCertRetDictType: TypeAlias = dict[str, str | _PCTRTTT | _PCTRTT] - -class _Cipher(TypedDict): - aead: bool - alg_bits: int - auth: str - description: str - digest: str | None - id: int - kea: str - name: str - protocol: str - strength_bits: int - symmetric: str - -class _CertInfo(TypedDict): - subject: tuple[tuple[tuple[str, str], ...], ...] - issuer: tuple[tuple[tuple[str, str], ...], ...] - version: int - serialNumber: str - notBefore: str - notAfter: str - subjectAltName: NotRequired[tuple[tuple[str, str], ...] | None] - OCSP: NotRequired[tuple[str, ...] | None] - caIssuers: NotRequired[tuple[str, ...] | None] - crlDistributionPoints: NotRequired[tuple[str, ...] | None] - -def RAND_add(string: str | ReadableBuffer, entropy: float, /) -> None: ... -def RAND_bytes(n: int, /) -> bytes: ... - -if sys.version_info < (3, 12): - def RAND_pseudo_bytes(n: int, /) -> tuple[bytes, bool]: ... - -if sys.version_info < (3, 10): - def RAND_egd(path: str) -> None: ... - -def RAND_status() -> bool: ... -def get_default_verify_paths() -> tuple[str, str, str, str]: ... - -if sys.platform == "win32": - _EnumRetType: TypeAlias = list[tuple[bytes, str, set[str] | bool]] - def enum_certificates(store_name: str) -> _EnumRetType: ... - def enum_crls(store_name: str) -> _EnumRetType: ... - -def txt2obj(txt: str, name: bool = False) -> tuple[int, str, str, str]: ... -def nid2obj(nid: int, /) -> tuple[int, str, str, str]: ... - -class _SSLContext: - check_hostname: bool - keylog_filename: str | None - maximum_version: int - minimum_version: int - num_tickets: int - options: int - post_handshake_auth: bool - protocol: int - if sys.version_info >= (3, 10): - security_level: int - sni_callback: Callable[[SSLObject, str, SSLContext], None | int] | None - verify_flags: int - verify_mode: int - def __new__(cls, protocol: int, /) -> Self: ... - def cert_store_stats(self) -> dict[str, int]: ... - @overload - def get_ca_certs(self, binary_form: Literal[False] = False) -> list[_PeerCertRetDictType]: ... - @overload - def get_ca_certs(self, binary_form: Literal[True]) -> list[bytes]: ... - @overload - def get_ca_certs(self, binary_form: bool = False) -> Any: ... - def get_ciphers(self) -> list[_Cipher]: ... - def load_cert_chain( - self, certfile: StrOrBytesPath, keyfile: StrOrBytesPath | None = None, password: _PasswordType | None = None - ) -> None: ... - def load_dh_params(self, path: str, /) -> None: ... - def load_verify_locations( - self, - cafile: StrOrBytesPath | None = None, - capath: StrOrBytesPath | None = None, - cadata: str | ReadableBuffer | None = None, - ) -> None: ... - def session_stats(self) -> dict[str, int]: ... - def set_ciphers(self, cipherlist: str, /) -> None: ... - def set_default_verify_paths(self) -> None: ... - def set_ecdh_curve(self, name: str, /) -> None: ... - if sys.version_info >= (3, 13): - def set_psk_client_callback(self, callback: Callable[[str | None], tuple[str | None, bytes]] | None) -> None: ... - def set_psk_server_callback( - self, callback: Callable[[str | None], bytes] | None, identity_hint: str | None = None - ) -> None: ... - -@final -class MemoryBIO: - eof: bool - pending: int - def __new__(self) -> Self: ... - def read(self, size: int = -1, /) -> bytes: ... - def write(self, b: ReadableBuffer, /) -> int: ... - def write_eof(self) -> None: ... - -@final -class SSLSession: - __hash__: ClassVar[None] # type: ignore[assignment] - @property - def has_ticket(self) -> bool: ... - @property - def id(self) -> bytes: ... - @property - def ticket_lifetime_hint(self) -> int: ... - @property - def time(self) -> int: ... - @property - def timeout(self) -> int: ... - -# _ssl.Certificate is weird: it can't be instantiated or subclassed. -# Instances can only be created via methods of the private _ssl._SSLSocket class, -# for which the relevant method signatures are: -# -# class _SSLSocket: -# def get_unverified_chain(self) -> list[Certificate] | None: ... -# def get_verified_chain(self) -> list[Certificate] | None: ... -# -# You can find a _ssl._SSLSocket object as the _sslobj attribute of a ssl.SSLSocket object - -if sys.version_info >= (3, 10): - @final - class Certificate: - def get_info(self) -> _CertInfo: ... - @overload - def public_bytes(self) -> str: ... - @overload - def public_bytes(self, format: Literal[1] = 1, /) -> str: ... # ENCODING_PEM - @overload - def public_bytes(self, format: Literal[2], /) -> bytes: ... # ENCODING_DER - @overload - def public_bytes(self, format: int, /) -> str | bytes: ... - -if sys.version_info < (3, 12): - err_codes_to_names: dict[tuple[int, int], str] - err_names_to_codes: dict[str, tuple[int, int]] - lib_codes_to_names: dict[int, str] - -_DEFAULT_CIPHERS: str - -# SSL error numbers -SSL_ERROR_ZERO_RETURN: int -SSL_ERROR_WANT_READ: int -SSL_ERROR_WANT_WRITE: int -SSL_ERROR_WANT_X509_LOOKUP: int -SSL_ERROR_SYSCALL: int -SSL_ERROR_SSL: int -SSL_ERROR_WANT_CONNECT: int -SSL_ERROR_EOF: int -SSL_ERROR_INVALID_ERROR_CODE: int - -# verify modes -CERT_NONE: int -CERT_OPTIONAL: int -CERT_REQUIRED: int - -# verify flags -VERIFY_DEFAULT: int -VERIFY_CRL_CHECK_LEAF: int -VERIFY_CRL_CHECK_CHAIN: int -VERIFY_X509_STRICT: int -VERIFY_X509_TRUSTED_FIRST: int -if sys.version_info >= (3, 10): - VERIFY_ALLOW_PROXY_CERTS: int - VERIFY_X509_PARTIAL_CHAIN: int - -# alert descriptions -ALERT_DESCRIPTION_CLOSE_NOTIFY: int -ALERT_DESCRIPTION_UNEXPECTED_MESSAGE: int -ALERT_DESCRIPTION_BAD_RECORD_MAC: int -ALERT_DESCRIPTION_RECORD_OVERFLOW: int -ALERT_DESCRIPTION_DECOMPRESSION_FAILURE: int -ALERT_DESCRIPTION_HANDSHAKE_FAILURE: int -ALERT_DESCRIPTION_BAD_CERTIFICATE: int -ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE: int -ALERT_DESCRIPTION_CERTIFICATE_REVOKED: int -ALERT_DESCRIPTION_CERTIFICATE_EXPIRED: int -ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN: int -ALERT_DESCRIPTION_ILLEGAL_PARAMETER: int -ALERT_DESCRIPTION_UNKNOWN_CA: int -ALERT_DESCRIPTION_ACCESS_DENIED: int -ALERT_DESCRIPTION_DECODE_ERROR: int -ALERT_DESCRIPTION_DECRYPT_ERROR: int -ALERT_DESCRIPTION_PROTOCOL_VERSION: int -ALERT_DESCRIPTION_INSUFFICIENT_SECURITY: int -ALERT_DESCRIPTION_INTERNAL_ERROR: int -ALERT_DESCRIPTION_USER_CANCELLED: int -ALERT_DESCRIPTION_NO_RENEGOTIATION: int -ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION: int -ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE: int -ALERT_DESCRIPTION_UNRECOGNIZED_NAME: int -ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE: int -ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE: int -ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY: int - -# protocol versions -PROTOCOL_SSLv23: int -PROTOCOL_TLS: int -PROTOCOL_TLS_CLIENT: int -PROTOCOL_TLS_SERVER: int -PROTOCOL_TLSv1: int -PROTOCOL_TLSv1_1: int -PROTOCOL_TLSv1_2: int - -# protocol options -OP_ALL: int -OP_NO_SSLv2: int -OP_NO_SSLv3: int -OP_NO_TLSv1: int -OP_NO_TLSv1_1: int -OP_NO_TLSv1_2: int -OP_NO_TLSv1_3: int -OP_CIPHER_SERVER_PREFERENCE: int -OP_SINGLE_DH_USE: int -OP_NO_TICKET: int -OP_SINGLE_ECDH_USE: int -OP_NO_COMPRESSION: int -OP_ENABLE_MIDDLEBOX_COMPAT: int -OP_NO_RENEGOTIATION: int -if sys.version_info >= (3, 11) or sys.platform == "linux": - OP_IGNORE_UNEXPECTED_EOF: int -if sys.version_info >= (3, 12): - OP_LEGACY_SERVER_CONNECT: int - OP_ENABLE_KTLS: int - -# host flags -HOSTFLAG_ALWAYS_CHECK_SUBJECT: int -HOSTFLAG_NEVER_CHECK_SUBJECT: int -HOSTFLAG_NO_WILDCARDS: int -HOSTFLAG_NO_PARTIAL_WILDCARDS: int -HOSTFLAG_MULTI_LABEL_WILDCARDS: int -HOSTFLAG_SINGLE_LABEL_SUBDOMAINS: int - -if sys.version_info >= (3, 10): - # certificate file types - # Typed as Literal so the overload on Certificate.public_bytes can work properly. - ENCODING_PEM: Literal[1] - ENCODING_DER: Literal[2] - -# protocol versions -PROTO_MINIMUM_SUPPORTED: int -PROTO_MAXIMUM_SUPPORTED: int -PROTO_SSLv3: int -PROTO_TLSv1: int -PROTO_TLSv1_1: int -PROTO_TLSv1_2: int -PROTO_TLSv1_3: int - -# feature support -HAS_SNI: bool -HAS_TLS_UNIQUE: bool -HAS_ECDH: bool -HAS_NPN: bool -if sys.version_info >= (3, 13): - HAS_PSK: bool -HAS_ALPN: bool -HAS_SSLv2: bool -HAS_SSLv3: bool -HAS_TLSv1: bool -HAS_TLSv1_1: bool -HAS_TLSv1_2: bool -HAS_TLSv1_3: bool - -# version info -OPENSSL_VERSION_NUMBER: int -OPENSSL_VERSION_INFO: tuple[int, int, int, int, int] -OPENSSL_VERSION: str -_OPENSSL_API_VERSION: tuple[int, int, int, int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_stat.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_stat.pyi deleted file mode 100644 index 7129a282b5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_stat.pyi +++ /dev/null @@ -1,119 +0,0 @@ -import sys -from typing import Final - -SF_APPEND: Final = 0x00040000 -SF_ARCHIVED: Final = 0x00010000 -SF_IMMUTABLE: Final = 0x00020000 -SF_NOUNLINK: Final = 0x00100000 -SF_SNAPSHOT: Final = 0x00200000 - -ST_MODE: Final = 0 -ST_INO: Final = 1 -ST_DEV: Final = 2 -ST_NLINK: Final = 3 -ST_UID: Final = 4 -ST_GID: Final = 5 -ST_SIZE: Final = 6 -ST_ATIME: Final = 7 -ST_MTIME: Final = 8 -ST_CTIME: Final = 9 - -S_IFIFO: Final = 0o010000 -S_IFLNK: Final = 0o120000 -S_IFREG: Final = 0o100000 -S_IFSOCK: Final = 0o140000 -S_IFBLK: Final = 0o060000 -S_IFCHR: Final = 0o020000 -S_IFDIR: Final = 0o040000 - -# These are 0 on systems that don't support the specific kind of file. -# Example: Linux doesn't support door files, so S_IFDOOR is 0 on linux. -S_IFDOOR: Final[int] -S_IFPORT: Final[int] -S_IFWHT: Final[int] - -S_ISUID: Final = 0o4000 -S_ISGID: Final = 0o2000 -S_ISVTX: Final = 0o1000 - -S_IRWXU: Final = 0o0700 -S_IRUSR: Final = 0o0400 -S_IWUSR: Final = 0o0200 -S_IXUSR: Final = 0o0100 - -S_IRWXG: Final = 0o0070 -S_IRGRP: Final = 0o0040 -S_IWGRP: Final = 0o0020 -S_IXGRP: Final = 0o0010 - -S_IRWXO: Final = 0o0007 -S_IROTH: Final = 0o0004 -S_IWOTH: Final = 0o0002 -S_IXOTH: Final = 0o0001 - -S_ENFMT: Final = 0o2000 -S_IREAD: Final = 0o0400 -S_IWRITE: Final = 0o0200 -S_IEXEC: Final = 0o0100 - -UF_APPEND: Final = 0x00000004 -UF_COMPRESSED: Final = 0x00000020 # OS X 10.6+ only -UF_HIDDEN: Final = 0x00008000 # OX X 10.5+ only -UF_IMMUTABLE: Final = 0x00000002 -UF_NODUMP: Final = 0x00000001 -UF_NOUNLINK: Final = 0x00000010 -UF_OPAQUE: Final = 0x00000008 - -def S_IMODE(mode: int, /) -> int: ... -def S_IFMT(mode: int, /) -> int: ... -def S_ISBLK(mode: int, /) -> bool: ... -def S_ISCHR(mode: int, /) -> bool: ... -def S_ISDIR(mode: int, /) -> bool: ... -def S_ISDOOR(mode: int, /) -> bool: ... -def S_ISFIFO(mode: int, /) -> bool: ... -def S_ISLNK(mode: int, /) -> bool: ... -def S_ISPORT(mode: int, /) -> bool: ... -def S_ISREG(mode: int, /) -> bool: ... -def S_ISSOCK(mode: int, /) -> bool: ... -def S_ISWHT(mode: int, /) -> bool: ... -def filemode(mode: int, /) -> str: ... - -if sys.platform == "win32": - IO_REPARSE_TAG_SYMLINK: Final = 0xA000000C - IO_REPARSE_TAG_MOUNT_POINT: Final = 0xA0000003 - IO_REPARSE_TAG_APPEXECLINK: Final = 0x8000001B - -if sys.platform == "win32": - FILE_ATTRIBUTE_ARCHIVE: Final = 32 - FILE_ATTRIBUTE_COMPRESSED: Final = 2048 - FILE_ATTRIBUTE_DEVICE: Final = 64 - FILE_ATTRIBUTE_DIRECTORY: Final = 16 - FILE_ATTRIBUTE_ENCRYPTED: Final = 16384 - FILE_ATTRIBUTE_HIDDEN: Final = 2 - FILE_ATTRIBUTE_INTEGRITY_STREAM: Final = 32768 - FILE_ATTRIBUTE_NORMAL: Final = 128 - FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: Final = 8192 - FILE_ATTRIBUTE_NO_SCRUB_DATA: Final = 131072 - FILE_ATTRIBUTE_OFFLINE: Final = 4096 - FILE_ATTRIBUTE_READONLY: Final = 1 - FILE_ATTRIBUTE_REPARSE_POINT: Final = 1024 - FILE_ATTRIBUTE_SPARSE_FILE: Final = 512 - FILE_ATTRIBUTE_SYSTEM: Final = 4 - FILE_ATTRIBUTE_TEMPORARY: Final = 256 - FILE_ATTRIBUTE_VIRTUAL: Final = 65536 - -if sys.version_info >= (3, 13): - # Varies by platform. - SF_SETTABLE: Final[int] - # https://github.com/python/cpython/issues/114081#issuecomment-2119017790 - # SF_RESTRICTED: Literal[0x00080000] - SF_FIRMLINK: Final = 0x00800000 - SF_DATALESS: Final = 0x40000000 - - if sys.platform == "darwin": - SF_SUPPORTED: Final = 0x9F0000 - SF_SYNTHETIC: Final = 0xC0000000 - - UF_TRACKED: Final = 0x00000040 - UF_DATAVAULT: Final = 0x00000080 - UF_SETTABLE: Final = 0x0000FFFF diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_struct.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_struct.pyi deleted file mode 100644 index 662170e869..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_struct.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from _typeshed import ReadableBuffer, WriteableBuffer -from collections.abc import Iterator -from typing import Any - -def pack(fmt: str | bytes, /, *v: Any) -> bytes: ... -def pack_into(fmt: str | bytes, buffer: WriteableBuffer, offset: int, /, *v: Any) -> None: ... -def unpack(format: str | bytes, buffer: ReadableBuffer, /) -> tuple[Any, ...]: ... -def unpack_from(format: str | bytes, /, buffer: ReadableBuffer, offset: int = 0) -> tuple[Any, ...]: ... -def iter_unpack(format: str | bytes, buffer: ReadableBuffer, /) -> Iterator[tuple[Any, ...]]: ... -def calcsize(format: str | bytes, /) -> int: ... - -class Struct: - @property - def format(self) -> str: ... - @property - def size(self) -> int: ... - def __init__(self, format: str | bytes) -> None: ... - def pack(self, *v: Any) -> bytes: ... - def pack_into(self, buffer: WriteableBuffer, offset: int, *v: Any) -> None: ... - def unpack(self, buffer: ReadableBuffer, /) -> tuple[Any, ...]: ... - def unpack_from(self, buffer: ReadableBuffer, offset: int = 0) -> tuple[Any, ...]: ... - def iter_unpack(self, buffer: ReadableBuffer, /) -> Iterator[tuple[Any, ...]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_thread.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_thread.pyi deleted file mode 100644 index 378ac24237..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_thread.pyi +++ /dev/null @@ -1,111 +0,0 @@ -import signal -import sys -from _typeshed import structseq -from collections.abc import Callable -from threading import Thread -from types import TracebackType -from typing import Any, Final, NoReturn, final, overload -from typing_extensions import TypeVarTuple, Unpack - -_Ts = TypeVarTuple("_Ts") - -error = RuntimeError - -def _count() -> int: ... -@final -class RLock: - def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... - def release(self) -> None: ... - __enter__ = acquire - def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... - -if sys.version_info >= (3, 13): - @final - class _ThreadHandle: - ident: int - - def join(self, timeout: float | None = None, /) -> None: ... - def is_done(self) -> bool: ... - def _set_done(self) -> None: ... - - def start_joinable_thread( - function: Callable[[], object], handle: _ThreadHandle | None = None, daemon: bool = True - ) -> _ThreadHandle: ... - @final - class lock: - def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... - def release(self) -> None: ... - def locked(self) -> bool: ... - def acquire_lock(self, blocking: bool = True, timeout: float = -1) -> bool: ... - def release_lock(self) -> None: ... - def locked_lock(self) -> bool: ... - def __enter__(self) -> bool: ... - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> None: ... - - LockType = lock -else: - @final - class LockType: - def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... - def release(self) -> None: ... - def locked(self) -> bool: ... - def acquire_lock(self, blocking: bool = True, timeout: float = -1) -> bool: ... - def release_lock(self) -> None: ... - def locked_lock(self) -> bool: ... - def __enter__(self) -> bool: ... - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> None: ... - -@overload -def start_new_thread(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]], /) -> int: ... -@overload -def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any], /) -> int: ... - -# Obsolete synonym for start_new_thread() -@overload -def start_new(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]], /) -> int: ... -@overload -def start_new(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any], /) -> int: ... - -if sys.version_info >= (3, 10): - def interrupt_main(signum: signal.Signals = ..., /) -> None: ... - -else: - def interrupt_main() -> None: ... - -def exit() -> NoReturn: ... -def exit_thread() -> NoReturn: ... # Obsolete synonym for exit() -def allocate_lock() -> LockType: ... -def allocate() -> LockType: ... # Obsolete synonym for allocate_lock() -def get_ident() -> int: ... -def stack_size(size: int = 0, /) -> int: ... - -TIMEOUT_MAX: float - -def get_native_id() -> int: ... # only available on some platforms -@final -class _ExceptHookArgs(structseq[Any], tuple[type[BaseException], BaseException | None, TracebackType | None, Thread | None]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("exc_type", "exc_value", "exc_traceback", "thread") - - @property - def exc_type(self) -> type[BaseException]: ... - @property - def exc_value(self) -> BaseException | None: ... - @property - def exc_traceback(self) -> TracebackType | None: ... - @property - def thread(self) -> Thread | None: ... - -_excepthook: Callable[[_ExceptHookArgs], Any] - -if sys.version_info >= (3, 12): - def daemon_threads_allowed() -> bool: ... - -class _local: - def __getattribute__(self, name: str, /) -> Any: ... - def __setattr__(self, name: str, value: Any, /) -> None: ... - def __delattr__(self, name: str, /) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_threading_local.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_threading_local.pyi deleted file mode 100644 index 07a825f0d8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_threading_local.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from threading import RLock -from typing import Any -from typing_extensions import Self, TypeAlias -from weakref import ReferenceType - -__all__ = ["local"] -_LocalDict: TypeAlias = dict[Any, Any] - -class _localimpl: - key: str - dicts: dict[int, tuple[ReferenceType[Any], _LocalDict]] - # Keep localargs in sync with the *args, **kwargs annotation on local.__new__ - localargs: tuple[list[Any], dict[str, Any]] - locallock: RLock - def get_dict(self) -> _LocalDict: ... - def create_dict(self) -> _LocalDict: ... - -class local: - def __new__(cls, /, *args: Any, **kw: Any) -> Self: ... - def __getattribute__(self, name: str) -> Any: ... - def __setattr__(self, name: str, value: Any) -> None: ... - def __delattr__(self, name: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_tkinter.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_tkinter.pyi deleted file mode 100644 index 4206a2114f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_tkinter.pyi +++ /dev/null @@ -1,143 +0,0 @@ -import sys -from collections.abc import Callable -from typing import Any, ClassVar, Final, final -from typing_extensions import TypeAlias - -# _tkinter is meant to be only used internally by tkinter, but some tkinter -# functions e.g. return _tkinter.Tcl_Obj objects. Tcl_Obj represents a Tcl -# object that hasn't been converted to a string. -# -# There are not many ways to get Tcl_Objs from tkinter, and I'm not sure if the -# only existing ways are supposed to return Tcl_Objs as opposed to returning -# strings. Here's one of these things that return Tcl_Objs: -# -# >>> import tkinter -# >>> text = tkinter.Text() -# >>> text.tag_add('foo', '1.0', 'end') -# >>> text.tag_ranges('foo') -# (, ) -@final -class Tcl_Obj: - @property - def string(self) -> str: ... - @property - def typename(self) -> str: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __eq__(self, value, /): ... - def __ge__(self, value, /): ... - def __gt__(self, value, /): ... - def __le__(self, value, /): ... - def __lt__(self, value, /): ... - def __ne__(self, value, /): ... - -class TclError(Exception): ... - -_TkinterTraceFunc: TypeAlias = Callable[[tuple[str, ...]], object] - -# This class allows running Tcl code. Tkinter uses it internally a lot, and -# it's often handy to drop a piece of Tcl code into a tkinter program. Example: -# -# >>> import tkinter, _tkinter -# >>> tkapp = tkinter.Tk().tk -# >>> isinstance(tkapp, _tkinter.TkappType) -# True -# >>> tkapp.call('set', 'foo', (1,2,3)) -# (1, 2, 3) -# >>> tkapp.eval('return $foo') -# '1 2 3' -# >>> -# -# call args can be pretty much anything. Also, call(some_tuple) is same as call(*some_tuple). -# -# eval always returns str because _tkinter_tkapp_eval_impl in _tkinter.c calls -# Tkapp_UnicodeResult, and it returns a string when it succeeds. -@final -class TkappType: - # Please keep in sync with tkinter.Tk - def adderrorinfo(self, msg, /): ... - def call(self, command: Any, /, *args: Any) -> Any: ... - def createcommand(self, name, func, /): ... - if sys.platform != "win32": - def createfilehandler(self, file, mask, func, /): ... - def deletefilehandler(self, file, /): ... - - def createtimerhandler(self, milliseconds, func, /): ... - def deletecommand(self, name, /): ... - def dooneevent(self, flags: int = 0, /): ... - def eval(self, script: str, /) -> str: ... - def evalfile(self, fileName, /): ... - def exprboolean(self, s, /): ... - def exprdouble(self, s, /): ... - def exprlong(self, s, /): ... - def exprstring(self, s, /): ... - def getboolean(self, arg, /): ... - def getdouble(self, arg, /): ... - def getint(self, arg, /): ... - def getvar(self, *args, **kwargs): ... - def globalgetvar(self, *args, **kwargs): ... - def globalsetvar(self, *args, **kwargs): ... - def globalunsetvar(self, *args, **kwargs): ... - def interpaddr(self): ... - def loadtk(self) -> None: ... - def mainloop(self, threshold: int = 0, /): ... - def quit(self): ... - def record(self, script, /): ... - def setvar(self, *ags, **kwargs): ... - if sys.version_info < (3, 11): - def split(self, arg, /): ... - - def splitlist(self, arg, /): ... - def unsetvar(self, *args, **kwargs): ... - def wantobjects(self, *args, **kwargs): ... - def willdispatch(self): ... - if sys.version_info >= (3, 12): - def gettrace(self, /) -> _TkinterTraceFunc | None: ... - def settrace(self, func: _TkinterTraceFunc | None, /) -> None: ... - -# These should be kept in sync with tkinter.tix constants, except ALL_EVENTS which doesn't match TCL_ALL_EVENTS -ALL_EVENTS: Final = -3 -FILE_EVENTS: Final = 8 -IDLE_EVENTS: Final = 32 -TIMER_EVENTS: Final = 16 -WINDOW_EVENTS: Final = 4 - -DONT_WAIT: Final = 2 -EXCEPTION: Final = 8 -READABLE: Final = 2 -WRITABLE: Final = 4 - -TCL_VERSION: Final[str] -TK_VERSION: Final[str] - -@final -class TkttType: - def deletetimerhandler(self): ... - -if sys.version_info >= (3, 13): - def create( - screenName: str | None = None, - baseName: str = "", - className: str = "Tk", - interactive: bool = False, - wantobjects: int = 0, - wantTk: bool = True, - sync: bool = False, - use: str | None = None, - /, - ): ... - -else: - def create( - screenName: str | None = None, - baseName: str = "", - className: str = "Tk", - interactive: bool = False, - wantobjects: bool = False, - wantTk: bool = True, - sync: bool = False, - use: str | None = None, - /, - ): ... - -def getbusywaitinterval(): ... -def setbusywaitinterval(new_val, /): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_tracemalloc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_tracemalloc.pyi deleted file mode 100644 index e9720f4669..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_tracemalloc.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from collections.abc import Sequence -from tracemalloc import _FrameTuple, _TraceTuple - -def _get_object_traceback(obj: object, /) -> Sequence[_FrameTuple] | None: ... -def _get_traces() -> Sequence[_TraceTuple]: ... -def clear_traces() -> None: ... -def get_traceback_limit() -> int: ... -def get_traced_memory() -> tuple[int, int]: ... -def get_tracemalloc_memory() -> int: ... -def is_tracing() -> bool: ... -def reset_peak() -> None: ... -def start(nframe: int = 1, /) -> None: ... -def stop() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_typeshed/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_typeshed/__init__.pyi index a503637998..977ba20ee1 100644 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_typeshed/__init__.pyi +++ b/crates/red_knot_vendored/vendor/typeshed/stdlib/_typeshed/__init__.pyi @@ -1,366 +1,7 @@ -# Utility types for typeshed -# -# See the README.md file in this directory for more information. - import sys -from collections.abc import Awaitable, Callable, Iterable, Sequence, Set as AbstractSet, Sized -from dataclasses import Field -from os import PathLike -from types import FrameType, TracebackType -from typing import ( - Any, - AnyStr, - ClassVar, - Final, - Generic, - Literal, - Protocol, - SupportsFloat, - SupportsIndex, - SupportsInt, - TypeVar, - final, - overload, -) -from typing_extensions import Buffer, LiteralString, Self as _Self, TypeAlias -_KT = TypeVar("_KT") -_KT_co = TypeVar("_KT_co", covariant=True) -_KT_contra = TypeVar("_KT_contra", contravariant=True) -_VT = TypeVar("_VT") -_VT_co = TypeVar("_VT_co", covariant=True) -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True) -_T_contra = TypeVar("_T_contra", contravariant=True) - -# Alternative to `typing_extensions.Self`, exclusively for use with `__new__` -# in metaclasses: -# def __new__(cls: type[Self], ...) -> Self: ... -# In other cases, use `typing_extensions.Self`. -Self = TypeVar("Self") # noqa: Y001 - -# covariant version of typing.AnyStr, useful for protocols -AnyStr_co = TypeVar("AnyStr_co", str, bytes, covariant=True) # noqa: Y001 - -# For partially known annotations. Usually, fields where type annotations -# haven't been added are left unannotated, but in some situations this -# isn't possible or a type is already partially known. In cases like these, -# use Incomplete instead of Any as a marker. For example, use -# "Incomplete | None" instead of "Any | None". -Incomplete: TypeAlias = Any # stable - -# To describe a function parameter that is unused and will work with anything. -Unused: TypeAlias = object # stable - -# Marker for return types that include None, but where forcing the user to -# check for None can be detrimental. Sometimes called "the Any trick". See -# CONTRIBUTING.md for more information. -MaybeNone: TypeAlias = Any # stable - -# Used to mark arguments that default to a sentinel value. This prevents -# stubtest from complaining about the default value not matching. -# -# def foo(x: int | None = sentinel) -> None: ... -# -# In cases where the sentinel object is exported and can be used by user code, -# a construct like this is better: -# -# _SentinelType = NewType("_SentinelType", object) -# sentinel: _SentinelType -# def foo(x: int | None | _SentinelType = ...) -> None: ... -sentinel: Any - -# stable -class IdentityFunction(Protocol): - def __call__(self, x: _T, /) -> _T: ... - -# stable -class SupportsNext(Protocol[_T_co]): - def __next__(self) -> _T_co: ... - -# stable -class SupportsAnext(Protocol[_T_co]): - def __anext__(self) -> Awaitable[_T_co]: ... - -# Comparison protocols - -class SupportsDunderLT(Protocol[_T_contra]): - def __lt__(self, other: _T_contra, /) -> bool: ... - -class SupportsDunderGT(Protocol[_T_contra]): - def __gt__(self, other: _T_contra, /) -> bool: ... - -class SupportsDunderLE(Protocol[_T_contra]): - def __le__(self, other: _T_contra, /) -> bool: ... - -class SupportsDunderGE(Protocol[_T_contra]): - def __ge__(self, other: _T_contra, /) -> bool: ... - -class SupportsAllComparisons( - SupportsDunderLT[Any], SupportsDunderGT[Any], SupportsDunderLE[Any], SupportsDunderGE[Any], Protocol -): ... - -SupportsRichComparison: TypeAlias = SupportsDunderLT[Any] | SupportsDunderGT[Any] -SupportsRichComparisonT = TypeVar("SupportsRichComparisonT", bound=SupportsRichComparison) # noqa: Y001 - -# Dunder protocols - -class SupportsAdd(Protocol[_T_contra, _T_co]): - def __add__(self, x: _T_contra, /) -> _T_co: ... - -class SupportsRAdd(Protocol[_T_contra, _T_co]): - def __radd__(self, x: _T_contra, /) -> _T_co: ... - -class SupportsSub(Protocol[_T_contra, _T_co]): - def __sub__(self, x: _T_contra, /) -> _T_co: ... - -class SupportsRSub(Protocol[_T_contra, _T_co]): - def __rsub__(self, x: _T_contra, /) -> _T_co: ... - -class SupportsMul(Protocol[_T_contra, _T_co]): - def __mul__(self, x: _T_contra, /) -> _T_co: ... - -class SupportsRMul(Protocol[_T_contra, _T_co]): - def __rmul__(self, x: _T_contra, /) -> _T_co: ... - -class SupportsDivMod(Protocol[_T_contra, _T_co]): - def __divmod__(self, other: _T_contra, /) -> _T_co: ... - -class SupportsRDivMod(Protocol[_T_contra, _T_co]): - def __rdivmod__(self, other: _T_contra, /) -> _T_co: ... - -# This protocol is generic over the iterator type, while Iterable is -# generic over the type that is iterated over. -class SupportsIter(Protocol[_T_co]): - def __iter__(self) -> _T_co: ... - -# This protocol is generic over the iterator type, while AsyncIterable is -# generic over the type that is iterated over. -class SupportsAiter(Protocol[_T_co]): - def __aiter__(self) -> _T_co: ... - -class SupportsLenAndGetItem(Protocol[_T_co]): - def __len__(self) -> int: ... - def __getitem__(self, k: int, /) -> _T_co: ... - -class SupportsTrunc(Protocol): - def __trunc__(self) -> int: ... - -# Mapping-like protocols - -# stable -class SupportsItems(Protocol[_KT_co, _VT_co]): - def items(self) -> AbstractSet[tuple[_KT_co, _VT_co]]: ... - -# stable -class SupportsKeysAndGetItem(Protocol[_KT, _VT_co]): - def keys(self) -> Iterable[_KT]: ... - def __getitem__(self, key: _KT, /) -> _VT_co: ... - -# stable -class SupportsGetItem(Protocol[_KT_contra, _VT_co]): - def __getitem__(self, key: _KT_contra, /) -> _VT_co: ... - -# stable -class SupportsContainsAndGetItem(Protocol[_KT_contra, _VT_co]): - def __contains__(self, x: Any, /) -> bool: ... - def __getitem__(self, key: _KT_contra, /) -> _VT_co: ... - -# stable -class SupportsItemAccess(Protocol[_KT_contra, _VT]): - def __contains__(self, x: Any, /) -> bool: ... - def __getitem__(self, key: _KT_contra, /) -> _VT: ... - def __setitem__(self, key: _KT_contra, value: _VT, /) -> None: ... - def __delitem__(self, key: _KT_contra, /) -> None: ... - -StrPath: TypeAlias = str | PathLike[str] # stable -BytesPath: TypeAlias = bytes | PathLike[bytes] # stable -GenericPath: TypeAlias = AnyStr | PathLike[AnyStr] -StrOrBytesPath: TypeAlias = str | bytes | PathLike[str] | PathLike[bytes] # stable - -OpenTextModeUpdating: TypeAlias = Literal[ - "r+", - "+r", - "rt+", - "r+t", - "+rt", - "tr+", - "t+r", - "+tr", - "w+", - "+w", - "wt+", - "w+t", - "+wt", - "tw+", - "t+w", - "+tw", - "a+", - "+a", - "at+", - "a+t", - "+at", - "ta+", - "t+a", - "+ta", - "x+", - "+x", - "xt+", - "x+t", - "+xt", - "tx+", - "t+x", - "+tx", -] -OpenTextModeWriting: TypeAlias = Literal["w", "wt", "tw", "a", "at", "ta", "x", "xt", "tx"] -OpenTextModeReading: TypeAlias = Literal["r", "rt", "tr", "U", "rU", "Ur", "rtU", "rUt", "Urt", "trU", "tUr", "Utr"] -OpenTextMode: TypeAlias = OpenTextModeUpdating | OpenTextModeWriting | OpenTextModeReading -OpenBinaryModeUpdating: TypeAlias = Literal[ - "rb+", - "r+b", - "+rb", - "br+", - "b+r", - "+br", - "wb+", - "w+b", - "+wb", - "bw+", - "b+w", - "+bw", - "ab+", - "a+b", - "+ab", - "ba+", - "b+a", - "+ba", - "xb+", - "x+b", - "+xb", - "bx+", - "b+x", - "+bx", -] -OpenBinaryModeWriting: TypeAlias = Literal["wb", "bw", "ab", "ba", "xb", "bx"] -OpenBinaryModeReading: TypeAlias = Literal["rb", "br", "rbU", "rUb", "Urb", "brU", "bUr", "Ubr"] -OpenBinaryMode: TypeAlias = OpenBinaryModeUpdating | OpenBinaryModeReading | OpenBinaryModeWriting - -# stable -class HasFileno(Protocol): - def fileno(self) -> int: ... - -FileDescriptor: TypeAlias = int # stable -FileDescriptorLike: TypeAlias = int | HasFileno # stable -FileDescriptorOrPath: TypeAlias = int | StrOrBytesPath - -# stable -class SupportsRead(Protocol[_T_co]): - def read(self, length: int = ..., /) -> _T_co: ... - -# stable -class SupportsReadline(Protocol[_T_co]): - def readline(self, length: int = ..., /) -> _T_co: ... - -# stable -class SupportsNoArgReadline(Protocol[_T_co]): - def readline(self) -> _T_co: ... - -# stable -class SupportsWrite(Protocol[_T_contra]): - def write(self, s: _T_contra, /) -> object: ... - -# stable -class SupportsFlush(Protocol): - def flush(self) -> object: ... - -# Unfortunately PEP 688 does not allow us to distinguish read-only -# from writable buffers. We use these aliases for readability for now. -# Perhaps a future extension of the buffer protocol will allow us to -# distinguish these cases in the type system. -ReadOnlyBuffer: TypeAlias = Buffer # stable -# Anything that implements the read-write buffer interface. -WriteableBuffer: TypeAlias = Buffer -# Same as WriteableBuffer, but also includes read-only buffer types (like bytes). -ReadableBuffer: TypeAlias = Buffer # stable - -class SliceableBuffer(Buffer, Protocol): - def __getitem__(self, slice: slice, /) -> Sequence[int]: ... - -class IndexableBuffer(Buffer, Protocol): - def __getitem__(self, i: int, /) -> int: ... - -class SupportsGetItemBuffer(SliceableBuffer, IndexableBuffer, Protocol): - def __contains__(self, x: Any, /) -> bool: ... - @overload - def __getitem__(self, slice: slice, /) -> Sequence[int]: ... - @overload - def __getitem__(self, i: int, /) -> int: ... - -class SizedBuffer(Sized, Buffer, Protocol): ... - -# for compatibility with third-party stubs that may use this -_BufferWithLen: TypeAlias = SizedBuffer # not stable # noqa: Y047 - -ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, TracebackType] -OptExcInfo: TypeAlias = ExcInfo | tuple[None, None, None] - -# stable +# issue only repros if we check `sys.version_info` here; no other test will do if sys.version_info >= (3, 10): - from types import NoneType as NoneType + class NoneType: ... else: - # Used by type checkers for checks involving None (does not exist at runtime) - @final - class NoneType: - def __bool__(self) -> Literal[False]: ... - -# This is an internal CPython type that is like, but subtly different from, a NamedTuple -# Subclasses of this type are found in multiple modules. -# In typeshed, `structseq` is only ever used as a mixin in combination with a fixed-length `Tuple` -# See discussion at #6546 & #6560 -# `structseq` classes are unsubclassable, so are all decorated with `@final`. -class structseq(Generic[_T_co]): - n_fields: Final[int] - n_unnamed_fields: Final[int] - n_sequence_fields: Final[int] - # The first parameter will generally only take an iterable of a specific length. - # E.g. `os.uname_result` takes any iterable of length exactly 5. - # - # The second parameter will accept a dict of any kind without raising an exception, - # but only has any meaning if you supply it a dict where the keys are strings. - # https://github.com/python/typeshed/pull/6560#discussion_r767149830 - def __new__(cls, sequence: Iterable[_T_co], dict: dict[str, Any] = ...) -> _Self: ... - if sys.version_info >= (3, 13): - def __replace__(self, **kwargs: Any) -> _Self: ... - -# Superset of typing.AnyStr that also includes LiteralString -AnyOrLiteralStr = TypeVar("AnyOrLiteralStr", str, bytes, LiteralString) # noqa: Y001 - -# Represents when str or LiteralStr is acceptable. Useful for string processing -# APIs where literalness of return value depends on literalness of inputs -StrOrLiteralStr = TypeVar("StrOrLiteralStr", LiteralString, str) # noqa: Y001 - -# Objects suitable to be passed to sys.setprofile, threading.setprofile, and similar -ProfileFunction: TypeAlias = Callable[[FrameType, str, Any], object] - -# Objects suitable to be passed to sys.settrace, threading.settrace, and similar -TraceFunction: TypeAlias = Callable[[FrameType, str, Any], TraceFunction | None] - -# experimental -# Might not work as expected for pyright, see -# https://github.com/python/typeshed/pull/9362 -# https://github.com/microsoft/pyright/issues/4339 -class DataclassInstance(Protocol): - __dataclass_fields__: ClassVar[dict[str, Field[Any]]] - -# Anything that can be passed to the int/float constructors -ConvertibleToInt: TypeAlias = str | ReadableBuffer | SupportsInt | SupportsIndex | SupportsTrunc -ConvertibleToFloat: TypeAlias = str | ReadableBuffer | SupportsFloat | SupportsIndex - -# A few classes updated from Foo(str, Enum) to Foo(StrEnum). This is a convenience so these -# can be accurate on all python versions without getting too wordy -if sys.version_info >= (3, 11): - from enum import StrEnum as StrEnum -else: - from enum import Enum - - class StrEnum(str, Enum): ... + class NoneType: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_warnings.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_warnings.pyi deleted file mode 100644 index 2e571e676c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_warnings.pyi +++ /dev/null @@ -1,55 +0,0 @@ -import sys -from typing import Any, overload - -_defaultaction: str -_onceregistry: dict[Any, Any] -filters: list[tuple[str, str | None, type[Warning], str | None, int]] - -if sys.version_info >= (3, 12): - @overload - def warn( - message: str, - category: type[Warning] | None = None, - stacklevel: int = 1, - source: Any | None = None, - *, - skip_file_prefixes: tuple[str, ...] = (), - ) -> None: ... - @overload - def warn( - message: Warning, - category: Any = None, - stacklevel: int = 1, - source: Any | None = None, - *, - skip_file_prefixes: tuple[str, ...] = (), - ) -> None: ... - -else: - @overload - def warn(message: str, category: type[Warning] | None = None, stacklevel: int = 1, source: Any | None = None) -> None: ... - @overload - def warn(message: Warning, category: Any = None, stacklevel: int = 1, source: Any | None = None) -> None: ... - -@overload -def warn_explicit( - message: str, - category: type[Warning], - filename: str, - lineno: int, - module: str | None = ..., - registry: dict[str | tuple[str, type[Warning], int], int] | None = ..., - module_globals: dict[str, Any] | None = ..., - source: Any | None = ..., -) -> None: ... -@overload -def warn_explicit( - message: Warning, - category: Any, - filename: str, - lineno: int, - module: str | None = ..., - registry: dict[str | tuple[str, type[Warning], int], int] | None = ..., - module_globals: dict[str, Any] | None = ..., - source: Any | None = ..., -) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_weakref.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_weakref.pyi deleted file mode 100644 index a744340afa..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_weakref.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from collections.abc import Callable -from typing import Any, TypeVar, overload -from weakref import CallableProxyType as CallableProxyType, ProxyType as ProxyType, ReferenceType as ReferenceType, ref as ref - -_C = TypeVar("_C", bound=Callable[..., Any]) -_T = TypeVar("_T") - -def getweakrefcount(object: Any, /) -> int: ... -def getweakrefs(object: Any, /) -> list[Any]: ... - -# Return CallableProxyType if object is callable, ProxyType otherwise -@overload -def proxy(object: _C, callback: Callable[[_C], Any] | None = None, /) -> CallableProxyType[_C]: ... -@overload -def proxy(object: _T, callback: Callable[[_T], Any] | None = None, /) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_weakrefset.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_weakrefset.pyi deleted file mode 100644 index dad1ed7a4f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_weakrefset.pyi +++ /dev/null @@ -1,48 +0,0 @@ -from collections.abc import Iterable, Iterator, MutableSet -from types import GenericAlias -from typing import Any, ClassVar, TypeVar, overload -from typing_extensions import Self - -__all__ = ["WeakSet"] - -_S = TypeVar("_S") -_T = TypeVar("_T") - -class WeakSet(MutableSet[_T]): - @overload - def __init__(self, data: None = None) -> None: ... - @overload - def __init__(self, data: Iterable[_T]) -> None: ... - def add(self, item: _T) -> None: ... - def discard(self, item: _T) -> None: ... - def copy(self) -> Self: ... - def remove(self, item: _T) -> None: ... - def update(self, other: Iterable[_T]) -> None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __contains__(self, item: object) -> bool: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[_T]: ... - def __ior__(self, other: Iterable[_T]) -> Self: ... # type: ignore[override,misc] - def difference(self, other: Iterable[_T]) -> Self: ... - def __sub__(self, other: Iterable[Any]) -> Self: ... - def difference_update(self, other: Iterable[Any]) -> None: ... - def __isub__(self, other: Iterable[Any]) -> Self: ... - def intersection(self, other: Iterable[_T]) -> Self: ... - def __and__(self, other: Iterable[Any]) -> Self: ... - def intersection_update(self, other: Iterable[Any]) -> None: ... - def __iand__(self, other: Iterable[Any]) -> Self: ... - def issubset(self, other: Iterable[_T]) -> bool: ... - def __le__(self, other: Iterable[_T]) -> bool: ... - def __lt__(self, other: Iterable[_T]) -> bool: ... - def issuperset(self, other: Iterable[_T]) -> bool: ... - def __ge__(self, other: Iterable[_T]) -> bool: ... - def __gt__(self, other: Iterable[_T]) -> bool: ... - def __eq__(self, other: object) -> bool: ... - def symmetric_difference(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ... - def __xor__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ... - def symmetric_difference_update(self, other: Iterable[_T]) -> None: ... - def __ixor__(self, other: Iterable[_T]) -> Self: ... # type: ignore[override,misc] - def union(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ... - def __or__(self, other: Iterable[_S]) -> WeakSet[_S | _T]: ... - def isdisjoint(self, other: Iterable[_T]) -> bool: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/_winapi.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/_winapi.pyi deleted file mode 100644 index 0f71a06877..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/_winapi.pyi +++ /dev/null @@ -1,283 +0,0 @@ -import sys -from _typeshed import ReadableBuffer -from collections.abc import Sequence -from typing import Any, Final, Literal, NoReturn, final, overload - -if sys.platform == "win32": - ABOVE_NORMAL_PRIORITY_CLASS: Final = 0x8000 - BELOW_NORMAL_PRIORITY_CLASS: Final = 0x4000 - - CREATE_BREAKAWAY_FROM_JOB: Final = 0x1000000 - CREATE_DEFAULT_ERROR_MODE: Final = 0x4000000 - CREATE_NO_WINDOW: Final = 0x8000000 - CREATE_NEW_CONSOLE: Final = 0x10 - CREATE_NEW_PROCESS_GROUP: Final = 0x200 - - DETACHED_PROCESS: Final = 8 - DUPLICATE_CLOSE_SOURCE: Final = 1 - DUPLICATE_SAME_ACCESS: Final = 2 - - ERROR_ALREADY_EXISTS: Final = 183 - ERROR_BROKEN_PIPE: Final = 109 - ERROR_IO_PENDING: Final = 997 - ERROR_MORE_DATA: Final = 234 - ERROR_NETNAME_DELETED: Final = 64 - ERROR_NO_DATA: Final = 232 - ERROR_NO_SYSTEM_RESOURCES: Final = 1450 - ERROR_OPERATION_ABORTED: Final = 995 - ERROR_PIPE_BUSY: Final = 231 - ERROR_PIPE_CONNECTED: Final = 535 - ERROR_SEM_TIMEOUT: Final = 121 - - FILE_FLAG_FIRST_PIPE_INSTANCE: Final = 0x80000 - FILE_FLAG_OVERLAPPED: Final = 0x40000000 - - FILE_GENERIC_READ: Final = 1179785 - FILE_GENERIC_WRITE: Final = 1179926 - - FILE_MAP_ALL_ACCESS: Final = 983071 - FILE_MAP_COPY: Final = 1 - FILE_MAP_EXECUTE: Final = 32 - FILE_MAP_READ: Final = 4 - FILE_MAP_WRITE: Final = 2 - - FILE_TYPE_CHAR: Final = 2 - FILE_TYPE_DISK: Final = 1 - FILE_TYPE_PIPE: Final = 3 - FILE_TYPE_REMOTE: Final = 32768 - FILE_TYPE_UNKNOWN: Final = 0 - - GENERIC_READ: Final = 0x80000000 - GENERIC_WRITE: Final = 0x40000000 - HIGH_PRIORITY_CLASS: Final = 0x80 - INFINITE: Final = 0xFFFFFFFF - # Ignore the Flake8 error -- flake8-pyi assumes - # most numbers this long will be implementation details, - # but here we can see that it's a power of 2 - INVALID_HANDLE_VALUE: Final = 0xFFFFFFFFFFFFFFFF # noqa: Y054 - IDLE_PRIORITY_CLASS: Final = 0x40 - NORMAL_PRIORITY_CLASS: Final = 0x20 - REALTIME_PRIORITY_CLASS: Final = 0x100 - NMPWAIT_WAIT_FOREVER: Final = 0xFFFFFFFF - - MEM_COMMIT: Final = 0x1000 - MEM_FREE: Final = 0x10000 - MEM_IMAGE: Final = 0x1000000 - MEM_MAPPED: Final = 0x40000 - MEM_PRIVATE: Final = 0x20000 - MEM_RESERVE: Final = 0x2000 - - NULL: Final = 0 - OPEN_EXISTING: Final = 3 - - PIPE_ACCESS_DUPLEX: Final = 3 - PIPE_ACCESS_INBOUND: Final = 1 - PIPE_READMODE_MESSAGE: Final = 2 - PIPE_TYPE_MESSAGE: Final = 4 - PIPE_UNLIMITED_INSTANCES: Final = 255 - PIPE_WAIT: Final = 0 - - PAGE_EXECUTE: Final = 0x10 - PAGE_EXECUTE_READ: Final = 0x20 - PAGE_EXECUTE_READWRITE: Final = 0x40 - PAGE_EXECUTE_WRITECOPY: Final = 0x80 - PAGE_GUARD: Final = 0x100 - PAGE_NOACCESS: Final = 0x1 - PAGE_NOCACHE: Final = 0x200 - PAGE_READONLY: Final = 0x2 - PAGE_READWRITE: Final = 0x4 - PAGE_WRITECOMBINE: Final = 0x400 - PAGE_WRITECOPY: Final = 0x8 - - PROCESS_ALL_ACCESS: Final = 0x1FFFFF - PROCESS_DUP_HANDLE: Final = 0x40 - - SEC_COMMIT: Final = 0x8000000 - SEC_IMAGE: Final = 0x1000000 - SEC_LARGE_PAGES: Final = 0x80000000 - SEC_NOCACHE: Final = 0x10000000 - SEC_RESERVE: Final = 0x4000000 - SEC_WRITECOMBINE: Final = 0x40000000 - - if sys.version_info >= (3, 13): - STARTF_FORCEOFFFEEDBACK: Final = 0x80 - STARTF_FORCEONFEEDBACK: Final = 0x40 - STARTF_PREVENTPINNING: Final = 0x2000 - STARTF_RUNFULLSCREEN: Final = 0x20 - STARTF_TITLEISAPPID: Final = 0x1000 - STARTF_TITLEISLINKNAME: Final = 0x800 - STARTF_UNTRUSTEDSOURCE: Final = 0x8000 - STARTF_USECOUNTCHARS: Final = 0x8 - STARTF_USEFILLATTRIBUTE: Final = 0x10 - STARTF_USEHOTKEY: Final = 0x200 - STARTF_USEPOSITION: Final = 0x4 - STARTF_USESIZE: Final = 0x2 - - STARTF_USESHOWWINDOW: Final = 0x1 - STARTF_USESTDHANDLES: Final = 0x100 - - STD_ERROR_HANDLE: Final = 0xFFFFFFF4 - STD_OUTPUT_HANDLE: Final = 0xFFFFFFF5 - STD_INPUT_HANDLE: Final = 0xFFFFFFF6 - - STILL_ACTIVE: Final = 259 - SW_HIDE: Final = 0 - SYNCHRONIZE: Final = 0x100000 - WAIT_ABANDONED_0: Final = 128 - WAIT_OBJECT_0: Final = 0 - WAIT_TIMEOUT: Final = 258 - - if sys.version_info >= (3, 10): - LOCALE_NAME_INVARIANT: str - LOCALE_NAME_MAX_LENGTH: int - LOCALE_NAME_SYSTEM_DEFAULT: str - LOCALE_NAME_USER_DEFAULT: str | None - - LCMAP_FULLWIDTH: int - LCMAP_HALFWIDTH: int - LCMAP_HIRAGANA: int - LCMAP_KATAKANA: int - LCMAP_LINGUISTIC_CASING: int - LCMAP_LOWERCASE: int - LCMAP_SIMPLIFIED_CHINESE: int - LCMAP_TITLECASE: int - LCMAP_TRADITIONAL_CHINESE: int - LCMAP_UPPERCASE: int - - if sys.version_info >= (3, 12): - COPYFILE2_CALLBACK_CHUNK_STARTED: Final = 1 - COPYFILE2_CALLBACK_CHUNK_FINISHED: Final = 2 - COPYFILE2_CALLBACK_STREAM_STARTED: Final = 3 - COPYFILE2_CALLBACK_STREAM_FINISHED: Final = 4 - COPYFILE2_CALLBACK_POLL_CONTINUE: Final = 5 - COPYFILE2_CALLBACK_ERROR: Final = 6 - - COPYFILE2_PROGRESS_CONTINUE: Final = 0 - COPYFILE2_PROGRESS_CANCEL: Final = 1 - COPYFILE2_PROGRESS_STOP: Final = 2 - COPYFILE2_PROGRESS_QUIET: Final = 3 - COPYFILE2_PROGRESS_PAUSE: Final = 4 - - COPY_FILE_FAIL_IF_EXISTS: Final = 0x1 - COPY_FILE_RESTARTABLE: Final = 0x2 - COPY_FILE_OPEN_SOURCE_FOR_WRITE: Final = 0x4 - COPY_FILE_ALLOW_DECRYPTED_DESTINATION: Final = 0x8 - COPY_FILE_COPY_SYMLINK: Final = 0x800 - COPY_FILE_NO_BUFFERING: Final = 0x1000 - COPY_FILE_REQUEST_SECURITY_PRIVILEGES: Final = 0x2000 - COPY_FILE_RESUME_FROM_PAUSE: Final = 0x4000 - COPY_FILE_NO_OFFLOAD: Final = 0x40000 - COPY_FILE_REQUEST_COMPRESSED_TRAFFIC: Final = 0x10000000 - - ERROR_ACCESS_DENIED: Final = 5 - ERROR_PRIVILEGE_NOT_HELD: Final = 1314 - - def CloseHandle(handle: int, /) -> None: ... - @overload - def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ... - @overload - def ConnectNamedPipe(handle: int, overlapped: Literal[False] = False) -> None: ... - @overload - def ConnectNamedPipe(handle: int, overlapped: bool) -> Overlapped | None: ... - def CreateFile( - file_name: str, - desired_access: int, - share_mode: int, - security_attributes: int, - creation_disposition: int, - flags_and_attributes: int, - template_file: int, - /, - ) -> int: ... - def CreateJunction(src_path: str, dst_path: str, /) -> None: ... - def CreateNamedPipe( - name: str, - open_mode: int, - pipe_mode: int, - max_instances: int, - out_buffer_size: int, - in_buffer_size: int, - default_timeout: int, - security_attributes: int, - /, - ) -> int: ... - def CreatePipe(pipe_attrs: Any, size: int, /) -> tuple[int, int]: ... - def CreateProcess( - application_name: str | None, - command_line: str | None, - proc_attrs: Any, - thread_attrs: Any, - inherit_handles: bool, - creation_flags: int, - env_mapping: dict[str, str], - current_directory: str | None, - startup_info: Any, - /, - ) -> tuple[int, int, int, int]: ... - def DuplicateHandle( - source_process_handle: int, - source_handle: int, - target_process_handle: int, - desired_access: int, - inherit_handle: bool, - options: int = 0, - /, - ) -> int: ... - def ExitProcess(ExitCode: int, /) -> NoReturn: ... - def GetACP() -> int: ... - def GetFileType(handle: int) -> int: ... - def GetCurrentProcess() -> int: ... - def GetExitCodeProcess(process: int, /) -> int: ... - def GetLastError() -> int: ... - def GetModuleFileName(module_handle: int, /) -> str: ... - def GetStdHandle(std_handle: int, /) -> int: ... - def GetVersion() -> int: ... - def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int, /) -> int: ... - def PeekNamedPipe(handle: int, size: int = 0, /) -> tuple[int, int] | tuple[bytes, int, int]: ... - if sys.version_info >= (3, 10): - def LCMapStringEx(locale: str, flags: int, src: str) -> str: ... - def UnmapViewOfFile(address: int, /) -> None: ... - - @overload - def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> tuple[Overlapped, int]: ... - @overload - def ReadFile(handle: int, size: int, overlapped: Literal[False] = False) -> tuple[bytes, int]: ... - @overload - def ReadFile(handle: int, size: int, overlapped: int | bool) -> tuple[Any, int]: ... - def SetNamedPipeHandleState( - named_pipe: int, mode: int | None, max_collection_count: int | None, collect_data_timeout: int | None, / - ) -> None: ... - def TerminateProcess(handle: int, exit_code: int, /) -> None: ... - def WaitForMultipleObjects(handle_seq: Sequence[int], wait_flag: bool, milliseconds: int = 0xFFFFFFFF, /) -> int: ... - def WaitForSingleObject(handle: int, milliseconds: int, /) -> int: ... - def WaitNamedPipe(name: str, timeout: int, /) -> None: ... - @overload - def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[True]) -> tuple[Overlapped, int]: ... - @overload - def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[False] = False) -> tuple[int, int]: ... - @overload - def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: int | bool) -> tuple[Any, int]: ... - @final - class Overlapped: - event: int - def GetOverlappedResult(self, wait: bool, /) -> tuple[int, int]: ... - def cancel(self) -> None: ... - def getbuffer(self) -> bytes | None: ... - - if sys.version_info >= (3, 13): - def BatchedWaitForMultipleObjects( - handle_seq: Sequence[int], wait_all: bool, milliseconds: int = 0xFFFFFFFF - ) -> list[int]: ... - def CreateEventW(security_attributes: int, manual_reset: bool, initial_state: bool, name: str | None) -> int: ... - def CreateMutexW(security_attributes: int, initial_owner: bool, name: str) -> int: ... - def GetLongPathName(path: str) -> str: ... - def GetShortPathName(path: str) -> str: ... - def OpenEventW(desired_access: int, inherit_handle: bool, name: str) -> int: ... - def OpenMutexW(desired_access: int, inherit_handle: bool, name: str) -> int: ... - def ReleaseMutex(mutex: int) -> None: ... - def ResetEvent(event: int) -> None: ... - def SetEvent(event: int) -> None: ... - - if sys.version_info >= (3, 12): - def CopyFile2(existing_file_name: str, new_file_name: str, flags: int, progress_routine: int | None = None) -> int: ... - def NeedCurrentDirectoryForExePath(exe_name: str, /) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/abc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/abc.pyi deleted file mode 100644 index fdca48ac7a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/abc.pyi +++ /dev/null @@ -1,51 +0,0 @@ -import _typeshed -import sys -from _typeshed import SupportsWrite -from collections.abc import Callable -from typing import Any, Literal, TypeVar -from typing_extensions import Concatenate, ParamSpec, deprecated - -_T = TypeVar("_T") -_R_co = TypeVar("_R_co", covariant=True) -_FuncT = TypeVar("_FuncT", bound=Callable[..., Any]) -_P = ParamSpec("_P") - -# These definitions have special processing in mypy -class ABCMeta(type): - __abstractmethods__: frozenset[str] - if sys.version_info >= (3, 11): - def __new__( - mcls: type[_typeshed.Self], name: str, bases: tuple[type, ...], namespace: dict[str, Any], /, **kwargs: Any - ) -> _typeshed.Self: ... - else: - def __new__( - mcls: type[_typeshed.Self], name: str, bases: tuple[type, ...], namespace: dict[str, Any], **kwargs: Any - ) -> _typeshed.Self: ... - - def __instancecheck__(cls: ABCMeta, instance: Any) -> bool: ... - def __subclasscheck__(cls: ABCMeta, subclass: type) -> bool: ... - def _dump_registry(cls: ABCMeta, file: SupportsWrite[str] | None = None) -> None: ... - def register(cls: ABCMeta, subclass: type[_T]) -> type[_T]: ... - -def abstractmethod(funcobj: _FuncT) -> _FuncT: ... -@deprecated("Use 'classmethod' with 'abstractmethod' instead") -class abstractclassmethod(classmethod[_T, _P, _R_co]): - __isabstractmethod__: Literal[True] - def __init__(self, callable: Callable[Concatenate[type[_T], _P], _R_co]) -> None: ... - -@deprecated("Use 'staticmethod' with 'abstractmethod' instead") -class abstractstaticmethod(staticmethod[_P, _R_co]): - __isabstractmethod__: Literal[True] - def __init__(self, callable: Callable[_P, _R_co]) -> None: ... - -@deprecated("Use 'property' with 'abstractmethod' instead") -class abstractproperty(property): - __isabstractmethod__: Literal[True] - -class ABC(metaclass=ABCMeta): - __slots__ = () - -def get_cache_token() -> object: ... - -if sys.version_info >= (3, 10): - def update_abstractmethods(cls: type[_T]) -> type[_T]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/aifc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/aifc.pyi deleted file mode 100644 index bfe12c6af2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/aifc.pyi +++ /dev/null @@ -1,79 +0,0 @@ -from types import TracebackType -from typing import IO, Any, Literal, NamedTuple, overload -from typing_extensions import Self, TypeAlias - -__all__ = ["Error", "open"] - -class Error(Exception): ... - -class _aifc_params(NamedTuple): - nchannels: int - sampwidth: int - framerate: int - nframes: int - comptype: bytes - compname: bytes - -_File: TypeAlias = str | IO[bytes] -_Marker: TypeAlias = tuple[int, int, bytes] - -class Aifc_read: - def __init__(self, f: _File) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - def initfp(self, file: IO[bytes]) -> None: ... - def getfp(self) -> IO[bytes]: ... - def rewind(self) -> None: ... - def close(self) -> None: ... - def tell(self) -> int: ... - def getnchannels(self) -> int: ... - def getnframes(self) -> int: ... - def getsampwidth(self) -> int: ... - def getframerate(self) -> int: ... - def getcomptype(self) -> bytes: ... - def getcompname(self) -> bytes: ... - def getparams(self) -> _aifc_params: ... - def getmarkers(self) -> list[_Marker] | None: ... - def getmark(self, id: int) -> _Marker: ... - def setpos(self, pos: int) -> None: ... - def readframes(self, nframes: int) -> bytes: ... - -class Aifc_write: - def __init__(self, f: _File) -> None: ... - def __del__(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - def initfp(self, file: IO[bytes]) -> None: ... - def aiff(self) -> None: ... - def aifc(self) -> None: ... - def setnchannels(self, nchannels: int) -> None: ... - def getnchannels(self) -> int: ... - def setsampwidth(self, sampwidth: int) -> None: ... - def getsampwidth(self) -> int: ... - def setframerate(self, framerate: int) -> None: ... - def getframerate(self) -> int: ... - def setnframes(self, nframes: int) -> None: ... - def getnframes(self) -> int: ... - def setcomptype(self, comptype: bytes, compname: bytes) -> None: ... - def getcomptype(self) -> bytes: ... - def getcompname(self) -> bytes: ... - def setparams(self, params: tuple[int, int, int, int, bytes, bytes]) -> None: ... - def getparams(self) -> _aifc_params: ... - def setmark(self, id: int, pos: int, name: bytes) -> None: ... - def getmark(self, id: int) -> _Marker: ... - def getmarkers(self) -> list[_Marker] | None: ... - def tell(self) -> int: ... - def writeframesraw(self, data: Any) -> None: ... # Actual type for data is Buffer Protocol - def writeframes(self, data: Any) -> None: ... - def close(self) -> None: ... - -@overload -def open(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ... -@overload -def open(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ... -@overload -def open(f: _File, mode: str | None = None) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/antigravity.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/antigravity.pyi deleted file mode 100644 index 3986e7d1c9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/antigravity.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _typeshed import ReadableBuffer - -def geohash(latitude: float, longitude: float, datedow: ReadableBuffer) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/argparse.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/argparse.pyi deleted file mode 100644 index 32beaff146..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/argparse.pyi +++ /dev/null @@ -1,725 +0,0 @@ -import sys -from _typeshed import SupportsWrite, sentinel -from collections.abc import Callable, Generator, Iterable, Sequence -from re import Pattern -from typing import IO, Any, ClassVar, Final, Generic, NoReturn, Protocol, TypeVar, overload -from typing_extensions import Self, TypeAlias, deprecated - -__all__ = [ - "ArgumentParser", - "ArgumentError", - "ArgumentTypeError", - "FileType", - "HelpFormatter", - "ArgumentDefaultsHelpFormatter", - "RawDescriptionHelpFormatter", - "RawTextHelpFormatter", - "MetavarTypeHelpFormatter", - "Namespace", - "Action", - "BooleanOptionalAction", - "ONE_OR_MORE", - "OPTIONAL", - "PARSER", - "REMAINDER", - "SUPPRESS", - "ZERO_OR_MORE", -] - -_T = TypeVar("_T") -_ActionT = TypeVar("_ActionT", bound=Action) -_ArgumentParserT = TypeVar("_ArgumentParserT", bound=ArgumentParser) -_N = TypeVar("_N") -_ActionType: TypeAlias = Callable[[str], Any] | FileType | str - -ONE_OR_MORE: Final = "+" -OPTIONAL: Final = "?" -PARSER: Final = "A..." -REMAINDER: Final = "..." -SUPPRESS: Final = "==SUPPRESS==" -ZERO_OR_MORE: Final = "*" -_UNRECOGNIZED_ARGS_ATTR: Final = "_unrecognized_args" # undocumented - -class ArgumentError(Exception): - argument_name: str | None - message: str - def __init__(self, argument: Action | None, message: str) -> None: ... - -# undocumented -class _AttributeHolder: - def _get_kwargs(self) -> list[tuple[str, Any]]: ... - def _get_args(self) -> list[Any]: ... - -# undocumented -class _ActionsContainer: - description: str | None - prefix_chars: str - argument_default: Any - conflict_handler: str - - _registries: dict[str, dict[Any, Any]] - _actions: list[Action] - _option_string_actions: dict[str, Action] - _action_groups: list[_ArgumentGroup] - _mutually_exclusive_groups: list[_MutuallyExclusiveGroup] - _defaults: dict[str, Any] - _negative_number_matcher: Pattern[str] - _has_negative_number_optionals: list[bool] - def __init__(self, description: str | None, prefix_chars: str, argument_default: Any, conflict_handler: str) -> None: ... - def register(self, registry_name: str, value: Any, object: Any) -> None: ... - def _registry_get(self, registry_name: str, value: Any, default: Any = None) -> Any: ... - def set_defaults(self, **kwargs: Any) -> None: ... - def get_default(self, dest: str) -> Any: ... - def add_argument( - self, - *name_or_flags: str, - # str covers predefined actions ("store_true", "count", etc.) - # and user registered actions via the `register` method. - action: str | type[Action] = ..., - # more precisely, Literal["?", "*", "+", "...", "A...", "==SUPPRESS=="], - # but using this would make it hard to annotate callers that don't use a - # literal argument and for subclasses to override this method. - nargs: int | str | None = None, - const: Any = ..., - default: Any = ..., - type: _ActionType = ..., - choices: Iterable[_T] | None = ..., - required: bool = ..., - help: str | None = ..., - metavar: str | tuple[str, ...] | None = ..., - dest: str | None = ..., - version: str = ..., - **kwargs: Any, - ) -> Action: ... - def add_argument_group( - self, - title: str | None = None, - description: str | None = None, - *, - prefix_chars: str = ..., - argument_default: Any = ..., - conflict_handler: str = ..., - ) -> _ArgumentGroup: ... - def add_mutually_exclusive_group(self, *, required: bool = False) -> _MutuallyExclusiveGroup: ... - def _add_action(self, action: _ActionT) -> _ActionT: ... - def _remove_action(self, action: Action) -> None: ... - def _add_container_actions(self, container: _ActionsContainer) -> None: ... - def _get_positional_kwargs(self, dest: str, **kwargs: Any) -> dict[str, Any]: ... - def _get_optional_kwargs(self, *args: Any, **kwargs: Any) -> dict[str, Any]: ... - def _pop_action_class(self, kwargs: Any, default: type[Action] | None = None) -> type[Action]: ... - def _get_handler(self) -> Callable[[Action, Iterable[tuple[str, Action]]], Any]: ... - def _check_conflict(self, action: Action) -> None: ... - def _handle_conflict_error(self, action: Action, conflicting_actions: Iterable[tuple[str, Action]]) -> NoReturn: ... - def _handle_conflict_resolve(self, action: Action, conflicting_actions: Iterable[tuple[str, Action]]) -> None: ... - -class _FormatterClass(Protocol): - def __call__(self, *, prog: str) -> HelpFormatter: ... - -class ArgumentParser(_AttributeHolder, _ActionsContainer): - prog: str - usage: str | None - epilog: str | None - formatter_class: _FormatterClass - fromfile_prefix_chars: str | None - add_help: bool - allow_abbrev: bool - - # undocumented - _positionals: _ArgumentGroup - _optionals: _ArgumentGroup - _subparsers: _ArgumentGroup | None - - # Note: the constructor arguments are also used in _SubParsersAction.add_parser. - def __init__( - self, - prog: str | None = None, - usage: str | None = None, - description: str | None = None, - epilog: str | None = None, - parents: Sequence[ArgumentParser] = [], - formatter_class: _FormatterClass = ..., - prefix_chars: str = "-", - fromfile_prefix_chars: str | None = None, - argument_default: Any = None, - conflict_handler: str = "error", - add_help: bool = True, - allow_abbrev: bool = True, - exit_on_error: bool = True, - ) -> None: ... - @overload - def parse_args(self, args: Sequence[str] | None = None, namespace: None = None) -> Namespace: ... - @overload - def parse_args(self, args: Sequence[str] | None, namespace: _N) -> _N: ... - @overload - def parse_args(self, *, namespace: _N) -> _N: ... - @overload - def add_subparsers( - self: _ArgumentParserT, - *, - title: str = "subcommands", - description: str | None = None, - prog: str | None = None, - action: type[Action] = ..., - option_string: str = ..., - dest: str | None = None, - required: bool = False, - help: str | None = None, - metavar: str | None = None, - ) -> _SubParsersAction[_ArgumentParserT]: ... - @overload - def add_subparsers( - self, - *, - title: str = "subcommands", - description: str | None = None, - prog: str | None = None, - parser_class: type[_ArgumentParserT], - action: type[Action] = ..., - option_string: str = ..., - dest: str | None = None, - required: bool = False, - help: str | None = None, - metavar: str | None = None, - ) -> _SubParsersAction[_ArgumentParserT]: ... - def print_usage(self, file: SupportsWrite[str] | None = None) -> None: ... - def print_help(self, file: SupportsWrite[str] | None = None) -> None: ... - def format_usage(self) -> str: ... - def format_help(self) -> str: ... - @overload - def parse_known_args(self, args: Sequence[str] | None = None, namespace: None = None) -> tuple[Namespace, list[str]]: ... - @overload - def parse_known_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]: ... - @overload - def parse_known_args(self, *, namespace: _N) -> tuple[_N, list[str]]: ... - def convert_arg_line_to_args(self, arg_line: str) -> list[str]: ... - def exit(self, status: int = 0, message: str | None = None) -> NoReturn: ... - def error(self, message: str) -> NoReturn: ... - @overload - def parse_intermixed_args(self, args: Sequence[str] | None = None, namespace: None = None) -> Namespace: ... - @overload - def parse_intermixed_args(self, args: Sequence[str] | None, namespace: _N) -> _N: ... - @overload - def parse_intermixed_args(self, *, namespace: _N) -> _N: ... - @overload - def parse_known_intermixed_args( - self, args: Sequence[str] | None = None, namespace: None = None - ) -> tuple[Namespace, list[str]]: ... - @overload - def parse_known_intermixed_args(self, args: Sequence[str] | None, namespace: _N) -> tuple[_N, list[str]]: ... - @overload - def parse_known_intermixed_args(self, *, namespace: _N) -> tuple[_N, list[str]]: ... - # undocumented - def _get_optional_actions(self) -> list[Action]: ... - def _get_positional_actions(self) -> list[Action]: ... - if sys.version_info >= (3, 12): - def _parse_known_args( - self, arg_strings: list[str], namespace: Namespace, intermixed: bool - ) -> tuple[Namespace, list[str]]: ... - else: - def _parse_known_args(self, arg_strings: list[str], namespace: Namespace) -> tuple[Namespace, list[str]]: ... - - def _read_args_from_files(self, arg_strings: list[str]) -> list[str]: ... - def _match_argument(self, action: Action, arg_strings_pattern: str) -> int: ... - def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: str) -> list[int]: ... - def _parse_optional(self, arg_string: str) -> tuple[Action | None, str, str | None] | None: ... - def _get_option_tuples(self, option_string: str) -> list[tuple[Action, str, str | None]]: ... - def _get_nargs_pattern(self, action: Action) -> str: ... - def _get_values(self, action: Action, arg_strings: list[str]) -> Any: ... - def _get_value(self, action: Action, arg_string: str) -> Any: ... - def _check_value(self, action: Action, value: Any) -> None: ... - def _get_formatter(self) -> HelpFormatter: ... - def _print_message(self, message: str, file: SupportsWrite[str] | None = None) -> None: ... - -class HelpFormatter: - # undocumented - _prog: str - _indent_increment: int - _max_help_position: int - _width: int - _current_indent: int - _level: int - _action_max_length: int - _root_section: _Section - _current_section: _Section - _whitespace_matcher: Pattern[str] - _long_break_matcher: Pattern[str] - - class _Section: - formatter: HelpFormatter - heading: str | None - parent: Self | None - items: list[tuple[Callable[..., str], Iterable[Any]]] - def __init__(self, formatter: HelpFormatter, parent: Self | None, heading: str | None = None) -> None: ... - def format_help(self) -> str: ... - - def __init__(self, prog: str, indent_increment: int = 2, max_help_position: int = 24, width: int | None = None) -> None: ... - def _indent(self) -> None: ... - def _dedent(self) -> None: ... - def _add_item(self, func: Callable[..., str], args: Iterable[Any]) -> None: ... - def start_section(self, heading: str | None) -> None: ... - def end_section(self) -> None: ... - def add_text(self, text: str | None) -> None: ... - def add_usage( - self, usage: str | None, actions: Iterable[Action], groups: Iterable[_MutuallyExclusiveGroup], prefix: str | None = None - ) -> None: ... - def add_argument(self, action: Action) -> None: ... - def add_arguments(self, actions: Iterable[Action]) -> None: ... - def format_help(self) -> str: ... - def _join_parts(self, part_strings: Iterable[str]) -> str: ... - def _format_usage( - self, usage: str | None, actions: Iterable[Action], groups: Iterable[_MutuallyExclusiveGroup], prefix: str | None - ) -> str: ... - def _format_actions_usage(self, actions: Iterable[Action], groups: Iterable[_MutuallyExclusiveGroup]) -> str: ... - def _format_text(self, text: str) -> str: ... - def _format_action(self, action: Action) -> str: ... - def _format_action_invocation(self, action: Action) -> str: ... - def _metavar_formatter(self, action: Action, default_metavar: str) -> Callable[[int], tuple[str, ...]]: ... - def _format_args(self, action: Action, default_metavar: str) -> str: ... - def _expand_help(self, action: Action) -> str: ... - def _iter_indented_subactions(self, action: Action) -> Generator[Action, None, None]: ... - def _split_lines(self, text: str, width: int) -> list[str]: ... - def _fill_text(self, text: str, width: int, indent: str) -> str: ... - def _get_help_string(self, action: Action) -> str | None: ... - def _get_default_metavar_for_optional(self, action: Action) -> str: ... - def _get_default_metavar_for_positional(self, action: Action) -> str: ... - -class RawDescriptionHelpFormatter(HelpFormatter): ... -class RawTextHelpFormatter(RawDescriptionHelpFormatter): ... -class ArgumentDefaultsHelpFormatter(HelpFormatter): ... -class MetavarTypeHelpFormatter(HelpFormatter): ... - -class Action(_AttributeHolder): - option_strings: Sequence[str] - dest: str - nargs: int | str | None - const: Any - default: Any - type: _ActionType | None - choices: Iterable[Any] | None - required: bool - help: str | None - metavar: str | tuple[str, ...] | None - if sys.version_info >= (3, 13): - def __init__( - self, - option_strings: Sequence[str], - dest: str, - nargs: int | str | None = None, - const: _T | None = None, - default: _T | str | None = None, - type: Callable[[str], _T] | FileType | None = None, - choices: Iterable[_T] | None = None, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = None, - deprecated: bool = False, - ) -> None: ... - else: - def __init__( - self, - option_strings: Sequence[str], - dest: str, - nargs: int | str | None = None, - const: _T | None = None, - default: _T | str | None = None, - type: Callable[[str], _T] | FileType | None = None, - choices: Iterable[_T] | None = None, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = None, - ) -> None: ... - - def __call__( - self, parser: ArgumentParser, namespace: Namespace, values: str | Sequence[Any] | None, option_string: str | None = None - ) -> None: ... - def format_usage(self) -> str: ... - -if sys.version_info >= (3, 12): - class BooleanOptionalAction(Action): - if sys.version_info >= (3, 14): - def __init__( - self, - option_strings: Sequence[str], - dest: str, - default: bool | None = None, - required: bool = False, - help: str | None = None, - deprecated: bool = False, - ) -> None: ... - elif sys.version_info >= (3, 13): - @overload - def __init__( - self, - option_strings: Sequence[str], - dest: str, - default: bool | None = None, - *, - required: bool = False, - help: str | None = None, - deprecated: bool = False, - ) -> None: ... - @overload - @deprecated("The `type`, `choices`, and `metavar` parameters are ignored and will be removed in Python 3.14.") - def __init__( - self, - option_strings: Sequence[str], - dest: str, - default: _T | bool | None = None, - type: Callable[[str], _T] | FileType | None = sentinel, - choices: Iterable[_T] | None = sentinel, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = sentinel, - deprecated: bool = False, - ) -> None: ... - else: - @overload - def __init__( - self, - option_strings: Sequence[str], - dest: str, - default: bool | None = None, - *, - required: bool = False, - help: str | None = None, - ) -> None: ... - @overload - @deprecated("The `type`, `choices`, and `metavar` parameters are ignored and will be removed in Python 3.14.") - def __init__( - self, - option_strings: Sequence[str], - dest: str, - default: _T | bool | None = None, - type: Callable[[str], _T] | FileType | None = sentinel, - choices: Iterable[_T] | None = sentinel, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = sentinel, - ) -> None: ... - -else: - class BooleanOptionalAction(Action): - @overload - def __init__( - self, - option_strings: Sequence[str], - dest: str, - default: bool | None = None, - *, - required: bool = False, - help: str | None = None, - ) -> None: ... - @overload - @deprecated("The `type`, `choices`, and `metavar` parameters are ignored and will be removed in Python 3.14.") - def __init__( - self, - option_strings: Sequence[str], - dest: str, - default: _T | bool | None = None, - type: Callable[[str], _T] | FileType | None = None, - choices: Iterable[_T] | None = None, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = None, - ) -> None: ... - -class Namespace(_AttributeHolder): - def __init__(self, **kwargs: Any) -> None: ... - def __getattr__(self, name: str) -> Any: ... - def __setattr__(self, name: str, value: Any, /) -> None: ... - def __contains__(self, key: str) -> bool: ... - def __eq__(self, other: object) -> bool: ... - __hash__: ClassVar[None] # type: ignore[assignment] - -class FileType: - # undocumented - _mode: str - _bufsize: int - _encoding: str | None - _errors: str | None - def __init__(self, mode: str = "r", bufsize: int = -1, encoding: str | None = None, errors: str | None = None) -> None: ... - def __call__(self, string: str) -> IO[Any]: ... - -# undocumented -class _ArgumentGroup(_ActionsContainer): - title: str | None - _group_actions: list[Action] - def __init__( - self, - container: _ActionsContainer, - title: str | None = None, - description: str | None = None, - *, - prefix_chars: str = ..., - argument_default: Any = ..., - conflict_handler: str = ..., - ) -> None: ... - -# undocumented -class _MutuallyExclusiveGroup(_ArgumentGroup): - required: bool - _container: _ActionsContainer - def __init__(self, container: _ActionsContainer, required: bool = False) -> None: ... - -# undocumented -class _StoreAction(Action): ... - -# undocumented -class _StoreConstAction(Action): - if sys.version_info >= (3, 13): - def __init__( - self, - option_strings: Sequence[str], - dest: str, - const: Any | None = None, - default: Any = None, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = None, - deprecated: bool = False, - ) -> None: ... - elif sys.version_info >= (3, 11): - def __init__( - self, - option_strings: Sequence[str], - dest: str, - const: Any | None = None, - default: Any = None, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = None, - ) -> None: ... - else: - def __init__( - self, - option_strings: Sequence[str], - dest: str, - const: Any, - default: Any = None, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = None, - ) -> None: ... - -# undocumented -class _StoreTrueAction(_StoreConstAction): - if sys.version_info >= (3, 13): - def __init__( - self, - option_strings: Sequence[str], - dest: str, - default: bool = False, - required: bool = False, - help: str | None = None, - deprecated: bool = False, - ) -> None: ... - else: - def __init__( - self, option_strings: Sequence[str], dest: str, default: bool = False, required: bool = False, help: str | None = None - ) -> None: ... - -# undocumented -class _StoreFalseAction(_StoreConstAction): - if sys.version_info >= (3, 13): - def __init__( - self, - option_strings: Sequence[str], - dest: str, - default: bool = True, - required: bool = False, - help: str | None = None, - deprecated: bool = False, - ) -> None: ... - else: - def __init__( - self, option_strings: Sequence[str], dest: str, default: bool = True, required: bool = False, help: str | None = None - ) -> None: ... - -# undocumented -class _AppendAction(Action): ... - -# undocumented -class _ExtendAction(_AppendAction): ... - -# undocumented -class _AppendConstAction(Action): - if sys.version_info >= (3, 13): - def __init__( - self, - option_strings: Sequence[str], - dest: str, - const: Any | None = None, - default: Any = None, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = None, - deprecated: bool = False, - ) -> None: ... - elif sys.version_info >= (3, 11): - def __init__( - self, - option_strings: Sequence[str], - dest: str, - const: Any | None = None, - default: Any = None, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = None, - ) -> None: ... - else: - def __init__( - self, - option_strings: Sequence[str], - dest: str, - const: Any, - default: Any = None, - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = None, - ) -> None: ... - -# undocumented -class _CountAction(Action): - if sys.version_info >= (3, 13): - def __init__( - self, - option_strings: Sequence[str], - dest: str, - default: Any = None, - required: bool = False, - help: str | None = None, - deprecated: bool = False, - ) -> None: ... - else: - def __init__( - self, option_strings: Sequence[str], dest: str, default: Any = None, required: bool = False, help: str | None = None - ) -> None: ... - -# undocumented -class _HelpAction(Action): - if sys.version_info >= (3, 13): - def __init__( - self, - option_strings: Sequence[str], - dest: str = "==SUPPRESS==", - default: str = "==SUPPRESS==", - help: str | None = None, - deprecated: bool = False, - ) -> None: ... - else: - def __init__( - self, - option_strings: Sequence[str], - dest: str = "==SUPPRESS==", - default: str = "==SUPPRESS==", - help: str | None = None, - ) -> None: ... - -# undocumented -class _VersionAction(Action): - version: str | None - if sys.version_info >= (3, 13): - def __init__( - self, - option_strings: Sequence[str], - version: str | None = None, - dest: str = "==SUPPRESS==", - default: str = "==SUPPRESS==", - help: str | None = None, - deprecated: bool = False, - ) -> None: ... - elif sys.version_info >= (3, 11): - def __init__( - self, - option_strings: Sequence[str], - version: str | None = None, - dest: str = "==SUPPRESS==", - default: str = "==SUPPRESS==", - help: str | None = None, - ) -> None: ... - else: - def __init__( - self, - option_strings: Sequence[str], - version: str | None = None, - dest: str = "==SUPPRESS==", - default: str = "==SUPPRESS==", - help: str = "show program's version number and exit", - ) -> None: ... - -# undocumented -class _SubParsersAction(Action, Generic[_ArgumentParserT]): - _ChoicesPseudoAction: type[Any] # nested class - _prog_prefix: str - _parser_class: type[_ArgumentParserT] - _name_parser_map: dict[str, _ArgumentParserT] - choices: dict[str, _ArgumentParserT] - _choices_actions: list[Action] - def __init__( - self, - option_strings: Sequence[str], - prog: str, - parser_class: type[_ArgumentParserT], - dest: str = "==SUPPRESS==", - required: bool = False, - help: str | None = None, - metavar: str | tuple[str, ...] | None = None, - ) -> None: ... - - # Note: `add_parser` accepts all kwargs of `ArgumentParser.__init__`. It also - # accepts its own `help` and `aliases` kwargs. - if sys.version_info >= (3, 13): - def add_parser( - self, - name: str, - *, - deprecated: bool = False, - help: str | None = ..., - aliases: Sequence[str] = ..., - # Kwargs from ArgumentParser constructor - prog: str | None = ..., - usage: str | None = ..., - description: str | None = ..., - epilog: str | None = ..., - parents: Sequence[_ArgumentParserT] = ..., - formatter_class: _FormatterClass = ..., - prefix_chars: str = ..., - fromfile_prefix_chars: str | None = ..., - argument_default: Any = ..., - conflict_handler: str = ..., - add_help: bool = ..., - allow_abbrev: bool = ..., - exit_on_error: bool = ..., - **kwargs: Any, # Accepting any additional kwargs for custom parser classes - ) -> _ArgumentParserT: ... - else: - def add_parser( - self, - name: str, - *, - help: str | None = ..., - aliases: Sequence[str] = ..., - # Kwargs from ArgumentParser constructor - prog: str | None = ..., - usage: str | None = ..., - description: str | None = ..., - epilog: str | None = ..., - parents: Sequence[_ArgumentParserT] = ..., - formatter_class: _FormatterClass = ..., - prefix_chars: str = ..., - fromfile_prefix_chars: str | None = ..., - argument_default: Any = ..., - conflict_handler: str = ..., - add_help: bool = ..., - allow_abbrev: bool = ..., - exit_on_error: bool = ..., - **kwargs: Any, # Accepting any additional kwargs for custom parser classes - ) -> _ArgumentParserT: ... - - def _get_subactions(self) -> list[Action]: ... - -# undocumented -class ArgumentTypeError(Exception): ... - -# undocumented -def _get_action_name(argument: Action | None) -> str | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/array.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/array.pyi deleted file mode 100644 index bd96c9bc2d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/array.pyi +++ /dev/null @@ -1,88 +0,0 @@ -import sys -from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite -from collections.abc import Iterable, MutableSequence -from types import GenericAlias -from typing import Any, ClassVar, Literal, SupportsIndex, TypeVar, overload -from typing_extensions import Self, TypeAlias - -_IntTypeCode: TypeAlias = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"] -_FloatTypeCode: TypeAlias = Literal["f", "d"] -_UnicodeTypeCode: TypeAlias = Literal["u"] -_TypeCode: TypeAlias = _IntTypeCode | _FloatTypeCode | _UnicodeTypeCode - -_T = TypeVar("_T", int, float, str) - -typecodes: str - -class array(MutableSequence[_T]): - @property - def typecode(self) -> _TypeCode: ... - @property - def itemsize(self) -> int: ... - @overload - def __new__( - cls: type[array[int]], typecode: _IntTypeCode, initializer: bytes | bytearray | Iterable[int] = ..., / - ) -> array[int]: ... - @overload - def __new__( - cls: type[array[float]], typecode: _FloatTypeCode, initializer: bytes | bytearray | Iterable[float] = ..., / - ) -> array[float]: ... - @overload - def __new__( - cls: type[array[str]], typecode: _UnicodeTypeCode, initializer: bytes | bytearray | Iterable[str] = ..., / - ) -> array[str]: ... - @overload - def __new__(cls, typecode: str, initializer: Iterable[_T], /) -> Self: ... - @overload - def __new__(cls, typecode: str, initializer: bytes | bytearray = ..., /) -> Self: ... - def append(self, v: _T, /) -> None: ... - def buffer_info(self) -> tuple[int, int]: ... - def byteswap(self) -> None: ... - def count(self, v: _T, /) -> int: ... - def extend(self, bb: Iterable[_T], /) -> None: ... - def frombytes(self, buffer: ReadableBuffer, /) -> None: ... - def fromfile(self, f: SupportsRead[bytes], n: int, /) -> None: ... - def fromlist(self, list: list[_T], /) -> None: ... - def fromunicode(self, ustr: str, /) -> None: ... - if sys.version_info >= (3, 10): - def index(self, v: _T, start: int = 0, stop: int = sys.maxsize, /) -> int: ... - else: - def index(self, v: _T, /) -> int: ... # type: ignore[override] - - def insert(self, i: int, v: _T, /) -> None: ... - def pop(self, i: int = -1, /) -> _T: ... - def remove(self, v: _T, /) -> None: ... - def tobytes(self) -> bytes: ... - def tofile(self, f: SupportsWrite[bytes], /) -> None: ... - def tolist(self) -> list[_T]: ... - def tounicode(self) -> str: ... - - __hash__: ClassVar[None] # type: ignore[assignment] - def __len__(self) -> int: ... - @overload - def __getitem__(self, key: SupportsIndex, /) -> _T: ... - @overload - def __getitem__(self, key: slice, /) -> array[_T]: ... - @overload # type: ignore[override] - def __setitem__(self, key: SupportsIndex, value: _T, /) -> None: ... - @overload - 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] - def __imul__(self, value: int, /) -> Self: ... - def __le__(self, value: array[_T], /) -> bool: ... - def __lt__(self, value: array[_T], /) -> bool: ... - def __mul__(self, value: int, /) -> array[_T]: ... - def __rmul__(self, value: int, /) -> array[_T]: ... - def __copy__(self) -> array[_T]: ... - def __deepcopy__(self, unused: Any, /) -> array[_T]: ... - def __buffer__(self, flags: int, /) -> memoryview: ... - def __release_buffer__(self, buffer: memoryview, /) -> None: ... - if sys.version_info >= (3, 12): - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -ArrayType = array diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ast.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ast.pyi deleted file mode 100644 index 90c6d2ff0e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ast.pyi +++ /dev/null @@ -1,2041 +0,0 @@ -import os -import sys -import typing_extensions -from _ast import ( - PyCF_ALLOW_TOP_LEVEL_AWAIT as PyCF_ALLOW_TOP_LEVEL_AWAIT, - PyCF_ONLY_AST as PyCF_ONLY_AST, - PyCF_TYPE_COMMENTS as PyCF_TYPE_COMMENTS, -) -from _typeshed import ReadableBuffer, Unused -from collections.abc import Iterable, Iterator -from typing import Any, ClassVar, Generic, Literal, TypedDict, TypeVar as _TypeVar, overload -from typing_extensions import Self, Unpack, deprecated - -if sys.version_info >= (3, 13): - from _ast import PyCF_OPTIMIZED_AST as PyCF_OPTIMIZED_AST - -# Alias used for fields that must always be valid identifiers -# A string `x` counts as a valid identifier if both the following are True -# (1) `x.isidentifier()` evaluates to `True` -# (2) `keyword.iskeyword(x)` evaluates to `False` -_Identifier: typing_extensions.TypeAlias = str - -# Used for node end positions in constructor keyword arguments -_EndPositionT = typing_extensions.TypeVar("_EndPositionT", int, int | None, default=int | None) - -# Corresponds to the names in the `_attributes` class variable which is non-empty in certain AST nodes -class _Attributes(TypedDict, Generic[_EndPositionT], total=False): - lineno: int - col_offset: int - end_lineno: _EndPositionT - end_col_offset: _EndPositionT - -# The various AST classes are implemented in C, and imported from _ast at runtime, -# but they consider themselves to live in the ast module, -# so we'll define the stubs in this file. -class AST: - if sys.version_info >= (3, 10): - __match_args__ = () - _attributes: ClassVar[tuple[str, ...]] - _fields: ClassVar[tuple[str, ...]] - if sys.version_info >= (3, 13): - _field_types: ClassVar[dict[str, Any]] - - if sys.version_info >= (3, 14): - def __replace__(self) -> Self: ... - -class mod(AST): ... - -class Module(mod): - if sys.version_info >= (3, 10): - __match_args__ = ("body", "type_ignores") - body: list[stmt] - type_ignores: list[TypeIgnore] - if sys.version_info >= (3, 13): - def __init__(self, body: list[stmt] = ..., type_ignores: list[TypeIgnore] = ...) -> None: ... - else: - def __init__(self, body: list[stmt], type_ignores: list[TypeIgnore]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, body: list[stmt] = ..., type_ignores: list[TypeIgnore] = ...) -> Self: ... - -class Interactive(mod): - if sys.version_info >= (3, 10): - __match_args__ = ("body",) - body: list[stmt] - if sys.version_info >= (3, 13): - def __init__(self, body: list[stmt] = ...) -> None: ... - else: - def __init__(self, body: list[stmt]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, body: list[stmt] = ...) -> Self: ... - -class Expression(mod): - if sys.version_info >= (3, 10): - __match_args__ = ("body",) - body: expr - def __init__(self, body: expr) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, body: expr = ...) -> Self: ... - -class FunctionType(mod): - if sys.version_info >= (3, 10): - __match_args__ = ("argtypes", "returns") - argtypes: list[expr] - returns: expr - if sys.version_info >= (3, 13): - @overload - def __init__(self, argtypes: list[expr], returns: expr) -> None: ... - @overload - def __init__(self, argtypes: list[expr] = ..., *, returns: expr) -> None: ... - else: - def __init__(self, argtypes: list[expr], returns: expr) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, argtypes: list[expr] = ..., returns: expr = ...) -> Self: ... - -class stmt(AST): - lineno: int - col_offset: int - end_lineno: int | None - end_col_offset: int | None - def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, **kwargs: Unpack[_Attributes]) -> Self: ... - -class FunctionDef(stmt): - if sys.version_info >= (3, 12): - __match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment", "type_params") - elif sys.version_info >= (3, 10): - __match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment") - name: _Identifier - args: arguments - body: list[stmt] - decorator_list: list[expr] - returns: expr | None - type_comment: str | None - if sys.version_info >= (3, 12): - type_params: list[type_param] - if sys.version_info >= (3, 13): - def __init__( - self, - name: _Identifier, - args: arguments, - body: list[stmt] = ..., - decorator_list: list[expr] = ..., - returns: expr | None = None, - type_comment: str | None = None, - type_params: list[type_param] = ..., - **kwargs: Unpack[_Attributes], - ) -> None: ... - elif sys.version_info >= (3, 12): - @overload - def __init__( - self, - name: _Identifier, - args: arguments, - body: list[stmt], - decorator_list: list[expr], - returns: expr | None, - type_comment: str | None, - type_params: list[type_param], - **kwargs: Unpack[_Attributes], - ) -> None: ... - @overload - def __init__( - self, - name: _Identifier, - args: arguments, - body: list[stmt], - decorator_list: list[expr], - returns: expr | None = None, - type_comment: str | None = None, - *, - type_params: list[type_param], - **kwargs: Unpack[_Attributes], - ) -> None: ... - else: - def __init__( - self, - name: _Identifier, - args: arguments, - body: list[stmt], - decorator_list: list[expr], - returns: expr | None = None, - type_comment: str | None = None, - **kwargs: Unpack[_Attributes], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - name: _Identifier = ..., - args: arguments = ..., - body: list[stmt] = ..., - decorator_list: list[expr] = ..., - returns: expr | None = ..., - type_comment: str | None = ..., - type_params: list[type_param] = ..., - ) -> Self: ... - -class AsyncFunctionDef(stmt): - if sys.version_info >= (3, 12): - __match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment", "type_params") - elif sys.version_info >= (3, 10): - __match_args__ = ("name", "args", "body", "decorator_list", "returns", "type_comment") - name: _Identifier - args: arguments - body: list[stmt] - decorator_list: list[expr] - returns: expr | None - type_comment: str | None - if sys.version_info >= (3, 12): - type_params: list[type_param] - if sys.version_info >= (3, 13): - def __init__( - self, - name: _Identifier, - args: arguments, - body: list[stmt] = ..., - decorator_list: list[expr] = ..., - returns: expr | None = None, - type_comment: str | None = None, - type_params: list[type_param] = ..., - **kwargs: Unpack[_Attributes], - ) -> None: ... - elif sys.version_info >= (3, 12): - @overload - def __init__( - self, - name: _Identifier, - args: arguments, - body: list[stmt], - decorator_list: list[expr], - returns: expr | None, - type_comment: str | None, - type_params: list[type_param], - **kwargs: Unpack[_Attributes], - ) -> None: ... - @overload - def __init__( - self, - name: _Identifier, - args: arguments, - body: list[stmt], - decorator_list: list[expr], - returns: expr | None = None, - type_comment: str | None = None, - *, - type_params: list[type_param], - **kwargs: Unpack[_Attributes], - ) -> None: ... - else: - def __init__( - self, - name: _Identifier, - args: arguments, - body: list[stmt], - decorator_list: list[expr], - returns: expr | None = None, - type_comment: str | None = None, - **kwargs: Unpack[_Attributes], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - name: _Identifier = ..., - args: arguments = ..., - body: list[stmt], - decorator_list: list[expr], - returns: expr | None, - type_comment: str | None, - type_params: list[type_param], - ) -> Self: ... - -class ClassDef(stmt): - if sys.version_info >= (3, 12): - __match_args__ = ("name", "bases", "keywords", "body", "decorator_list", "type_params") - elif sys.version_info >= (3, 10): - __match_args__ = ("name", "bases", "keywords", "body", "decorator_list") - name: _Identifier - bases: list[expr] - keywords: list[keyword] - body: list[stmt] - decorator_list: list[expr] - if sys.version_info >= (3, 12): - type_params: list[type_param] - if sys.version_info >= (3, 13): - def __init__( - self, - name: _Identifier, - bases: list[expr] = ..., - keywords: list[keyword] = ..., - body: list[stmt] = ..., - decorator_list: list[expr] = ..., - type_params: list[type_param] = ..., - **kwargs: Unpack[_Attributes], - ) -> None: ... - elif sys.version_info >= (3, 12): - def __init__( - self, - name: _Identifier, - bases: list[expr], - keywords: list[keyword], - body: list[stmt], - decorator_list: list[expr], - type_params: list[type_param], - **kwargs: Unpack[_Attributes], - ) -> None: ... - else: - def __init__( - self, - name: _Identifier, - bases: list[expr], - keywords: list[keyword], - body: list[stmt], - decorator_list: list[expr], - **kwargs: Unpack[_Attributes], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - name: _Identifier, - bases: list[expr], - keywords: list[keyword], - body: list[stmt], - decorator_list: list[expr], - type_params: list[type_param], - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -class Return(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("value",) - value: expr | None - def __init__(self, value: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, value: expr | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Delete(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("targets",) - targets: list[expr] - if sys.version_info >= (3, 13): - def __init__(self, targets: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, targets: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, targets: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Assign(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("targets", "value", "type_comment") - targets: list[expr] - value: expr - type_comment: str | None - if sys.version_info >= (3, 13): - @overload - def __init__( - self, targets: list[expr], value: expr, type_comment: str | None = None, **kwargs: Unpack[_Attributes] - ) -> None: ... - @overload - def __init__( - self, targets: list[expr] = ..., *, value: expr, type_comment: str | None = None, **kwargs: Unpack[_Attributes] - ) -> None: ... - else: - def __init__( - self, targets: list[expr], value: expr, type_comment: str | None = None, **kwargs: Unpack[_Attributes] - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, targets: list[expr] = ..., value: expr = ..., type_comment: str | None = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -if sys.version_info >= (3, 12): - class TypeAlias(stmt): - __match_args__ = ("name", "type_params", "value") - name: Name - type_params: list[type_param] - value: expr - if sys.version_info >= (3, 13): - @overload - def __init__( - self, name: Name, type_params: list[type_param], value: expr, **kwargs: Unpack[_Attributes[int]] - ) -> None: ... - @overload - def __init__( - self, name: Name, type_params: list[type_param] = ..., *, value: expr, **kwargs: Unpack[_Attributes[int]] - ) -> None: ... - else: - def __init__( - self, name: Name, type_params: list[type_param], value: expr, **kwargs: Unpack[_Attributes[int]] - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - name: Name = ..., - type_params: list[type_param] = ..., - value: expr = ..., - **kwargs: Unpack[_Attributes[int]], - ) -> Self: ... - -class AugAssign(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("target", "op", "value") - target: Name | Attribute | Subscript - op: operator - value: expr - def __init__( - self, target: Name | Attribute | Subscript, op: operator, value: expr, **kwargs: Unpack[_Attributes] - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - target: Name | Attribute | Subscript = ..., - op: operator = ..., - value: expr = ..., - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -class AnnAssign(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("target", "annotation", "value", "simple") - target: Name | Attribute | Subscript - annotation: expr - value: expr | None - simple: int - @overload - def __init__( - self, - target: Name | Attribute | Subscript, - annotation: expr, - value: expr | None, - simple: int, - **kwargs: Unpack[_Attributes], - ) -> None: ... - @overload - def __init__( - self, - target: Name | Attribute | Subscript, - annotation: expr, - value: expr | None = None, - *, - simple: int, - **kwargs: Unpack[_Attributes], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - target: Name | Attribute | Subscript = ..., - annotation: expr = ..., - value: expr | None = ..., - simple: int = ..., - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -class For(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("target", "iter", "body", "orelse", "type_comment") - target: expr - iter: expr - body: list[stmt] - orelse: list[stmt] - type_comment: str | None - if sys.version_info >= (3, 13): - def __init__( - self, - target: expr, - iter: expr, - body: list[stmt] = ..., - orelse: list[stmt] = ..., - type_comment: str | None = None, - **kwargs: Unpack[_Attributes], - ) -> None: ... - else: - def __init__( - self, - target: expr, - iter: expr, - body: list[stmt], - orelse: list[stmt], - type_comment: str | None = None, - **kwargs: Unpack[_Attributes], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - target: expr = ..., - iter: expr = ..., - body: list[stmt] = ..., - orelse: list[stmt] = ..., - type_comment: str | None = ..., - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -class AsyncFor(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("target", "iter", "body", "orelse", "type_comment") - target: expr - iter: expr - body: list[stmt] - orelse: list[stmt] - type_comment: str | None - if sys.version_info >= (3, 13): - def __init__( - self, - target: expr, - iter: expr, - body: list[stmt] = ..., - orelse: list[stmt] = ..., - type_comment: str | None = None, - **kwargs: Unpack[_Attributes], - ) -> None: ... - else: - def __init__( - self, - target: expr, - iter: expr, - body: list[stmt], - orelse: list[stmt], - type_comment: str | None = None, - **kwargs: Unpack[_Attributes], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - target: expr = ..., - iter: expr = ..., - body: list[stmt] = ..., - orelse: list[stmt] = ..., - type_comment: str | None = ..., - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -class While(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("test", "body", "orelse") - test: expr - body: list[stmt] - orelse: list[stmt] - if sys.version_info >= (3, 13): - def __init__( - self, test: expr, body: list[stmt] = ..., orelse: list[stmt] = ..., **kwargs: Unpack[_Attributes] - ) -> None: ... - else: - def __init__(self, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> Self: ... - -class If(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("test", "body", "orelse") - test: expr - body: list[stmt] - orelse: list[stmt] - if sys.version_info >= (3, 13): - def __init__( - self, test: expr, body: list[stmt] = ..., orelse: list[stmt] = ..., **kwargs: Unpack[_Attributes] - ) -> None: ... - else: - def __init__(self, test: expr, body: list[stmt], orelse: list[stmt], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, test: expr = ..., body: list[stmt] = ..., orelse: list[stmt] = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class With(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("items", "body", "type_comment") - items: list[withitem] - body: list[stmt] - type_comment: str | None - if sys.version_info >= (3, 13): - def __init__( - self, - items: list[withitem] = ..., - body: list[stmt] = ..., - type_comment: str | None = None, - **kwargs: Unpack[_Attributes], - ) -> None: ... - else: - def __init__( - self, items: list[withitem], body: list[stmt], type_comment: str | None = None, **kwargs: Unpack[_Attributes] - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - items: list[withitem] = ..., - body: list[stmt] = ..., - type_comment: str | None = ..., - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -class AsyncWith(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("items", "body", "type_comment") - items: list[withitem] - body: list[stmt] - type_comment: str | None - if sys.version_info >= (3, 13): - def __init__( - self, - items: list[withitem] = ..., - body: list[stmt] = ..., - type_comment: str | None = None, - **kwargs: Unpack[_Attributes], - ) -> None: ... - else: - def __init__( - self, items: list[withitem], body: list[stmt], type_comment: str | None = None, **kwargs: Unpack[_Attributes] - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - items: list[withitem] = ..., - body: list[stmt] = ..., - type_comment: str | None = ..., - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -if sys.version_info >= (3, 10): - class Match(stmt): - __match_args__ = ("subject", "cases") - subject: expr - cases: list[match_case] - if sys.version_info >= (3, 13): - def __init__(self, subject: expr, cases: list[match_case] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, subject: expr, cases: list[match_case], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, subject: expr = ..., cases: list[match_case] = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class Raise(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("exc", "cause") - exc: expr | None - cause: expr | None - def __init__(self, exc: expr | None = None, cause: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, exc: expr | None = ..., cause: expr | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Try(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("body", "handlers", "orelse", "finalbody") - body: list[stmt] - handlers: list[ExceptHandler] - orelse: list[stmt] - finalbody: list[stmt] - if sys.version_info >= (3, 13): - def __init__( - self, - body: list[stmt] = ..., - handlers: list[ExceptHandler] = ..., - orelse: list[stmt] = ..., - finalbody: list[stmt] = ..., - **kwargs: Unpack[_Attributes], - ) -> None: ... - else: - def __init__( - self, - body: list[stmt], - handlers: list[ExceptHandler], - orelse: list[stmt], - finalbody: list[stmt], - **kwargs: Unpack[_Attributes], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - body: list[stmt] = ..., - handlers: list[ExceptHandler] = ..., - orelse: list[stmt] = ..., - finalbody: list[stmt] = ..., - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -if sys.version_info >= (3, 11): - class TryStar(stmt): - __match_args__ = ("body", "handlers", "orelse", "finalbody") - body: list[stmt] - handlers: list[ExceptHandler] - orelse: list[stmt] - finalbody: list[stmt] - if sys.version_info >= (3, 13): - def __init__( - self, - body: list[stmt] = ..., - handlers: list[ExceptHandler] = ..., - orelse: list[stmt] = ..., - finalbody: list[stmt] = ..., - **kwargs: Unpack[_Attributes], - ) -> None: ... - else: - def __init__( - self, - body: list[stmt], - handlers: list[ExceptHandler], - orelse: list[stmt], - finalbody: list[stmt], - **kwargs: Unpack[_Attributes], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - body: list[stmt] = ..., - handlers: list[ExceptHandler] = ..., - orelse: list[stmt] = ..., - finalbody: list[stmt] = ..., - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -class Assert(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("test", "msg") - test: expr - msg: expr | None - def __init__(self, test: expr, msg: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, test: expr, msg: expr | None, **kwargs: Unpack[_Attributes]) -> Self: ... - -class Import(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("names",) - names: list[alias] - if sys.version_info >= (3, 13): - def __init__(self, names: list[alias] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, names: list[alias], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, names: list[alias] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class ImportFrom(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("module", "names", "level") - module: str | None - names: list[alias] - level: int - if sys.version_info >= (3, 13): - @overload - def __init__(self, module: str | None, names: list[alias], level: int, **kwargs: Unpack[_Attributes]) -> None: ... - @overload - def __init__( - self, module: str | None = None, names: list[alias] = ..., *, level: int, **kwargs: Unpack[_Attributes] - ) -> None: ... - else: - @overload - def __init__(self, module: str | None, names: list[alias], level: int, **kwargs: Unpack[_Attributes]) -> None: ... - @overload - def __init__( - self, module: str | None = None, *, names: list[alias], level: int, **kwargs: Unpack[_Attributes] - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, module: str | None = ..., names: list[alias] = ..., level: int = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class Global(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("names",) - names: list[_Identifier] - if sys.version_info >= (3, 13): - def __init__(self, names: list[_Identifier] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> Self: ... - -class Nonlocal(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("names",) - names: list[_Identifier] - if sys.version_info >= (3, 13): - def __init__(self, names: list[_Identifier] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, names: list[_Identifier], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, names: list[_Identifier] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Expr(stmt): - if sys.version_info >= (3, 10): - __match_args__ = ("value",) - value: expr - def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Pass(stmt): ... -class Break(stmt): ... -class Continue(stmt): ... - -class expr(AST): - lineno: int - col_offset: int - end_lineno: int | None - end_col_offset: int | None - def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, **kwargs: Unpack[_Attributes]) -> Self: ... - -class BoolOp(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("op", "values") - op: boolop - values: list[expr] - if sys.version_info >= (3, 13): - def __init__(self, op: boolop, values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, op: boolop, values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, op: boolop = ..., values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class NamedExpr(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("target", "value") - target: Name - value: expr - def __init__(self, target: Name, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, target: Name = ..., value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class BinOp(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("left", "op", "right") - left: expr - op: operator - right: expr - def __init__(self, left: expr, op: operator, right: expr, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, left: expr = ..., op: operator = ..., right: expr = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class UnaryOp(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("op", "operand") - op: unaryop - operand: expr - def __init__(self, op: unaryop, operand: expr, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, op: unaryop = ..., operand: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Lambda(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("args", "body") - args: arguments - body: expr - def __init__(self, args: arguments, body: expr, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, args: arguments = ..., body: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class IfExp(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("test", "body", "orelse") - test: expr - body: expr - orelse: expr - def __init__(self, test: expr, body: expr, orelse: expr, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, test: expr = ..., body: expr = ..., orelse: expr = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class Dict(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("keys", "values") - keys: list[expr | None] - values: list[expr] - if sys.version_info >= (3, 13): - def __init__(self, keys: list[expr | None] = ..., values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, keys: list[expr | None], values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, keys: list[expr | None] = ..., values: list[expr] = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class Set(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("elts",) - elts: list[expr] - if sys.version_info >= (3, 13): - def __init__(self, elts: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, elts: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, elts: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class ListComp(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("elt", "generators") - elt: expr - generators: list[comprehension] - if sys.version_info >= (3, 13): - def __init__(self, elt: expr, generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, elt: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class SetComp(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("elt", "generators") - elt: expr - generators: list[comprehension] - if sys.version_info >= (3, 13): - def __init__(self, elt: expr, generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, elt: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class DictComp(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("key", "value", "generators") - key: expr - value: expr - generators: list[comprehension] - if sys.version_info >= (3, 13): - def __init__( - self, key: expr, value: expr, generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes] - ) -> None: ... - else: - def __init__(self, key: expr, value: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, key: expr = ..., value: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class GeneratorExp(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("elt", "generators") - elt: expr - generators: list[comprehension] - if sys.version_info >= (3, 13): - def __init__(self, elt: expr, generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, elt: expr, generators: list[comprehension], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, elt: expr = ..., generators: list[comprehension] = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class Await(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("value",) - value: expr - def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Yield(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("value",) - value: expr | None - def __init__(self, value: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, value: expr | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class YieldFrom(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("value",) - value: expr - def __init__(self, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Compare(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("left", "ops", "comparators") - left: expr - ops: list[cmpop] - comparators: list[expr] - if sys.version_info >= (3, 13): - def __init__( - self, left: expr, ops: list[cmpop] = ..., comparators: list[expr] = ..., **kwargs: Unpack[_Attributes] - ) -> None: ... - else: - def __init__(self, left: expr, ops: list[cmpop], comparators: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, left: expr = ..., ops: list[cmpop] = ..., comparators: list[expr] = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class Call(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("func", "args", "keywords") - func: expr - args: list[expr] - keywords: list[keyword] - if sys.version_info >= (3, 13): - def __init__( - self, func: expr, args: list[expr] = ..., keywords: list[keyword] = ..., **kwargs: Unpack[_Attributes] - ) -> None: ... - else: - def __init__(self, func: expr, args: list[expr], keywords: list[keyword], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, func: expr = ..., args: list[expr] = ..., keywords: list[keyword] = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class FormattedValue(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("value", "conversion", "format_spec") - value: expr - conversion: int - format_spec: expr | None - def __init__(self, value: expr, conversion: int, format_spec: expr | None = None, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, value: expr = ..., conversion: int = ..., format_spec: expr | None = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class JoinedStr(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("values",) - values: list[expr] - if sys.version_info >= (3, 13): - def __init__(self, values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, values: list[expr], **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, values: list[expr] = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Constant(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("value", "kind") - value: Any # None, str, bytes, bool, int, float, complex, Ellipsis - kind: str | None - if sys.version_info < (3, 14): - # Aliases for value, for backwards compatibility - s: Any - n: int | float | complex - - def __init__(self, value: Any, kind: str | None = None, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, value: Any = ..., kind: str | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Attribute(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("value", "attr", "ctx") - value: expr - attr: _Identifier - ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__` - def __init__(self, value: expr, attr: _Identifier, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, value: expr = ..., attr: _Identifier = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class Subscript(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("value", "slice", "ctx") - value: expr - slice: _Slice - ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__` - def __init__(self, value: expr, slice: _Slice, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, value: expr = ..., slice: _Slice = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes] - ) -> Self: ... - -class Starred(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("value", "ctx") - value: expr - ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__` - def __init__(self, value: expr, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, value: expr = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Name(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("id", "ctx") - id: _Identifier - ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__` - def __init__(self, id: _Identifier, ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, id: _Identifier = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class List(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("elts", "ctx") - elts: list[expr] - ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__` - if sys.version_info >= (3, 13): - def __init__(self, elts: list[expr] = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, elts: list[expr], ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, elts: list[expr] = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class Tuple(expr): - if sys.version_info >= (3, 10): - __match_args__ = ("elts", "ctx") - elts: list[expr] - ctx: expr_context # Not present in Python < 3.13 if not passed to `__init__` - dims: list[expr] - if sys.version_info >= (3, 13): - def __init__(self, elts: list[expr] = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... - else: - def __init__(self, elts: list[expr], ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, elts: list[expr] = ..., ctx: expr_context = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -@deprecated("Deprecated since Python 3.9.") -class slice(AST): ... - -_Slice: typing_extensions.TypeAlias = expr -_SliceAttributes: typing_extensions.TypeAlias = _Attributes - -class Slice(_Slice): - if sys.version_info >= (3, 10): - __match_args__ = ("lower", "upper", "step") - lower: expr | None - upper: expr | None - step: expr | None - def __init__( - self, lower: expr | None = None, upper: expr | None = None, step: expr | None = None, **kwargs: Unpack[_SliceAttributes] - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - lower: expr | None = ..., - upper: expr | None = ..., - step: expr | None = ..., - **kwargs: Unpack[_SliceAttributes], - ) -> Self: ... - -@deprecated("Deprecated since Python 3.9. Use ast.Tuple instead.") -class ExtSlice(slice): - def __new__(cls, dims: Iterable[slice] = (), **kwargs: Unpack[_SliceAttributes]) -> Tuple: ... # type: ignore[misc] - -@deprecated("Deprecated since Python 3.9. Use the index value directly instead.") -class Index(slice): - def __new__(cls, value: expr, **kwargs: Unpack[_SliceAttributes]) -> expr: ... # type: ignore[misc] - -class expr_context(AST): ... - -@deprecated("Deprecated since Python 3.9. Unused in Python 3.") -class AugLoad(expr_context): ... - -@deprecated("Deprecated since Python 3.9. Unused in Python 3.") -class AugStore(expr_context): ... - -@deprecated("Deprecated since Python 3.9. Unused in Python 3.") -class Param(expr_context): ... - -@deprecated("Deprecated since Python 3.9. Unused in Python 3.") -class Suite(mod): ... - -class Load(expr_context): ... -class Store(expr_context): ... -class Del(expr_context): ... -class boolop(AST): ... -class And(boolop): ... -class Or(boolop): ... -class operator(AST): ... -class Add(operator): ... -class Sub(operator): ... -class Mult(operator): ... -class MatMult(operator): ... -class Div(operator): ... -class Mod(operator): ... -class Pow(operator): ... -class LShift(operator): ... -class RShift(operator): ... -class BitOr(operator): ... -class BitXor(operator): ... -class BitAnd(operator): ... -class FloorDiv(operator): ... -class unaryop(AST): ... -class Invert(unaryop): ... -class Not(unaryop): ... -class UAdd(unaryop): ... -class USub(unaryop): ... -class cmpop(AST): ... -class Eq(cmpop): ... -class NotEq(cmpop): ... -class Lt(cmpop): ... -class LtE(cmpop): ... -class Gt(cmpop): ... -class GtE(cmpop): ... -class Is(cmpop): ... -class IsNot(cmpop): ... -class In(cmpop): ... -class NotIn(cmpop): ... - -class comprehension(AST): - if sys.version_info >= (3, 10): - __match_args__ = ("target", "iter", "ifs", "is_async") - target: expr - iter: expr - ifs: list[expr] - is_async: int - if sys.version_info >= (3, 13): - @overload - def __init__(self, target: expr, iter: expr, ifs: list[expr], is_async: int) -> None: ... - @overload - def __init__(self, target: expr, iter: expr, ifs: list[expr] = ..., *, is_async: int) -> None: ... - else: - def __init__(self, target: expr, iter: expr, ifs: list[expr], is_async: int) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, target: expr = ..., iter: expr = ..., ifs: list[expr] = ..., is_async: int = ...) -> Self: ... - -class excepthandler(AST): - lineno: int - col_offset: int - end_lineno: int | None - end_col_offset: int | None - def __init__(self, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, lineno: int = ..., col_offset: int = ..., end_lineno: int | None = ..., end_col_offset: int | None = ... - ) -> Self: ... - -class ExceptHandler(excepthandler): - if sys.version_info >= (3, 10): - __match_args__ = ("type", "name", "body") - type: expr | None - name: _Identifier | None - body: list[stmt] - if sys.version_info >= (3, 13): - def __init__( - self, type: expr | None = None, name: _Identifier | None = None, body: list[stmt] = ..., **kwargs: Unpack[_Attributes] - ) -> None: ... - else: - @overload - def __init__( - self, type: expr | None, name: _Identifier | None, body: list[stmt], **kwargs: Unpack[_Attributes] - ) -> None: ... - @overload - def __init__( - self, type: expr | None = None, name: _Identifier | None = None, *, body: list[stmt], **kwargs: Unpack[_Attributes] - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - type: expr | None = ..., - name: _Identifier | None = ..., - body: list[stmt] = ..., - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -class arguments(AST): - if sys.version_info >= (3, 10): - __match_args__ = ("posonlyargs", "args", "vararg", "kwonlyargs", "kw_defaults", "kwarg", "defaults") - posonlyargs: list[arg] - args: list[arg] - vararg: arg | None - kwonlyargs: list[arg] - kw_defaults: list[expr | None] - kwarg: arg | None - defaults: list[expr] - if sys.version_info >= (3, 13): - def __init__( - self, - posonlyargs: list[arg] = ..., - args: list[arg] = ..., - vararg: arg | None = None, - kwonlyargs: list[arg] = ..., - kw_defaults: list[expr | None] = ..., - kwarg: arg | None = None, - defaults: list[expr] = ..., - ) -> None: ... - else: - @overload - def __init__( - self, - posonlyargs: list[arg], - args: list[arg], - vararg: arg | None, - kwonlyargs: list[arg], - kw_defaults: list[expr | None], - kwarg: arg | None, - defaults: list[expr], - ) -> None: ... - @overload - def __init__( - self, - posonlyargs: list[arg], - args: list[arg], - vararg: arg | None, - kwonlyargs: list[arg], - kw_defaults: list[expr | None], - kwarg: arg | None = None, - *, - defaults: list[expr], - ) -> None: ... - @overload - def __init__( - self, - posonlyargs: list[arg], - args: list[arg], - vararg: arg | None = None, - *, - kwonlyargs: list[arg], - kw_defaults: list[expr | None], - kwarg: arg | None = None, - defaults: list[expr], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - posonlyargs: list[arg] = ..., - args: list[arg] = ..., - vararg: arg | None = ..., - kwonlyargs: list[arg] = ..., - kw_defaults: list[expr | None] = ..., - kwarg: arg | None = ..., - defaults: list[expr] = ..., - ) -> Self: ... - -class arg(AST): - lineno: int - col_offset: int - end_lineno: int | None - end_col_offset: int | None - if sys.version_info >= (3, 10): - __match_args__ = ("arg", "annotation", "type_comment") - arg: _Identifier - annotation: expr | None - type_comment: str | None - def __init__( - self, arg: _Identifier, annotation: expr | None = None, type_comment: str | None = None, **kwargs: Unpack[_Attributes] - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - arg: _Identifier = ..., - annotation: expr | None = ..., - type_comment: str | None = ..., - **kwargs: Unpack[_Attributes], - ) -> Self: ... - -class keyword(AST): - lineno: int - col_offset: int - end_lineno: int | None - end_col_offset: int | None - if sys.version_info >= (3, 10): - __match_args__ = ("arg", "value") - arg: _Identifier | None - value: expr - @overload - def __init__(self, arg: _Identifier | None, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... - @overload - def __init__(self, arg: _Identifier | None = None, *, value: expr, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, arg: _Identifier | None = ..., value: expr = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class alias(AST): - lineno: int - col_offset: int - end_lineno: int | None - end_col_offset: int | None - if sys.version_info >= (3, 10): - __match_args__ = ("name", "asname") - name: str - asname: _Identifier | None - def __init__(self, name: str, asname: _Identifier | None = None, **kwargs: Unpack[_Attributes]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, name: str = ..., asname: _Identifier | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ... - -class withitem(AST): - if sys.version_info >= (3, 10): - __match_args__ = ("context_expr", "optional_vars") - context_expr: expr - optional_vars: expr | None - def __init__(self, context_expr: expr, optional_vars: expr | None = None) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, context_expr: expr = ..., optional_vars: expr | None = ...) -> Self: ... - -if sys.version_info >= (3, 10): - class match_case(AST): - __match_args__ = ("pattern", "guard", "body") - pattern: _Pattern - guard: expr | None - body: list[stmt] - if sys.version_info >= (3, 13): - def __init__(self, pattern: _Pattern, guard: expr | None = None, body: list[stmt] = ...) -> None: ... - else: - @overload - def __init__(self, pattern: _Pattern, guard: expr | None, body: list[stmt]) -> None: ... - @overload - def __init__(self, pattern: _Pattern, guard: expr | None = None, *, body: list[stmt]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, pattern: _Pattern = ..., guard: expr | None = ..., body: list[stmt] = ...) -> Self: ... - - class pattern(AST): - lineno: int - col_offset: int - end_lineno: int - end_col_offset: int - def __init__(self, **kwargs: Unpack[_Attributes[int]]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, lineno: int = ..., col_offset: int = ..., end_lineno: int = ..., end_col_offset: int = ... - ) -> Self: ... - - # Without the alias, Pyright complains variables named pattern are recursively defined - _Pattern: typing_extensions.TypeAlias = pattern - - class MatchValue(pattern): - __match_args__ = ("value",) - value: expr - def __init__(self, value: expr, **kwargs: Unpack[_Attributes[int]]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, value: expr = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ... - - class MatchSingleton(pattern): - __match_args__ = ("value",) - value: Literal[True, False] | None - def __init__(self, value: Literal[True, False] | None, **kwargs: Unpack[_Attributes[int]]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, value: Literal[True, False] | None = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ... - - class MatchSequence(pattern): - __match_args__ = ("patterns",) - patterns: list[pattern] - if sys.version_info >= (3, 13): - def __init__(self, patterns: list[pattern] = ..., **kwargs: Unpack[_Attributes[int]]) -> None: ... - else: - def __init__(self, patterns: list[pattern], **kwargs: Unpack[_Attributes[int]]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, patterns: list[pattern] = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ... - - class MatchMapping(pattern): - __match_args__ = ("keys", "patterns", "rest") - keys: list[expr] - patterns: list[pattern] - rest: _Identifier | None - if sys.version_info >= (3, 13): - def __init__( - self, - keys: list[expr] = ..., - patterns: list[pattern] = ..., - rest: _Identifier | None = None, - **kwargs: Unpack[_Attributes[int]], - ) -> None: ... - else: - def __init__( - self, - keys: list[expr], - patterns: list[pattern], - rest: _Identifier | None = None, - **kwargs: Unpack[_Attributes[int]], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - keys: list[expr] = ..., - patterns: list[pattern] = ..., - rest: _Identifier | None = ..., - **kwargs: Unpack[_Attributes[int]], - ) -> Self: ... - - class MatchClass(pattern): - __match_args__ = ("cls", "patterns", "kwd_attrs", "kwd_patterns") - cls: expr - patterns: list[pattern] - kwd_attrs: list[_Identifier] - kwd_patterns: list[pattern] - if sys.version_info >= (3, 13): - def __init__( - self, - cls: expr, - patterns: list[pattern] = ..., - kwd_attrs: list[_Identifier] = ..., - kwd_patterns: list[pattern] = ..., - **kwargs: Unpack[_Attributes[int]], - ) -> None: ... - else: - def __init__( - self, - cls: expr, - patterns: list[pattern], - kwd_attrs: list[_Identifier], - kwd_patterns: list[pattern], - **kwargs: Unpack[_Attributes[int]], - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - cls: expr = ..., - patterns: list[pattern] = ..., - kwd_attrs: list[_Identifier] = ..., - kwd_patterns: list[pattern] = ..., - **kwargs: Unpack[_Attributes[int]], - ) -> Self: ... - - class MatchStar(pattern): - __match_args__ = ("name",) - name: _Identifier | None - def __init__(self, name: _Identifier | None, **kwargs: Unpack[_Attributes[int]]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, name: _Identifier | None = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ... - - class MatchAs(pattern): - __match_args__ = ("pattern", "name") - pattern: _Pattern | None - name: _Identifier | None - def __init__( - self, pattern: _Pattern | None = None, name: _Identifier | None = None, **kwargs: Unpack[_Attributes[int]] - ) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, pattern: _Pattern | None = ..., name: _Identifier | None = ..., **kwargs: Unpack[_Attributes[int]] - ) -> Self: ... - - class MatchOr(pattern): - __match_args__ = ("patterns",) - patterns: list[pattern] - if sys.version_info >= (3, 13): - def __init__(self, patterns: list[pattern] = ..., **kwargs: Unpack[_Attributes[int]]) -> None: ... - else: - def __init__(self, patterns: list[pattern], **kwargs: Unpack[_Attributes[int]]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, patterns: list[pattern] = ..., **kwargs: Unpack[_Attributes[int]]) -> Self: ... - -class type_ignore(AST): ... - -class TypeIgnore(type_ignore): - if sys.version_info >= (3, 10): - __match_args__ = ("lineno", "tag") - lineno: int - tag: str - def __init__(self, lineno: int, tag: str) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, *, lineno: int = ..., tag: str = ...) -> Self: ... - -if sys.version_info >= (3, 12): - class type_param(AST): - lineno: int - col_offset: int - end_lineno: int - end_col_offset: int - def __init__(self, **kwargs: Unpack[_Attributes[int]]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__(self, **kwargs: Unpack[_Attributes[int]]) -> Self: ... - - class TypeVar(type_param): - if sys.version_info >= (3, 13): - __match_args__ = ("name", "bound", "default_value") - else: - __match_args__ = ("name", "bound") - name: _Identifier - bound: expr | None - if sys.version_info >= (3, 13): - default_value: expr | None - def __init__( - self, - name: _Identifier, - bound: expr | None = None, - default_value: expr | None = None, - **kwargs: Unpack[_Attributes[int]], - ) -> None: ... - else: - def __init__(self, name: _Identifier, bound: expr | None = None, **kwargs: Unpack[_Attributes[int]]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, - *, - name: _Identifier = ..., - bound: expr | None = ..., - default_value: expr | None = ..., - **kwargs: Unpack[_Attributes[int]], - ) -> Self: ... - - class ParamSpec(type_param): - if sys.version_info >= (3, 13): - __match_args__ = ("name", "default_value") - else: - __match_args__ = ("name",) - name: _Identifier - if sys.version_info >= (3, 13): - default_value: expr | None - def __init__( - self, name: _Identifier, default_value: expr | None = None, **kwargs: Unpack[_Attributes[int]] - ) -> None: ... - else: - def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, name: _Identifier = ..., default_value: expr | None = ..., **kwargs: Unpack[_Attributes[int]] - ) -> Self: ... - - class TypeVarTuple(type_param): - if sys.version_info >= (3, 13): - __match_args__ = ("name", "default_value") - else: - __match_args__ = ("name",) - name: _Identifier - if sys.version_info >= (3, 13): - default_value: expr | None - def __init__( - self, name: _Identifier, default_value: expr | None = None, **kwargs: Unpack[_Attributes[int]] - ) -> None: ... - else: - def __init__(self, name: _Identifier, **kwargs: Unpack[_Attributes[int]]) -> None: ... - - if sys.version_info >= (3, 14): - def __replace__( - self, *, name: _Identifier = ..., default_value: expr | None = ..., **kwargs: Unpack[_Attributes[int]] - ) -> Self: ... - -class _ABC(type): - def __init__(cls, *args: Unused) -> None: ... - -if sys.version_info < (3, 14): - @deprecated("Replaced by ast.Constant; removed in Python 3.14") - class Num(Constant, metaclass=_ABC): - value: int | float | complex - - @deprecated("Replaced by ast.Constant; removed in Python 3.14") - class Str(Constant, metaclass=_ABC): - value: str - # Aliases for value, for backwards compatibility - s: str - - @deprecated("Replaced by ast.Constant; removed in Python 3.14") - class Bytes(Constant, metaclass=_ABC): - value: bytes - # Aliases for value, for backwards compatibility - s: bytes - - @deprecated("Replaced by ast.Constant; removed in Python 3.14") - class NameConstant(Constant, metaclass=_ABC): ... - - @deprecated("Replaced by ast.Constant; removed in Python 3.14") - class Ellipsis(Constant, metaclass=_ABC): ... - -# everything below here is defined in ast.py - -_T = _TypeVar("_T", bound=AST) - -if sys.version_info >= (3, 13): - @overload - def parse( - source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any] = "", - mode: Literal["exec"] = "exec", - *, - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - optimize: Literal[-1, 0, 1, 2] = -1, - ) -> Module: ... - @overload - def parse( - source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any], - mode: Literal["eval"], - *, - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - optimize: Literal[-1, 0, 1, 2] = -1, - ) -> Expression: ... - @overload - def parse( - source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any], - mode: Literal["func_type"], - *, - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - optimize: Literal[-1, 0, 1, 2] = -1, - ) -> FunctionType: ... - @overload - def parse( - source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any], - mode: Literal["single"], - *, - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - optimize: Literal[-1, 0, 1, 2] = -1, - ) -> Interactive: ... - @overload - def parse( - source: str | ReadableBuffer, - *, - mode: Literal["eval"], - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - optimize: Literal[-1, 0, 1, 2] = -1, - ) -> Expression: ... - @overload - def parse( - source: str | ReadableBuffer, - *, - mode: Literal["func_type"], - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - optimize: Literal[-1, 0, 1, 2] = -1, - ) -> FunctionType: ... - @overload - def parse( - source: str | ReadableBuffer, - *, - mode: Literal["single"], - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - optimize: Literal[-1, 0, 1, 2] = -1, - ) -> Interactive: ... - @overload - def parse( - source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any] = "", - mode: str = "exec", - *, - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - optimize: Literal[-1, 0, 1, 2] = -1, - ) -> AST: ... - -else: - @overload - def parse( - source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any] = "", - mode: Literal["exec"] = "exec", - *, - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - ) -> Module: ... - @overload - def parse( - source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any], - mode: Literal["eval"], - *, - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - ) -> Expression: ... - @overload - def parse( - source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any], - mode: Literal["func_type"], - *, - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - ) -> FunctionType: ... - @overload - def parse( - source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any], - mode: Literal["single"], - *, - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - ) -> Interactive: ... - @overload - def parse( - source: str | ReadableBuffer, - *, - mode: Literal["eval"], - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - ) -> Expression: ... - @overload - def parse( - source: str | ReadableBuffer, - *, - mode: Literal["func_type"], - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - ) -> FunctionType: ... - @overload - def parse( - source: str | ReadableBuffer, - *, - mode: Literal["single"], - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - ) -> Interactive: ... - @overload - def parse( - source: str | ReadableBuffer, - filename: str | ReadableBuffer | os.PathLike[Any] = "", - mode: str = "exec", - *, - type_comments: bool = False, - feature_version: None | int | tuple[int, int] = None, - ) -> AST: ... - -def literal_eval(node_or_string: str | AST) -> Any: ... - -if sys.version_info >= (3, 13): - def dump( - node: AST, - annotate_fields: bool = True, - include_attributes: bool = False, - *, - indent: int | str | None = None, - show_empty: bool = False, - ) -> str: ... - -else: - def dump( - node: AST, annotate_fields: bool = True, include_attributes: bool = False, *, indent: int | str | None = None - ) -> str: ... - -def copy_location(new_node: _T, old_node: AST) -> _T: ... -def fix_missing_locations(node: _T) -> _T: ... -def increment_lineno(node: _T, n: int = 1) -> _T: ... -def iter_fields(node: AST) -> Iterator[tuple[str, Any]]: ... -def iter_child_nodes(node: AST) -> Iterator[AST]: ... -def get_docstring(node: AsyncFunctionDef | FunctionDef | ClassDef | Module, clean: bool = True) -> str | None: ... -def get_source_segment(source: str, node: AST, *, padded: bool = False) -> str | None: ... -def walk(node: AST) -> Iterator[AST]: ... - -if sys.version_info >= (3, 14): - def compare(left: AST, right: AST, /, *, compare_attributes: bool = False) -> bool: ... - -class NodeVisitor: - def visit(self, node: AST) -> Any: ... - def generic_visit(self, node: AST) -> Any: ... - def visit_Module(self, node: Module) -> Any: ... - def visit_Interactive(self, node: Interactive) -> Any: ... - def visit_Expression(self, node: Expression) -> Any: ... - def visit_FunctionDef(self, node: FunctionDef) -> Any: ... - def visit_AsyncFunctionDef(self, node: AsyncFunctionDef) -> Any: ... - def visit_ClassDef(self, node: ClassDef) -> Any: ... - def visit_Return(self, node: Return) -> Any: ... - def visit_Delete(self, node: Delete) -> Any: ... - def visit_Assign(self, node: Assign) -> Any: ... - def visit_AugAssign(self, node: AugAssign) -> Any: ... - def visit_AnnAssign(self, node: AnnAssign) -> Any: ... - def visit_For(self, node: For) -> Any: ... - def visit_AsyncFor(self, node: AsyncFor) -> Any: ... - def visit_While(self, node: While) -> Any: ... - def visit_If(self, node: If) -> Any: ... - def visit_With(self, node: With) -> Any: ... - def visit_AsyncWith(self, node: AsyncWith) -> Any: ... - def visit_Raise(self, node: Raise) -> Any: ... - def visit_Try(self, node: Try) -> Any: ... - def visit_Assert(self, node: Assert) -> Any: ... - def visit_Import(self, node: Import) -> Any: ... - def visit_ImportFrom(self, node: ImportFrom) -> Any: ... - def visit_Global(self, node: Global) -> Any: ... - def visit_Nonlocal(self, node: Nonlocal) -> Any: ... - def visit_Expr(self, node: Expr) -> Any: ... - def visit_Pass(self, node: Pass) -> Any: ... - def visit_Break(self, node: Break) -> Any: ... - def visit_Continue(self, node: Continue) -> Any: ... - def visit_Slice(self, node: Slice) -> Any: ... - def visit_BoolOp(self, node: BoolOp) -> Any: ... - def visit_BinOp(self, node: BinOp) -> Any: ... - def visit_UnaryOp(self, node: UnaryOp) -> Any: ... - def visit_Lambda(self, node: Lambda) -> Any: ... - def visit_IfExp(self, node: IfExp) -> Any: ... - def visit_Dict(self, node: Dict) -> Any: ... - def visit_Set(self, node: Set) -> Any: ... - def visit_ListComp(self, node: ListComp) -> Any: ... - def visit_SetComp(self, node: SetComp) -> Any: ... - def visit_DictComp(self, node: DictComp) -> Any: ... - def visit_GeneratorExp(self, node: GeneratorExp) -> Any: ... - def visit_Await(self, node: Await) -> Any: ... - def visit_Yield(self, node: Yield) -> Any: ... - def visit_YieldFrom(self, node: YieldFrom) -> Any: ... - def visit_Compare(self, node: Compare) -> Any: ... - def visit_Call(self, node: Call) -> Any: ... - def visit_FormattedValue(self, node: FormattedValue) -> Any: ... - def visit_JoinedStr(self, node: JoinedStr) -> Any: ... - def visit_Constant(self, node: Constant) -> Any: ... - def visit_NamedExpr(self, node: NamedExpr) -> Any: ... - def visit_TypeIgnore(self, node: TypeIgnore) -> Any: ... - def visit_Attribute(self, node: Attribute) -> Any: ... - def visit_Subscript(self, node: Subscript) -> Any: ... - def visit_Starred(self, node: Starred) -> Any: ... - def visit_Name(self, node: Name) -> Any: ... - def visit_List(self, node: List) -> Any: ... - def visit_Tuple(self, node: Tuple) -> Any: ... - def visit_Del(self, node: Del) -> Any: ... - def visit_Load(self, node: Load) -> Any: ... - def visit_Store(self, node: Store) -> Any: ... - def visit_And(self, node: And) -> Any: ... - def visit_Or(self, node: Or) -> Any: ... - def visit_Add(self, node: Add) -> Any: ... - def visit_BitAnd(self, node: BitAnd) -> Any: ... - def visit_BitOr(self, node: BitOr) -> Any: ... - def visit_BitXor(self, node: BitXor) -> Any: ... - def visit_Div(self, node: Div) -> Any: ... - def visit_FloorDiv(self, node: FloorDiv) -> Any: ... - def visit_LShift(self, node: LShift) -> Any: ... - def visit_Mod(self, node: Mod) -> Any: ... - def visit_Mult(self, node: Mult) -> Any: ... - def visit_MatMult(self, node: MatMult) -> Any: ... - def visit_Pow(self, node: Pow) -> Any: ... - def visit_RShift(self, node: RShift) -> Any: ... - def visit_Sub(self, node: Sub) -> Any: ... - def visit_Invert(self, node: Invert) -> Any: ... - def visit_Not(self, node: Not) -> Any: ... - def visit_UAdd(self, node: UAdd) -> Any: ... - def visit_USub(self, node: USub) -> Any: ... - def visit_Eq(self, node: Eq) -> Any: ... - def visit_Gt(self, node: Gt) -> Any: ... - def visit_GtE(self, node: GtE) -> Any: ... - def visit_In(self, node: In) -> Any: ... - def visit_Is(self, node: Is) -> Any: ... - def visit_IsNot(self, node: IsNot) -> Any: ... - def visit_Lt(self, node: Lt) -> Any: ... - def visit_LtE(self, node: LtE) -> Any: ... - def visit_NotEq(self, node: NotEq) -> Any: ... - def visit_NotIn(self, node: NotIn) -> Any: ... - def visit_comprehension(self, node: comprehension) -> Any: ... - def visit_ExceptHandler(self, node: ExceptHandler) -> Any: ... - def visit_arguments(self, node: arguments) -> Any: ... - def visit_arg(self, node: arg) -> Any: ... - def visit_keyword(self, node: keyword) -> Any: ... - def visit_alias(self, node: alias) -> Any: ... - def visit_withitem(self, node: withitem) -> Any: ... - if sys.version_info >= (3, 10): - def visit_Match(self, node: Match) -> Any: ... - def visit_match_case(self, node: match_case) -> Any: ... - def visit_MatchValue(self, node: MatchValue) -> Any: ... - def visit_MatchSequence(self, node: MatchSequence) -> Any: ... - def visit_MatchSingleton(self, node: MatchSingleton) -> Any: ... - def visit_MatchStar(self, node: MatchStar) -> Any: ... - def visit_MatchMapping(self, node: MatchMapping) -> Any: ... - def visit_MatchClass(self, node: MatchClass) -> Any: ... - def visit_MatchAs(self, node: MatchAs) -> Any: ... - def visit_MatchOr(self, node: MatchOr) -> Any: ... - - if sys.version_info >= (3, 11): - def visit_TryStar(self, node: TryStar) -> Any: ... - - if sys.version_info >= (3, 12): - def visit_TypeVar(self, node: TypeVar) -> Any: ... - def visit_ParamSpec(self, node: ParamSpec) -> Any: ... - def visit_TypeVarTuple(self, node: TypeVarTuple) -> Any: ... - def visit_TypeAlias(self, node: TypeAlias) -> Any: ... - - # visit methods for deprecated nodes - def visit_ExtSlice(self, node: ExtSlice) -> Any: ... - def visit_Index(self, node: Index) -> Any: ... - def visit_Suite(self, node: Suite) -> Any: ... - def visit_AugLoad(self, node: AugLoad) -> Any: ... - def visit_AugStore(self, node: AugStore) -> Any: ... - def visit_Param(self, node: Param) -> Any: ... - - if sys.version_info < (3, 14): - @deprecated("Replaced by visit_Constant; removed in Python 3.14") - def visit_Num(self, node: Num) -> Any: ... # type: ignore[deprecated] - @deprecated("Replaced by visit_Constant; removed in Python 3.14") - def visit_Str(self, node: Str) -> Any: ... # type: ignore[deprecated] - @deprecated("Replaced by visit_Constant; removed in Python 3.14") - def visit_Bytes(self, node: Bytes) -> Any: ... # type: ignore[deprecated] - @deprecated("Replaced by visit_Constant; removed in Python 3.14") - def visit_NameConstant(self, node: NameConstant) -> Any: ... # type: ignore[deprecated] - @deprecated("Replaced by visit_Constant; removed in Python 3.14") - def visit_Ellipsis(self, node: Ellipsis) -> Any: ... # type: ignore[deprecated] - -class NodeTransformer(NodeVisitor): - def generic_visit(self, node: AST) -> AST: ... - # TODO: Override the visit_* methods with better return types. - # The usual return type is AST | None, but Iterable[AST] - # is also allowed in some cases -- this needs to be mapped. - -def unparse(ast_obj: AST) -> str: ... -def main() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asynchat.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asynchat.pyi deleted file mode 100644 index 79a70d1c1e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asynchat.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import asyncore -from abc import abstractmethod - -class simple_producer: - def __init__(self, data: bytes, buffer_size: int = 512) -> None: ... - def more(self) -> bytes: ... - -class async_chat(asyncore.dispatcher): - ac_in_buffer_size: int - ac_out_buffer_size: int - @abstractmethod - def collect_incoming_data(self, data: bytes) -> None: ... - @abstractmethod - def found_terminator(self) -> None: ... - def set_terminator(self, term: bytes | int | None) -> None: ... - def get_terminator(self) -> bytes | int | None: ... - def push(self, data: bytes) -> None: ... - def push_with_producer(self, producer: simple_producer) -> None: ... - def close_when_done(self) -> None: ... - def initiate_send(self) -> None: ... - def discard_buffers(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/__init__.pyi deleted file mode 100644 index c314acbea1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/__init__.pyi +++ /dev/null @@ -1,990 +0,0 @@ -# ruff: noqa: PLR5501 # This condition is so big, it's clearer to keep to platform condition in two blocks -# Can't NOQA on a specific line: https://github.com/plinss/flake8-noqa/issues/22 -import sys -from collections.abc import Awaitable, Coroutine, Generator -from typing import Any, TypeVar -from typing_extensions import TypeAlias - -# As at runtime, this depends on all submodules defining __all__ accurately. -from .base_events import * -from .coroutines import * -from .events import * -from .exceptions import * -from .futures import * -from .locks import * -from .protocols import * -from .queues import * -from .runners import * -from .streams import * -from .subprocess import * -from .tasks import * -from .threads import * -from .transports import * - -if sys.version_info >= (3, 11): - from .taskgroups import * - from .timeouts import * - -if sys.platform == "win32": - from .windows_events import * -else: - from .unix_events import * - -if sys.platform == "win32": - if sys.version_info >= (3, 14): - __all__ = ( - "BaseEventLoop", # from base_events - "Server", # from base_events - "iscoroutinefunction", # from coroutines - "iscoroutine", # from coroutines - "AbstractEventLoopPolicy", # from events - "AbstractEventLoop", # from events - "AbstractServer", # from events - "Handle", # from events - "TimerHandle", # from events - "get_event_loop_policy", # from events - "set_event_loop_policy", # from events - "get_event_loop", # from events - "set_event_loop", # from events - "new_event_loop", # from events - "_set_running_loop", # from events - "get_running_loop", # from events - "_get_running_loop", # from events - "BrokenBarrierError", # from exceptions - "CancelledError", # from exceptions - "InvalidStateError", # from exceptions - "TimeoutError", # from exceptions - "IncompleteReadError", # from exceptions - "LimitOverrunError", # from exceptions - "SendfileNotAvailableError", # from exceptions - "Future", # from futures - "wrap_future", # from futures - "isfuture", # from futures - "Lock", # from locks - "Event", # from locks - "Condition", # from locks - "Semaphore", # from locks - "BoundedSemaphore", # from locks - "Barrier", # from locks - "BaseProtocol", # from protocols - "Protocol", # from protocols - "DatagramProtocol", # from protocols - "SubprocessProtocol", # from protocols - "BufferedProtocol", # from protocols - "Runner", # from runners - "run", # from runners - "Queue", # from queues - "PriorityQueue", # from queues - "LifoQueue", # from queues - "QueueFull", # from queues - "QueueEmpty", # from queues - "QueueShutDown", # from queues - "StreamReader", # from streams - "StreamWriter", # from streams - "StreamReaderProtocol", # from streams - "open_connection", # from streams - "start_server", # from streams - "create_subprocess_exec", # from subprocess - "create_subprocess_shell", # from subprocess - "Task", # from tasks - "create_task", # from tasks - "FIRST_COMPLETED", # from tasks - "FIRST_EXCEPTION", # from tasks - "ALL_COMPLETED", # from tasks - "wait", # from tasks - "wait_for", # from tasks - "as_completed", # from tasks - "sleep", # from tasks - "gather", # from tasks - "shield", # from tasks - "ensure_future", # from tasks - "run_coroutine_threadsafe", # from tasks - "current_task", # from tasks - "all_tasks", # from tasks - "create_eager_task_factory", # from tasks - "eager_task_factory", # from tasks - "_register_task", # from tasks - "_unregister_task", # from tasks - "_enter_task", # from tasks - "_leave_task", # from tasks - "TaskGroup", # from taskgroups - "to_thread", # from threads - "Timeout", # from timeouts - "timeout", # from timeouts - "timeout_at", # from timeouts - "BaseTransport", # from transports - "ReadTransport", # from transports - "WriteTransport", # from transports - "Transport", # from transports - "DatagramTransport", # from transports - "SubprocessTransport", # from transports - "SelectorEventLoop", # from windows_events - "ProactorEventLoop", # from windows_events - "IocpProactor", # from windows_events - "DefaultEventLoopPolicy", # from windows_events - "WindowsSelectorEventLoopPolicy", # from windows_events - "WindowsProactorEventLoopPolicy", # from windows_events - "EventLoop", # from windows_events - ) - elif sys.version_info >= (3, 13): - __all__ = ( - "BaseEventLoop", # from base_events - "Server", # from base_events - "iscoroutinefunction", # from coroutines - "iscoroutine", # from coroutines - "AbstractEventLoopPolicy", # from events - "AbstractEventLoop", # from events - "AbstractServer", # from events - "Handle", # from events - "TimerHandle", # from events - "get_event_loop_policy", # from events - "set_event_loop_policy", # from events - "get_event_loop", # from events - "set_event_loop", # from events - "new_event_loop", # from events - "get_child_watcher", # from events - "set_child_watcher", # from events - "_set_running_loop", # from events - "get_running_loop", # from events - "_get_running_loop", # from events - "BrokenBarrierError", # from exceptions - "CancelledError", # from exceptions - "InvalidStateError", # from exceptions - "TimeoutError", # from exceptions - "IncompleteReadError", # from exceptions - "LimitOverrunError", # from exceptions - "SendfileNotAvailableError", # from exceptions - "Future", # from futures - "wrap_future", # from futures - "isfuture", # from futures - "Lock", # from locks - "Event", # from locks - "Condition", # from locks - "Semaphore", # from locks - "BoundedSemaphore", # from locks - "Barrier", # from locks - "BaseProtocol", # from protocols - "Protocol", # from protocols - "DatagramProtocol", # from protocols - "SubprocessProtocol", # from protocols - "BufferedProtocol", # from protocols - "Runner", # from runners - "run", # from runners - "Queue", # from queues - "PriorityQueue", # from queues - "LifoQueue", # from queues - "QueueFull", # from queues - "QueueEmpty", # from queues - "QueueShutDown", # from queues - "StreamReader", # from streams - "StreamWriter", # from streams - "StreamReaderProtocol", # from streams - "open_connection", # from streams - "start_server", # from streams - "create_subprocess_exec", # from subprocess - "create_subprocess_shell", # from subprocess - "Task", # from tasks - "create_task", # from tasks - "FIRST_COMPLETED", # from tasks - "FIRST_EXCEPTION", # from tasks - "ALL_COMPLETED", # from tasks - "wait", # from tasks - "wait_for", # from tasks - "as_completed", # from tasks - "sleep", # from tasks - "gather", # from tasks - "shield", # from tasks - "ensure_future", # from tasks - "run_coroutine_threadsafe", # from tasks - "current_task", # from tasks - "all_tasks", # from tasks - "create_eager_task_factory", # from tasks - "eager_task_factory", # from tasks - "_register_task", # from tasks - "_unregister_task", # from tasks - "_enter_task", # from tasks - "_leave_task", # from tasks - "TaskGroup", # from taskgroups - "to_thread", # from threads - "Timeout", # from timeouts - "timeout", # from timeouts - "timeout_at", # from timeouts - "BaseTransport", # from transports - "ReadTransport", # from transports - "WriteTransport", # from transports - "Transport", # from transports - "DatagramTransport", # from transports - "SubprocessTransport", # from transports - "SelectorEventLoop", # from windows_events - "ProactorEventLoop", # from windows_events - "IocpProactor", # from windows_events - "DefaultEventLoopPolicy", # from windows_events - "WindowsSelectorEventLoopPolicy", # from windows_events - "WindowsProactorEventLoopPolicy", # from windows_events - "EventLoop", # from windows_events - ) - elif sys.version_info >= (3, 12): - __all__ = ( - "BaseEventLoop", # from base_events - "Server", # from base_events - "iscoroutinefunction", # from coroutines - "iscoroutine", # from coroutines - "AbstractEventLoopPolicy", # from events - "AbstractEventLoop", # from events - "AbstractServer", # from events - "Handle", # from events - "TimerHandle", # from events - "get_event_loop_policy", # from events - "set_event_loop_policy", # from events - "get_event_loop", # from events - "set_event_loop", # from events - "new_event_loop", # from events - "get_child_watcher", # from events - "set_child_watcher", # from events - "_set_running_loop", # from events - "get_running_loop", # from events - "_get_running_loop", # from events - "BrokenBarrierError", # from exceptions - "CancelledError", # from exceptions - "InvalidStateError", # from exceptions - "TimeoutError", # from exceptions - "IncompleteReadError", # from exceptions - "LimitOverrunError", # from exceptions - "SendfileNotAvailableError", # from exceptions - "Future", # from futures - "wrap_future", # from futures - "isfuture", # from futures - "Lock", # from locks - "Event", # from locks - "Condition", # from locks - "Semaphore", # from locks - "BoundedSemaphore", # from locks - "Barrier", # from locks - "BaseProtocol", # from protocols - "Protocol", # from protocols - "DatagramProtocol", # from protocols - "SubprocessProtocol", # from protocols - "BufferedProtocol", # from protocols - "Runner", # from runners - "run", # from runners - "Queue", # from queues - "PriorityQueue", # from queues - "LifoQueue", # from queues - "QueueFull", # from queues - "QueueEmpty", # from queues - "StreamReader", # from streams - "StreamWriter", # from streams - "StreamReaderProtocol", # from streams - "open_connection", # from streams - "start_server", # from streams - "create_subprocess_exec", # from subprocess - "create_subprocess_shell", # from subprocess - "Task", # from tasks - "create_task", # from tasks - "FIRST_COMPLETED", # from tasks - "FIRST_EXCEPTION", # from tasks - "ALL_COMPLETED", # from tasks - "wait", # from tasks - "wait_for", # from tasks - "as_completed", # from tasks - "sleep", # from tasks - "gather", # from tasks - "shield", # from tasks - "ensure_future", # from tasks - "run_coroutine_threadsafe", # from tasks - "current_task", # from tasks - "all_tasks", # from tasks - "create_eager_task_factory", # from tasks - "eager_task_factory", # from tasks - "_register_task", # from tasks - "_unregister_task", # from tasks - "_enter_task", # from tasks - "_leave_task", # from tasks - "TaskGroup", # from taskgroups - "to_thread", # from threads - "Timeout", # from timeouts - "timeout", # from timeouts - "timeout_at", # from timeouts - "BaseTransport", # from transports - "ReadTransport", # from transports - "WriteTransport", # from transports - "Transport", # from transports - "DatagramTransport", # from transports - "SubprocessTransport", # from transports - "SelectorEventLoop", # from windows_events - "ProactorEventLoop", # from windows_events - "IocpProactor", # from windows_events - "DefaultEventLoopPolicy", # from windows_events - "WindowsSelectorEventLoopPolicy", # from windows_events - "WindowsProactorEventLoopPolicy", # from windows_events - ) - elif sys.version_info >= (3, 11): - __all__ = ( - "BaseEventLoop", # from base_events - "Server", # from base_events - "iscoroutinefunction", # from coroutines - "iscoroutine", # from coroutines - "AbstractEventLoopPolicy", # from events - "AbstractEventLoop", # from events - "AbstractServer", # from events - "Handle", # from events - "TimerHandle", # from events - "get_event_loop_policy", # from events - "set_event_loop_policy", # from events - "get_event_loop", # from events - "set_event_loop", # from events - "new_event_loop", # from events - "get_child_watcher", # from events - "set_child_watcher", # from events - "_set_running_loop", # from events - "get_running_loop", # from events - "_get_running_loop", # from events - "BrokenBarrierError", # from exceptions - "CancelledError", # from exceptions - "InvalidStateError", # from exceptions - "TimeoutError", # from exceptions - "IncompleteReadError", # from exceptions - "LimitOverrunError", # from exceptions - "SendfileNotAvailableError", # from exceptions - "Future", # from futures - "wrap_future", # from futures - "isfuture", # from futures - "Lock", # from locks - "Event", # from locks - "Condition", # from locks - "Semaphore", # from locks - "BoundedSemaphore", # from locks - "Barrier", # from locks - "BaseProtocol", # from protocols - "Protocol", # from protocols - "DatagramProtocol", # from protocols - "SubprocessProtocol", # from protocols - "BufferedProtocol", # from protocols - "Runner", # from runners - "run", # from runners - "Queue", # from queues - "PriorityQueue", # from queues - "LifoQueue", # from queues - "QueueFull", # from queues - "QueueEmpty", # from queues - "StreamReader", # from streams - "StreamWriter", # from streams - "StreamReaderProtocol", # from streams - "open_connection", # from streams - "start_server", # from streams - "create_subprocess_exec", # from subprocess - "create_subprocess_shell", # from subprocess - "Task", # from tasks - "create_task", # from tasks - "FIRST_COMPLETED", # from tasks - "FIRST_EXCEPTION", # from tasks - "ALL_COMPLETED", # from tasks - "wait", # from tasks - "wait_for", # from tasks - "as_completed", # from tasks - "sleep", # from tasks - "gather", # from tasks - "shield", # from tasks - "ensure_future", # from tasks - "run_coroutine_threadsafe", # from tasks - "current_task", # from tasks - "all_tasks", # from tasks - "_register_task", # from tasks - "_unregister_task", # from tasks - "_enter_task", # from tasks - "_leave_task", # from tasks - "to_thread", # from threads - "Timeout", # from timeouts - "timeout", # from timeouts - "timeout_at", # from timeouts - "BaseTransport", # from transports - "ReadTransport", # from transports - "WriteTransport", # from transports - "Transport", # from transports - "DatagramTransport", # from transports - "SubprocessTransport", # from transports - "SelectorEventLoop", # from windows_events - "ProactorEventLoop", # from windows_events - "IocpProactor", # from windows_events - "DefaultEventLoopPolicy", # from windows_events - "WindowsSelectorEventLoopPolicy", # from windows_events - "WindowsProactorEventLoopPolicy", # from windows_events - ) - else: - __all__ = ( - "BaseEventLoop", # from base_events - "Server", # from base_events - "coroutine", # from coroutines - "iscoroutinefunction", # from coroutines - "iscoroutine", # from coroutines - "AbstractEventLoopPolicy", # from events - "AbstractEventLoop", # from events - "AbstractServer", # from events - "Handle", # from events - "TimerHandle", # from events - "get_event_loop_policy", # from events - "set_event_loop_policy", # from events - "get_event_loop", # from events - "set_event_loop", # from events - "new_event_loop", # from events - "get_child_watcher", # from events - "set_child_watcher", # from events - "_set_running_loop", # from events - "get_running_loop", # from events - "_get_running_loop", # from events - "CancelledError", # from exceptions - "InvalidStateError", # from exceptions - "TimeoutError", # from exceptions - "IncompleteReadError", # from exceptions - "LimitOverrunError", # from exceptions - "SendfileNotAvailableError", # from exceptions - "Future", # from futures - "wrap_future", # from futures - "isfuture", # from futures - "Lock", # from locks - "Event", # from locks - "Condition", # from locks - "Semaphore", # from locks - "BoundedSemaphore", # from locks - "BaseProtocol", # from protocols - "Protocol", # from protocols - "DatagramProtocol", # from protocols - "SubprocessProtocol", # from protocols - "BufferedProtocol", # from protocols - "run", # from runners - "Queue", # from queues - "PriorityQueue", # from queues - "LifoQueue", # from queues - "QueueFull", # from queues - "QueueEmpty", # from queues - "StreamReader", # from streams - "StreamWriter", # from streams - "StreamReaderProtocol", # from streams - "open_connection", # from streams - "start_server", # from streams - "create_subprocess_exec", # from subprocess - "create_subprocess_shell", # from subprocess - "Task", # from tasks - "create_task", # from tasks - "FIRST_COMPLETED", # from tasks - "FIRST_EXCEPTION", # from tasks - "ALL_COMPLETED", # from tasks - "wait", # from tasks - "wait_for", # from tasks - "as_completed", # from tasks - "sleep", # from tasks - "gather", # from tasks - "shield", # from tasks - "ensure_future", # from tasks - "run_coroutine_threadsafe", # from tasks - "current_task", # from tasks - "all_tasks", # from tasks - "_register_task", # from tasks - "_unregister_task", # from tasks - "_enter_task", # from tasks - "_leave_task", # from tasks - "to_thread", # from threads - "BaseTransport", # from transports - "ReadTransport", # from transports - "WriteTransport", # from transports - "Transport", # from transports - "DatagramTransport", # from transports - "SubprocessTransport", # from transports - "SelectorEventLoop", # from windows_events - "ProactorEventLoop", # from windows_events - "IocpProactor", # from windows_events - "DefaultEventLoopPolicy", # from windows_events - "WindowsSelectorEventLoopPolicy", # from windows_events - "WindowsProactorEventLoopPolicy", # from windows_events - ) -else: - if sys.version_info >= (3, 14): - __all__ = ( - "BaseEventLoop", # from base_events - "Server", # from base_events - "iscoroutinefunction", # from coroutines - "iscoroutine", # from coroutines - "AbstractEventLoopPolicy", # from events - "AbstractEventLoop", # from events - "AbstractServer", # from events - "Handle", # from events - "TimerHandle", # from events - "get_event_loop_policy", # from events - "set_event_loop_policy", # from events - "get_event_loop", # from events - "set_event_loop", # from events - "new_event_loop", # from events - "_set_running_loop", # from events - "get_running_loop", # from events - "_get_running_loop", # from events - "BrokenBarrierError", # from exceptions - "CancelledError", # from exceptions - "InvalidStateError", # from exceptions - "TimeoutError", # from exceptions - "IncompleteReadError", # from exceptions - "LimitOverrunError", # from exceptions - "SendfileNotAvailableError", # from exceptions - "Future", # from futures - "wrap_future", # from futures - "isfuture", # from futures - "Lock", # from locks - "Event", # from locks - "Condition", # from locks - "Semaphore", # from locks - "BoundedSemaphore", # from locks - "Barrier", # from locks - "BaseProtocol", # from protocols - "Protocol", # from protocols - "DatagramProtocol", # from protocols - "SubprocessProtocol", # from protocols - "BufferedProtocol", # from protocols - "Runner", # from runners - "run", # from runners - "Queue", # from queues - "PriorityQueue", # from queues - "LifoQueue", # from queues - "QueueFull", # from queues - "QueueEmpty", # from queues - "QueueShutDown", # from queues - "StreamReader", # from streams - "StreamWriter", # from streams - "StreamReaderProtocol", # from streams - "open_connection", # from streams - "start_server", # from streams - "open_unix_connection", # from streams - "start_unix_server", # from streams - "create_subprocess_exec", # from subprocess - "create_subprocess_shell", # from subprocess - "Task", # from tasks - "create_task", # from tasks - "FIRST_COMPLETED", # from tasks - "FIRST_EXCEPTION", # from tasks - "ALL_COMPLETED", # from tasks - "wait", # from tasks - "wait_for", # from tasks - "as_completed", # from tasks - "sleep", # from tasks - "gather", # from tasks - "shield", # from tasks - "ensure_future", # from tasks - "run_coroutine_threadsafe", # from tasks - "current_task", # from tasks - "all_tasks", # from tasks - "create_eager_task_factory", # from tasks - "eager_task_factory", # from tasks - "_register_task", # from tasks - "_unregister_task", # from tasks - "_enter_task", # from tasks - "_leave_task", # from tasks - "TaskGroup", # from taskgroups - "to_thread", # from threads - "Timeout", # from timeouts - "timeout", # from timeouts - "timeout_at", # from timeouts - "BaseTransport", # from transports - "ReadTransport", # from transports - "WriteTransport", # from transports - "Transport", # from transports - "DatagramTransport", # from transports - "SubprocessTransport", # from transports - "SelectorEventLoop", # from unix_events - "DefaultEventLoopPolicy", # from unix_events - "EventLoop", # from unix_events - ) - elif sys.version_info >= (3, 13): - __all__ = ( - "BaseEventLoop", # from base_events - "Server", # from base_events - "iscoroutinefunction", # from coroutines - "iscoroutine", # from coroutines - "AbstractEventLoopPolicy", # from events - "AbstractEventLoop", # from events - "AbstractServer", # from events - "Handle", # from events - "TimerHandle", # from events - "get_event_loop_policy", # from events - "set_event_loop_policy", # from events - "get_event_loop", # from events - "set_event_loop", # from events - "new_event_loop", # from events - "get_child_watcher", # from events - "set_child_watcher", # from events - "_set_running_loop", # from events - "get_running_loop", # from events - "_get_running_loop", # from events - "BrokenBarrierError", # from exceptions - "CancelledError", # from exceptions - "InvalidStateError", # from exceptions - "TimeoutError", # from exceptions - "IncompleteReadError", # from exceptions - "LimitOverrunError", # from exceptions - "SendfileNotAvailableError", # from exceptions - "Future", # from futures - "wrap_future", # from futures - "isfuture", # from futures - "Lock", # from locks - "Event", # from locks - "Condition", # from locks - "Semaphore", # from locks - "BoundedSemaphore", # from locks - "Barrier", # from locks - "BaseProtocol", # from protocols - "Protocol", # from protocols - "DatagramProtocol", # from protocols - "SubprocessProtocol", # from protocols - "BufferedProtocol", # from protocols - "Runner", # from runners - "run", # from runners - "Queue", # from queues - "PriorityQueue", # from queues - "LifoQueue", # from queues - "QueueFull", # from queues - "QueueEmpty", # from queues - "QueueShutDown", # from queues - "StreamReader", # from streams - "StreamWriter", # from streams - "StreamReaderProtocol", # from streams - "open_connection", # from streams - "start_server", # from streams - "open_unix_connection", # from streams - "start_unix_server", # from streams - "create_subprocess_exec", # from subprocess - "create_subprocess_shell", # from subprocess - "Task", # from tasks - "create_task", # from tasks - "FIRST_COMPLETED", # from tasks - "FIRST_EXCEPTION", # from tasks - "ALL_COMPLETED", # from tasks - "wait", # from tasks - "wait_for", # from tasks - "as_completed", # from tasks - "sleep", # from tasks - "gather", # from tasks - "shield", # from tasks - "ensure_future", # from tasks - "run_coroutine_threadsafe", # from tasks - "current_task", # from tasks - "all_tasks", # from tasks - "create_eager_task_factory", # from tasks - "eager_task_factory", # from tasks - "_register_task", # from tasks - "_unregister_task", # from tasks - "_enter_task", # from tasks - "_leave_task", # from tasks - "TaskGroup", # from taskgroups - "to_thread", # from threads - "Timeout", # from timeouts - "timeout", # from timeouts - "timeout_at", # from timeouts - "BaseTransport", # from transports - "ReadTransport", # from transports - "WriteTransport", # from transports - "Transport", # from transports - "DatagramTransport", # from transports - "SubprocessTransport", # from transports - "SelectorEventLoop", # from unix_events - "AbstractChildWatcher", # from unix_events - "SafeChildWatcher", # from unix_events - "FastChildWatcher", # from unix_events - "PidfdChildWatcher", # from unix_events - "MultiLoopChildWatcher", # from unix_events - "ThreadedChildWatcher", # from unix_events - "DefaultEventLoopPolicy", # from unix_events - "EventLoop", # from unix_events - ) - elif sys.version_info >= (3, 12): - __all__ = ( - "BaseEventLoop", # from base_events - "Server", # from base_events - "iscoroutinefunction", # from coroutines - "iscoroutine", # from coroutines - "AbstractEventLoopPolicy", # from events - "AbstractEventLoop", # from events - "AbstractServer", # from events - "Handle", # from events - "TimerHandle", # from events - "get_event_loop_policy", # from events - "set_event_loop_policy", # from events - "get_event_loop", # from events - "set_event_loop", # from events - "new_event_loop", # from events - "get_child_watcher", # from events - "set_child_watcher", # from events - "_set_running_loop", # from events - "get_running_loop", # from events - "_get_running_loop", # from events - "BrokenBarrierError", # from exceptions - "CancelledError", # from exceptions - "InvalidStateError", # from exceptions - "TimeoutError", # from exceptions - "IncompleteReadError", # from exceptions - "LimitOverrunError", # from exceptions - "SendfileNotAvailableError", # from exceptions - "Future", # from futures - "wrap_future", # from futures - "isfuture", # from futures - "Lock", # from locks - "Event", # from locks - "Condition", # from locks - "Semaphore", # from locks - "BoundedSemaphore", # from locks - "Barrier", # from locks - "BaseProtocol", # from protocols - "Protocol", # from protocols - "DatagramProtocol", # from protocols - "SubprocessProtocol", # from protocols - "BufferedProtocol", # from protocols - "Runner", # from runners - "run", # from runners - "Queue", # from queues - "PriorityQueue", # from queues - "LifoQueue", # from queues - "QueueFull", # from queues - "QueueEmpty", # from queues - "StreamReader", # from streams - "StreamWriter", # from streams - "StreamReaderProtocol", # from streams - "open_connection", # from streams - "start_server", # from streams - "open_unix_connection", # from streams - "start_unix_server", # from streams - "create_subprocess_exec", # from subprocess - "create_subprocess_shell", # from subprocess - "Task", # from tasks - "create_task", # from tasks - "FIRST_COMPLETED", # from tasks - "FIRST_EXCEPTION", # from tasks - "ALL_COMPLETED", # from tasks - "wait", # from tasks - "wait_for", # from tasks - "as_completed", # from tasks - "sleep", # from tasks - "gather", # from tasks - "shield", # from tasks - "ensure_future", # from tasks - "run_coroutine_threadsafe", # from tasks - "current_task", # from tasks - "all_tasks", # from tasks - "create_eager_task_factory", # from tasks - "eager_task_factory", # from tasks - "_register_task", # from tasks - "_unregister_task", # from tasks - "_enter_task", # from tasks - "_leave_task", # from tasks - "TaskGroup", # from taskgroups - "to_thread", # from threads - "Timeout", # from timeouts - "timeout", # from timeouts - "timeout_at", # from timeouts - "BaseTransport", # from transports - "ReadTransport", # from transports - "WriteTransport", # from transports - "Transport", # from transports - "DatagramTransport", # from transports - "SubprocessTransport", # from transports - "SelectorEventLoop", # from unix_events - "AbstractChildWatcher", # from unix_events - "SafeChildWatcher", # from unix_events - "FastChildWatcher", # from unix_events - "PidfdChildWatcher", # from unix_events - "MultiLoopChildWatcher", # from unix_events - "ThreadedChildWatcher", # from unix_events - "DefaultEventLoopPolicy", # from unix_events - ) - elif sys.version_info >= (3, 11): - __all__ = ( - "BaseEventLoop", # from base_events - "Server", # from base_events - "iscoroutinefunction", # from coroutines - "iscoroutine", # from coroutines - "AbstractEventLoopPolicy", # from events - "AbstractEventLoop", # from events - "AbstractServer", # from events - "Handle", # from events - "TimerHandle", # from events - "get_event_loop_policy", # from events - "set_event_loop_policy", # from events - "get_event_loop", # from events - "set_event_loop", # from events - "new_event_loop", # from events - "get_child_watcher", # from events - "set_child_watcher", # from events - "_set_running_loop", # from events - "get_running_loop", # from events - "_get_running_loop", # from events - "BrokenBarrierError", # from exceptions - "CancelledError", # from exceptions - "InvalidStateError", # from exceptions - "TimeoutError", # from exceptions - "IncompleteReadError", # from exceptions - "LimitOverrunError", # from exceptions - "SendfileNotAvailableError", # from exceptions - "Future", # from futures - "wrap_future", # from futures - "isfuture", # from futures - "Lock", # from locks - "Event", # from locks - "Condition", # from locks - "Semaphore", # from locks - "BoundedSemaphore", # from locks - "Barrier", # from locks - "BaseProtocol", # from protocols - "Protocol", # from protocols - "DatagramProtocol", # from protocols - "SubprocessProtocol", # from protocols - "BufferedProtocol", # from protocols - "Runner", # from runners - "run", # from runners - "Queue", # from queues - "PriorityQueue", # from queues - "LifoQueue", # from queues - "QueueFull", # from queues - "QueueEmpty", # from queues - "StreamReader", # from streams - "StreamWriter", # from streams - "StreamReaderProtocol", # from streams - "open_connection", # from streams - "start_server", # from streams - "open_unix_connection", # from streams - "start_unix_server", # from streams - "create_subprocess_exec", # from subprocess - "create_subprocess_shell", # from subprocess - "Task", # from tasks - "create_task", # from tasks - "FIRST_COMPLETED", # from tasks - "FIRST_EXCEPTION", # from tasks - "ALL_COMPLETED", # from tasks - "wait", # from tasks - "wait_for", # from tasks - "as_completed", # from tasks - "sleep", # from tasks - "gather", # from tasks - "shield", # from tasks - "ensure_future", # from tasks - "run_coroutine_threadsafe", # from tasks - "current_task", # from tasks - "all_tasks", # from tasks - "_register_task", # from tasks - "_unregister_task", # from tasks - "_enter_task", # from tasks - "_leave_task", # from tasks - "to_thread", # from threads - "Timeout", # from timeouts - "timeout", # from timeouts - "timeout_at", # from timeouts - "BaseTransport", # from transports - "ReadTransport", # from transports - "WriteTransport", # from transports - "Transport", # from transports - "DatagramTransport", # from transports - "SubprocessTransport", # from transports - "SelectorEventLoop", # from unix_events - "AbstractChildWatcher", # from unix_events - "SafeChildWatcher", # from unix_events - "FastChildWatcher", # from unix_events - "PidfdChildWatcher", # from unix_events - "MultiLoopChildWatcher", # from unix_events - "ThreadedChildWatcher", # from unix_events - "DefaultEventLoopPolicy", # from unix_events - ) - else: - __all__ = ( - "BaseEventLoop", # from base_events - "Server", # from base_events - "coroutine", # from coroutines - "iscoroutinefunction", # from coroutines - "iscoroutine", # from coroutines - "AbstractEventLoopPolicy", # from events - "AbstractEventLoop", # from events - "AbstractServer", # from events - "Handle", # from events - "TimerHandle", # from events - "get_event_loop_policy", # from events - "set_event_loop_policy", # from events - "get_event_loop", # from events - "set_event_loop", # from events - "new_event_loop", # from events - "get_child_watcher", # from events - "set_child_watcher", # from events - "_set_running_loop", # from events - "get_running_loop", # from events - "_get_running_loop", # from events - "CancelledError", # from exceptions - "InvalidStateError", # from exceptions - "TimeoutError", # from exceptions - "IncompleteReadError", # from exceptions - "LimitOverrunError", # from exceptions - "SendfileNotAvailableError", # from exceptions - "Future", # from futures - "wrap_future", # from futures - "isfuture", # from futures - "Lock", # from locks - "Event", # from locks - "Condition", # from locks - "Semaphore", # from locks - "BoundedSemaphore", # from locks - "BaseProtocol", # from protocols - "Protocol", # from protocols - "DatagramProtocol", # from protocols - "SubprocessProtocol", # from protocols - "BufferedProtocol", # from protocols - "run", # from runners - "Queue", # from queues - "PriorityQueue", # from queues - "LifoQueue", # from queues - "QueueFull", # from queues - "QueueEmpty", # from queues - "StreamReader", # from streams - "StreamWriter", # from streams - "StreamReaderProtocol", # from streams - "open_connection", # from streams - "start_server", # from streams - "open_unix_connection", # from streams - "start_unix_server", # from streams - "create_subprocess_exec", # from subprocess - "create_subprocess_shell", # from subprocess - "Task", # from tasks - "create_task", # from tasks - "FIRST_COMPLETED", # from tasks - "FIRST_EXCEPTION", # from tasks - "ALL_COMPLETED", # from tasks - "wait", # from tasks - "wait_for", # from tasks - "as_completed", # from tasks - "sleep", # from tasks - "gather", # from tasks - "shield", # from tasks - "ensure_future", # from tasks - "run_coroutine_threadsafe", # from tasks - "current_task", # from tasks - "all_tasks", # from tasks - "_register_task", # from tasks - "_unregister_task", # from tasks - "_enter_task", # from tasks - "_leave_task", # from tasks - "to_thread", # from threads - "BaseTransport", # from transports - "ReadTransport", # from transports - "WriteTransport", # from transports - "Transport", # from transports - "DatagramTransport", # from transports - "SubprocessTransport", # from transports - "SelectorEventLoop", # from unix_events - "AbstractChildWatcher", # from unix_events - "SafeChildWatcher", # from unix_events - "FastChildWatcher", # from unix_events - "PidfdChildWatcher", # from unix_events - "MultiLoopChildWatcher", # from unix_events - "ThreadedChildWatcher", # from unix_events - "DefaultEventLoopPolicy", # from unix_events - ) - -_T_co = TypeVar("_T_co", covariant=True) - -# Aliases imported by multiple submodules in typeshed -if sys.version_info >= (3, 12): - _AwaitableLike: TypeAlias = Awaitable[_T_co] # noqa: Y047 - _CoroutineLike: TypeAlias = Coroutine[Any, Any, _T_co] # noqa: Y047 -else: - _AwaitableLike: TypeAlias = Generator[Any, None, _T_co] | Awaitable[_T_co] - _CoroutineLike: TypeAlias = Generator[Any, None, _T_co] | Coroutine[Any, Any, _T_co] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_events.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_events.pyi deleted file mode 100644 index cad7dde40b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_events.pyi +++ /dev/null @@ -1,488 +0,0 @@ -import ssl -import sys -from _typeshed import FileDescriptorLike, ReadableBuffer, WriteableBuffer -from asyncio import _AwaitableLike, _CoroutineLike -from asyncio.events import AbstractEventLoop, AbstractServer, Handle, TimerHandle, _TaskFactory -from asyncio.futures import Future -from asyncio.protocols import BaseProtocol -from asyncio.tasks import Task -from asyncio.transports import BaseTransport, DatagramTransport, ReadTransport, SubprocessTransport, Transport, WriteTransport -from collections.abc import Callable, Iterable, Sequence -from concurrent.futures import Executor, ThreadPoolExecutor -from contextvars import Context -from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket -from typing import IO, Any, Literal, TypeVar, overload -from typing_extensions import TypeAlias, TypeVarTuple, Unpack - -# Keep asyncio.__all__ updated with any changes to __all__ here -__all__ = ("BaseEventLoop", "Server") - -_T = TypeVar("_T") -_Ts = TypeVarTuple("_Ts") -_ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol) -_Context: TypeAlias = dict[str, Any] -_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object] -_ProtocolFactory: TypeAlias = Callable[[], BaseProtocol] -_SSLContext: TypeAlias = bool | None | ssl.SSLContext - -class Server(AbstractServer): - if sys.version_info >= (3, 11): - def __init__( - self, - loop: AbstractEventLoop, - sockets: Iterable[socket], - protocol_factory: _ProtocolFactory, - ssl_context: _SSLContext, - backlog: int, - ssl_handshake_timeout: float | None, - ssl_shutdown_timeout: float | None = None, - ) -> None: ... - else: - def __init__( - self, - loop: AbstractEventLoop, - sockets: Iterable[socket], - protocol_factory: _ProtocolFactory, - ssl_context: _SSLContext, - backlog: int, - ssl_handshake_timeout: float | None, - ) -> None: ... - - if sys.version_info >= (3, 13): - def close_clients(self) -> None: ... - def abort_clients(self) -> None: ... - - def get_loop(self) -> AbstractEventLoop: ... - def is_serving(self) -> bool: ... - async def start_serving(self) -> None: ... - async def serve_forever(self) -> None: ... - @property - def sockets(self) -> tuple[socket, ...]: ... - def close(self) -> None: ... - async def wait_closed(self) -> None: ... - -class BaseEventLoop(AbstractEventLoop): - def run_forever(self) -> None: ... - def run_until_complete(self, future: _AwaitableLike[_T]) -> _T: ... - def stop(self) -> None: ... - def is_running(self) -> bool: ... - def is_closed(self) -> bool: ... - def close(self) -> None: ... - async def shutdown_asyncgens(self) -> None: ... - # Methods scheduling callbacks. All these return Handles. - def call_soon( - self, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts], context: Context | None = None - ) -> Handle: ... - def call_later( - self, delay: float, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts], context: Context | None = None - ) -> TimerHandle: ... - def call_at( - self, when: float, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts], context: Context | None = None - ) -> TimerHandle: ... - def time(self) -> float: ... - # Future methods - def create_future(self) -> Future[Any]: ... - # Tasks methods - if sys.version_info >= (3, 11): - def create_task(self, coro: _CoroutineLike[_T], *, name: object = None, context: Context | None = None) -> Task[_T]: ... - else: - def create_task(self, coro: _CoroutineLike[_T], *, name: object = None) -> Task[_T]: ... - - def set_task_factory(self, factory: _TaskFactory | None) -> None: ... - def get_task_factory(self) -> _TaskFactory | None: ... - # Methods for interacting with threads - def call_soon_threadsafe( - self, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts], context: Context | None = None - ) -> Handle: ... - def run_in_executor(self, executor: Executor | None, func: Callable[[Unpack[_Ts]], _T], *args: Unpack[_Ts]) -> Future[_T]: ... - def set_default_executor(self, executor: ThreadPoolExecutor) -> None: ... # type: ignore[override] - # Network I/O methods returning Futures. - async def getaddrinfo( - self, - host: bytes | str | None, - port: bytes | str | int | None, - *, - family: int = 0, - type: int = 0, - proto: int = 0, - flags: int = 0, - ) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ... - async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = 0) -> tuple[str, str]: ... - if sys.version_info >= (3, 12): - @overload - async def create_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., - *, - ssl: _SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: None = None, - local_addr: tuple[str, int] | None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - all_errors: bool = False, - ) -> tuple[Transport, _ProtocolT]: ... - @overload - async def create_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - host: None = None, - port: None = None, - *, - ssl: _SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: socket, - local_addr: None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - all_errors: bool = False, - ) -> tuple[Transport, _ProtocolT]: ... - elif sys.version_info >= (3, 11): - @overload - async def create_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., - *, - ssl: _SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: None = None, - local_addr: tuple[str, int] | None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - @overload - async def create_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - host: None = None, - port: None = None, - *, - ssl: _SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: socket, - local_addr: None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - else: - @overload - async def create_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., - *, - ssl: _SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: None = None, - local_addr: tuple[str, int] | None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - @overload - async def create_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - host: None = None, - port: None = None, - *, - ssl: _SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: socket, - local_addr: None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - - if sys.version_info >= (3, 13): - # 3.13 added `keep_alive`. - @overload - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = None, - port: int = ..., - *, - family: int = ..., - flags: int = ..., - sock: None = None, - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - keep_alive: bool | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - @overload - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: None = None, - port: None = None, - *, - family: int = ..., - flags: int = ..., - sock: socket = ..., - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - keep_alive: bool | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - elif sys.version_info >= (3, 11): - @overload - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = None, - port: int = ..., - *, - family: int = ..., - flags: int = ..., - sock: None = None, - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - @overload - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: None = None, - port: None = None, - *, - family: int = ..., - flags: int = ..., - sock: socket = ..., - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - else: - @overload - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = None, - port: int = ..., - *, - family: int = ..., - flags: int = ..., - sock: None = None, - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - ssl_handshake_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - @overload - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: None = None, - port: None = None, - *, - family: int = ..., - flags: int = ..., - sock: socket = ..., - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - ssl_handshake_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - - if sys.version_info >= (3, 11): - async def start_tls( - self, - transport: BaseTransport, - protocol: BaseProtocol, - sslcontext: ssl.SSLContext, - *, - server_side: bool = False, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - ) -> Transport | None: ... - async def connect_accepted_socket( - self, - protocol_factory: Callable[[], _ProtocolT], - sock: socket, - *, - ssl: _SSLContext = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - else: - async def start_tls( - self, - transport: BaseTransport, - protocol: BaseProtocol, - sslcontext: ssl.SSLContext, - *, - server_side: bool = False, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ) -> Transport | None: ... - async def connect_accepted_socket( - self, - protocol_factory: Callable[[], _ProtocolT], - sock: socket, - *, - ssl: _SSLContext = None, - ssl_handshake_timeout: float | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - - async def sock_sendfile( - self, sock: socket, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool | None = True - ) -> int: ... - async def sendfile( - self, transport: WriteTransport, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool = True - ) -> int: ... - if sys.version_info >= (3, 11): - async def create_datagram_endpoint( # type: ignore[override] - self, - protocol_factory: Callable[[], _ProtocolT], - local_addr: tuple[str, int] | str | None = None, - remote_addr: tuple[str, int] | str | None = None, - *, - family: int = 0, - proto: int = 0, - flags: int = 0, - reuse_port: bool | None = None, - allow_broadcast: bool | None = None, - sock: socket | None = None, - ) -> tuple[DatagramTransport, _ProtocolT]: ... - else: - async def create_datagram_endpoint( - self, - protocol_factory: Callable[[], _ProtocolT], - local_addr: tuple[str, int] | str | None = None, - remote_addr: tuple[str, int] | str | None = None, - *, - family: int = 0, - proto: int = 0, - flags: int = 0, - reuse_address: bool | None = ..., - reuse_port: bool | None = None, - allow_broadcast: bool | None = None, - sock: socket | None = None, - ) -> tuple[DatagramTransport, _ProtocolT]: ... - # Pipes and subprocesses. - async def connect_read_pipe( - self, protocol_factory: Callable[[], _ProtocolT], pipe: Any - ) -> tuple[ReadTransport, _ProtocolT]: ... - async def connect_write_pipe( - self, protocol_factory: Callable[[], _ProtocolT], pipe: Any - ) -> tuple[WriteTransport, _ProtocolT]: ... - async def subprocess_shell( - self, - protocol_factory: Callable[[], _ProtocolT], - cmd: bytes | str, - *, - stdin: int | IO[Any] | None = -1, - stdout: int | IO[Any] | None = -1, - stderr: int | IO[Any] | None = -1, - universal_newlines: Literal[False] = False, - shell: Literal[True] = True, - bufsize: Literal[0] = 0, - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - **kwargs: Any, - ) -> tuple[SubprocessTransport, _ProtocolT]: ... - async def subprocess_exec( - self, - protocol_factory: Callable[[], _ProtocolT], - program: Any, - *args: Any, - stdin: int | IO[Any] | None = -1, - stdout: int | IO[Any] | None = -1, - stderr: int | IO[Any] | None = -1, - universal_newlines: Literal[False] = False, - shell: Literal[False] = False, - bufsize: Literal[0] = 0, - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - **kwargs: Any, - ) -> tuple[SubprocessTransport, _ProtocolT]: ... - def add_reader(self, fd: FileDescriptorLike, callback: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> None: ... - def remove_reader(self, fd: FileDescriptorLike) -> bool: ... - def add_writer(self, fd: FileDescriptorLike, callback: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> None: ... - def remove_writer(self, fd: FileDescriptorLike) -> bool: ... - # The sock_* methods (and probably some others) are not actually implemented on - # BaseEventLoop, only on subclasses. We list them here for now for convenience. - async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ... - async def sock_recv_into(self, sock: socket, buf: WriteableBuffer) -> int: ... - async def sock_sendall(self, sock: socket, data: ReadableBuffer) -> None: ... - async def sock_connect(self, sock: socket, address: _Address) -> None: ... - async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ... - if sys.version_info >= (3, 11): - async def sock_recvfrom(self, sock: socket, bufsize: int) -> tuple[bytes, _RetAddress]: ... - async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = 0) -> tuple[int, _RetAddress]: ... - async def sock_sendto(self, sock: socket, data: ReadableBuffer, address: _Address) -> int: ... - # Signal handling. - def add_signal_handler(self, sig: int, callback: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> None: ... - def remove_signal_handler(self, sig: int) -> bool: ... - # Error handlers. - def set_exception_handler(self, handler: _ExceptionHandler | None) -> None: ... - def get_exception_handler(self) -> _ExceptionHandler | None: ... - def default_exception_handler(self, context: _Context) -> None: ... - def call_exception_handler(self, context: _Context) -> None: ... - # Debug flag management. - def get_debug(self) -> bool: ... - def set_debug(self, enabled: bool) -> None: ... - if sys.version_info >= (3, 12): - async def shutdown_default_executor(self, timeout: float | None = None) -> None: ... - else: - async def shutdown_default_executor(self) -> None: ... - - def __del__(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_futures.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_futures.pyi deleted file mode 100644 index 55d2fbdbdb..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_futures.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from collections.abc import Callable, Sequence -from contextvars import Context -from typing import Any, Final - -from . import futures - -__all__ = () - -# asyncio defines 'isfuture()' in base_futures.py and re-imports it in futures.py -# but it leads to circular import error in pytype tool. -# That's why the import order is reversed. -from .futures import isfuture as isfuture - -_PENDING: Final = "PENDING" # undocumented -_CANCELLED: Final = "CANCELLED" # undocumented -_FINISHED: Final = "FINISHED" # undocumented - -def _format_callbacks(cb: Sequence[tuple[Callable[[futures.Future[Any]], None], Context]]) -> str: ... # undocumented -def _future_repr_info(future: futures.Future[Any]) -> list[str]: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_subprocess.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_subprocess.pyi deleted file mode 100644 index a5fe24e876..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_subprocess.pyi +++ /dev/null @@ -1,63 +0,0 @@ -import subprocess -from collections import deque -from collections.abc import Callable, Sequence -from typing import IO, Any -from typing_extensions import TypeAlias - -from . import events, futures, protocols, transports - -_File: TypeAlias = int | IO[Any] | None - -class BaseSubprocessTransport(transports.SubprocessTransport): - _closed: bool # undocumented - _protocol: protocols.SubprocessProtocol # undocumented - _loop: events.AbstractEventLoop # undocumented - _proc: subprocess.Popen[Any] | None # undocumented - _pid: int | None # undocumented - _returncode: int | None # undocumented - _exit_waiters: list[futures.Future[Any]] # undocumented - _pending_calls: deque[tuple[Callable[..., Any], tuple[Any, ...]]] # undocumented - _pipes: dict[int, _File] # undocumented - _finished: bool # undocumented - def __init__( - self, - loop: events.AbstractEventLoop, - protocol: protocols.SubprocessProtocol, - args: str | bytes | Sequence[str | bytes], - shell: bool, - stdin: _File, - stdout: _File, - stderr: _File, - bufsize: int, - waiter: futures.Future[Any] | None = None, - extra: Any | None = None, - **kwargs: Any, - ) -> None: ... - def _start( - self, - args: str | bytes | Sequence[str | bytes], - shell: bool, - stdin: _File, - stdout: _File, - stderr: _File, - bufsize: int, - **kwargs: Any, - ) -> None: ... # undocumented - def get_pid(self) -> int | None: ... # type: ignore[override] - def get_pipe_transport(self, fd: int) -> _File: ... # type: ignore[override] - def _check_proc(self) -> None: ... # undocumented - def send_signal(self, signal: int) -> None: ... - async def _connect_pipes(self, waiter: futures.Future[Any] | None) -> None: ... # undocumented - def _call(self, cb: Callable[..., object], *data: Any) -> None: ... # undocumented - def _pipe_connection_lost(self, fd: int, exc: BaseException | None) -> None: ... # undocumented - def _pipe_data_received(self, fd: int, data: bytes) -> None: ... # undocumented - def _process_exited(self, returncode: int) -> None: ... # undocumented - async def _wait(self) -> int: ... # undocumented - def _try_finish(self) -> None: ... # undocumented - def _call_connection_lost(self, exc: BaseException | None) -> None: ... # undocumented - def __del__(self) -> None: ... - -class WriteSubprocessPipeProto(protocols.BaseProtocol): # undocumented - def __init__(self, proc: BaseSubprocessTransport, fd: int) -> None: ... - -class ReadSubprocessPipeProto(WriteSubprocessPipeProto, protocols.Protocol): ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_tasks.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_tasks.pyi deleted file mode 100644 index 42e952ffac..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/base_tasks.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from _typeshed import StrOrBytesPath -from types import FrameType -from typing import Any - -from . import tasks - -def _task_repr_info(task: tasks.Task[Any]) -> list[str]: ... # undocumented -def _task_get_stack(task: tasks.Task[Any], limit: int | None) -> list[FrameType]: ... # undocumented -def _task_print_stack(task: tasks.Task[Any], limit: int | None, file: StrOrBytesPath) -> None: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/constants.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/constants.pyi deleted file mode 100644 index 5c6456b0e9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/constants.pyi +++ /dev/null @@ -1,20 +0,0 @@ -import enum -import sys -from typing import Final - -LOG_THRESHOLD_FOR_CONNLOST_WRITES: Final = 5 -ACCEPT_RETRY_DELAY: Final = 1 -DEBUG_STACK_DEPTH: Final = 10 -SSL_HANDSHAKE_TIMEOUT: float -SENDFILE_FALLBACK_READBUFFER_SIZE: Final = 262144 -if sys.version_info >= (3, 11): - SSL_SHUTDOWN_TIMEOUT: float - FLOW_CONTROL_HIGH_WATER_SSL_READ: Final = 256 - FLOW_CONTROL_HIGH_WATER_SSL_WRITE: Final = 512 -if sys.version_info >= (3, 12): - THREAD_JOIN_TIMEOUT: Final = 300 - -class _SendfileMode(enum.Enum): - UNSUPPORTED = 1 - TRY_NATIVE = 2 - FALLBACK = 3 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/coroutines.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/coroutines.pyi deleted file mode 100644 index 8ef30b3d31..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/coroutines.pyi +++ /dev/null @@ -1,27 +0,0 @@ -import sys -from collections.abc import Awaitable, Callable, Coroutine -from typing import Any, TypeVar, overload -from typing_extensions import ParamSpec, TypeGuard, TypeIs - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.version_info >= (3, 11): - __all__ = ("iscoroutinefunction", "iscoroutine") -else: - __all__ = ("coroutine", "iscoroutinefunction", "iscoroutine") - -_T = TypeVar("_T") -_FunctionT = TypeVar("_FunctionT", bound=Callable[..., Any]) -_P = ParamSpec("_P") - -if sys.version_info < (3, 11): - def coroutine(func: _FunctionT) -> _FunctionT: ... - -@overload -def iscoroutinefunction(func: Callable[..., Coroutine[Any, Any, Any]]) -> bool: ... -@overload -def iscoroutinefunction(func: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, _T]]]: ... -@overload -def iscoroutinefunction(func: Callable[_P, object]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, Any]]]: ... -@overload -def iscoroutinefunction(func: object) -> TypeGuard[Callable[..., Coroutine[Any, Any, Any]]]: ... -def iscoroutine(obj: object) -> TypeIs[Coroutine[Any, Any, Any]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/events.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/events.pyi deleted file mode 100644 index afe912d01f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/events.pyi +++ /dev/null @@ -1,642 +0,0 @@ -import ssl -import sys -from _asyncio import ( - _get_running_loop as _get_running_loop, - _set_running_loop as _set_running_loop, - get_event_loop as get_event_loop, - get_running_loop as get_running_loop, -) -from _typeshed import FileDescriptorLike, ReadableBuffer, StrPath, Unused, WriteableBuffer -from abc import ABCMeta, abstractmethod -from collections.abc import Callable, Sequence -from concurrent.futures import Executor -from contextvars import Context -from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket -from typing import IO, Any, Literal, Protocol, TypeVar, overload -from typing_extensions import Self, TypeAlias, TypeVarTuple, Unpack, deprecated - -from . import _AwaitableLike, _CoroutineLike -from .base_events import Server -from .futures import Future -from .protocols import BaseProtocol -from .tasks import Task -from .transports import BaseTransport, DatagramTransport, ReadTransport, SubprocessTransport, Transport, WriteTransport -from .unix_events import AbstractChildWatcher - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.version_info >= (3, 14): - __all__ = ( - "AbstractEventLoopPolicy", - "AbstractEventLoop", - "AbstractServer", - "Handle", - "TimerHandle", - "get_event_loop_policy", - "set_event_loop_policy", - "get_event_loop", - "set_event_loop", - "new_event_loop", - "_set_running_loop", - "get_running_loop", - "_get_running_loop", - ) -else: - __all__ = ( - "AbstractEventLoopPolicy", - "AbstractEventLoop", - "AbstractServer", - "Handle", - "TimerHandle", - "get_event_loop_policy", - "set_event_loop_policy", - "get_event_loop", - "set_event_loop", - "new_event_loop", - "get_child_watcher", - "set_child_watcher", - "_set_running_loop", - "get_running_loop", - "_get_running_loop", - ) - -_T = TypeVar("_T") -_Ts = TypeVarTuple("_Ts") -_ProtocolT = TypeVar("_ProtocolT", bound=BaseProtocol) -_Context: TypeAlias = dict[str, Any] -_ExceptionHandler: TypeAlias = Callable[[AbstractEventLoop, _Context], object] -_ProtocolFactory: TypeAlias = Callable[[], BaseProtocol] -_SSLContext: TypeAlias = bool | None | ssl.SSLContext - -class _TaskFactory(Protocol): - def __call__(self, loop: AbstractEventLoop, factory: _CoroutineLike[_T], /) -> Future[_T]: ... - -class Handle: - _cancelled: bool - _args: Sequence[Any] - def __init__( - self, callback: Callable[..., object], args: Sequence[Any], loop: AbstractEventLoop, context: Context | None = None - ) -> None: ... - def cancel(self) -> None: ... - def _run(self) -> None: ... - def cancelled(self) -> bool: ... - if sys.version_info >= (3, 12): - def get_context(self) -> Context: ... - -class TimerHandle(Handle): - def __init__( - self, - when: float, - callback: Callable[..., object], - args: Sequence[Any], - loop: AbstractEventLoop, - context: Context | None = None, - ) -> None: ... - def __hash__(self) -> int: ... - def when(self) -> float: ... - def __lt__(self, other: TimerHandle) -> bool: ... - def __le__(self, other: TimerHandle) -> bool: ... - def __gt__(self, other: TimerHandle) -> bool: ... - def __ge__(self, other: TimerHandle) -> bool: ... - def __eq__(self, other: object) -> bool: ... - -class AbstractServer: - @abstractmethod - def close(self) -> None: ... - if sys.version_info >= (3, 13): - @abstractmethod - def close_clients(self) -> None: ... - @abstractmethod - def abort_clients(self) -> None: ... - - async def __aenter__(self) -> Self: ... - async def __aexit__(self, *exc: Unused) -> None: ... - @abstractmethod - def get_loop(self) -> AbstractEventLoop: ... - @abstractmethod - def is_serving(self) -> bool: ... - @abstractmethod - async def start_serving(self) -> None: ... - @abstractmethod - async def serve_forever(self) -> None: ... - @abstractmethod - async def wait_closed(self) -> None: ... - -class AbstractEventLoop: - slow_callback_duration: float - @abstractmethod - def run_forever(self) -> None: ... - @abstractmethod - def run_until_complete(self, future: _AwaitableLike[_T]) -> _T: ... - @abstractmethod - def stop(self) -> None: ... - @abstractmethod - def is_running(self) -> bool: ... - @abstractmethod - def is_closed(self) -> bool: ... - @abstractmethod - def close(self) -> None: ... - @abstractmethod - async def shutdown_asyncgens(self) -> None: ... - # Methods scheduling callbacks. All these return Handles. - # "context" added in 3.9.10/3.10.2 for call_* - @abstractmethod - def call_soon( - self, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts], context: Context | None = None - ) -> Handle: ... - @abstractmethod - def call_later( - self, delay: float, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts], context: Context | None = None - ) -> TimerHandle: ... - @abstractmethod - def call_at( - self, when: float, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts], context: Context | None = None - ) -> TimerHandle: ... - @abstractmethod - def time(self) -> float: ... - # Future methods - @abstractmethod - def create_future(self) -> Future[Any]: ... - # Tasks methods - if sys.version_info >= (3, 11): - @abstractmethod - def create_task( - self, coro: _CoroutineLike[_T], *, name: str | None = None, context: Context | None = None - ) -> Task[_T]: ... - else: - @abstractmethod - def create_task(self, coro: _CoroutineLike[_T], *, name: str | None = None) -> Task[_T]: ... - - @abstractmethod - def set_task_factory(self, factory: _TaskFactory | None) -> None: ... - @abstractmethod - def get_task_factory(self) -> _TaskFactory | None: ... - # Methods for interacting with threads - # "context" added in 3.9.10/3.10.2 - @abstractmethod - def call_soon_threadsafe( - self, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts], context: Context | None = None - ) -> Handle: ... - @abstractmethod - def run_in_executor(self, executor: Executor | None, func: Callable[[Unpack[_Ts]], _T], *args: Unpack[_Ts]) -> Future[_T]: ... - @abstractmethod - def set_default_executor(self, executor: Executor) -> None: ... - # Network I/O methods returning Futures. - @abstractmethod - async def getaddrinfo( - self, - host: bytes | str | None, - port: bytes | str | int | None, - *, - family: int = 0, - type: int = 0, - proto: int = 0, - flags: int = 0, - ) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ... - @abstractmethod - async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = 0) -> tuple[str, str]: ... - if sys.version_info >= (3, 11): - @overload - @abstractmethod - async def create_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., - *, - ssl: _SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: None = None, - local_addr: tuple[str, int] | None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - @overload - @abstractmethod - async def create_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - host: None = None, - port: None = None, - *, - ssl: _SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: socket, - local_addr: None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - else: - @overload - @abstractmethod - async def create_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - host: str = ..., - port: int = ..., - *, - ssl: _SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: None = None, - local_addr: tuple[str, int] | None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - @overload - @abstractmethod - async def create_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - host: None = None, - port: None = None, - *, - ssl: _SSLContext = None, - family: int = 0, - proto: int = 0, - flags: int = 0, - sock: socket, - local_addr: None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - happy_eyeballs_delay: float | None = None, - interleave: int | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - - if sys.version_info >= (3, 13): - # 3.13 added `keep_alive`. - @overload - @abstractmethod - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = None, - port: int = ..., - *, - family: int = ..., - flags: int = ..., - sock: None = None, - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - keep_alive: bool | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - @overload - @abstractmethod - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: None = None, - port: None = None, - *, - family: int = ..., - flags: int = ..., - sock: socket = ..., - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - keep_alive: bool | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - elif sys.version_info >= (3, 11): - @overload - @abstractmethod - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = None, - port: int = ..., - *, - family: int = ..., - flags: int = ..., - sock: None = None, - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - @overload - @abstractmethod - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: None = None, - port: None = None, - *, - family: int = ..., - flags: int = ..., - sock: socket = ..., - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - else: - @overload - @abstractmethod - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: str | Sequence[str] | None = None, - port: int = ..., - *, - family: int = ..., - flags: int = ..., - sock: None = None, - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - ssl_handshake_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - @overload - @abstractmethod - async def create_server( - self, - protocol_factory: _ProtocolFactory, - host: None = None, - port: None = None, - *, - family: int = ..., - flags: int = ..., - sock: socket = ..., - backlog: int = 100, - ssl: _SSLContext = None, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - ssl_handshake_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - - if sys.version_info >= (3, 11): - @abstractmethod - async def start_tls( - self, - transport: WriteTransport, - protocol: BaseProtocol, - sslcontext: ssl.SSLContext, - *, - server_side: bool = False, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - ) -> Transport | None: ... - async def create_unix_server( - self, - protocol_factory: _ProtocolFactory, - path: StrPath | None = None, - *, - sock: socket | None = None, - backlog: int = 100, - ssl: _SSLContext = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - else: - @abstractmethod - async def start_tls( - self, - transport: BaseTransport, - protocol: BaseProtocol, - sslcontext: ssl.SSLContext, - *, - server_side: bool = False, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ) -> Transport | None: ... - async def create_unix_server( - self, - protocol_factory: _ProtocolFactory, - path: StrPath | None = None, - *, - sock: socket | None = None, - backlog: int = 100, - ssl: _SSLContext = None, - ssl_handshake_timeout: float | None = None, - start_serving: bool = True, - ) -> Server: ... - - if sys.version_info >= (3, 11): - async def connect_accepted_socket( - self, - protocol_factory: Callable[[], _ProtocolT], - sock: socket, - *, - ssl: _SSLContext = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - elif sys.version_info >= (3, 10): - async def connect_accepted_socket( - self, - protocol_factory: Callable[[], _ProtocolT], - sock: socket, - *, - ssl: _SSLContext = None, - ssl_handshake_timeout: float | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - if sys.version_info >= (3, 11): - async def create_unix_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - path: str | None = None, - *, - ssl: _SSLContext = None, - sock: socket | None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - else: - async def create_unix_connection( - self, - protocol_factory: Callable[[], _ProtocolT], - path: str | None = None, - *, - ssl: _SSLContext = None, - sock: socket | None = None, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ) -> tuple[Transport, _ProtocolT]: ... - - @abstractmethod - async def sock_sendfile( - self, sock: socket, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool | None = None - ) -> int: ... - @abstractmethod - async def sendfile( - self, transport: WriteTransport, file: IO[bytes], offset: int = 0, count: int | None = None, *, fallback: bool = True - ) -> int: ... - @abstractmethod - async def create_datagram_endpoint( - self, - protocol_factory: Callable[[], _ProtocolT], - local_addr: tuple[str, int] | str | None = None, - remote_addr: tuple[str, int] | str | None = None, - *, - family: int = 0, - proto: int = 0, - flags: int = 0, - reuse_address: bool | None = None, - reuse_port: bool | None = None, - allow_broadcast: bool | None = None, - sock: socket | None = None, - ) -> tuple[DatagramTransport, _ProtocolT]: ... - # Pipes and subprocesses. - @abstractmethod - async def connect_read_pipe( - self, protocol_factory: Callable[[], _ProtocolT], pipe: Any - ) -> tuple[ReadTransport, _ProtocolT]: ... - @abstractmethod - async def connect_write_pipe( - self, protocol_factory: Callable[[], _ProtocolT], pipe: Any - ) -> tuple[WriteTransport, _ProtocolT]: ... - @abstractmethod - async def subprocess_shell( - self, - protocol_factory: Callable[[], _ProtocolT], - cmd: bytes | str, - *, - stdin: int | IO[Any] | None = -1, - stdout: int | IO[Any] | None = -1, - stderr: int | IO[Any] | None = -1, - universal_newlines: Literal[False] = False, - shell: Literal[True] = True, - bufsize: Literal[0] = 0, - encoding: None = None, - errors: None = None, - text: Literal[False] | None = ..., - **kwargs: Any, - ) -> tuple[SubprocessTransport, _ProtocolT]: ... - @abstractmethod - async def subprocess_exec( - self, - protocol_factory: Callable[[], _ProtocolT], - program: Any, - *args: Any, - stdin: int | IO[Any] | None = -1, - stdout: int | IO[Any] | None = -1, - stderr: int | IO[Any] | None = -1, - universal_newlines: Literal[False] = False, - shell: Literal[False] = False, - bufsize: Literal[0] = 0, - encoding: None = None, - errors: None = None, - **kwargs: Any, - ) -> tuple[SubprocessTransport, _ProtocolT]: ... - @abstractmethod - def add_reader(self, fd: FileDescriptorLike, callback: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> None: ... - @abstractmethod - def remove_reader(self, fd: FileDescriptorLike) -> bool: ... - @abstractmethod - def add_writer(self, fd: FileDescriptorLike, callback: Callable[[Unpack[_Ts]], Any], *args: Unpack[_Ts]) -> None: ... - @abstractmethod - def remove_writer(self, fd: FileDescriptorLike) -> bool: ... - @abstractmethod - async def sock_recv(self, sock: socket, nbytes: int) -> bytes: ... - @abstractmethod - async def sock_recv_into(self, sock: socket, buf: WriteableBuffer) -> int: ... - @abstractmethod - async def sock_sendall(self, sock: socket, data: ReadableBuffer) -> None: ... - @abstractmethod - async def sock_connect(self, sock: socket, address: _Address) -> None: ... - @abstractmethod - async def sock_accept(self, sock: socket) -> tuple[socket, _RetAddress]: ... - if sys.version_info >= (3, 11): - @abstractmethod - async def sock_recvfrom(self, sock: socket, bufsize: int) -> tuple[bytes, _RetAddress]: ... - @abstractmethod - async def sock_recvfrom_into(self, sock: socket, buf: WriteableBuffer, nbytes: int = 0) -> tuple[int, _RetAddress]: ... - @abstractmethod - async def sock_sendto(self, sock: socket, data: ReadableBuffer, address: _Address) -> int: ... - # Signal handling. - @abstractmethod - def add_signal_handler(self, sig: int, callback: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> None: ... - @abstractmethod - def remove_signal_handler(self, sig: int) -> bool: ... - # Error handlers. - @abstractmethod - def set_exception_handler(self, handler: _ExceptionHandler | None) -> None: ... - @abstractmethod - def get_exception_handler(self) -> _ExceptionHandler | None: ... - @abstractmethod - def default_exception_handler(self, context: _Context) -> None: ... - @abstractmethod - def call_exception_handler(self, context: _Context) -> None: ... - # Debug flag management. - @abstractmethod - def get_debug(self) -> bool: ... - @abstractmethod - def set_debug(self, enabled: bool) -> None: ... - @abstractmethod - async def shutdown_default_executor(self) -> None: ... - -class AbstractEventLoopPolicy: - @abstractmethod - def get_event_loop(self) -> AbstractEventLoop: ... - @abstractmethod - def set_event_loop(self, loop: AbstractEventLoop | None) -> None: ... - @abstractmethod - def new_event_loop(self) -> AbstractEventLoop: ... - # Child processes handling (Unix only). - if sys.version_info < (3, 14): - if sys.version_info >= (3, 12): - @abstractmethod - @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14") - def get_child_watcher(self) -> AbstractChildWatcher: ... - @abstractmethod - @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14") - def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ... - else: - @abstractmethod - def get_child_watcher(self) -> AbstractChildWatcher: ... - @abstractmethod - def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ... - -class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy, metaclass=ABCMeta): - def get_event_loop(self) -> AbstractEventLoop: ... - def set_event_loop(self, loop: AbstractEventLoop | None) -> None: ... - def new_event_loop(self) -> AbstractEventLoop: ... - -def get_event_loop_policy() -> AbstractEventLoopPolicy: ... -def set_event_loop_policy(policy: AbstractEventLoopPolicy | None) -> None: ... -def set_event_loop(loop: AbstractEventLoop | None) -> None: ... -def new_event_loop() -> AbstractEventLoop: ... - -if sys.version_info < (3, 14): - if sys.version_info >= (3, 12): - @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14") - def get_child_watcher() -> AbstractChildWatcher: ... - @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14") - def set_child_watcher(watcher: AbstractChildWatcher) -> None: ... - - else: - def get_child_watcher() -> AbstractChildWatcher: ... - def set_child_watcher(watcher: AbstractChildWatcher) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/exceptions.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/exceptions.pyi deleted file mode 100644 index 759838f45d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/exceptions.pyi +++ /dev/null @@ -1,44 +0,0 @@ -import sys - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.version_info >= (3, 11): - __all__ = ( - "BrokenBarrierError", - "CancelledError", - "InvalidStateError", - "TimeoutError", - "IncompleteReadError", - "LimitOverrunError", - "SendfileNotAvailableError", - ) -else: - __all__ = ( - "CancelledError", - "InvalidStateError", - "TimeoutError", - "IncompleteReadError", - "LimitOverrunError", - "SendfileNotAvailableError", - ) - -class CancelledError(BaseException): ... - -if sys.version_info >= (3, 11): - from builtins import TimeoutError as TimeoutError -else: - class TimeoutError(Exception): ... - -class InvalidStateError(Exception): ... -class SendfileNotAvailableError(RuntimeError): ... - -class IncompleteReadError(EOFError): - expected: int | None - partial: bytes - def __init__(self, partial: bytes, expected: int | None) -> None: ... - -class LimitOverrunError(Exception): - consumed: int - def __init__(self, message: str, consumed: int) -> None: ... - -if sys.version_info >= (3, 11): - class BrokenBarrierError(RuntimeError): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/format_helpers.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/format_helpers.pyi deleted file mode 100644 index 41505b14cd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/format_helpers.pyi +++ /dev/null @@ -1,31 +0,0 @@ -import functools -import sys -import traceback -from collections.abc import Iterable -from types import FrameType, FunctionType -from typing import Any, overload -from typing_extensions import TypeAlias - -class _HasWrapper: - __wrapper__: _HasWrapper | FunctionType - -_FuncType: TypeAlias = FunctionType | _HasWrapper | functools.partial[Any] | functools.partialmethod[Any] - -@overload -def _get_function_source(func: _FuncType) -> tuple[str, int]: ... -@overload -def _get_function_source(func: object) -> tuple[str, int] | None: ... - -if sys.version_info >= (3, 13): - def _format_callback_source(func: object, args: Iterable[Any], *, debug: bool = False) -> str: ... - def _format_args_and_kwargs(args: Iterable[Any], kwargs: dict[str, Any], *, debug: bool = False) -> str: ... - def _format_callback( - func: object, args: Iterable[Any], kwargs: dict[str, Any], *, debug: bool = False, suffix: str = "" - ) -> str: ... - -else: - def _format_callback_source(func: object, args: Iterable[Any]) -> str: ... - def _format_args_and_kwargs(args: Iterable[Any], kwargs: dict[str, Any]) -> str: ... - def _format_callback(func: object, args: Iterable[Any], kwargs: dict[str, Any], suffix: str = "") -> str: ... - -def extract_stack(f: FrameType | None = None, limit: int | None = None) -> traceback.StackSummary: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/futures.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/futures.pyi deleted file mode 100644 index cb2785012f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/futures.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from _asyncio import Future as Future -from concurrent.futures._base import Future as _ConcurrentFuture -from typing import Any, TypeVar -from typing_extensions import TypeIs - -from .events import AbstractEventLoop - -# Keep asyncio.__all__ updated with any changes to __all__ here -__all__ = ("Future", "wrap_future", "isfuture") - -_T = TypeVar("_T") - -# asyncio defines 'isfuture()' in base_futures.py and re-imports it in futures.py -# but it leads to circular import error in pytype tool. -# That's why the import order is reversed. -def isfuture(obj: object) -> TypeIs[Future[Any]]: ... -def wrap_future(future: _ConcurrentFuture[_T] | Future[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/locks.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/locks.pyi deleted file mode 100644 index 17390b0c5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/locks.pyi +++ /dev/null @@ -1,104 +0,0 @@ -import enum -import sys -from _typeshed import Unused -from collections import deque -from collections.abc import Callable -from types import TracebackType -from typing import Any, Literal, TypeVar -from typing_extensions import Self - -from .events import AbstractEventLoop -from .futures import Future - -if sys.version_info >= (3, 10): - from .mixins import _LoopBoundMixin -else: - _LoopBoundMixin = object - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.version_info >= (3, 11): - __all__ = ("Lock", "Event", "Condition", "Semaphore", "BoundedSemaphore", "Barrier") -else: - __all__ = ("Lock", "Event", "Condition", "Semaphore", "BoundedSemaphore") - -_T = TypeVar("_T") - -class _ContextManagerMixin: - async def __aenter__(self) -> None: ... - async def __aexit__( - self, exc_type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None - ) -> None: ... - -class Lock(_ContextManagerMixin, _LoopBoundMixin): - _waiters: deque[Future[Any]] | None - if sys.version_info >= (3, 10): - def __init__(self) -> None: ... - else: - def __init__(self, *, loop: AbstractEventLoop | None = None) -> None: ... - - def locked(self) -> bool: ... - async def acquire(self) -> Literal[True]: ... - def release(self) -> None: ... - -class Event(_LoopBoundMixin): - _waiters: deque[Future[Any]] - if sys.version_info >= (3, 10): - def __init__(self) -> None: ... - else: - def __init__(self, *, loop: AbstractEventLoop | None = None) -> None: ... - - def is_set(self) -> bool: ... - def set(self) -> None: ... - def clear(self) -> None: ... - async def wait(self) -> Literal[True]: ... - -class Condition(_ContextManagerMixin, _LoopBoundMixin): - _waiters: deque[Future[Any]] - if sys.version_info >= (3, 10): - def __init__(self, lock: Lock | None = None) -> None: ... - else: - def __init__(self, lock: Lock | None = None, *, loop: AbstractEventLoop | None = None) -> None: ... - - def locked(self) -> bool: ... - async def acquire(self) -> Literal[True]: ... - def release(self) -> None: ... - async def wait(self) -> Literal[True]: ... - async def wait_for(self, predicate: Callable[[], _T]) -> _T: ... - def notify(self, n: int = 1) -> None: ... - def notify_all(self) -> None: ... - -class Semaphore(_ContextManagerMixin, _LoopBoundMixin): - _value: int - _waiters: deque[Future[Any]] | None - if sys.version_info >= (3, 10): - def __init__(self, value: int = 1) -> None: ... - else: - def __init__(self, value: int = 1, *, loop: AbstractEventLoop | None = None) -> None: ... - - def locked(self) -> bool: ... - async def acquire(self) -> Literal[True]: ... - def release(self) -> None: ... - def _wake_up_next(self) -> None: ... - -class BoundedSemaphore(Semaphore): ... - -if sys.version_info >= (3, 11): - class _BarrierState(enum.Enum): # undocumented - FILLING = "filling" - DRAINING = "draining" - RESETTING = "resetting" - BROKEN = "broken" - - class Barrier(_LoopBoundMixin): - def __init__(self, parties: int) -> None: ... - async def __aenter__(self) -> Self: ... - async def __aexit__(self, *args: Unused) -> None: ... - async def wait(self) -> int: ... - async def abort(self) -> None: ... - async def reset(self) -> None: ... - @property - def parties(self) -> int: ... - @property - def n_waiting(self) -> int: ... - @property - def broken(self) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/log.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/log.pyi deleted file mode 100644 index e1de0b3bb8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/log.pyi +++ /dev/null @@ -1,3 +0,0 @@ -import logging - -logger: logging.Logger diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/mixins.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/mixins.pyi deleted file mode 100644 index 6ebcf543e6..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/mixins.pyi +++ /dev/null @@ -1,9 +0,0 @@ -import sys -import threading -from typing_extensions import Never - -_global_lock: threading.Lock - -class _LoopBoundMixin: - if sys.version_info < (3, 11): - def __init__(self, *, loop: Never = ...) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/proactor_events.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/proactor_events.pyi deleted file mode 100644 index 909d671df2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/proactor_events.pyi +++ /dev/null @@ -1,65 +0,0 @@ -import sys -from collections.abc import Mapping -from socket import socket -from typing import Any, ClassVar, Literal - -from . import base_events, constants, events, futures, streams, transports - -__all__ = ("BaseProactorEventLoop",) - -class _ProactorBasePipeTransport(transports._FlowControlMixin, transports.BaseTransport): - def __init__( - self, - loop: events.AbstractEventLoop, - sock: socket, - protocol: streams.StreamReaderProtocol, - waiter: futures.Future[Any] | None = None, - extra: Mapping[Any, Any] | None = None, - server: events.AbstractServer | None = None, - ) -> None: ... - def __del__(self) -> None: ... - -class _ProactorReadPipeTransport(_ProactorBasePipeTransport, transports.ReadTransport): - if sys.version_info >= (3, 10): - def __init__( - self, - loop: events.AbstractEventLoop, - sock: socket, - protocol: streams.StreamReaderProtocol, - waiter: futures.Future[Any] | None = None, - extra: Mapping[Any, Any] | None = None, - server: events.AbstractServer | None = None, - buffer_size: int = 65536, - ) -> None: ... - else: - def __init__( - self, - loop: events.AbstractEventLoop, - sock: socket, - protocol: streams.StreamReaderProtocol, - waiter: futures.Future[Any] | None = None, - extra: Mapping[Any, Any] | None = None, - server: events.AbstractServer | None = None, - ) -> None: ... - -class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport, transports.WriteTransport): ... -class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport): ... -class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport): ... - -class _ProactorSocketTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport): - _sendfile_compatible: ClassVar[constants._SendfileMode] - def __init__( - self, - loop: events.AbstractEventLoop, - sock: socket, - protocol: streams.StreamReaderProtocol, - waiter: futures.Future[Any] | None = None, - extra: Mapping[Any, Any] | None = None, - server: events.AbstractServer | None = None, - ) -> None: ... - def _set_extra(self, sock: socket) -> None: ... - def can_write_eof(self) -> Literal[True]: ... - -class BaseProactorEventLoop(base_events.BaseEventLoop): - def __init__(self, proactor: Any) -> None: ... - async def sock_recv(self, sock: socket, n: int) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/protocols.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/protocols.pyi deleted file mode 100644 index 5425336c49..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/protocols.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from _typeshed import ReadableBuffer -from asyncio import transports -from typing import Any - -# Keep asyncio.__all__ updated with any changes to __all__ here -__all__ = ("BaseProtocol", "Protocol", "DatagramProtocol", "SubprocessProtocol", "BufferedProtocol") - -class BaseProtocol: - def connection_made(self, transport: transports.BaseTransport) -> None: ... - def connection_lost(self, exc: Exception | None) -> None: ... - def pause_writing(self) -> None: ... - def resume_writing(self) -> None: ... - -class Protocol(BaseProtocol): - def data_received(self, data: bytes) -> None: ... - def eof_received(self) -> bool | None: ... - -class BufferedProtocol(BaseProtocol): - def get_buffer(self, sizehint: int) -> ReadableBuffer: ... - def buffer_updated(self, nbytes: int) -> None: ... - def eof_received(self) -> bool | None: ... - -class DatagramProtocol(BaseProtocol): - def connection_made(self, transport: transports.DatagramTransport) -> None: ... # type: ignore[override] - # addr can be a tuple[int, int] for some unusual protocols like socket.AF_NETLINK. - # Use tuple[str | Any, int] to not cause typechecking issues on most usual cases. - # This could be improved by using tuple[AnyOf[str, int], int] if the AnyOf feature is accepted. - # See https://github.com/python/typing/issues/566 - def datagram_received(self, data: bytes, addr: tuple[str | Any, int]) -> None: ... - def error_received(self, exc: Exception) -> None: ... - -class SubprocessProtocol(BaseProtocol): - def pipe_data_received(self, fd: int, data: bytes) -> None: ... - def pipe_connection_lost(self, fd: int, exc: Exception | None) -> None: ... - def process_exited(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/queues.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/queues.pyi deleted file mode 100644 index 63cd98f53d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/queues.pyi +++ /dev/null @@ -1,54 +0,0 @@ -import sys -from asyncio.events import AbstractEventLoop -from types import GenericAlias -from typing import Any, Generic, TypeVar - -if sys.version_info >= (3, 10): - from .mixins import _LoopBoundMixin -else: - _LoopBoundMixin = object - -class QueueEmpty(Exception): ... -class QueueFull(Exception): ... - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.version_info >= (3, 13): - __all__ = ("Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty", "QueueShutDown") - -else: - __all__ = ("Queue", "PriorityQueue", "LifoQueue", "QueueFull", "QueueEmpty") - -_T = TypeVar("_T") - -if sys.version_info >= (3, 13): - class QueueShutDown(Exception): ... - -# If Generic[_T] is last and _LoopBoundMixin is object, pyright is unhappy. -# We can remove the noqa pragma when dropping 3.9 support. -class Queue(Generic[_T], _LoopBoundMixin): # noqa: Y059 - if sys.version_info >= (3, 10): - def __init__(self, maxsize: int = 0) -> None: ... - else: - def __init__(self, maxsize: int = 0, *, loop: AbstractEventLoop | None = None) -> None: ... - - def _init(self, maxsize: int) -> None: ... - def _get(self) -> _T: ... - def _put(self, item: _T) -> None: ... - def _format(self) -> str: ... - def qsize(self) -> int: ... - @property - def maxsize(self) -> int: ... - def empty(self) -> bool: ... - def full(self) -> bool: ... - async def put(self, item: _T) -> None: ... - def put_nowait(self, item: _T) -> None: ... - async def get(self) -> _T: ... - def get_nowait(self) -> _T: ... - async def join(self) -> None: ... - def task_done(self) -> None: ... - def __class_getitem__(cls, type: Any, /) -> GenericAlias: ... - if sys.version_info >= (3, 13): - def shutdown(self, immediate: bool = False) -> None: ... - -class PriorityQueue(Queue[_T]): ... -class LifoQueue(Queue[_T]): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/runners.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/runners.pyi deleted file mode 100644 index caf5e4996c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/runners.pyi +++ /dev/null @@ -1,33 +0,0 @@ -import sys -from _typeshed import Unused -from collections.abc import Callable, Coroutine -from contextvars import Context -from typing import Any, TypeVar, final -from typing_extensions import Self - -from .events import AbstractEventLoop - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.version_info >= (3, 11): - __all__ = ("Runner", "run") -else: - __all__ = ("run",) -_T = TypeVar("_T") - -if sys.version_info >= (3, 11): - @final - class Runner: - def __init__(self, *, debug: bool | None = None, loop_factory: Callable[[], AbstractEventLoop] | None = None) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, exc_type: Unused, exc_val: Unused, exc_tb: Unused) -> None: ... - def close(self) -> None: ... - def get_loop(self) -> AbstractEventLoop: ... - def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: ... - -if sys.version_info >= (3, 12): - def run( - main: Coroutine[Any, Any, _T], *, debug: bool | None = ..., loop_factory: Callable[[], AbstractEventLoop] | None = ... - ) -> _T: ... - -else: - def run(main: Coroutine[Any, Any, _T], *, debug: bool | None = None) -> _T: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/selector_events.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/selector_events.pyi deleted file mode 100644 index 18c5df033e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/selector_events.pyi +++ /dev/null @@ -1,10 +0,0 @@ -import selectors -from socket import socket - -from . import base_events - -__all__ = ("BaseSelectorEventLoop",) - -class BaseSelectorEventLoop(base_events.BaseEventLoop): - def __init__(self, selector: selectors.BaseSelector | None = None) -> None: ... - async def sock_recv(self, sock: socket, n: int) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/sslproto.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/sslproto.pyi deleted file mode 100644 index ab102f124c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/sslproto.pyi +++ /dev/null @@ -1,165 +0,0 @@ -import ssl -import sys -from collections import deque -from collections.abc import Callable -from enum import Enum -from typing import Any, ClassVar, Final, Literal -from typing_extensions import TypeAlias - -from . import constants, events, futures, protocols, transports - -def _create_transport_context(server_side: bool, server_hostname: str | None) -> ssl.SSLContext: ... - -if sys.version_info >= (3, 11): - SSLAgainErrors: tuple[type[ssl.SSLWantReadError], type[ssl.SSLSyscallError]] - - class SSLProtocolState(Enum): - UNWRAPPED = "UNWRAPPED" - DO_HANDSHAKE = "DO_HANDSHAKE" - WRAPPED = "WRAPPED" - FLUSHING = "FLUSHING" - SHUTDOWN = "SHUTDOWN" - - class AppProtocolState(Enum): - STATE_INIT = "STATE_INIT" - STATE_CON_MADE = "STATE_CON_MADE" - STATE_EOF = "STATE_EOF" - STATE_CON_LOST = "STATE_CON_LOST" - - def add_flowcontrol_defaults(high: int | None, low: int | None, kb: int) -> tuple[int, int]: ... - -else: - _UNWRAPPED: Final = "UNWRAPPED" - _DO_HANDSHAKE: Final = "DO_HANDSHAKE" - _WRAPPED: Final = "WRAPPED" - _SHUTDOWN: Final = "SHUTDOWN" - -if sys.version_info < (3, 11): - class _SSLPipe: - max_size: ClassVar[int] - - _context: ssl.SSLContext - _server_side: bool - _server_hostname: str | None - _state: str - _incoming: ssl.MemoryBIO - _outgoing: ssl.MemoryBIO - _sslobj: ssl.SSLObject | None - _need_ssldata: bool - _handshake_cb: Callable[[BaseException | None], None] | None - _shutdown_cb: Callable[[], None] | None - def __init__(self, context: ssl.SSLContext, server_side: bool, server_hostname: str | None = None) -> None: ... - @property - def context(self) -> ssl.SSLContext: ... - @property - def ssl_object(self) -> ssl.SSLObject | None: ... - @property - def need_ssldata(self) -> bool: ... - @property - def wrapped(self) -> bool: ... - def do_handshake(self, callback: Callable[[BaseException | None], object] | None = None) -> list[bytes]: ... - def shutdown(self, callback: Callable[[], object] | None = None) -> list[bytes]: ... - def feed_eof(self) -> None: ... - def feed_ssldata(self, data: bytes, only_handshake: bool = False) -> tuple[list[bytes], list[bytes]]: ... - def feed_appdata(self, data: bytes, offset: int = 0) -> tuple[list[bytes], int]: ... - -class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport): - _sendfile_compatible: ClassVar[constants._SendfileMode] - - _loop: events.AbstractEventLoop - if sys.version_info >= (3, 11): - _ssl_protocol: SSLProtocol | None - else: - _ssl_protocol: SSLProtocol - _closed: bool - def __init__(self, loop: events.AbstractEventLoop, ssl_protocol: SSLProtocol) -> None: ... - def get_extra_info(self, name: str, default: Any | None = None) -> dict[str, Any]: ... - @property - def _protocol_paused(self) -> bool: ... - def write(self, data: bytes | bytearray | memoryview[Any]) -> None: ... # any memoryview format or shape - def can_write_eof(self) -> Literal[False]: ... - if sys.version_info >= (3, 11): - def get_write_buffer_limits(self) -> tuple[int, int]: ... - def get_read_buffer_limits(self) -> tuple[int, int]: ... - def set_read_buffer_limits(self, high: int | None = None, low: int | None = None) -> None: ... - def get_read_buffer_size(self) -> int: ... - - def __del__(self) -> None: ... - -if sys.version_info >= (3, 11): - _SSLProtocolBase: TypeAlias = protocols.BufferedProtocol -else: - _SSLProtocolBase: TypeAlias = protocols.Protocol - -class SSLProtocol(_SSLProtocolBase): - _server_side: bool - _server_hostname: str | None - _sslcontext: ssl.SSLContext - _extra: dict[str, Any] - _write_backlog: deque[tuple[bytes, int]] - _write_buffer_size: int - _waiter: futures.Future[Any] - _loop: events.AbstractEventLoop - _app_transport: _SSLProtocolTransport - _transport: transports.BaseTransport | None - _ssl_handshake_timeout: int | None - _app_protocol: protocols.BaseProtocol - _app_protocol_is_buffer: bool - - if sys.version_info >= (3, 11): - max_size: ClassVar[int] - else: - _sslpipe: _SSLPipe | None - _session_established: bool - _call_connection_made: bool - _in_handshake: bool - _in_shutdown: bool - - if sys.version_info >= (3, 11): - def __init__( - self, - loop: events.AbstractEventLoop, - app_protocol: protocols.BaseProtocol, - sslcontext: ssl.SSLContext, - waiter: futures.Future[Any], - server_side: bool = False, - server_hostname: str | None = None, - call_connection_made: bool = True, - ssl_handshake_timeout: int | None = None, - ssl_shutdown_timeout: float | None = None, - ) -> None: ... - else: - def __init__( - self, - loop: events.AbstractEventLoop, - app_protocol: protocols.BaseProtocol, - sslcontext: ssl.SSLContext, - waiter: futures.Future[Any], - server_side: bool = False, - server_hostname: str | None = None, - call_connection_made: bool = True, - ssl_handshake_timeout: int | None = None, - ) -> None: ... - - def _set_app_protocol(self, app_protocol: protocols.BaseProtocol) -> None: ... - def _wakeup_waiter(self, exc: BaseException | None = None) -> None: ... - def connection_lost(self, exc: BaseException | None) -> None: ... - def eof_received(self) -> None: ... - def _get_extra_info(self, name: str, default: Any | None = None) -> Any: ... - def _start_shutdown(self) -> None: ... - if sys.version_info >= (3, 11): - def _write_appdata(self, list_of_data: list[bytes]) -> None: ... - else: - def _write_appdata(self, data: bytes) -> None: ... - - def _start_handshake(self) -> None: ... - def _check_handshake_timeout(self) -> None: ... - def _on_handshake_complete(self, handshake_exc: BaseException | None) -> None: ... - def _fatal_error(self, exc: BaseException, message: str = "Fatal error on transport") -> None: ... - if sys.version_info >= (3, 11): - def _abort(self, exc: BaseException | None) -> None: ... - def get_buffer(self, n: int) -> memoryview: ... - else: - def _abort(self) -> None: ... - def _finalize(self) -> None: ... - def _process_write_backlog(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/staggered.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/staggered.pyi deleted file mode 100644 index 3324777f41..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/staggered.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections.abc import Awaitable, Callable, Iterable -from typing import Any - -from . import events - -__all__ = ("staggered_race",) - -async def staggered_race( - coro_fns: Iterable[Callable[[], Awaitable[Any]]], delay: float | None, *, loop: events.AbstractEventLoop | None = None -) -> tuple[Any, int | None, list[Exception | None]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/streams.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/streams.pyi deleted file mode 100644 index 43df5ae2d0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/streams.pyi +++ /dev/null @@ -1,158 +0,0 @@ -import ssl -import sys -from _typeshed import ReadableBuffer, StrPath -from collections.abc import Awaitable, Callable, Iterable, Sequence, Sized -from types import ModuleType -from typing import Any, Protocol, SupportsIndex -from typing_extensions import Self, TypeAlias - -from . import events, protocols, transports -from .base_events import Server - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.platform == "win32": - __all__ = ("StreamReader", "StreamWriter", "StreamReaderProtocol", "open_connection", "start_server") -else: - __all__ = ( - "StreamReader", - "StreamWriter", - "StreamReaderProtocol", - "open_connection", - "start_server", - "open_unix_connection", - "start_unix_server", - ) - -_ClientConnectedCallback: TypeAlias = Callable[[StreamReader, StreamWriter], Awaitable[None] | None] - -class _ReaduntilBuffer(ReadableBuffer, Sized, Protocol): ... - -if sys.version_info >= (3, 10): - async def open_connection( - host: str | None = None, - port: int | str | None = None, - *, - limit: int = 65536, - ssl_handshake_timeout: float | None = ..., - **kwds: Any, - ) -> tuple[StreamReader, StreamWriter]: ... - async def start_server( - client_connected_cb: _ClientConnectedCallback, - host: str | Sequence[str] | None = None, - port: int | str | None = None, - *, - limit: int = 65536, - ssl_handshake_timeout: float | None = ..., - **kwds: Any, - ) -> Server: ... - -else: - async def open_connection( - host: str | None = None, - port: int | str | None = None, - *, - loop: events.AbstractEventLoop | None = None, - limit: int = 65536, - ssl_handshake_timeout: float | None = ..., - **kwds: Any, - ) -> tuple[StreamReader, StreamWriter]: ... - async def start_server( - client_connected_cb: _ClientConnectedCallback, - host: str | None = None, - port: int | str | None = None, - *, - loop: events.AbstractEventLoop | None = None, - limit: int = 65536, - ssl_handshake_timeout: float | None = ..., - **kwds: Any, - ) -> Server: ... - -if sys.platform != "win32": - if sys.version_info >= (3, 10): - async def open_unix_connection( - path: StrPath | None = None, *, limit: int = 65536, **kwds: Any - ) -> tuple[StreamReader, StreamWriter]: ... - async def start_unix_server( - client_connected_cb: _ClientConnectedCallback, path: StrPath | None = None, *, limit: int = 65536, **kwds: Any - ) -> Server: ... - else: - async def open_unix_connection( - path: StrPath | None = None, *, loop: events.AbstractEventLoop | None = None, limit: int = 65536, **kwds: Any - ) -> tuple[StreamReader, StreamWriter]: ... - async def start_unix_server( - client_connected_cb: _ClientConnectedCallback, - path: StrPath | None = None, - *, - loop: events.AbstractEventLoop | None = None, - limit: int = 65536, - **kwds: Any, - ) -> Server: ... - -class FlowControlMixin(protocols.Protocol): - def __init__(self, loop: events.AbstractEventLoop | None = None) -> None: ... - -class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): - def __init__( - self, - stream_reader: StreamReader, - client_connected_cb: _ClientConnectedCallback | None = None, - loop: events.AbstractEventLoop | None = None, - ) -> None: ... - def __del__(self) -> None: ... - -class StreamWriter: - def __init__( - self, - transport: transports.WriteTransport, - protocol: protocols.BaseProtocol, - reader: StreamReader | None, - loop: events.AbstractEventLoop, - ) -> None: ... - @property - def transport(self) -> transports.WriteTransport: ... - def write(self, data: bytes | bytearray | memoryview) -> None: ... - def writelines(self, data: Iterable[bytes | bytearray | memoryview]) -> None: ... - def write_eof(self) -> None: ... - def can_write_eof(self) -> bool: ... - def close(self) -> None: ... - def is_closing(self) -> bool: ... - async def wait_closed(self) -> None: ... - def get_extra_info(self, name: str, default: Any = None) -> Any: ... - async def drain(self) -> None: ... - if sys.version_info >= (3, 12): - async def start_tls( - self, - sslcontext: ssl.SSLContext, - *, - server_hostname: str | None = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - ) -> None: ... - elif sys.version_info >= (3, 11): - async def start_tls( - self, sslcontext: ssl.SSLContext, *, server_hostname: str | None = None, ssl_handshake_timeout: float | None = None - ) -> None: ... - - if sys.version_info >= (3, 13): - def __del__(self, warnings: ModuleType = ...) -> None: ... - elif sys.version_info >= (3, 11): - def __del__(self) -> None: ... - -class StreamReader: - def __init__(self, limit: int = 65536, loop: events.AbstractEventLoop | None = None) -> None: ... - def exception(self) -> Exception: ... - def set_exception(self, exc: Exception) -> None: ... - def set_transport(self, transport: transports.BaseTransport) -> None: ... - def feed_eof(self) -> None: ... - def at_eof(self) -> bool: ... - def feed_data(self, data: Iterable[SupportsIndex]) -> None: ... - async def readline(self) -> bytes: ... - if sys.version_info >= (3, 13): - async def readuntil(self, separator: _ReaduntilBuffer | tuple[_ReaduntilBuffer, ...] = b"\n") -> bytes: ... - else: - async def readuntil(self, separator: _ReaduntilBuffer = b"\n") -> bytes: ... - - async def read(self, n: int = -1) -> bytes: ... - async def readexactly(self, n: int) -> bytes: ... - def __aiter__(self) -> Self: ... - async def __anext__(self) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/subprocess.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/subprocess.pyi deleted file mode 100644 index 50d75391f3..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/subprocess.pyi +++ /dev/null @@ -1,230 +0,0 @@ -import subprocess -import sys -from _typeshed import StrOrBytesPath -from asyncio import events, protocols, streams, transports -from collections.abc import Callable, Collection -from typing import IO, Any, Literal - -# Keep asyncio.__all__ updated with any changes to __all__ here -__all__ = ("create_subprocess_exec", "create_subprocess_shell") - -PIPE: int -STDOUT: int -DEVNULL: int - -class SubprocessStreamProtocol(streams.FlowControlMixin, protocols.SubprocessProtocol): - stdin: streams.StreamWriter | None - stdout: streams.StreamReader | None - stderr: streams.StreamReader | None - def __init__(self, limit: int, loop: events.AbstractEventLoop) -> None: ... - def pipe_data_received(self, fd: int, data: bytes | str) -> None: ... - -class Process: - stdin: streams.StreamWriter | None - stdout: streams.StreamReader | None - stderr: streams.StreamReader | None - pid: int - def __init__( - self, transport: transports.BaseTransport, protocol: protocols.BaseProtocol, loop: events.AbstractEventLoop - ) -> None: ... - @property - def returncode(self) -> int | None: ... - async def wait(self) -> int: ... - def send_signal(self, signal: int) -> None: ... - def terminate(self) -> None: ... - def kill(self) -> None: ... - async def communicate(self, input: bytes | bytearray | memoryview | None = None) -> tuple[bytes, bytes]: ... - -if sys.version_info >= (3, 11): - async def create_subprocess_shell( - cmd: str | bytes, - stdin: int | IO[Any] | None = None, - stdout: int | IO[Any] | None = None, - stderr: int | IO[Any] | None = None, - limit: int = 65536, - *, - # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = False, - shell: Literal[True] = True, - bufsize: Literal[0] = 0, - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - # These parameters are taken by subprocess.Popen, which this ultimately delegates to - executable: StrOrBytesPath | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - cwd: StrOrBytesPath | None = None, - env: subprocess._ENV | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - group: None | str | int = None, - extra_groups: None | Collection[str | int] = None, - user: None | str | int = None, - umask: int = -1, - process_group: int | None = None, - pipesize: int = -1, - ) -> Process: ... - async def create_subprocess_exec( - program: StrOrBytesPath, - *args: StrOrBytesPath, - stdin: int | IO[Any] | None = None, - stdout: int | IO[Any] | None = None, - stderr: int | IO[Any] | None = None, - limit: int = 65536, - # These parameters are forced to these values by BaseEventLoop.subprocess_exec - universal_newlines: Literal[False] = False, - shell: Literal[False] = False, - bufsize: Literal[0] = 0, - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - # These parameters are taken by subprocess.Popen, which this ultimately delegates to - executable: StrOrBytesPath | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - cwd: StrOrBytesPath | None = None, - env: subprocess._ENV | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - group: None | str | int = None, - extra_groups: None | Collection[str | int] = None, - user: None | str | int = None, - umask: int = -1, - process_group: int | None = None, - pipesize: int = -1, - ) -> Process: ... - -elif sys.version_info >= (3, 10): - async def create_subprocess_shell( - cmd: str | bytes, - stdin: int | IO[Any] | None = None, - stdout: int | IO[Any] | None = None, - stderr: int | IO[Any] | None = None, - limit: int = 65536, - *, - # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = False, - shell: Literal[True] = True, - bufsize: Literal[0] = 0, - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - # These parameters are taken by subprocess.Popen, which this ultimately delegates to - executable: StrOrBytesPath | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - cwd: StrOrBytesPath | None = None, - env: subprocess._ENV | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - group: None | str | int = None, - extra_groups: None | Collection[str | int] = None, - user: None | str | int = None, - umask: int = -1, - pipesize: int = -1, - ) -> Process: ... - async def create_subprocess_exec( - program: StrOrBytesPath, - *args: StrOrBytesPath, - stdin: int | IO[Any] | None = None, - stdout: int | IO[Any] | None = None, - stderr: int | IO[Any] | None = None, - limit: int = 65536, - # These parameters are forced to these values by BaseEventLoop.subprocess_exec - universal_newlines: Literal[False] = False, - shell: Literal[False] = False, - bufsize: Literal[0] = 0, - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - # These parameters are taken by subprocess.Popen, which this ultimately delegates to - executable: StrOrBytesPath | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - cwd: StrOrBytesPath | None = None, - env: subprocess._ENV | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - group: None | str | int = None, - extra_groups: None | Collection[str | int] = None, - user: None | str | int = None, - umask: int = -1, - pipesize: int = -1, - ) -> Process: ... - -else: # >= 3.9 - async def create_subprocess_shell( - cmd: str | bytes, - stdin: int | IO[Any] | None = None, - stdout: int | IO[Any] | None = None, - stderr: int | IO[Any] | None = None, - loop: events.AbstractEventLoop | None = None, - limit: int = 65536, - *, - # These parameters are forced to these values by BaseEventLoop.subprocess_shell - universal_newlines: Literal[False] = False, - shell: Literal[True] = True, - bufsize: Literal[0] = 0, - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - # These parameters are taken by subprocess.Popen, which this ultimately delegates to - executable: StrOrBytesPath | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - cwd: StrOrBytesPath | None = None, - env: subprocess._ENV | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - group: None | str | int = None, - extra_groups: None | Collection[str | int] = None, - user: None | str | int = None, - umask: int = -1, - ) -> Process: ... - async def create_subprocess_exec( - program: StrOrBytesPath, - *args: StrOrBytesPath, - stdin: int | IO[Any] | None = None, - stdout: int | IO[Any] | None = None, - stderr: int | IO[Any] | None = None, - loop: events.AbstractEventLoop | None = None, - limit: int = 65536, - # These parameters are forced to these values by BaseEventLoop.subprocess_exec - universal_newlines: Literal[False] = False, - shell: Literal[False] = False, - bufsize: Literal[0] = 0, - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - # These parameters are taken by subprocess.Popen, which this ultimately delegates to - executable: StrOrBytesPath | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - cwd: StrOrBytesPath | None = None, - env: subprocess._ENV | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - group: None | str | int = None, - extra_groups: None | Collection[str | int] = None, - user: None | str | int = None, - umask: int = -1, - ) -> Process: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/taskgroups.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/taskgroups.pyi deleted file mode 100644 index 30b7c9129f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/taskgroups.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import sys -from contextvars import Context -from types import TracebackType -from typing import Any, TypeVar -from typing_extensions import Self - -from . import _CoroutineLike -from .events import AbstractEventLoop -from .tasks import Task - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.version_info >= (3, 12): - __all__ = ("TaskGroup",) -else: - __all__ = ["TaskGroup"] - -_T = TypeVar("_T") - -class TaskGroup: - _loop: AbstractEventLoop | None - _tasks: set[Task[Any]] - - async def __aenter__(self) -> Self: ... - async def __aexit__(self, et: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None) -> None: ... - def create_task(self, coro: _CoroutineLike[_T], *, name: str | None = None, context: Context | None = None) -> Task[_T]: ... - def _on_task_done(self, task: Task[object]) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/tasks.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/tasks.pyi deleted file mode 100644 index e42151213e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/tasks.pyi +++ /dev/null @@ -1,460 +0,0 @@ -import concurrent.futures -import sys -from _asyncio import ( - Task as Task, - _enter_task as _enter_task, - _leave_task as _leave_task, - _register_task as _register_task, - _unregister_task as _unregister_task, -) -from collections.abc import AsyncIterator, Awaitable, Coroutine, Generator, Iterable, Iterator -from typing import Any, Literal, Protocol, TypeVar, overload -from typing_extensions import TypeAlias - -from . import _CoroutineLike -from .events import AbstractEventLoop -from .futures import Future - -if sys.version_info >= (3, 11): - from contextvars import Context - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.version_info >= (3, 12): - __all__ = ( - "Task", - "create_task", - "FIRST_COMPLETED", - "FIRST_EXCEPTION", - "ALL_COMPLETED", - "wait", - "wait_for", - "as_completed", - "sleep", - "gather", - "shield", - "ensure_future", - "run_coroutine_threadsafe", - "current_task", - "all_tasks", - "create_eager_task_factory", - "eager_task_factory", - "_register_task", - "_unregister_task", - "_enter_task", - "_leave_task", - ) -else: - __all__ = ( - "Task", - "create_task", - "FIRST_COMPLETED", - "FIRST_EXCEPTION", - "ALL_COMPLETED", - "wait", - "wait_for", - "as_completed", - "sleep", - "gather", - "shield", - "ensure_future", - "run_coroutine_threadsafe", - "current_task", - "all_tasks", - "_register_task", - "_unregister_task", - "_enter_task", - "_leave_task", - ) - -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True) -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") -_T3 = TypeVar("_T3") -_T4 = TypeVar("_T4") -_T5 = TypeVar("_T5") -_T6 = TypeVar("_T6") -_FT = TypeVar("_FT", bound=Future[Any]) -if sys.version_info >= (3, 12): - _FutureLike: TypeAlias = Future[_T] | Awaitable[_T] -else: - _FutureLike: TypeAlias = Future[_T] | Generator[Any, None, _T] | Awaitable[_T] - -_TaskYieldType: TypeAlias = Future[object] | None - -FIRST_COMPLETED = concurrent.futures.FIRST_COMPLETED -FIRST_EXCEPTION = concurrent.futures.FIRST_EXCEPTION -ALL_COMPLETED = concurrent.futures.ALL_COMPLETED - -if sys.version_info >= (3, 13): - class _SyncAndAsyncIterator(Iterator[_T_co], AsyncIterator[_T_co], Protocol[_T_co]): ... - - def as_completed(fs: Iterable[_FutureLike[_T]], *, timeout: float | None = None) -> _SyncAndAsyncIterator[Future[_T]]: ... - -elif sys.version_info >= (3, 10): - def as_completed(fs: Iterable[_FutureLike[_T]], *, timeout: float | None = None) -> Iterator[Future[_T]]: ... - -else: - def as_completed( - fs: Iterable[_FutureLike[_T]], *, loop: AbstractEventLoop | None = None, timeout: float | None = None - ) -> Iterator[Future[_T]]: ... - -@overload -def ensure_future(coro_or_future: _FT, *, loop: AbstractEventLoop | None = None) -> _FT: ... # type: ignore[overload-overlap] -@overload -def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | None = None) -> Task[_T]: ... - -# `gather()` actually returns a list with length equal to the number -# of tasks passed; however, Tuple is used similar to the annotation for -# zip() because typing does not support variadic type variables. See -# typing PR #1550 for discussion. -# -# N.B. Having overlapping overloads is the only way to get acceptable type inference in all edge cases. -if sys.version_info >= (3, 10): - @overload - def gather(coro_or_future1: _FutureLike[_T1], /, *, return_exceptions: Literal[False] = False) -> Future[tuple[_T1]]: ... # type: ignore[overload-overlap] - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], coro_or_future2: _FutureLike[_T2], /, *, return_exceptions: Literal[False] = False - ) -> Future[tuple[_T1, _T2]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - /, - *, - return_exceptions: Literal[False] = False, - ) -> Future[tuple[_T1, _T2, _T3]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - /, - *, - return_exceptions: Literal[False] = False, - ) -> Future[tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - coro_or_future5: _FutureLike[_T5], - /, - *, - return_exceptions: Literal[False] = False, - ) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - coro_or_future5: _FutureLike[_T5], - coro_or_future6: _FutureLike[_T6], - /, - *, - return_exceptions: Literal[False] = False, - ) -> Future[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... - @overload - def gather(*coros_or_futures: _FutureLike[_T], return_exceptions: Literal[False] = False) -> Future[list[_T]]: ... # type: ignore[overload-overlap] - @overload - def gather(coro_or_future1: _FutureLike[_T1], /, *, return_exceptions: bool) -> Future[tuple[_T1 | BaseException]]: ... - @overload - def gather( - coro_or_future1: _FutureLike[_T1], coro_or_future2: _FutureLike[_T2], /, *, return_exceptions: bool - ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ... - @overload - def gather( - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - /, - *, - return_exceptions: bool, - ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ... - @overload - def gather( - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - /, - *, - return_exceptions: bool, - ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ... - @overload - def gather( - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - coro_or_future5: _FutureLike[_T5], - /, - *, - return_exceptions: bool, - ) -> Future[ - tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException] - ]: ... - @overload - def gather( - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - coro_or_future5: _FutureLike[_T5], - coro_or_future6: _FutureLike[_T6], - /, - *, - return_exceptions: bool, - ) -> Future[ - tuple[ - _T1 | BaseException, - _T2 | BaseException, - _T3 | BaseException, - _T4 | BaseException, - _T5 | BaseException, - _T6 | BaseException, - ] - ]: ... - @overload - def gather(*coros_or_futures: _FutureLike[_T], return_exceptions: bool) -> Future[list[_T | BaseException]]: ... - -else: - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], /, *, loop: AbstractEventLoop | None = None, return_exceptions: Literal[False] = False - ) -> Future[tuple[_T1]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - /, - *, - loop: AbstractEventLoop | None = None, - return_exceptions: Literal[False] = False, - ) -> Future[tuple[_T1, _T2]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - /, - *, - loop: AbstractEventLoop | None = None, - return_exceptions: Literal[False] = False, - ) -> Future[tuple[_T1, _T2, _T3]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - /, - *, - loop: AbstractEventLoop | None = None, - return_exceptions: Literal[False] = False, - ) -> Future[tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - coro_or_future5: _FutureLike[_T5], - /, - *, - loop: AbstractEventLoop | None = None, - return_exceptions: Literal[False] = False, - ) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - coro_or_future5: _FutureLike[_T5], - coro_or_future6: _FutureLike[_T6], - /, - *, - loop: AbstractEventLoop | None = None, - return_exceptions: Literal[False] = False, - ) -> Future[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... - @overload - def gather( # type: ignore[overload-overlap] - *coros_or_futures: _FutureLike[_T], loop: AbstractEventLoop | None = None, return_exceptions: Literal[False] = False - ) -> Future[list[_T]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], /, *, loop: AbstractEventLoop | None = None, return_exceptions: bool - ) -> Future[tuple[_T1 | BaseException]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - /, - *, - loop: AbstractEventLoop | None = None, - return_exceptions: bool, - ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - /, - *, - loop: AbstractEventLoop | None = None, - return_exceptions: bool, - ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - /, - *, - loop: AbstractEventLoop | None = None, - return_exceptions: bool, - ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ... - @overload - def gather( # type: ignore[overload-overlap] - coro_or_future1: _FutureLike[_T1], - coro_or_future2: _FutureLike[_T2], - coro_or_future3: _FutureLike[_T3], - coro_or_future4: _FutureLike[_T4], - coro_or_future5: _FutureLike[_T5], - coro_or_future6: _FutureLike[_T6], - /, - *, - loop: AbstractEventLoop | None = None, - return_exceptions: bool, - ) -> Future[ - tuple[ - _T1 | BaseException, - _T2 | BaseException, - _T3 | BaseException, - _T4 | BaseException, - _T5 | BaseException, - _T6 | BaseException, - ] - ]: ... - @overload - def gather( - *coros_or_futures: _FutureLike[_T], loop: AbstractEventLoop | None = None, return_exceptions: bool - ) -> Future[list[_T | BaseException]]: ... - -# unlike some asyncio apis, This does strict runtime checking of actually being a coroutine, not of any future-like. -def run_coroutine_threadsafe(coro: Coroutine[Any, Any, _T], loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ... - -if sys.version_info >= (3, 10): - def shield(arg: _FutureLike[_T]) -> Future[_T]: ... - @overload - async def sleep(delay: float) -> None: ... - @overload - async def sleep(delay: float, result: _T) -> _T: ... - async def wait_for(fut: _FutureLike[_T], timeout: float | None) -> _T: ... - -else: - def shield(arg: _FutureLike[_T], *, loop: AbstractEventLoop | None = None) -> Future[_T]: ... - @overload - async def sleep(delay: float, *, loop: AbstractEventLoop | None = None) -> None: ... - @overload - async def sleep(delay: float, result: _T, *, loop: AbstractEventLoop | None = None) -> _T: ... - async def wait_for(fut: _FutureLike[_T], timeout: float | None, *, loop: AbstractEventLoop | None = None) -> _T: ... - -if sys.version_info >= (3, 11): - @overload - async def wait( - fs: Iterable[_FT], *, timeout: float | None = None, return_when: str = "ALL_COMPLETED" - ) -> tuple[set[_FT], set[_FT]]: ... - @overload - async def wait( - fs: Iterable[Task[_T]], *, timeout: float | None = None, return_when: str = "ALL_COMPLETED" - ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... - -elif sys.version_info >= (3, 10): - @overload - async def wait( # type: ignore[overload-overlap] - fs: Iterable[_FT], *, timeout: float | None = None, return_when: str = "ALL_COMPLETED" - ) -> tuple[set[_FT], set[_FT]]: ... - @overload - async def wait( - fs: Iterable[Awaitable[_T]], *, timeout: float | None = None, return_when: str = "ALL_COMPLETED" - ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... - -else: - @overload - async def wait( # type: ignore[overload-overlap] - fs: Iterable[_FT], - *, - loop: AbstractEventLoop | None = None, - timeout: float | None = None, - return_when: str = "ALL_COMPLETED", - ) -> tuple[set[_FT], set[_FT]]: ... - @overload - async def wait( - fs: Iterable[Awaitable[_T]], - *, - loop: AbstractEventLoop | None = None, - timeout: float | None = None, - return_when: str = "ALL_COMPLETED", - ) -> tuple[set[Task[_T]], set[Task[_T]]]: ... - -if sys.version_info >= (3, 12): - _TaskCompatibleCoro: TypeAlias = Coroutine[Any, Any, _T_co] -else: - _TaskCompatibleCoro: TypeAlias = Generator[_TaskYieldType, None, _T_co] | Coroutine[Any, Any, _T_co] - -def all_tasks(loop: AbstractEventLoop | None = None) -> set[Task[Any]]: ... - -if sys.version_info >= (3, 11): - def create_task(coro: _CoroutineLike[_T], *, name: str | None = None, context: Context | None = None) -> Task[_T]: ... - -else: - def create_task(coro: _CoroutineLike[_T], *, name: str | None = None) -> Task[_T]: ... - -if sys.version_info >= (3, 12): - from _asyncio import current_task as current_task -else: - def current_task(loop: AbstractEventLoop | None = None) -> Task[Any] | None: ... - -if sys.version_info >= (3, 12): - _TaskT_co = TypeVar("_TaskT_co", bound=Task[Any], covariant=True) - - class _CustomTaskConstructor(Protocol[_TaskT_co]): - def __call__( - self, - coro: _TaskCompatibleCoro[Any], - /, - *, - loop: AbstractEventLoop, - name: str | None, - context: Context | None, - eager_start: bool, - ) -> _TaskT_co: ... - - class _EagerTaskFactoryType(Protocol[_TaskT_co]): - def __call__( - self, - loop: AbstractEventLoop, - coro: _TaskCompatibleCoro[Any], - *, - name: str | None = None, - context: Context | None = None, - ) -> _TaskT_co: ... - - def create_eager_task_factory( - custom_task_constructor: _CustomTaskConstructor[_TaskT_co], - ) -> _EagerTaskFactoryType[_TaskT_co]: ... - def eager_task_factory( - loop: AbstractEventLoop | None, - coro: _TaskCompatibleCoro[_T_co], - *, - name: str | None = None, - context: Context | None = None, - ) -> Task[_T_co]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/threads.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/threads.pyi deleted file mode 100644 index 00aae2ea81..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/threads.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections.abc import Callable -from typing import TypeVar -from typing_extensions import ParamSpec - -# Keep asyncio.__all__ updated with any changes to __all__ here -__all__ = ("to_thread",) -_P = ParamSpec("_P") -_R = TypeVar("_R") - -async def to_thread(func: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs) -> _R: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/timeouts.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/timeouts.pyi deleted file mode 100644 index 668cccbfe8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/timeouts.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from types import TracebackType -from typing import final -from typing_extensions import Self - -# Keep asyncio.__all__ updated with any changes to __all__ here -__all__ = ("Timeout", "timeout", "timeout_at") - -@final -class Timeout: - def __init__(self, when: float | None) -> None: ... - def when(self) -> float | None: ... - def reschedule(self, when: float | None) -> None: ... - def expired(self) -> bool: ... - async def __aenter__(self) -> Self: ... - async def __aexit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - -def timeout(delay: float | None) -> Timeout: ... -def timeout_at(when: float | None) -> Timeout: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/transports.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/transports.pyi deleted file mode 100644 index bce54897f1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/transports.pyi +++ /dev/null @@ -1,50 +0,0 @@ -from asyncio.events import AbstractEventLoop -from asyncio.protocols import BaseProtocol -from collections.abc import Iterable, Mapping -from socket import _Address -from typing import Any - -# Keep asyncio.__all__ updated with any changes to __all__ here -__all__ = ("BaseTransport", "ReadTransport", "WriteTransport", "Transport", "DatagramTransport", "SubprocessTransport") - -class BaseTransport: - def __init__(self, extra: Mapping[str, Any] | None = None) -> None: ... - def get_extra_info(self, name: str, default: Any = None) -> Any: ... - def is_closing(self) -> bool: ... - def close(self) -> None: ... - def set_protocol(self, protocol: BaseProtocol) -> None: ... - def get_protocol(self) -> BaseProtocol: ... - -class ReadTransport(BaseTransport): - def is_reading(self) -> bool: ... - def pause_reading(self) -> None: ... - def resume_reading(self) -> None: ... - -class WriteTransport(BaseTransport): - def set_write_buffer_limits(self, high: int | None = None, low: int | None = None) -> None: ... - def get_write_buffer_size(self) -> int: ... - def get_write_buffer_limits(self) -> tuple[int, int]: ... - def write(self, data: bytes | bytearray | memoryview[Any]) -> None: ... # any memoryview format or shape - def writelines( - self, list_of_data: Iterable[bytes | bytearray | memoryview[Any]] - ) -> None: ... # any memoryview format or shape - def write_eof(self) -> None: ... - def can_write_eof(self) -> bool: ... - def abort(self) -> None: ... - -class Transport(ReadTransport, WriteTransport): ... - -class DatagramTransport(BaseTransport): - def sendto(self, data: bytes | bytearray | memoryview, addr: _Address | None = None) -> None: ... - def abort(self) -> None: ... - -class SubprocessTransport(BaseTransport): - def get_pid(self) -> int: ... - def get_returncode(self) -> int | None: ... - def get_pipe_transport(self, fd: int) -> BaseTransport | None: ... - def send_signal(self, signal: int) -> None: ... - def terminate(self) -> None: ... - def kill(self) -> None: ... - -class _FlowControlMixin(Transport): - def __init__(self, extra: Mapping[str, Any] | None = None, loop: AbstractEventLoop | None = None) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/trsock.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/trsock.pyi deleted file mode 100644 index e74cf6fd4e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/trsock.pyi +++ /dev/null @@ -1,94 +0,0 @@ -import socket -import sys -from _typeshed import ReadableBuffer -from builtins import type as Type # alias to avoid name clashes with property named "type" -from collections.abc import Iterable -from types import TracebackType -from typing import Any, BinaryIO, NoReturn, overload -from typing_extensions import TypeAlias - -# These are based in socket, maybe move them out into _typeshed.pyi or such -_Address: TypeAlias = socket._Address -_RetAddress: TypeAlias = Any -_WriteBuffer: TypeAlias = bytearray | memoryview -_CMSG: TypeAlias = tuple[int, int, bytes] - -class TransportSocket: - def __init__(self, sock: socket.socket) -> None: ... - @property - def family(self) -> int: ... - @property - def type(self) -> int: ... - @property - def proto(self) -> int: ... - def __getstate__(self) -> NoReturn: ... - def fileno(self) -> int: ... - def dup(self) -> socket.socket: ... - def get_inheritable(self) -> bool: ... - def shutdown(self, how: int) -> None: ... - @overload - def getsockopt(self, level: int, optname: int) -> int: ... - @overload - def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... - @overload - def setsockopt(self, level: int, optname: int, value: int | ReadableBuffer) -> None: ... - @overload - def setsockopt(self, level: int, optname: int, value: None, optlen: int) -> None: ... - def getpeername(self) -> _RetAddress: ... - def getsockname(self) -> _RetAddress: ... - def getsockbyname(self) -> NoReturn: ... # This method doesn't exist on socket, yet is passed through? - def settimeout(self, value: float | None) -> None: ... - def gettimeout(self) -> float | None: ... - def setblocking(self, flag: bool) -> None: ... - if sys.version_info < (3, 11): - def _na(self, what: str) -> None: ... - def accept(self) -> tuple[socket.socket, _RetAddress]: ... - def connect(self, address: _Address) -> None: ... - def connect_ex(self, address: _Address) -> int: ... - def bind(self, address: _Address) -> None: ... - if sys.platform == "win32": - def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> None: ... - else: - def ioctl(self, control: int, option: int | tuple[int, int, int] | bool) -> NoReturn: ... - - def listen(self, backlog: int = ..., /) -> None: ... - def makefile(self) -> BinaryIO: ... - def sendfile(self, file: BinaryIO, offset: int = ..., count: int | None = ...) -> int: ... - def close(self) -> None: ... - def detach(self) -> int: ... - if sys.platform == "linux": - def sendmsg_afalg( - self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... - ) -> int: ... - else: - def sendmsg_afalg( - self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ... - ) -> NoReturn: ... - - def sendmsg( - self, buffers: Iterable[ReadableBuffer], ancdata: Iterable[_CMSG] = ..., flags: int = ..., address: _Address = ..., / - ) -> int: ... - @overload - def sendto(self, data: ReadableBuffer, address: _Address) -> int: ... - @overload - def sendto(self, data: ReadableBuffer, flags: int, address: _Address) -> int: ... - def send(self, data: ReadableBuffer, flags: int = ...) -> int: ... - def sendall(self, data: ReadableBuffer, flags: int = ...) -> None: ... - def set_inheritable(self, inheritable: bool) -> None: ... - if sys.platform == "win32": - def share(self, process_id: int) -> bytes: ... - else: - def share(self, process_id: int) -> NoReturn: ... - - def recv_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> int: ... - def recvfrom_into(self, buffer: _WriteBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ... - def recvmsg_into( - self, buffers: Iterable[_WriteBuffer], ancbufsize: int = ..., flags: int = ..., / - ) -> tuple[int, list[_CMSG], int, Any]: ... - def recvmsg(self, bufsize: int, ancbufsize: int = ..., flags: int = ..., /) -> tuple[bytes, list[_CMSG], int, Any]: ... - def recvfrom(self, bufsize: int, flags: int = ...) -> tuple[bytes, _RetAddress]: ... - def recv(self, bufsize: int, flags: int = ...) -> bytes: ... - def __enter__(self) -> socket.socket: ... - def __exit__( - self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/unix_events.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/unix_events.pyi deleted file mode 100644 index 79f99fbe37..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/unix_events.pyi +++ /dev/null @@ -1,243 +0,0 @@ -import sys -import types -from _typeshed import StrPath -from abc import ABCMeta, abstractmethod -from collections.abc import Callable -from socket import socket -from typing import Literal -from typing_extensions import Self, TypeVarTuple, Unpack, deprecated - -from .base_events import Server, _ProtocolFactory, _SSLContext -from .events import AbstractEventLoop, BaseDefaultEventLoopPolicy -from .selector_events import BaseSelectorEventLoop - -_Ts = TypeVarTuple("_Ts") - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.platform != "win32": - if sys.version_info >= (3, 14): - __all__ = ("SelectorEventLoop", "DefaultEventLoopPolicy", "EventLoop") - elif sys.version_info >= (3, 13): - # Adds EventLoop - __all__ = ( - "SelectorEventLoop", - "AbstractChildWatcher", - "SafeChildWatcher", - "FastChildWatcher", - "PidfdChildWatcher", - "MultiLoopChildWatcher", - "ThreadedChildWatcher", - "DefaultEventLoopPolicy", - "EventLoop", - ) - else: - # adds PidfdChildWatcher - __all__ = ( - "SelectorEventLoop", - "AbstractChildWatcher", - "SafeChildWatcher", - "FastChildWatcher", - "PidfdChildWatcher", - "MultiLoopChildWatcher", - "ThreadedChildWatcher", - "DefaultEventLoopPolicy", - ) - -# This is also technically not available on Win, -# but other parts of typeshed need this definition. -# So, it is special cased. -if sys.version_info < (3, 14): - if sys.version_info >= (3, 12): - @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14") - class AbstractChildWatcher: - @abstractmethod - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - @abstractmethod - def remove_child_handler(self, pid: int) -> bool: ... - @abstractmethod - def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... - @abstractmethod - def close(self) -> None: ... - @abstractmethod - def __enter__(self) -> Self: ... - @abstractmethod - def __exit__( - self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None - ) -> None: ... - @abstractmethod - def is_active(self) -> bool: ... - - else: - class AbstractChildWatcher: - @abstractmethod - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - @abstractmethod - def remove_child_handler(self, pid: int) -> bool: ... - @abstractmethod - def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... - @abstractmethod - def close(self) -> None: ... - @abstractmethod - def __enter__(self) -> Self: ... - @abstractmethod - def __exit__( - self, typ: type[BaseException] | None, exc: BaseException | None, tb: types.TracebackType | None - ) -> None: ... - @abstractmethod - def is_active(self) -> bool: ... - -if sys.platform != "win32": - if sys.version_info < (3, 14): - if sys.version_info >= (3, 12): - # Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub. - # See discussion in #7412 - class BaseChildWatcher(AbstractChildWatcher, metaclass=ABCMeta): - def close(self) -> None: ... - def is_active(self) -> bool: ... - def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... - - @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14") - class SafeChildWatcher(BaseChildWatcher): - def __enter__(self) -> Self: ... - def __exit__( - self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None - ) -> None: ... - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - def remove_child_handler(self, pid: int) -> bool: ... - - @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14") - class FastChildWatcher(BaseChildWatcher): - def __enter__(self) -> Self: ... - def __exit__( - self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None - ) -> None: ... - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - def remove_child_handler(self, pid: int) -> bool: ... - - else: - # Doesn't actually have ABCMeta metaclass at runtime, but mypy complains if we don't have it in the stub. - # See discussion in #7412 - class BaseChildWatcher(AbstractChildWatcher, metaclass=ABCMeta): - def close(self) -> None: ... - def is_active(self) -> bool: ... - def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... - - class SafeChildWatcher(BaseChildWatcher): - def __enter__(self) -> Self: ... - def __exit__( - self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None - ) -> None: ... - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - def remove_child_handler(self, pid: int) -> bool: ... - - class FastChildWatcher(BaseChildWatcher): - def __enter__(self) -> Self: ... - def __exit__( - self, a: type[BaseException] | None, b: BaseException | None, c: types.TracebackType | None - ) -> None: ... - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - def remove_child_handler(self, pid: int) -> bool: ... - - class _UnixSelectorEventLoop(BaseSelectorEventLoop): - if sys.version_info >= (3, 13): - async def create_unix_server( - self, - protocol_factory: _ProtocolFactory, - path: StrPath | None = None, - *, - sock: socket | None = None, - backlog: int = 100, - ssl: _SSLContext = None, - ssl_handshake_timeout: float | None = None, - ssl_shutdown_timeout: float | None = None, - start_serving: bool = True, - cleanup_socket: bool = True, - ) -> Server: ... - - class _UnixDefaultEventLoopPolicy(BaseDefaultEventLoopPolicy): - if sys.version_info < (3, 14): - if sys.version_info >= (3, 12): - @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14") - def get_child_watcher(self) -> AbstractChildWatcher: ... - @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14") - def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ... - else: - def get_child_watcher(self) -> AbstractChildWatcher: ... - def set_child_watcher(self, watcher: AbstractChildWatcher | None) -> None: ... - - SelectorEventLoop = _UnixSelectorEventLoop - - DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy - - if sys.version_info >= (3, 13): - EventLoop = SelectorEventLoop - - if sys.version_info < (3, 14): - if sys.version_info >= (3, 12): - @deprecated("Deprecated as of Python 3.12; will be removed in Python 3.14") - class MultiLoopChildWatcher(AbstractChildWatcher): - def is_active(self) -> bool: ... - def close(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None - ) -> None: ... - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - def remove_child_handler(self, pid: int) -> bool: ... - def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... - - else: - class MultiLoopChildWatcher(AbstractChildWatcher): - def is_active(self) -> bool: ... - def close(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None - ) -> None: ... - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - def remove_child_handler(self, pid: int) -> bool: ... - def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... - - if sys.version_info < (3, 14): - class ThreadedChildWatcher(AbstractChildWatcher): - def is_active(self) -> Literal[True]: ... - def close(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None - ) -> None: ... - def __del__(self) -> None: ... - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - def remove_child_handler(self, pid: int) -> bool: ... - def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... - - class PidfdChildWatcher(AbstractChildWatcher): - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None - ) -> None: ... - def is_active(self) -> bool: ... - def close(self) -> None: ... - def attach_loop(self, loop: AbstractEventLoop | None) -> None: ... - def add_child_handler( - self, pid: int, callback: Callable[[int, int, Unpack[_Ts]], object], *args: Unpack[_Ts] - ) -> None: ... - def remove_child_handler(self, pid: int) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/windows_events.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/windows_events.pyi deleted file mode 100644 index 2ffc2eccb2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/windows_events.pyi +++ /dev/null @@ -1,101 +0,0 @@ -import socket -import sys -from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer -from collections.abc import Callable -from typing import IO, Any, ClassVar, Final, NoReturn - -from . import events, futures, proactor_events, selector_events, streams, windows_utils - -# Keep asyncio.__all__ updated with any changes to __all__ here -if sys.platform == "win32": - if sys.version_info >= (3, 13): - # 3.13 added `EventLoop`. - __all__ = ( - "SelectorEventLoop", - "ProactorEventLoop", - "IocpProactor", - "DefaultEventLoopPolicy", - "WindowsSelectorEventLoopPolicy", - "WindowsProactorEventLoopPolicy", - "EventLoop", - ) - else: - __all__ = ( - "SelectorEventLoop", - "ProactorEventLoop", - "IocpProactor", - "DefaultEventLoopPolicy", - "WindowsSelectorEventLoopPolicy", - "WindowsProactorEventLoopPolicy", - ) - - NULL: Final = 0 - INFINITE: Final = 0xFFFFFFFF - ERROR_CONNECTION_REFUSED: Final = 1225 - ERROR_CONNECTION_ABORTED: Final = 1236 - CONNECT_PIPE_INIT_DELAY: float - CONNECT_PIPE_MAX_DELAY: float - - class PipeServer: - def __init__(self, address: str) -> None: ... - def __del__(self) -> None: ... - def closed(self) -> bool: ... - def close(self) -> None: ... - - class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop): ... - - class ProactorEventLoop(proactor_events.BaseProactorEventLoop): - def __init__(self, proactor: IocpProactor | None = None) -> None: ... - async def create_pipe_connection( - self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str - ) -> tuple[proactor_events._ProactorDuplexPipeTransport, streams.StreamReaderProtocol]: ... - async def start_serving_pipe( - self, protocol_factory: Callable[[], streams.StreamReaderProtocol], address: str - ) -> list[PipeServer]: ... - - class IocpProactor: - def __init__(self, concurrency: int = 0xFFFFFFFF) -> None: ... - def __del__(self) -> None: ... - def set_loop(self, loop: events.AbstractEventLoop) -> None: ... - def select(self, timeout: int | None = None) -> list[futures.Future[Any]]: ... - def recv(self, conn: socket.socket, nbytes: int, flags: int = 0) -> futures.Future[bytes]: ... - def recv_into(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ... - def recvfrom( - self, conn: socket.socket, nbytes: int, flags: int = 0 - ) -> futures.Future[tuple[bytes, socket._RetAddress]]: ... - def sendto( - self, conn: socket.socket, buf: ReadableBuffer, flags: int = 0, addr: socket._Address | None = None - ) -> futures.Future[int]: ... - def send(self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0) -> futures.Future[Any]: ... - def accept(self, listener: socket.socket) -> futures.Future[Any]: ... - def connect( - self, - conn: socket.socket, - address: tuple[Incomplete, Incomplete] | tuple[Incomplete, Incomplete, Incomplete, Incomplete], - ) -> futures.Future[Any]: ... - def sendfile(self, sock: socket.socket, file: IO[bytes], offset: int, count: int) -> futures.Future[Any]: ... - def accept_pipe(self, pipe: socket.socket) -> futures.Future[Any]: ... - async def connect_pipe(self, address: str) -> windows_utils.PipeHandle: ... - def wait_for_handle(self, handle: windows_utils.PipeHandle, timeout: int | None = None) -> bool: ... - def close(self) -> None: ... - if sys.version_info >= (3, 11): - def recvfrom_into( - self, conn: socket.socket, buf: WriteableBuffer, flags: int = 0 - ) -> futures.Future[tuple[int, socket._RetAddress]]: ... - - SelectorEventLoop = _WindowsSelectorEventLoop - - class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): - _loop_factory: ClassVar[type[SelectorEventLoop]] - if sys.version_info < (3, 14): - def get_child_watcher(self) -> NoReturn: ... - def set_child_watcher(self, watcher: Any) -> NoReturn: ... - - class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy): - _loop_factory: ClassVar[type[ProactorEventLoop]] - def get_child_watcher(self) -> NoReturn: ... - def set_child_watcher(self, watcher: Any) -> NoReturn: ... - - DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy - if sys.version_info >= (3, 13): - EventLoop = ProactorEventLoop diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/windows_utils.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/windows_utils.pyi deleted file mode 100644 index 4fa0145323..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncio/windows_utils.pyi +++ /dev/null @@ -1,49 +0,0 @@ -import subprocess -import sys -from collections.abc import Callable -from types import TracebackType -from typing import Any, AnyStr, Final -from typing_extensions import Self - -if sys.platform == "win32": - __all__ = ("pipe", "Popen", "PIPE", "PipeHandle") - - BUFSIZE: Final = 8192 - PIPE = subprocess.PIPE - STDOUT = subprocess.STDOUT - def pipe(*, duplex: bool = False, overlapped: tuple[bool, bool] = (True, True), bufsize: int = 8192) -> tuple[int, int]: ... - - class PipeHandle: - def __init__(self, handle: int) -> None: ... - def __del__(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... - @property - def handle(self) -> int: ... - def fileno(self) -> int: ... - def close(self, *, CloseHandle: Callable[[int], object] = ...) -> None: ... - - class Popen(subprocess.Popen[AnyStr]): - stdin: PipeHandle | None # type: ignore[assignment] - stdout: PipeHandle | None # type: ignore[assignment] - stderr: PipeHandle | None # type: ignore[assignment] - # For simplicity we omit the full overloaded __new__ signature of - # subprocess.Popen. The arguments are mostly the same, but - # subprocess.Popen takes other positional-or-keyword arguments before - # stdin. - def __new__( - cls, - args: subprocess._CMD, - stdin: subprocess._FILE | None = ..., - stdout: subprocess._FILE | None = ..., - stderr: subprocess._FILE | None = ..., - **kwds: Any, - ) -> Self: ... - def __init__( - self, - args: subprocess._CMD, - stdin: subprocess._FILE | None = None, - stdout: subprocess._FILE | None = None, - stderr: subprocess._FILE | None = None, - **kwds: Any, - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncore.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncore.pyi deleted file mode 100644 index 36d1862fdd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/asyncore.pyi +++ /dev/null @@ -1,90 +0,0 @@ -import sys -from _typeshed import FileDescriptorLike, ReadableBuffer -from socket import socket -from typing import Any, overload -from typing_extensions import TypeAlias - -# cyclic dependence with asynchat -_MapType: TypeAlias = dict[int, Any] -_Socket: TypeAlias = socket - -socket_map: _MapType # undocumented - -class ExitNow(Exception): ... - -def read(obj: Any) -> None: ... -def write(obj: Any) -> None: ... -def readwrite(obj: Any, flags: int) -> None: ... -def poll(timeout: float = 0.0, map: _MapType | None = None) -> None: ... -def poll2(timeout: float = 0.0, map: _MapType | None = None) -> None: ... - -poll3 = poll2 - -def loop(timeout: float = 30.0, use_poll: bool = False, map: _MapType | None = None, count: int | None = None) -> None: ... - -# Not really subclass of socket.socket; it's only delegation. -# It is not covariant to it. -class dispatcher: - debug: bool - connected: bool - accepting: bool - connecting: bool - closing: bool - ignore_log_types: frozenset[str] - socket: _Socket | None - def __init__(self, sock: _Socket | None = None, map: _MapType | None = None) -> None: ... - def add_channel(self, map: _MapType | None = None) -> None: ... - def del_channel(self, map: _MapType | None = None) -> None: ... - def create_socket(self, family: int = ..., type: int = ...) -> None: ... - def set_socket(self, sock: _Socket, map: _MapType | None = None) -> None: ... - def set_reuse_addr(self) -> None: ... - def readable(self) -> bool: ... - def writable(self) -> bool: ... - def listen(self, num: int) -> None: ... - def bind(self, addr: tuple[Any, ...] | str) -> None: ... - def connect(self, address: tuple[Any, ...] | str) -> None: ... - def accept(self) -> tuple[_Socket, Any] | None: ... - def send(self, data: ReadableBuffer) -> int: ... - def recv(self, buffer_size: int) -> bytes: ... - def close(self) -> None: ... - def log(self, message: Any) -> None: ... - def log_info(self, message: Any, type: str = "info") -> None: ... - def handle_read_event(self) -> None: ... - def handle_connect_event(self) -> None: ... - def handle_write_event(self) -> None: ... - def handle_expt_event(self) -> None: ... - def handle_error(self) -> None: ... - def handle_expt(self) -> None: ... - def handle_read(self) -> None: ... - def handle_write(self) -> None: ... - def handle_connect(self) -> None: ... - def handle_accept(self) -> None: ... - def handle_close(self) -> None: ... - -class dispatcher_with_send(dispatcher): - def initiate_send(self) -> None: ... - # incompatible signature: - # def send(self, data: bytes) -> int | None: ... - -def compact_traceback() -> tuple[tuple[str, str, str], type, type, str]: ... -def close_all(map: _MapType | None = None, ignore_all: bool = False) -> None: ... - -if sys.platform != "win32": - class file_wrapper: - fd: int - def __init__(self, fd: int) -> None: ... - def recv(self, bufsize: int, flags: int = ...) -> bytes: ... - def send(self, data: bytes, flags: int = ...) -> int: ... - @overload - def getsockopt(self, level: int, optname: int, buflen: None = None) -> int: ... - @overload - def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... - def read(self, bufsize: int, flags: int = ...) -> bytes: ... - def write(self, data: bytes, flags: int = ...) -> int: ... - def close(self) -> None: ... - def fileno(self) -> int: ... - def __del__(self) -> None: ... - - class file_dispatcher(dispatcher): - def __init__(self, fd: FileDescriptorLike, map: _MapType | None = None) -> None: ... - def set_file(self, fd: int) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/atexit.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/atexit.pyi deleted file mode 100644 index 7f7b05ccc0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/atexit.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from collections.abc import Callable -from typing import TypeVar -from typing_extensions import ParamSpec - -_T = TypeVar("_T") -_P = ParamSpec("_P") - -def _clear() -> None: ... -def _ncallbacks() -> int: ... -def _run_exitfuncs() -> None: ... -def register(func: Callable[_P, _T], /, *args: _P.args, **kwargs: _P.kwargs) -> Callable[_P, _T]: ... -def unregister(func: Callable[..., object], /) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/audioop.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/audioop.pyi deleted file mode 100644 index f3ce78ccb7..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/audioop.pyi +++ /dev/null @@ -1,43 +0,0 @@ -from typing_extensions import Buffer, TypeAlias - -_AdpcmState: TypeAlias = tuple[int, int] -_RatecvState: TypeAlias = tuple[int, tuple[tuple[int, int], ...]] - -class error(Exception): ... - -def add(fragment1: Buffer, fragment2: Buffer, width: int, /) -> bytes: ... -def adpcm2lin(fragment: Buffer, width: int, state: _AdpcmState | None, /) -> tuple[bytes, _AdpcmState]: ... -def alaw2lin(fragment: Buffer, width: int, /) -> bytes: ... -def avg(fragment: Buffer, width: int, /) -> int: ... -def avgpp(fragment: Buffer, width: int, /) -> int: ... -def bias(fragment: Buffer, width: int, bias: int, /) -> bytes: ... -def byteswap(fragment: Buffer, width: int, /) -> bytes: ... -def cross(fragment: Buffer, width: int, /) -> int: ... -def findfactor(fragment: Buffer, reference: Buffer, /) -> float: ... -def findfit(fragment: Buffer, reference: Buffer, /) -> tuple[int, float]: ... -def findmax(fragment: Buffer, length: int, /) -> int: ... -def getsample(fragment: Buffer, width: int, index: int, /) -> int: ... -def lin2adpcm(fragment: Buffer, width: int, state: _AdpcmState | None, /) -> tuple[bytes, _AdpcmState]: ... -def lin2alaw(fragment: Buffer, width: int, /) -> bytes: ... -def lin2lin(fragment: Buffer, width: int, newwidth: int, /) -> bytes: ... -def lin2ulaw(fragment: Buffer, width: int, /) -> bytes: ... -def max(fragment: Buffer, width: int, /) -> int: ... -def maxpp(fragment: Buffer, width: int, /) -> int: ... -def minmax(fragment: Buffer, width: int, /) -> tuple[int, int]: ... -def mul(fragment: Buffer, width: int, factor: float, /) -> bytes: ... -def ratecv( - fragment: Buffer, - width: int, - nchannels: int, - inrate: int, - outrate: int, - state: _RatecvState | None, - weightA: int = 1, - weightB: int = 0, - /, -) -> tuple[bytes, _RatecvState]: ... -def reverse(fragment: Buffer, width: int, /) -> bytes: ... -def rms(fragment: Buffer, width: int, /) -> int: ... -def tomono(fragment: Buffer, width: int, lfactor: float, rfactor: float, /) -> bytes: ... -def tostereo(fragment: Buffer, width: int, lfactor: float, rfactor: float, /) -> bytes: ... -def ulaw2lin(fragment: Buffer, width: int, /) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/base64.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/base64.pyi deleted file mode 100644 index 279d74a94e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/base64.pyi +++ /dev/null @@ -1,61 +0,0 @@ -import sys -from _typeshed import ReadableBuffer -from typing import IO - -__all__ = [ - "encode", - "decode", - "encodebytes", - "decodebytes", - "b64encode", - "b64decode", - "b32encode", - "b32decode", - "b16encode", - "b16decode", - "b85encode", - "b85decode", - "a85encode", - "a85decode", - "standard_b64encode", - "standard_b64decode", - "urlsafe_b64encode", - "urlsafe_b64decode", -] - -if sys.version_info >= (3, 10): - __all__ += ["b32hexencode", "b32hexdecode"] -if sys.version_info >= (3, 13): - __all__ += ["z85decode", "z85encode"] - -def b64encode(s: ReadableBuffer, altchars: ReadableBuffer | None = None) -> bytes: ... -def b64decode(s: str | ReadableBuffer, altchars: str | ReadableBuffer | None = None, validate: bool = False) -> bytes: ... -def standard_b64encode(s: ReadableBuffer) -> bytes: ... -def standard_b64decode(s: str | ReadableBuffer) -> bytes: ... -def urlsafe_b64encode(s: ReadableBuffer) -> bytes: ... -def urlsafe_b64decode(s: str | ReadableBuffer) -> bytes: ... -def b32encode(s: ReadableBuffer) -> bytes: ... -def b32decode(s: str | ReadableBuffer, casefold: bool = False, map01: str | ReadableBuffer | None = None) -> bytes: ... -def b16encode(s: ReadableBuffer) -> bytes: ... -def b16decode(s: str | ReadableBuffer, casefold: bool = False) -> bytes: ... - -if sys.version_info >= (3, 10): - def b32hexencode(s: ReadableBuffer) -> bytes: ... - def b32hexdecode(s: str | ReadableBuffer, casefold: bool = False) -> bytes: ... - -def a85encode( - b: ReadableBuffer, *, foldspaces: bool = False, wrapcol: int = 0, pad: bool = False, adobe: bool = False -) -> bytes: ... -def a85decode( - b: str | ReadableBuffer, *, foldspaces: bool = False, adobe: bool = False, ignorechars: bytearray | bytes = b" \t\n\r\x0b" -) -> bytes: ... -def b85encode(b: ReadableBuffer, pad: bool = False) -> bytes: ... -def b85decode(b: str | ReadableBuffer) -> bytes: ... -def decode(input: IO[bytes], output: IO[bytes]) -> None: ... -def encode(input: IO[bytes], output: IO[bytes]) -> None: ... -def encodebytes(s: ReadableBuffer) -> bytes: ... -def decodebytes(s: ReadableBuffer) -> bytes: ... - -if sys.version_info >= (3, 13): - def z85encode(s: ReadableBuffer) -> bytes: ... - def z85decode(s: str | ReadableBuffer) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/bdb.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/bdb.pyi deleted file mode 100644 index 2004874a52..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/bdb.pyi +++ /dev/null @@ -1,119 +0,0 @@ -import sys -from _typeshed import ExcInfo, TraceFunction, Unused -from collections.abc import Callable, Iterable, Iterator, Mapping -from contextlib import contextmanager -from types import CodeType, FrameType, TracebackType -from typing import IO, Any, Final, SupportsInt, TypeVar -from typing_extensions import ParamSpec - -__all__ = ["BdbQuit", "Bdb", "Breakpoint"] - -_T = TypeVar("_T") -_P = ParamSpec("_P") - -# A union of code-object flags at runtime. -# The exact values of code-object flags are implementation details, -# so we don't include the value of this constant in the stubs. -GENERATOR_AND_COROUTINE_FLAGS: Final[int] - -class BdbQuit(Exception): ... - -class Bdb: - skip: set[str] | None - breaks: dict[str, list[int]] - fncache: dict[str, str] - frame_returning: FrameType | None - botframe: FrameType | None - quitting: bool - stopframe: FrameType | None - returnframe: FrameType | None - stoplineno: int - def __init__(self, skip: Iterable[str] | None = None) -> None: ... - def canonic(self, filename: str) -> str: ... - def reset(self) -> None: ... - if sys.version_info >= (3, 12): - @contextmanager - def set_enterframe(self, frame: FrameType) -> Iterator[None]: ... - - def trace_dispatch(self, frame: FrameType, event: str, arg: Any) -> TraceFunction: ... - def dispatch_line(self, frame: FrameType) -> TraceFunction: ... - def dispatch_call(self, frame: FrameType, arg: None) -> TraceFunction: ... - def dispatch_return(self, frame: FrameType, arg: Any) -> TraceFunction: ... - def dispatch_exception(self, frame: FrameType, arg: ExcInfo) -> TraceFunction: ... - if sys.version_info >= (3, 13): - def dispatch_opcode(self, frame: FrameType, arg: Unused) -> Callable[[FrameType, str, Any], TraceFunction]: ... - - def is_skipped_module(self, module_name: str) -> bool: ... - def stop_here(self, frame: FrameType) -> bool: ... - def break_here(self, frame: FrameType) -> bool: ... - def do_clear(self, arg: Any) -> bool | None: ... - def break_anywhere(self, frame: FrameType) -> bool: ... - def user_call(self, frame: FrameType, argument_list: None) -> None: ... - def user_line(self, frame: FrameType) -> None: ... - def user_return(self, frame: FrameType, return_value: Any) -> None: ... - def user_exception(self, frame: FrameType, exc_info: ExcInfo) -> None: ... - def set_until(self, frame: FrameType, lineno: int | None = None) -> None: ... - if sys.version_info >= (3, 13): - def user_opcode(self, frame: FrameType) -> None: ... # undocumented - - def set_step(self) -> None: ... - if sys.version_info >= (3, 13): - def set_stepinstr(self) -> None: ... # undocumented - - def set_next(self, frame: FrameType) -> None: ... - def set_return(self, frame: FrameType) -> None: ... - def set_trace(self, frame: FrameType | None = None) -> None: ... - def set_continue(self) -> None: ... - def set_quit(self) -> None: ... - def set_break( - self, filename: str, lineno: int, temporary: bool = False, cond: str | None = None, funcname: str | None = None - ) -> str | None: ... - def clear_break(self, filename: str, lineno: int) -> str | None: ... - def clear_bpbynumber(self, arg: SupportsInt) -> str | None: ... - def clear_all_file_breaks(self, filename: str) -> str | None: ... - def clear_all_breaks(self) -> str | None: ... - def get_bpbynumber(self, arg: SupportsInt) -> Breakpoint: ... - def get_break(self, filename: str, lineno: int) -> bool: ... - def get_breaks(self, filename: str, lineno: int) -> list[Breakpoint]: ... - def get_file_breaks(self, filename: str) -> list[Breakpoint]: ... - def get_all_breaks(self) -> list[Breakpoint]: ... - def get_stack(self, f: FrameType | None, t: TracebackType | None) -> tuple[list[tuple[FrameType, int]], int]: ... - def format_stack_entry(self, frame_lineno: tuple[FrameType, int], lprefix: str = ": ") -> str: ... - def run( - self, cmd: str | CodeType, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None - ) -> None: ... - def runeval(self, expr: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> None: ... - def runctx(self, cmd: str | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ... - def runcall(self, func: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> _T | None: ... - -class Breakpoint: - next: int - bplist: dict[tuple[str, int], list[Breakpoint]] - bpbynumber: list[Breakpoint | None] - - funcname: str | None - func_first_executable_line: int | None - file: str - line: int - temporary: bool - cond: str | None - enabled: bool - ignore: int - hits: int - number: int - def __init__( - self, file: str, line: int, temporary: bool = False, cond: str | None = None, funcname: str | None = None - ) -> None: ... - if sys.version_info >= (3, 11): - @staticmethod - def clearBreakpoints() -> None: ... - - def deleteMe(self) -> None: ... - def enable(self) -> None: ... - def disable(self) -> None: ... - def bpprint(self, out: IO[str] | None = None) -> None: ... - def bpformat(self) -> str: ... - -def checkfuncname(b: Breakpoint, frame: FrameType) -> bool: ... -def effective(file: str, line: int, frame: FrameType) -> tuple[Breakpoint, bool] | tuple[None, None]: ... -def set_trace() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/binascii.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/binascii.pyi deleted file mode 100644 index 32e018c653..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/binascii.pyi +++ /dev/null @@ -1,36 +0,0 @@ -import sys -from _typeshed import ReadableBuffer -from typing_extensions import TypeAlias - -# Many functions in binascii accept buffer objects -# or ASCII-only strings. -_AsciiBuffer: TypeAlias = str | ReadableBuffer - -def a2b_uu(data: _AsciiBuffer, /) -> bytes: ... -def b2a_uu(data: ReadableBuffer, /, *, backtick: bool = False) -> bytes: ... - -if sys.version_info >= (3, 11): - def a2b_base64(data: _AsciiBuffer, /, *, strict_mode: bool = False) -> bytes: ... - -else: - def a2b_base64(data: _AsciiBuffer, /) -> bytes: ... - -def b2a_base64(data: ReadableBuffer, /, *, newline: bool = True) -> bytes: ... -def a2b_qp(data: _AsciiBuffer, header: bool = False) -> bytes: ... -def b2a_qp(data: ReadableBuffer, quotetabs: bool = False, istext: bool = True, header: bool = False) -> bytes: ... - -if sys.version_info < (3, 11): - def a2b_hqx(data: _AsciiBuffer, /) -> bytes: ... - def rledecode_hqx(data: ReadableBuffer, /) -> bytes: ... - def rlecode_hqx(data: ReadableBuffer, /) -> bytes: ... - def b2a_hqx(data: ReadableBuffer, /) -> bytes: ... - -def crc_hqx(data: ReadableBuffer, crc: int, /) -> int: ... -def crc32(data: ReadableBuffer, crc: int = 0, /) -> int: ... -def b2a_hex(data: ReadableBuffer, sep: str | bytes = ..., bytes_per_sep: int = ...) -> bytes: ... -def hexlify(data: ReadableBuffer, sep: str | bytes = ..., bytes_per_sep: int = ...) -> bytes: ... -def a2b_hex(hexstr: _AsciiBuffer, /) -> bytes: ... -def unhexlify(hexstr: _AsciiBuffer, /) -> bytes: ... - -class Error(ValueError): ... -class Incomplete(Exception): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/binhex.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/binhex.pyi deleted file mode 100644 index bdead92846..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/binhex.pyi +++ /dev/null @@ -1,45 +0,0 @@ -from _typeshed import SizedBuffer -from typing import IO, Any, Final -from typing_extensions import TypeAlias - -__all__ = ["binhex", "hexbin", "Error"] - -class Error(Exception): ... - -REASONABLY_LARGE: Final = 32768 -LINELEN: Final = 64 -RUNCHAR: Final = b"\x90" - -class FInfo: - Type: str - Creator: str - Flags: int - -_FileInfoTuple: TypeAlias = tuple[str, FInfo, int, int] -_FileHandleUnion: TypeAlias = str | IO[bytes] - -def getfileinfo(name: str) -> _FileInfoTuple: ... - -class openrsrc: - def __init__(self, *args: Any) -> None: ... - def read(self, *args: Any) -> bytes: ... - def write(self, *args: Any) -> None: ... - def close(self) -> None: ... - -class BinHex: - def __init__(self, name_finfo_dlen_rlen: _FileInfoTuple, ofp: _FileHandleUnion) -> None: ... - def write(self, data: SizedBuffer) -> None: ... - def close_data(self) -> None: ... - def write_rsrc(self, data: SizedBuffer) -> None: ... - def close(self) -> None: ... - -def binhex(inp: str, out: str) -> None: ... - -class HexBin: - def __init__(self, ifp: _FileHandleUnion) -> None: ... - def read(self, *n: int) -> bytes: ... - def close_data(self) -> None: ... - def read_rsrc(self, *n: int) -> bytes: ... - def close(self) -> None: ... - -def hexbin(inp: str, out: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/bisect.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/bisect.pyi deleted file mode 100644 index 60dfc48d69..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/bisect.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from _bisect import * - -bisect = bisect_right -insort = insort_right diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/builtins.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/builtins.pyi index b75250aad3..d347a3a1d8 100644 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/builtins.pyi +++ b/crates/red_knot_vendored/vendor/typeshed/stdlib/builtins.pyi @@ -1,2144 +1,3 @@ -import _ast -import _sitebuiltins -import _typeshed -import sys -import types -from _collections_abc import dict_items, dict_keys, dict_values -from _typeshed import ( - AnyStr_co, - ConvertibleToFloat, - ConvertibleToInt, - FileDescriptorOrPath, - OpenBinaryMode, - OpenBinaryModeReading, - OpenBinaryModeUpdating, - OpenBinaryModeWriting, - OpenTextMode, - ReadableBuffer, - SupportsAdd, - SupportsAiter, - SupportsAnext, - SupportsDivMod, - SupportsFlush, - SupportsIter, - SupportsKeysAndGetItem, - SupportsLenAndGetItem, - SupportsNext, - SupportsRAdd, - SupportsRDivMod, - SupportsRichComparison, - SupportsRichComparisonT, - SupportsWrite, -) -from collections.abc import Awaitable, Callable, Iterable, Iterator, MutableSet, Reversible, Set as AbstractSet, Sized -from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper -from types import CellType, CodeType, GenericAlias, TracebackType +class object: ... -# mypy crashes if any of {ByteString, Sequence, MutableSequence, Mapping, MutableMapping} -# are imported from collections.abc in builtins.pyi -from typing import ( # noqa: Y022,UP035 - IO, - Any, - BinaryIO, - ClassVar, - Generic, - Mapping, - MutableMapping, - MutableSequence, - Protocol, - Sequence, - SupportsAbs, - SupportsBytes, - SupportsComplex, - SupportsFloat, - SupportsIndex, - TypeVar, - final, - overload, - type_check_only, -) - -# we can't import `Literal` from typing or mypy crashes: see #11247 -from typing_extensions import ( # noqa: Y023 - Concatenate, - Literal, - LiteralString, - ParamSpec, - Self, - TypeAlias, - TypeGuard, - TypeIs, - TypeVarTuple, - deprecated, -) - -_T = TypeVar("_T") -_I = TypeVar("_I", default=int) -_T_co = TypeVar("_T_co", covariant=True) -_T_contra = TypeVar("_T_contra", contravariant=True) -_R_co = TypeVar("_R_co", covariant=True) -_KT = TypeVar("_KT") -_VT = TypeVar("_VT") -_S = TypeVar("_S") -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") -_T3 = TypeVar("_T3") -_T4 = TypeVar("_T4") -_T5 = TypeVar("_T5") -_SupportsNextT_co = TypeVar("_SupportsNextT_co", bound=SupportsNext[Any], covariant=True) -_SupportsAnextT_co = TypeVar("_SupportsAnextT_co", bound=SupportsAnext[Any], covariant=True) -_AwaitableT = TypeVar("_AwaitableT", bound=Awaitable[Any]) -_AwaitableT_co = TypeVar("_AwaitableT_co", bound=Awaitable[Any], covariant=True) -_P = ParamSpec("_P") - -# Type variables for slice -_StartT_co = TypeVar("_StartT_co", covariant=True, default=Any) # slice -> slice[Any, Any, Any] -_StopT_co = TypeVar("_StopT_co", covariant=True, default=_StartT_co) # slice[A] -> slice[A, A, A] -# NOTE: step could differ from start and stop, (e.g. datetime/timedelta)l -# the default (start|stop) is chosen to cater to the most common case of int/index slices. -# FIXME: https://github.com/python/typing/issues/213 (replace step=start|stop with step=start&stop) -_StepT_co = TypeVar("_StepT_co", covariant=True, default=_StartT_co | _StopT_co) # slice[A,B] -> slice[A, B, A|B] - -class object: - __doc__: str | None - __dict__: dict[str, Any] - __module__: str - __annotations__: dict[str, Any] - @property - def __class__(self) -> type[Self]: ... - @__class__.setter - def __class__(self, type: type[Self], /) -> None: ... - def __init__(self) -> None: ... - def __new__(cls) -> Self: ... - # N.B. `object.__setattr__` and `object.__delattr__` are heavily special-cased by type checkers. - # Overriding them in subclasses has different semantics, even if the override has an identical signature. - def __setattr__(self, name: str, value: Any, /) -> None: ... - def __delattr__(self, name: str, /) -> None: ... - def __eq__(self, value: object, /) -> bool: ... - def __ne__(self, value: object, /) -> bool: ... - def __str__(self) -> str: ... # noqa: Y029 - def __repr__(self) -> str: ... # noqa: Y029 - def __hash__(self) -> int: ... - def __format__(self, format_spec: str, /) -> str: ... - def __getattribute__(self, name: str, /) -> Any: ... - def __sizeof__(self) -> int: ... - # return type of pickle methods is rather hard to express in the current type system - # see #6661 and https://docs.python.org/3/library/pickle.html#object.__reduce__ - def __reduce__(self) -> str | tuple[Any, ...]: ... - def __reduce_ex__(self, protocol: SupportsIndex, /) -> str | tuple[Any, ...]: ... - if sys.version_info >= (3, 11): - def __getstate__(self) -> object: ... - - def __dir__(self) -> Iterable[str]: ... - def __init_subclass__(cls) -> None: ... - @classmethod - def __subclasshook__(cls, subclass: type, /) -> bool: ... - -class staticmethod(Generic[_P, _R_co]): - @property - def __func__(self) -> Callable[_P, _R_co]: ... - @property - def __isabstractmethod__(self) -> bool: ... - def __init__(self, f: Callable[_P, _R_co], /) -> None: ... - @overload - def __get__(self, instance: None, owner: type, /) -> Callable[_P, _R_co]: ... - @overload - def __get__(self, instance: _T, owner: type[_T] | None = None, /) -> Callable[_P, _R_co]: ... - if sys.version_info >= (3, 10): - __name__: str - __qualname__: str - @property - def __wrapped__(self) -> Callable[_P, _R_co]: ... - def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _R_co: ... - -class classmethod(Generic[_T, _P, _R_co]): - @property - def __func__(self) -> Callable[Concatenate[type[_T], _P], _R_co]: ... - @property - def __isabstractmethod__(self) -> bool: ... - def __init__(self, f: Callable[Concatenate[type[_T], _P], _R_co], /) -> None: ... - @overload - def __get__(self, instance: _T, owner: type[_T] | None = None, /) -> Callable[_P, _R_co]: ... - @overload - def __get__(self, instance: None, owner: type[_T], /) -> Callable[_P, _R_co]: ... - if sys.version_info >= (3, 10): - __name__: str - __qualname__: str - @property - def __wrapped__(self) -> Callable[Concatenate[type[_T], _P], _R_co]: ... - -class type: - # object.__base__ is None. Otherwise, it would be a type. - @property - def __base__(self) -> type | None: ... - __bases__: tuple[type, ...] - @property - def __basicsize__(self) -> int: ... - @property - def __dict__(self) -> types.MappingProxyType[str, Any]: ... # type: ignore[override] - @property - def __dictoffset__(self) -> int: ... - @property - def __flags__(self) -> int: ... - @property - def __itemsize__(self) -> int: ... - __module__: str - @property - def __mro__(self) -> tuple[type, ...]: ... - __name__: str - __qualname__: str - @property - def __text_signature__(self) -> str | None: ... - @property - def __weakrefoffset__(self) -> int: ... - @overload - def __init__(self, o: object, /) -> None: ... - @overload - def __init__(self, name: str, bases: tuple[type, ...], dict: dict[str, Any], /, **kwds: Any) -> None: ... - @overload - def __new__(cls, o: object, /) -> type: ... - @overload - def __new__( - cls: type[_typeshed.Self], name: str, bases: tuple[type, ...], namespace: dict[str, Any], /, **kwds: Any - ) -> _typeshed.Self: ... - def __call__(self, *args: Any, **kwds: Any) -> Any: ... - def __subclasses__(self: _typeshed.Self) -> list[_typeshed.Self]: ... - # Note: the documentation doesn't specify what the return type is, the standard - # implementation seems to be returning a list. - def mro(self) -> list[type]: ... - def __instancecheck__(self, instance: Any, /) -> bool: ... - def __subclasscheck__(self, subclass: type, /) -> bool: ... - @classmethod - def __prepare__(metacls, name: str, bases: tuple[type, ...], /, **kwds: Any) -> MutableMapping[str, object]: ... - if sys.version_info >= (3, 10): - def __or__(self, value: Any, /) -> types.UnionType: ... - def __ror__(self, value: Any, /) -> types.UnionType: ... - if sys.version_info >= (3, 12): - __type_params__: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] - -class super: - @overload - def __init__(self, t: Any, obj: Any, /) -> None: ... - @overload - def __init__(self, t: Any, /) -> None: ... - @overload - def __init__(self) -> None: ... - -_PositiveInteger: TypeAlias = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25] -_NegativeInteger: TypeAlias = Literal[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -17, -18, -19, -20] -_LiteralInteger = _PositiveInteger | _NegativeInteger | Literal[0] # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed - -class int: - @overload - def __new__(cls, x: ConvertibleToInt = ..., /) -> Self: ... - @overload - def __new__(cls, x: str | bytes | bytearray, /, base: SupportsIndex) -> Self: ... - def as_integer_ratio(self) -> tuple[int, Literal[1]]: ... - @property - def real(self) -> int: ... - @property - def imag(self) -> Literal[0]: ... - @property - def numerator(self) -> int: ... - @property - def denominator(self) -> Literal[1]: ... - def conjugate(self) -> int: ... - def bit_length(self) -> int: ... - if sys.version_info >= (3, 10): - def bit_count(self) -> int: ... - - if sys.version_info >= (3, 11): - def to_bytes( - self, length: SupportsIndex = 1, byteorder: Literal["little", "big"] = "big", *, signed: bool = False - ) -> bytes: ... - @classmethod - def from_bytes( - cls, - bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer, - byteorder: Literal["little", "big"] = "big", - *, - signed: bool = False, - ) -> Self: ... - else: - def to_bytes(self, length: SupportsIndex, byteorder: Literal["little", "big"], *, signed: bool = False) -> bytes: ... - @classmethod - def from_bytes( - cls, - bytes: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer, - byteorder: Literal["little", "big"], - *, - signed: bool = False, - ) -> Self: ... - - if sys.version_info >= (3, 12): - def is_integer(self) -> Literal[True]: ... - - def __add__(self, value: int, /) -> int: ... - def __sub__(self, value: int, /) -> int: ... - def __mul__(self, value: int, /) -> int: ... - def __floordiv__(self, value: int, /) -> int: ... - def __truediv__(self, value: int, /) -> float: ... - def __mod__(self, value: int, /) -> int: ... - def __divmod__(self, value: int, /) -> tuple[int, int]: ... - def __radd__(self, value: int, /) -> int: ... - def __rsub__(self, value: int, /) -> int: ... - def __rmul__(self, value: int, /) -> int: ... - def __rfloordiv__(self, value: int, /) -> int: ... - def __rtruediv__(self, value: int, /) -> float: ... - def __rmod__(self, value: int, /) -> int: ... - def __rdivmod__(self, value: int, /) -> tuple[int, int]: ... - @overload - def __pow__(self, x: Literal[0], /) -> Literal[1]: ... - @overload - def __pow__(self, value: Literal[0], mod: None, /) -> Literal[1]: ... - @overload - def __pow__(self, value: _PositiveInteger, mod: None = None, /) -> int: ... - @overload - def __pow__(self, value: _NegativeInteger, mod: None = None, /) -> float: ... - # positive __value -> int; negative __value -> float - # return type must be Any as `int | float` causes too many false-positive errors - @overload - def __pow__(self, value: int, mod: None = None, /) -> Any: ... - @overload - def __pow__(self, value: int, mod: int, /) -> int: ... - def __rpow__(self, value: int, mod: int | None = None, /) -> Any: ... - def __and__(self, value: int, /) -> int: ... - def __or__(self, value: int, /) -> int: ... - def __xor__(self, value: int, /) -> int: ... - def __lshift__(self, value: int, /) -> int: ... - def __rshift__(self, value: int, /) -> int: ... - def __rand__(self, value: int, /) -> int: ... - def __ror__(self, value: int, /) -> int: ... - def __rxor__(self, value: int, /) -> int: ... - def __rlshift__(self, value: int, /) -> int: ... - def __rrshift__(self, value: int, /) -> int: ... - def __neg__(self) -> int: ... - def __pos__(self) -> int: ... - def __invert__(self) -> int: ... - def __trunc__(self) -> int: ... - def __ceil__(self) -> int: ... - def __floor__(self) -> int: ... - def __round__(self, ndigits: SupportsIndex = ..., /) -> int: ... - def __getnewargs__(self) -> tuple[int]: ... - def __eq__(self, value: object, /) -> bool: ... - def __ne__(self, value: object, /) -> bool: ... - def __lt__(self, value: int, /) -> bool: ... - def __le__(self, value: int, /) -> bool: ... - def __gt__(self, value: int, /) -> bool: ... - def __ge__(self, value: int, /) -> bool: ... - def __float__(self) -> float: ... - def __int__(self) -> int: ... - def __abs__(self) -> int: ... - def __hash__(self) -> int: ... - def __bool__(self) -> bool: ... - def __index__(self) -> int: ... - -class float: - def __new__(cls, x: ConvertibleToFloat = ..., /) -> Self: ... - def as_integer_ratio(self) -> tuple[int, int]: ... - def hex(self) -> str: ... - def is_integer(self) -> bool: ... - @classmethod - def fromhex(cls, string: str, /) -> Self: ... - @property - def real(self) -> float: ... - @property - def imag(self) -> float: ... - def conjugate(self) -> float: ... - def __add__(self, value: float, /) -> float: ... - def __sub__(self, value: float, /) -> float: ... - def __mul__(self, value: float, /) -> float: ... - def __floordiv__(self, value: float, /) -> float: ... - def __truediv__(self, value: float, /) -> float: ... - def __mod__(self, value: float, /) -> float: ... - def __divmod__(self, value: float, /) -> tuple[float, float]: ... - @overload - def __pow__(self, value: int, mod: None = None, /) -> float: ... - # positive __value -> float; negative __value -> complex - # return type must be Any as `float | complex` causes too many false-positive errors - @overload - def __pow__(self, value: float, mod: None = None, /) -> Any: ... - def __radd__(self, value: float, /) -> float: ... - def __rsub__(self, value: float, /) -> float: ... - def __rmul__(self, value: float, /) -> float: ... - def __rfloordiv__(self, value: float, /) -> float: ... - def __rtruediv__(self, value: float, /) -> float: ... - def __rmod__(self, value: float, /) -> float: ... - def __rdivmod__(self, value: float, /) -> tuple[float, float]: ... - @overload - def __rpow__(self, value: _PositiveInteger, mod: None = None, /) -> float: ... - @overload - def __rpow__(self, value: _NegativeInteger, mod: None = None, /) -> complex: ... - # Returning `complex` for the general case gives too many false-positive errors. - @overload - def __rpow__(self, value: float, mod: None = None, /) -> Any: ... - def __getnewargs__(self) -> tuple[float]: ... - def __trunc__(self) -> int: ... - def __ceil__(self) -> int: ... - def __floor__(self) -> int: ... - @overload - def __round__(self, ndigits: None = None, /) -> int: ... - @overload - def __round__(self, ndigits: SupportsIndex, /) -> float: ... - def __eq__(self, value: object, /) -> bool: ... - def __ne__(self, value: object, /) -> bool: ... - def __lt__(self, value: float, /) -> bool: ... - def __le__(self, value: float, /) -> bool: ... - def __gt__(self, value: float, /) -> bool: ... - def __ge__(self, value: float, /) -> bool: ... - def __neg__(self) -> float: ... - def __pos__(self) -> float: ... - def __int__(self) -> int: ... - def __float__(self) -> float: ... - def __abs__(self) -> float: ... - def __hash__(self) -> int: ... - def __bool__(self) -> bool: ... - -class complex: - # Python doesn't currently accept SupportsComplex for the second argument - @overload - def __new__( - cls, - real: complex | SupportsComplex | SupportsFloat | SupportsIndex = ..., - imag: complex | SupportsFloat | SupportsIndex = ..., - ) -> Self: ... - @overload - def __new__(cls, real: str | SupportsComplex | SupportsFloat | SupportsIndex | complex) -> Self: ... - @property - def real(self) -> float: ... - @property - def imag(self) -> float: ... - def conjugate(self) -> complex: ... - def __add__(self, value: complex, /) -> complex: ... - def __sub__(self, value: complex, /) -> complex: ... - def __mul__(self, value: complex, /) -> complex: ... - def __pow__(self, value: complex, mod: None = None, /) -> complex: ... - def __truediv__(self, value: complex, /) -> complex: ... - def __radd__(self, value: complex, /) -> complex: ... - def __rsub__(self, value: complex, /) -> complex: ... - def __rmul__(self, value: complex, /) -> complex: ... - def __rpow__(self, value: complex, mod: None = None, /) -> complex: ... - def __rtruediv__(self, value: complex, /) -> complex: ... - def __eq__(self, value: object, /) -> bool: ... - def __ne__(self, value: object, /) -> bool: ... - def __neg__(self) -> complex: ... - def __pos__(self) -> complex: ... - def __abs__(self) -> float: ... - def __hash__(self) -> int: ... - def __bool__(self) -> bool: ... - if sys.version_info >= (3, 11): - def __complex__(self) -> complex: ... - -class _FormatMapMapping(Protocol): - def __getitem__(self, key: str, /) -> Any: ... - -class _TranslateTable(Protocol): - def __getitem__(self, key: int, /) -> str | int | None: ... - -class str(Sequence[str]): - @overload - def __new__(cls, object: object = ...) -> Self: ... - @overload - def __new__(cls, object: ReadableBuffer, encoding: str = ..., errors: str = ...) -> Self: ... - @overload - def capitalize(self: LiteralString) -> LiteralString: ... - @overload - def capitalize(self) -> str: ... # type: ignore[misc] - @overload - def casefold(self: LiteralString) -> LiteralString: ... - @overload - def casefold(self) -> str: ... # type: ignore[misc] - @overload - def center(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: ... - @overload - def center(self, width: SupportsIndex, fillchar: str = " ", /) -> str: ... # type: ignore[misc] - def count(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ... - def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: ... - def endswith( - self, suffix: str | tuple[str, ...], start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> bool: ... - @overload - def expandtabs(self: LiteralString, tabsize: SupportsIndex = 8) -> LiteralString: ... - @overload - def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ... # type: ignore[misc] - def find(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ... - @overload - def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ... - @overload - def format(self, *args: object, **kwargs: object) -> str: ... - def format_map(self, mapping: _FormatMapMapping, /) -> str: ... - def index(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ... - def isalnum(self) -> bool: ... - def isalpha(self) -> bool: ... - def isascii(self) -> bool: ... - def isdecimal(self) -> bool: ... - def isdigit(self) -> bool: ... - def isidentifier(self) -> bool: ... - def islower(self) -> bool: ... - def isnumeric(self) -> bool: ... - def isprintable(self) -> bool: ... - def isspace(self) -> bool: ... - def istitle(self) -> bool: ... - def isupper(self) -> bool: ... - @overload - def join(self: LiteralString, iterable: Iterable[LiteralString], /) -> LiteralString: ... - @overload - def join(self, iterable: Iterable[str], /) -> str: ... # type: ignore[misc] - @overload - def ljust(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: ... - @overload - def ljust(self, width: SupportsIndex, fillchar: str = " ", /) -> str: ... # type: ignore[misc] - @overload - def lower(self: LiteralString) -> LiteralString: ... - @overload - def lower(self) -> str: ... # type: ignore[misc] - @overload - def lstrip(self: LiteralString, chars: LiteralString | None = None, /) -> LiteralString: ... - @overload - def lstrip(self, chars: str | None = None, /) -> str: ... # type: ignore[misc] - @overload - def partition(self: LiteralString, sep: LiteralString, /) -> tuple[LiteralString, LiteralString, LiteralString]: ... - @overload - def partition(self, sep: str, /) -> tuple[str, str, str]: ... # type: ignore[misc] - if sys.version_info >= (3, 13): - @overload - def replace( - self: LiteralString, old: LiteralString, new: LiteralString, /, count: SupportsIndex = -1 - ) -> LiteralString: ... - @overload - def replace(self, old: str, new: str, /, count: SupportsIndex = -1) -> str: ... # type: ignore[misc] - else: - @overload - def replace( - self: LiteralString, old: LiteralString, new: LiteralString, count: SupportsIndex = -1, / - ) -> LiteralString: ... - @overload - def replace(self, old: str, new: str, count: SupportsIndex = -1, /) -> str: ... # type: ignore[misc] - - @overload - def removeprefix(self: LiteralString, prefix: LiteralString, /) -> LiteralString: ... - @overload - def removeprefix(self, prefix: str, /) -> str: ... # type: ignore[misc] - @overload - def removesuffix(self: LiteralString, suffix: LiteralString, /) -> LiteralString: ... - @overload - def removesuffix(self, suffix: str, /) -> str: ... # type: ignore[misc] - def rfind(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ... - def rindex(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ... - @overload - def rjust(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: ... - @overload - def rjust(self, width: SupportsIndex, fillchar: str = " ", /) -> str: ... # type: ignore[misc] - @overload - def rpartition(self: LiteralString, sep: LiteralString, /) -> tuple[LiteralString, LiteralString, LiteralString]: ... - @overload - def rpartition(self, sep: str, /) -> tuple[str, str, str]: ... # type: ignore[misc] - @overload - def rsplit(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ... - @overload - def rsplit(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc] - @overload - def rstrip(self: LiteralString, chars: LiteralString | None = None, /) -> LiteralString: ... - @overload - def rstrip(self, chars: str | None = None, /) -> str: ... # type: ignore[misc] - @overload - def split(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ... - @overload - def split(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc] - @overload - def splitlines(self: LiteralString, keepends: bool = False) -> list[LiteralString]: ... - @overload - def splitlines(self, keepends: bool = False) -> list[str]: ... # type: ignore[misc] - def startswith( - self, prefix: str | tuple[str, ...], start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> bool: ... - @overload - def strip(self: LiteralString, chars: LiteralString | None = None, /) -> LiteralString: ... - @overload - def strip(self, chars: str | None = None, /) -> str: ... # type: ignore[misc] - @overload - def swapcase(self: LiteralString) -> LiteralString: ... - @overload - def swapcase(self) -> str: ... # type: ignore[misc] - @overload - def title(self: LiteralString) -> LiteralString: ... - @overload - def title(self) -> str: ... # type: ignore[misc] - def translate(self, table: _TranslateTable, /) -> str: ... - @overload - def upper(self: LiteralString) -> LiteralString: ... - @overload - def upper(self) -> str: ... # type: ignore[misc] - @overload - def zfill(self: LiteralString, width: SupportsIndex, /) -> LiteralString: ... - @overload - def zfill(self, width: SupportsIndex, /) -> str: ... # type: ignore[misc] - @staticmethod - @overload - def maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T], /) -> dict[int, _T]: ... - @staticmethod - @overload - def maketrans(x: str, y: str, /) -> dict[int, int]: ... - @staticmethod - @overload - def maketrans(x: str, y: str, z: str, /) -> dict[int, int | None]: ... - @overload - def __add__(self: LiteralString, value: LiteralString, /) -> LiteralString: ... - @overload - def __add__(self, value: str, /) -> str: ... # type: ignore[misc] - # Incompatible with Sequence.__contains__ - def __contains__(self, key: str, /) -> bool: ... # type: ignore[override] - def __eq__(self, value: object, /) -> bool: ... - def __ge__(self, value: str, /) -> bool: ... - @overload - def __getitem__(self: LiteralString, key: SupportsIndex | slice, /) -> LiteralString: ... - @overload - def __getitem__(self, key: SupportsIndex | slice, /) -> str: ... # type: ignore[misc] - def __gt__(self, value: str, /) -> bool: ... - def __hash__(self) -> int: ... - @overload - def __iter__(self: LiteralString) -> Iterator[LiteralString]: ... - @overload - def __iter__(self) -> Iterator[str]: ... # type: ignore[misc] - def __le__(self, value: str, /) -> bool: ... - def __len__(self) -> int: ... - def __lt__(self, value: str, /) -> bool: ... - @overload - def __mod__(self: LiteralString, value: LiteralString | tuple[LiteralString, ...], /) -> LiteralString: ... - @overload - def __mod__(self, value: Any, /) -> str: ... - @overload - def __mul__(self: LiteralString, value: SupportsIndex, /) -> LiteralString: ... - @overload - def __mul__(self, value: SupportsIndex, /) -> str: ... # type: ignore[misc] - def __ne__(self, value: object, /) -> bool: ... - @overload - def __rmul__(self: LiteralString, value: SupportsIndex, /) -> LiteralString: ... - @overload - def __rmul__(self, value: SupportsIndex, /) -> str: ... # type: ignore[misc] - def __getnewargs__(self) -> tuple[str]: ... - -class bytes(Sequence[int]): - @overload - def __new__(cls, o: Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer, /) -> Self: ... - @overload - def __new__(cls, string: str, /, encoding: str, errors: str = ...) -> Self: ... - @overload - def __new__(cls) -> Self: ... - def capitalize(self) -> bytes: ... - def center(self, width: SupportsIndex, fillchar: bytes = b" ", /) -> bytes: ... - def count( - self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> int: ... - def decode(self, encoding: str = "utf-8", errors: str = "strict") -> str: ... - def endswith( - self, - suffix: ReadableBuffer | tuple[ReadableBuffer, ...], - start: SupportsIndex | None = ..., - end: SupportsIndex | None = ..., - /, - ) -> bool: ... - def expandtabs(self, tabsize: SupportsIndex = 8) -> bytes: ... - def find( - self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> int: ... - def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = ...) -> str: ... - def index( - self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> int: ... - def isalnum(self) -> bool: ... - def isalpha(self) -> bool: ... - def isascii(self) -> bool: ... - def isdigit(self) -> bool: ... - def islower(self) -> bool: ... - def isspace(self) -> bool: ... - def istitle(self) -> bool: ... - def isupper(self) -> bool: ... - def join(self, iterable_of_bytes: Iterable[ReadableBuffer], /) -> bytes: ... - def ljust(self, width: SupportsIndex, fillchar: bytes | bytearray = b" ", /) -> bytes: ... - def lower(self) -> bytes: ... - def lstrip(self, bytes: ReadableBuffer | None = None, /) -> bytes: ... - def partition(self, sep: ReadableBuffer, /) -> tuple[bytes, bytes, bytes]: ... - def replace(self, old: ReadableBuffer, new: ReadableBuffer, count: SupportsIndex = -1, /) -> bytes: ... - def removeprefix(self, prefix: ReadableBuffer, /) -> bytes: ... - def removesuffix(self, suffix: ReadableBuffer, /) -> bytes: ... - def rfind( - self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> int: ... - def rindex( - self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> int: ... - def rjust(self, width: SupportsIndex, fillchar: bytes | bytearray = b" ", /) -> bytes: ... - def rpartition(self, sep: ReadableBuffer, /) -> tuple[bytes, bytes, bytes]: ... - def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]: ... - def rstrip(self, bytes: ReadableBuffer | None = None, /) -> bytes: ... - def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytes]: ... - def splitlines(self, keepends: bool = False) -> list[bytes]: ... - def startswith( - self, - prefix: ReadableBuffer | tuple[ReadableBuffer, ...], - start: SupportsIndex | None = ..., - end: SupportsIndex | None = ..., - /, - ) -> bool: ... - def strip(self, bytes: ReadableBuffer | None = None, /) -> bytes: ... - def swapcase(self) -> bytes: ... - def title(self) -> bytes: ... - def translate(self, table: ReadableBuffer | None, /, delete: bytes = b"") -> bytes: ... - def upper(self) -> bytes: ... - def zfill(self, width: SupportsIndex, /) -> bytes: ... - @classmethod - def fromhex(cls, string: str, /) -> Self: ... - @staticmethod - def maketrans(frm: ReadableBuffer, to: ReadableBuffer, /) -> bytes: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[int]: ... - def __hash__(self) -> int: ... - @overload - def __getitem__(self, key: SupportsIndex, /) -> int: ... - @overload - def __getitem__(self, key: slice, /) -> bytes: ... - def __add__(self, value: ReadableBuffer, /) -> bytes: ... - def __mul__(self, value: SupportsIndex, /) -> bytes: ... - def __rmul__(self, value: SupportsIndex, /) -> bytes: ... - def __mod__(self, value: Any, /) -> bytes: ... - # Incompatible with Sequence.__contains__ - def __contains__(self, key: SupportsIndex | ReadableBuffer, /) -> bool: ... # type: ignore[override] - def __eq__(self, value: object, /) -> bool: ... - def __ne__(self, value: object, /) -> bool: ... - def __lt__(self, value: bytes, /) -> bool: ... - def __le__(self, value: bytes, /) -> bool: ... - def __gt__(self, value: bytes, /) -> bool: ... - def __ge__(self, value: bytes, /) -> bool: ... - def __getnewargs__(self) -> tuple[bytes]: ... - if sys.version_info >= (3, 11): - def __bytes__(self) -> bytes: ... - - def __buffer__(self, flags: int, /) -> memoryview: ... - -class bytearray(MutableSequence[int]): - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, ints: Iterable[SupportsIndex] | SupportsIndex | ReadableBuffer, /) -> None: ... - @overload - def __init__(self, string: str, /, encoding: str, errors: str = ...) -> None: ... - def append(self, item: SupportsIndex, /) -> None: ... - def capitalize(self) -> bytearray: ... - def center(self, width: SupportsIndex, fillchar: bytes = b" ", /) -> bytearray: ... - def count( - self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> int: ... - def copy(self) -> bytearray: ... - def decode(self, encoding: str = "utf-8", errors: str = "strict") -> str: ... - def endswith( - self, - suffix: ReadableBuffer | tuple[ReadableBuffer, ...], - start: SupportsIndex | None = ..., - end: SupportsIndex | None = ..., - /, - ) -> bool: ... - def expandtabs(self, tabsize: SupportsIndex = 8) -> bytearray: ... - def extend(self, iterable_of_ints: Iterable[SupportsIndex], /) -> None: ... - def find( - self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> int: ... - def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = ...) -> str: ... - def index( - self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> int: ... - def insert(self, index: SupportsIndex, item: SupportsIndex, /) -> None: ... - def isalnum(self) -> bool: ... - def isalpha(self) -> bool: ... - def isascii(self) -> bool: ... - def isdigit(self) -> bool: ... - def islower(self) -> bool: ... - def isspace(self) -> bool: ... - def istitle(self) -> bool: ... - def isupper(self) -> bool: ... - def join(self, iterable_of_bytes: Iterable[ReadableBuffer], /) -> bytearray: ... - def ljust(self, width: SupportsIndex, fillchar: bytes | bytearray = b" ", /) -> bytearray: ... - def lower(self) -> bytearray: ... - def lstrip(self, bytes: ReadableBuffer | None = None, /) -> bytearray: ... - def partition(self, sep: ReadableBuffer, /) -> tuple[bytearray, bytearray, bytearray]: ... - def pop(self, index: int = -1, /) -> int: ... - def remove(self, value: int, /) -> None: ... - def removeprefix(self, prefix: ReadableBuffer, /) -> bytearray: ... - def removesuffix(self, suffix: ReadableBuffer, /) -> bytearray: ... - def replace(self, old: ReadableBuffer, new: ReadableBuffer, count: SupportsIndex = -1, /) -> bytearray: ... - def rfind( - self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> int: ... - def rindex( - self, sub: ReadableBuffer | SupportsIndex, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / - ) -> int: ... - def rjust(self, width: SupportsIndex, fillchar: bytes | bytearray = b" ", /) -> bytearray: ... - def rpartition(self, sep: ReadableBuffer, /) -> tuple[bytearray, bytearray, bytearray]: ... - def rsplit(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]: ... - def rstrip(self, bytes: ReadableBuffer | None = None, /) -> bytearray: ... - def split(self, sep: ReadableBuffer | None = None, maxsplit: SupportsIndex = -1) -> list[bytearray]: ... - def splitlines(self, keepends: bool = False) -> list[bytearray]: ... - def startswith( - self, - prefix: ReadableBuffer | tuple[ReadableBuffer, ...], - start: SupportsIndex | None = ..., - end: SupportsIndex | None = ..., - /, - ) -> bool: ... - def strip(self, bytes: ReadableBuffer | None = None, /) -> bytearray: ... - def swapcase(self) -> bytearray: ... - def title(self) -> bytearray: ... - def translate(self, table: ReadableBuffer | None, /, delete: bytes = b"") -> bytearray: ... - def upper(self) -> bytearray: ... - def zfill(self, width: SupportsIndex, /) -> bytearray: ... - @classmethod - def fromhex(cls, string: str, /) -> Self: ... - @staticmethod - def maketrans(frm: ReadableBuffer, to: ReadableBuffer, /) -> bytes: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[int]: ... - __hash__: ClassVar[None] # type: ignore[assignment] - @overload - def __getitem__(self, key: SupportsIndex, /) -> int: ... - @overload - def __getitem__(self, key: slice, /) -> bytearray: ... - @overload - def __setitem__(self, key: SupportsIndex, value: SupportsIndex, /) -> None: ... - @overload - def __setitem__(self, key: slice, value: Iterable[SupportsIndex] | bytes, /) -> None: ... - def __delitem__(self, key: SupportsIndex | slice, /) -> None: ... - def __add__(self, value: ReadableBuffer, /) -> bytearray: ... - # The superclass wants us to accept Iterable[int], but that fails at runtime. - def __iadd__(self, value: ReadableBuffer, /) -> Self: ... # type: ignore[override] - def __mul__(self, value: SupportsIndex, /) -> bytearray: ... - def __rmul__(self, value: SupportsIndex, /) -> bytearray: ... - def __imul__(self, value: SupportsIndex, /) -> Self: ... - def __mod__(self, value: Any, /) -> bytes: ... - # Incompatible with Sequence.__contains__ - def __contains__(self, key: SupportsIndex | ReadableBuffer, /) -> bool: ... # type: ignore[override] - def __eq__(self, value: object, /) -> bool: ... - def __ne__(self, value: object, /) -> bool: ... - def __lt__(self, value: ReadableBuffer, /) -> bool: ... - def __le__(self, value: ReadableBuffer, /) -> bool: ... - def __gt__(self, value: ReadableBuffer, /) -> bool: ... - def __ge__(self, value: ReadableBuffer, /) -> bool: ... - def __alloc__(self) -> int: ... - def __buffer__(self, flags: int, /) -> memoryview: ... - def __release_buffer__(self, buffer: memoryview, /) -> None: ... - -_IntegerFormats: TypeAlias = Literal[ - "b", "B", "@b", "@B", "h", "H", "@h", "@H", "i", "I", "@i", "@I", "l", "L", "@l", "@L", "q", "Q", "@q", "@Q", "P", "@P" -] - -@final -class memoryview(Sequence[_I]): - @property - def format(self) -> str: ... - @property - def itemsize(self) -> int: ... - @property - def shape(self) -> tuple[int, ...] | None: ... - @property - def strides(self) -> tuple[int, ...] | None: ... - @property - def suboffsets(self) -> tuple[int, ...] | None: ... - @property - def readonly(self) -> bool: ... - @property - def ndim(self) -> int: ... - @property - def obj(self) -> ReadableBuffer: ... - @property - def c_contiguous(self) -> bool: ... - @property - def f_contiguous(self) -> bool: ... - @property - def contiguous(self) -> bool: ... - @property - def nbytes(self) -> int: ... - def __new__(cls, obj: ReadableBuffer) -> Self: ... - def __enter__(self) -> Self: ... - def __exit__( - self, - exc_type: type[BaseException] | None, # noqa: PYI036 # This is the module declaring BaseException - exc_val: BaseException | None, - exc_tb: TracebackType | None, - /, - ) -> None: ... - @overload - def cast(self, format: Literal["c", "@c"], shape: list[int] | tuple[int, ...] = ...) -> memoryview[bytes]: ... - @overload - def cast(self, format: Literal["f", "@f", "d", "@d"], shape: list[int] | tuple[int, ...] = ...) -> memoryview[float]: ... - @overload - def cast(self, format: Literal["?"], shape: list[int] | tuple[int, ...] = ...) -> memoryview[bool]: ... - @overload - def cast(self, format: _IntegerFormats, shape: list[int] | tuple[int, ...] = ...) -> memoryview: ... - @overload - def __getitem__(self, key: SupportsIndex | tuple[SupportsIndex, ...], /) -> _I: ... - @overload - def __getitem__(self, key: slice, /) -> memoryview[_I]: ... - def __contains__(self, x: object, /) -> bool: ... - def __iter__(self) -> Iterator[_I]: ... - def __len__(self) -> int: ... - def __eq__(self, value: object, /) -> bool: ... - def __hash__(self) -> int: ... - @overload - def __setitem__(self, key: slice, value: ReadableBuffer, /) -> None: ... - @overload - def __setitem__(self, key: SupportsIndex | tuple[SupportsIndex, ...], value: _I, /) -> None: ... - if sys.version_info >= (3, 10): - def tobytes(self, order: Literal["C", "F", "A"] | None = "C") -> bytes: ... - else: - def tobytes(self, order: Literal["C", "F", "A"] | None = None) -> bytes: ... - - def tolist(self) -> list[int]: ... - def toreadonly(self) -> memoryview: ... - def release(self) -> None: ... - def hex(self, sep: str | bytes = ..., bytes_per_sep: SupportsIndex = ...) -> str: ... - def __buffer__(self, flags: int, /) -> memoryview: ... - def __release_buffer__(self, buffer: memoryview, /) -> None: ... - - # These are inherited from the Sequence ABC, but don't actually exist on memoryview. - # See https://github.com/python/cpython/issues/125420 - index: ClassVar[None] # type: ignore[assignment] - count: ClassVar[None] # type: ignore[assignment] - -@final -class bool(int): - def __new__(cls, o: object = ..., /) -> Self: ... - # The following overloads could be represented more elegantly with a TypeVar("_B", bool, int), - # however mypy has a bug regarding TypeVar constraints (https://github.com/python/mypy/issues/11880). - @overload - def __and__(self, value: bool, /) -> bool: ... - @overload - def __and__(self, value: int, /) -> int: ... - @overload - def __or__(self, value: bool, /) -> bool: ... - @overload - def __or__(self, value: int, /) -> int: ... - @overload - def __xor__(self, value: bool, /) -> bool: ... - @overload - def __xor__(self, value: int, /) -> int: ... - @overload - def __rand__(self, value: bool, /) -> bool: ... - @overload - def __rand__(self, value: int, /) -> int: ... - @overload - def __ror__(self, value: bool, /) -> bool: ... - @overload - def __ror__(self, value: int, /) -> int: ... - @overload - def __rxor__(self, value: bool, /) -> bool: ... - @overload - def __rxor__(self, value: int, /) -> int: ... - def __getnewargs__(self) -> tuple[int]: ... - @deprecated("Will throw an error in Python 3.14. Use `not` for logical negation of bools instead.") - def __invert__(self) -> int: ... - -@final -class slice(Generic[_StartT_co, _StopT_co, _StepT_co]): - @property - def start(self) -> _StartT_co: ... - @property - def step(self) -> _StepT_co: ... - @property - def stop(self) -> _StopT_co: ... - # Note: __new__ overloads map `None` to `Any`, since users expect slice(x, None) - # to be compatible with slice(None, x). - # generic slice -------------------------------------------------------------------- - @overload - def __new__(cls, start: None, stop: None = None, step: None = None, /) -> slice[Any, Any, Any]: ... - # unary overloads ------------------------------------------------------------------ - @overload - def __new__(cls, stop: _T2, /) -> slice[Any, _T2, Any]: ... - # binary overloads ----------------------------------------------------------------- - @overload - def __new__(cls, start: _T1, stop: None, step: None = None, /) -> slice[_T1, Any, Any]: ... - @overload - def __new__(cls, start: None, stop: _T2, step: None = None, /) -> slice[Any, _T2, Any]: ... - @overload - def __new__(cls, start: _T1, stop: _T2, step: None = None, /) -> slice[_T1, _T2, Any]: ... - # ternary overloads ---------------------------------------------------------------- - @overload - def __new__(cls, start: None, stop: None, step: _T3, /) -> slice[Any, Any, _T3]: ... - @overload - def __new__(cls, start: _T1, stop: None, step: _T3, /) -> slice[_T1, Any, _T3]: ... - @overload - def __new__(cls, start: None, stop: _T2, step: _T3, /) -> slice[Any, _T2, _T3]: ... - @overload - def __new__(cls, start: _T1, stop: _T2, step: _T3, /) -> slice[_T1, _T2, _T3]: ... - def __eq__(self, value: object, /) -> bool: ... - if sys.version_info >= (3, 12): - def __hash__(self) -> int: ... - else: - __hash__: ClassVar[None] # type: ignore[assignment] - - def indices(self, len: SupportsIndex, /) -> tuple[int, int, int]: ... - -class tuple(Sequence[_T_co]): - def __new__(cls, iterable: Iterable[_T_co] = ..., /) -> Self: ... - def __len__(self) -> int: ... - def __contains__(self, key: object, /) -> bool: ... - @overload - def __getitem__(self, key: SupportsIndex, /) -> _T_co: ... - @overload - def __getitem__(self, key: slice, /) -> tuple[_T_co, ...]: ... - def __iter__(self) -> Iterator[_T_co]: ... - def __lt__(self, value: tuple[_T_co, ...], /) -> bool: ... - 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 - def __add__(self, value: tuple[_T, ...], /) -> tuple[_T_co | _T, ...]: ... - def __mul__(self, value: SupportsIndex, /) -> tuple[_T_co, ...]: ... - def __rmul__(self, value: SupportsIndex, /) -> tuple[_T_co, ...]: ... - def count(self, value: Any, /) -> int: ... - def index(self, value: Any, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize, /) -> int: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -# Doesn't exist at runtime, but deleting this breaks mypy and pyright. See: -# https://github.com/python/typeshed/issues/7580 -# https://github.com/python/mypy/issues/8240 -@final -@type_check_only -class function: - # Make sure this class definition stays roughly in line with `types.FunctionType` - @property - def __closure__(self) -> tuple[CellType, ...] | None: ... - __code__: CodeType - __defaults__: tuple[Any, ...] | None - __dict__: dict[str, Any] - @property - def __globals__(self) -> dict[str, Any]: ... - __name__: str - __qualname__: str - __annotations__: dict[str, Any] - __kwdefaults__: dict[str, Any] - if sys.version_info >= (3, 10): - @property - def __builtins__(self) -> dict[str, Any]: ... - if sys.version_info >= (3, 12): - __type_params__: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] - - __module__: str - # mypy uses `builtins.function.__get__` to represent methods, properties, and getset_descriptors so we type the return as Any. - def __get__(self, instance: object, owner: type | None = None, /) -> Any: ... - -class list(MutableSequence[_T]): - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, iterable: Iterable[_T], /) -> None: ... - def copy(self) -> list[_T]: ... - def append(self, object: _T, /) -> None: ... - def extend(self, iterable: Iterable[_T], /) -> None: ... - def pop(self, index: SupportsIndex = -1, /) -> _T: ... - # Signature of `list.index` should be kept in line with `collections.UserList.index()` - # and multiprocessing.managers.ListProxy.index() - def index(self, value: _T, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize, /) -> int: ... - def count(self, value: _T, /) -> int: ... - def insert(self, index: SupportsIndex, object: _T, /) -> None: ... - def remove(self, value: _T, /) -> None: ... - # Signature of `list.sort` should be kept inline with `collections.UserList.sort()` - # and multiprocessing.managers.ListProxy.sort() - # - # Use list[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison] - # to work around invariance - @overload - def sort(self: list[SupportsRichComparisonT], *, key: None = None, reverse: bool = False) -> None: ... - @overload - def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> None: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[_T]: ... - __hash__: ClassVar[None] # type: ignore[assignment] - @overload - def __getitem__(self, i: SupportsIndex, /) -> _T: ... - @overload - def __getitem__(self, s: slice, /) -> list[_T]: ... - @overload - def __setitem__(self, key: SupportsIndex, value: _T, /) -> None: ... - @overload - def __setitem__(self, key: slice, value: Iterable[_T], /) -> None: ... - def __delitem__(self, key: SupportsIndex | slice, /) -> None: ... - # Overloading looks unnecessary, but is needed to work around complex mypy problems - @overload - def __add__(self, value: list[_T], /) -> list[_T]: ... - @overload - def __add__(self, value: list[_S], /) -> list[_S | _T]: ... - def __iadd__(self, value: Iterable[_T], /) -> Self: ... # type: ignore[misc] - def __mul__(self, value: SupportsIndex, /) -> list[_T]: ... - def __rmul__(self, value: SupportsIndex, /) -> list[_T]: ... - def __imul__(self, value: SupportsIndex, /) -> Self: ... - def __contains__(self, key: object, /) -> bool: ... - def __reversed__(self) -> Iterator[_T]: ... - def __gt__(self, value: list[_T], /) -> bool: ... - 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: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class dict(MutableMapping[_KT, _VT]): - # __init__ should be kept roughly in line with `collections.UserDict.__init__`, which has similar semantics - # Also multiprocessing.managers.SyncManager.dict() - @overload - def __init__(self) -> None: ... - @overload - def __init__(self: dict[str, _VT], **kwargs: _VT) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 - @overload - def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ... - @overload - def __init__( - self: dict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 - map: SupportsKeysAndGetItem[str, _VT], - /, - **kwargs: _VT, - ) -> None: ... - @overload - def __init__(self, iterable: Iterable[tuple[_KT, _VT]], /) -> None: ... - @overload - def __init__( - self: dict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 - iterable: Iterable[tuple[str, _VT]], - /, - **kwargs: _VT, - ) -> None: ... - # Next two overloads are for dict(string.split(sep) for string in iterable) - # Cannot be Iterable[Sequence[_T]] or otherwise dict(["foo", "bar", "baz"]) is not an error - @overload - def __init__(self: dict[str, str], iterable: Iterable[list[str]], /) -> None: ... - @overload - def __init__(self: dict[bytes, bytes], iterable: Iterable[list[bytes]], /) -> None: ... - def __new__(cls, *args: Any, **kwargs: Any) -> Self: ... - def copy(self) -> dict[_KT, _VT]: ... - def keys(self) -> dict_keys[_KT, _VT]: ... - def values(self) -> dict_values[_KT, _VT]: ... - def items(self) -> dict_items[_KT, _VT]: ... - # Signature of `dict.fromkeys` should be kept identical to - # `fromkeys` methods of `OrderedDict`/`ChainMap`/`UserDict` in `collections` - # TODO: the true signature of `dict.fromkeys` is not expressible in the current type system. - # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. - @classmethod - @overload - def fromkeys(cls, iterable: Iterable[_T], value: None = None, /) -> dict[_T, Any | None]: ... - @classmethod - @overload - def fromkeys(cls, iterable: Iterable[_T], value: _S, /) -> dict[_T, _S]: ... - # Positional-only in dict, but not in MutableMapping - @overload # type: ignore[override] - def get(self, key: _KT, default: None = None, /) -> _VT | None: ... - @overload - def get(self, key: _KT, default: _VT, /) -> _VT: ... - @overload - def get(self, key: _KT, default: _T, /) -> _VT | _T: ... - @overload - def pop(self, key: _KT, /) -> _VT: ... - @overload - def pop(self, key: _KT, default: _VT, /) -> _VT: ... - @overload - def pop(self, key: _KT, default: _T, /) -> _VT | _T: ... - def __len__(self) -> int: ... - def __getitem__(self, key: _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: ... - def __reversed__(self) -> Iterator[_KT]: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - @overload - def __or__(self, value: dict[_KT, _VT], /) -> dict[_KT, _VT]: ... - @overload - def __or__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ... - @overload - def __ror__(self, value: dict[_KT, _VT], /) -> dict[_KT, _VT]: ... - @overload - def __ror__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ... - # dict.__ior__ should be kept roughly in line with MutableMapping.update() - @overload # type: ignore[misc] - def __ior__(self, value: SupportsKeysAndGetItem[_KT, _VT], /) -> Self: ... - @overload - def __ior__(self, value: Iterable[tuple[_KT, _VT]], /) -> Self: ... - -class set(MutableSet[_T]): - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, iterable: Iterable[_T], /) -> None: ... - def add(self, element: _T, /) -> None: ... - def copy(self) -> set[_T]: ... - def difference(self, *s: Iterable[Any]) -> set[_T]: ... - def difference_update(self, *s: Iterable[Any]) -> None: ... - def discard(self, element: _T, /) -> None: ... - def intersection(self, *s: Iterable[Any]) -> set[_T]: ... - def intersection_update(self, *s: Iterable[Any]) -> None: ... - def isdisjoint(self, s: Iterable[Any], /) -> bool: ... - def issubset(self, s: Iterable[Any], /) -> bool: ... - def issuperset(self, s: Iterable[Any], /) -> bool: ... - def remove(self, element: _T, /) -> None: ... - def symmetric_difference(self, s: Iterable[_T], /) -> set[_T]: ... - def symmetric_difference_update(self, s: Iterable[_T], /) -> None: ... - def union(self, *s: Iterable[_S]) -> set[_T | _S]: ... - def update(self, *s: Iterable[_T]) -> None: ... - def __len__(self) -> int: ... - def __contains__(self, o: object, /) -> bool: ... - def __iter__(self) -> Iterator[_T]: ... - def __and__(self, value: AbstractSet[object], /) -> set[_T]: ... - def __iand__(self, value: AbstractSet[object], /) -> Self: ... - def __or__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... - def __ior__(self, value: AbstractSet[_T], /) -> Self: ... # type: ignore[override,misc] - def __sub__(self, value: AbstractSet[_T | None], /) -> set[_T]: ... - def __isub__(self, value: AbstractSet[object], /) -> Self: ... - def __xor__(self, value: AbstractSet[_S], /) -> set[_T | _S]: ... - def __ixor__(self, value: AbstractSet[_T], /) -> Self: ... # type: ignore[override,misc] - def __le__(self, value: AbstractSet[object], /) -> bool: ... - 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] - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class frozenset(AbstractSet[_T_co]): - @overload - def __new__(cls) -> Self: ... - @overload - def __new__(cls, iterable: Iterable[_T_co], /) -> Self: ... - def copy(self) -> frozenset[_T_co]: ... - def difference(self, *s: Iterable[object]) -> frozenset[_T_co]: ... - def intersection(self, *s: Iterable[object]) -> frozenset[_T_co]: ... - def isdisjoint(self, s: Iterable[_T_co], /) -> bool: ... - def issubset(self, s: Iterable[object], /) -> bool: ... - def issuperset(self, s: Iterable[object], /) -> bool: ... - def symmetric_difference(self, s: Iterable[_T_co], /) -> frozenset[_T_co]: ... - def union(self, *s: Iterable[_S]) -> frozenset[_T_co | _S]: ... - def __len__(self) -> int: ... - def __contains__(self, o: object, /) -> bool: ... - def __iter__(self) -> Iterator[_T_co]: ... - def __and__(self, value: AbstractSet[_T_co], /) -> frozenset[_T_co]: ... - def __or__(self, value: AbstractSet[_S], /) -> frozenset[_T_co | _S]: ... - def __sub__(self, value: AbstractSet[_T_co], /) -> frozenset[_T_co]: ... - def __xor__(self, value: AbstractSet[_S], /) -> frozenset[_T_co | _S]: ... - def __le__(self, value: AbstractSet[object], /) -> bool: ... - 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: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class enumerate(Generic[_T]): - def __new__(cls, iterable: Iterable[_T], start: int = 0) -> Self: ... - def __iter__(self) -> Self: ... - def __next__(self) -> tuple[int, _T]: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -@final -class range(Sequence[int]): - @property - def start(self) -> int: ... - @property - def stop(self) -> int: ... - @property - def step(self) -> int: ... - @overload - def __new__(cls, stop: SupportsIndex, /) -> Self: ... - @overload - def __new__(cls, start: SupportsIndex, stop: SupportsIndex, step: SupportsIndex = ..., /) -> Self: ... - 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 - def __getitem__(self, key: SupportsIndex, /) -> int: ... - @overload - def __getitem__(self, key: slice, /) -> range: ... - def __reversed__(self) -> Iterator[int]: ... - -class property: - fget: Callable[[Any], Any] | None - fset: Callable[[Any, Any], None] | None - fdel: Callable[[Any], None] | None - __isabstractmethod__: bool - if sys.version_info >= (3, 13): - __name__: str - - def __init__( - self, - fget: Callable[[Any], Any] | None = ..., - fset: Callable[[Any, Any], None] | None = ..., - fdel: Callable[[Any], None] | None = ..., - doc: str | None = ..., - ) -> None: ... - def getter(self, fget: Callable[[Any], Any], /) -> property: ... - def setter(self, fset: Callable[[Any, Any], None], /) -> property: ... - def deleter(self, fdel: Callable[[Any], None], /) -> property: ... - @overload - def __get__(self, instance: None, owner: type, /) -> Self: ... - @overload - def __get__(self, instance: Any, owner: type | None = None, /) -> Any: ... - def __set__(self, instance: Any, value: Any, /) -> None: ... - def __delete__(self, instance: Any, /) -> None: ... - -@final -class _NotImplementedType(Any): - __call__: None - -NotImplemented: _NotImplementedType - -def abs(x: SupportsAbs[_T], /) -> _T: ... -def all(iterable: Iterable[object], /) -> bool: ... -def any(iterable: Iterable[object], /) -> bool: ... -def ascii(obj: object, /) -> str: ... -def bin(number: int | SupportsIndex, /) -> str: ... -def breakpoint(*args: Any, **kws: Any) -> None: ... -def callable(obj: object, /) -> TypeIs[Callable[..., object]]: ... -def chr(i: int | SupportsIndex, /) -> str: ... - -# We define this here instead of using os.PathLike to avoid import cycle issues. -# See https://github.com/python/typeshed/pull/991#issuecomment-288160993 -class _PathLike(Protocol[AnyStr_co]): - def __fspath__(self) -> AnyStr_co: ... - -if sys.version_info >= (3, 10): - def aiter(async_iterable: SupportsAiter[_SupportsAnextT_co], /) -> _SupportsAnextT_co: ... - - class _SupportsSynchronousAnext(Protocol[_AwaitableT_co]): - def __anext__(self) -> _AwaitableT_co: ... - - @overload - # `anext` is not, in fact, an async function. When default is not provided - # `anext` is just a passthrough for `obj.__anext__` - # See discussion in #7491 and pure-Python implementation of `anext` at https://github.com/python/cpython/blob/ea786a882b9ed4261eafabad6011bc7ef3b5bf94/Lib/test/test_asyncgen.py#L52-L80 - def anext(i: _SupportsSynchronousAnext[_AwaitableT], /) -> _AwaitableT: ... - @overload - async def anext(i: SupportsAnext[_T], default: _VT, /) -> _T | _VT: ... - -# compile() returns a CodeType, unless the flags argument includes PyCF_ONLY_AST (=1024), -# in which case it returns ast.AST. We have overloads for flag 0 (the default) and for -# explicitly passing PyCF_ONLY_AST. We fall back to Any for other values of flags. -@overload -def compile( - source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, - filename: str | ReadableBuffer | _PathLike[Any], - mode: str, - flags: Literal[0], - dont_inherit: bool = False, - optimize: int = -1, - *, - _feature_version: int = -1, -) -> CodeType: ... -@overload -def compile( - source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, - filename: str | ReadableBuffer | _PathLike[Any], - mode: str, - *, - dont_inherit: bool = False, - optimize: int = -1, - _feature_version: int = -1, -) -> CodeType: ... -@overload -def compile( - source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, - filename: str | ReadableBuffer | _PathLike[Any], - mode: str, - flags: Literal[1024], - dont_inherit: bool = False, - optimize: int = -1, - *, - _feature_version: int = -1, -) -> _ast.AST: ... -@overload -def compile( - source: str | ReadableBuffer | _ast.Module | _ast.Expression | _ast.Interactive, - filename: str | ReadableBuffer | _PathLike[Any], - mode: str, - flags: int, - dont_inherit: bool = False, - optimize: int = -1, - *, - _feature_version: int = -1, -) -> Any: ... - -copyright: _sitebuiltins._Printer -credits: _sitebuiltins._Printer - -def delattr(obj: object, name: str, /) -> None: ... -def dir(o: object = ..., /) -> list[str]: ... -@overload -def divmod(x: SupportsDivMod[_T_contra, _T_co], y: _T_contra, /) -> _T_co: ... -@overload -def divmod(x: _T_contra, y: SupportsRDivMod[_T_contra, _T_co], /) -> _T_co: ... - -# The `globals` argument to `eval` has to be `dict[str, Any]` rather than `dict[str, object]` due to invariance. -# (The `globals` argument has to be a "real dict", rather than any old mapping, unlike the `locals` argument.) -if sys.version_info >= (3, 13): - def eval( - source: str | ReadableBuffer | CodeType, - /, - globals: dict[str, Any] | None = None, - locals: Mapping[str, object] | None = None, - ) -> Any: ... - -else: - def eval( - source: str | ReadableBuffer | CodeType, - globals: dict[str, Any] | None = None, - locals: Mapping[str, object] | None = None, - /, - ) -> Any: ... - -# Comment above regarding `eval` applies to `exec` as well -if sys.version_info >= (3, 13): - def exec( - source: str | ReadableBuffer | CodeType, - /, - globals: dict[str, Any] | None = None, - locals: Mapping[str, object] | None = None, - *, - closure: tuple[CellType, ...] | None = None, - ) -> None: ... - -elif sys.version_info >= (3, 11): - def exec( - source: str | ReadableBuffer | CodeType, - globals: dict[str, Any] | None = None, - locals: Mapping[str, object] | None = None, - /, - *, - closure: tuple[CellType, ...] | None = None, - ) -> None: ... - -else: - def exec( - source: str | ReadableBuffer | CodeType, - globals: dict[str, Any] | None = None, - locals: Mapping[str, object] | None = None, - /, - ) -> None: ... - -exit: _sitebuiltins.Quitter - -class filter(Generic[_T]): - @overload - def __new__(cls, function: None, iterable: Iterable[_T | None], /) -> Self: ... - @overload - def __new__(cls, function: Callable[[_S], TypeGuard[_T]], iterable: Iterable[_S], /) -> Self: ... - @overload - def __new__(cls, function: Callable[[_S], TypeIs[_T]], iterable: Iterable[_S], /) -> Self: ... - @overload - def __new__(cls, function: Callable[[_T], Any], iterable: Iterable[_T], /) -> Self: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T: ... - -def format(value: object, format_spec: str = "", /) -> str: ... -@overload -def getattr(o: object, name: str, /) -> Any: ... - -# While technically covered by the last overload, spelling out the types for None, bool -# and basic containers help mypy out in some tricky situations involving type context -# (aka bidirectional inference) -@overload -def getattr(o: object, name: str, default: None, /) -> Any | None: ... -@overload -def getattr(o: object, name: str, default: bool, /) -> Any | bool: ... -@overload -def getattr(o: object, name: str, default: list[Any], /) -> Any | list[Any]: ... -@overload -def getattr(o: object, name: str, default: dict[Any, Any], /) -> Any | dict[Any, Any]: ... -@overload -def getattr(o: object, name: str, default: _T, /) -> Any | _T: ... -def globals() -> dict[str, Any]: ... -def hasattr(obj: object, name: str, /) -> bool: ... -def hash(obj: object, /) -> int: ... - -help: _sitebuiltins._Helper - -def hex(number: int | SupportsIndex, /) -> str: ... -def id(obj: object, /) -> int: ... -def input(prompt: object = "", /) -> str: ... - -class _GetItemIterable(Protocol[_T_co]): - def __getitem__(self, i: int, /) -> _T_co: ... - -@overload -def iter(object: SupportsIter[_SupportsNextT_co], /) -> _SupportsNextT_co: ... -@overload -def iter(object: _GetItemIterable[_T], /) -> Iterator[_T]: ... -@overload -def iter(object: Callable[[], _T | None], sentinel: None, /) -> Iterator[_T]: ... -@overload -def iter(object: Callable[[], _T], sentinel: object, /) -> Iterator[_T]: ... - -# Keep this alias in sync with unittest.case._ClassInfo -if sys.version_info >= (3, 10): - _ClassInfo: TypeAlias = type | types.UnionType | tuple[_ClassInfo, ...] -else: - _ClassInfo: TypeAlias = type | tuple[_ClassInfo, ...] - -def isinstance(obj: object, class_or_tuple: _ClassInfo, /) -> bool: ... -def issubclass(cls: type, class_or_tuple: _ClassInfo, /) -> bool: ... -def len(obj: Sized, /) -> int: ... - -license: _sitebuiltins._Printer - -def locals() -> dict[str, Any]: ... - -class map(Generic[_S]): - @overload - def __new__(cls, func: Callable[[_T1], _S], iterable: Iterable[_T1], /) -> Self: ... - @overload - def __new__(cls, func: Callable[[_T1, _T2], _S], iterable: Iterable[_T1], iter2: Iterable[_T2], /) -> Self: ... - @overload - def __new__( - cls, func: Callable[[_T1, _T2, _T3], _S], iterable: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], / - ) -> Self: ... - @overload - def __new__( - cls, - func: Callable[[_T1, _T2, _T3, _T4], _S], - iterable: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - /, - ) -> Self: ... - @overload - def __new__( - cls, - func: Callable[[_T1, _T2, _T3, _T4, _T5], _S], - iterable: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5], - /, - ) -> Self: ... - @overload - def __new__( - cls, - func: Callable[..., _S], - iterable: Iterable[Any], - iter2: Iterable[Any], - iter3: Iterable[Any], - iter4: Iterable[Any], - iter5: Iterable[Any], - iter6: Iterable[Any], - /, - *iterables: Iterable[Any], - ) -> Self: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _S: ... - -@overload -def max( - arg1: SupportsRichComparisonT, arg2: SupportsRichComparisonT, /, *_args: SupportsRichComparisonT, key: None = None -) -> SupportsRichComparisonT: ... -@overload -def max(arg1: _T, arg2: _T, /, *_args: _T, key: Callable[[_T], SupportsRichComparison]) -> _T: ... -@overload -def max(iterable: Iterable[SupportsRichComparisonT], /, *, key: None = None) -> SupportsRichComparisonT: ... -@overload -def max(iterable: Iterable[_T], /, *, key: Callable[[_T], SupportsRichComparison]) -> _T: ... -@overload -def max(iterable: Iterable[SupportsRichComparisonT], /, *, key: None = None, default: _T) -> SupportsRichComparisonT | _T: ... -@overload -def max(iterable: Iterable[_T1], /, *, key: Callable[[_T1], SupportsRichComparison], default: _T2) -> _T1 | _T2: ... -@overload -def min( - arg1: SupportsRichComparisonT, arg2: SupportsRichComparisonT, /, *_args: SupportsRichComparisonT, key: None = None -) -> SupportsRichComparisonT: ... -@overload -def min(arg1: _T, arg2: _T, /, *_args: _T, key: Callable[[_T], SupportsRichComparison]) -> _T: ... -@overload -def min(iterable: Iterable[SupportsRichComparisonT], /, *, key: None = None) -> SupportsRichComparisonT: ... -@overload -def min(iterable: Iterable[_T], /, *, key: Callable[[_T], SupportsRichComparison]) -> _T: ... -@overload -def min(iterable: Iterable[SupportsRichComparisonT], /, *, key: None = None, default: _T) -> SupportsRichComparisonT | _T: ... -@overload -def min(iterable: Iterable[_T1], /, *, key: Callable[[_T1], SupportsRichComparison], default: _T2) -> _T1 | _T2: ... -@overload -def next(i: SupportsNext[_T], /) -> _T: ... -@overload -def next(i: SupportsNext[_T], default: _VT, /) -> _T | _VT: ... -def oct(number: int | SupportsIndex, /) -> str: ... - -_Opener: TypeAlias = Callable[[str, int], int] - -# Text mode: always returns a TextIOWrapper -@overload -def open( - file: FileDescriptorOrPath, - mode: OpenTextMode = "r", - buffering: int = -1, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - closefd: bool = True, - opener: _Opener | None = None, -) -> TextIOWrapper: ... - -# Unbuffered binary mode: returns a FileIO -@overload -def open( - file: FileDescriptorOrPath, - mode: OpenBinaryMode, - buffering: Literal[0], - encoding: None = None, - errors: None = None, - newline: None = None, - closefd: bool = True, - opener: _Opener | None = None, -) -> FileIO: ... - -# Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter -@overload -def open( - file: FileDescriptorOrPath, - mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - closefd: bool = True, - opener: _Opener | None = None, -) -> BufferedRandom: ... -@overload -def open( - file: FileDescriptorOrPath, - mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - closefd: bool = True, - opener: _Opener | None = None, -) -> BufferedWriter: ... -@overload -def open( - file: FileDescriptorOrPath, - mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - closefd: bool = True, - opener: _Opener | None = None, -) -> BufferedReader: ... - -# Buffering cannot be determined: fall back to BinaryIO -@overload -def open( - file: FileDescriptorOrPath, - mode: OpenBinaryMode, - buffering: int = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - closefd: bool = True, - opener: _Opener | None = None, -) -> BinaryIO: ... - -# Fallback if mode is not specified -@overload -def open( - file: FileDescriptorOrPath, - mode: str, - buffering: int = -1, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - closefd: bool = True, - opener: _Opener | None = None, -) -> IO[Any]: ... -def ord(c: str | bytes | bytearray, /) -> int: ... - -class _SupportsWriteAndFlush(SupportsWrite[_T_contra], SupportsFlush, Protocol[_T_contra]): ... - -@overload -def print( - *values: object, - sep: str | None = " ", - end: str | None = "\n", - file: SupportsWrite[str] | None = None, - flush: Literal[False] = False, -) -> None: ... -@overload -def print( - *values: object, sep: str | None = " ", end: str | None = "\n", file: _SupportsWriteAndFlush[str] | None = None, flush: bool -) -> None: ... - -_E_contra = TypeVar("_E_contra", contravariant=True) -_M_contra = TypeVar("_M_contra", contravariant=True) - -class _SupportsPow2(Protocol[_E_contra, _T_co]): - def __pow__(self, other: _E_contra, /) -> _T_co: ... - -class _SupportsPow3NoneOnly(Protocol[_E_contra, _T_co]): - def __pow__(self, other: _E_contra, modulo: None = None, /) -> _T_co: ... - -class _SupportsPow3(Protocol[_E_contra, _M_contra, _T_co]): - def __pow__(self, other: _E_contra, modulo: _M_contra, /) -> _T_co: ... - -_SupportsSomeKindOfPow = ( # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed - _SupportsPow2[Any, Any] | _SupportsPow3NoneOnly[Any, Any] | _SupportsPow3[Any, Any, Any] -) - -# TODO: `pow(int, int, Literal[0])` fails at runtime, -# but adding a `NoReturn` overload isn't a good solution for expressing that (see #8566). -@overload -def pow(base: int, exp: int, mod: int) -> int: ... -@overload -def pow(base: int, exp: Literal[0], mod: None = None) -> Literal[1]: ... -@overload -def pow(base: int, exp: _PositiveInteger, mod: None = None) -> int: ... -@overload -def pow(base: int, exp: _NegativeInteger, mod: None = None) -> float: ... - -# int base & positive-int exp -> int; int base & negative-int exp -> float -# return type must be Any as `int | float` causes too many false-positive errors -@overload -def pow(base: int, exp: int, mod: None = None) -> Any: ... -@overload -def pow(base: _PositiveInteger, exp: float, mod: None = None) -> float: ... -@overload -def pow(base: _NegativeInteger, exp: float, mod: None = None) -> complex: ... -@overload -def pow(base: float, exp: int, mod: None = None) -> float: ... - -# float base & float exp could return float or complex -# return type must be Any (same as complex base, complex exp), -# as `float | complex` causes too many false-positive errors -@overload -def pow(base: float, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> Any: ... -@overload -def pow(base: complex, exp: complex | _SupportsSomeKindOfPow, mod: None = None) -> complex: ... -@overload -def pow(base: _SupportsPow2[_E_contra, _T_co], exp: _E_contra, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap] -@overload -def pow(base: _SupportsPow3NoneOnly[_E_contra, _T_co], exp: _E_contra, mod: None = None) -> _T_co: ... # type: ignore[overload-overlap] -@overload -def pow(base: _SupportsPow3[_E_contra, _M_contra, _T_co], exp: _E_contra, mod: _M_contra) -> _T_co: ... -@overload -def pow(base: _SupportsSomeKindOfPow, exp: float, mod: None = None) -> Any: ... -@overload -def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex: ... - -quit: _sitebuiltins.Quitter - -class reversed(Generic[_T]): - @overload - def __new__(cls, sequence: Reversible[_T], /) -> Iterator[_T]: ... # type: ignore[misc] - @overload - def __new__(cls, sequence: SupportsLenAndGetItem[_T], /) -> Iterator[_T]: ... # type: ignore[misc] - def __iter__(self) -> Self: ... - def __next__(self) -> _T: ... - def __length_hint__(self) -> int: ... - -def repr(obj: object, /) -> str: ... - -# See https://github.com/python/typeshed/pull/9141 -# and https://github.com/python/typeshed/pull/9151 -# on why we don't use `SupportsRound` from `typing.pyi` - -class _SupportsRound1(Protocol[_T_co]): - def __round__(self) -> _T_co: ... - -class _SupportsRound2(Protocol[_T_co]): - def __round__(self, ndigits: int, /) -> _T_co: ... - -@overload -def round(number: _SupportsRound1[_T], ndigits: None = None) -> _T: ... -@overload -def round(number: _SupportsRound2[_T], ndigits: SupportsIndex) -> _T: ... - -# See https://github.com/python/typeshed/pull/6292#discussion_r748875189 -# for why arg 3 of `setattr` should be annotated with `Any` and not `object` -def setattr(obj: object, name: str, value: Any, /) -> None: ... -@overload -def sorted( - iterable: Iterable[SupportsRichComparisonT], /, *, key: None = None, reverse: bool = False -) -> list[SupportsRichComparisonT]: ... -@overload -def sorted(iterable: Iterable[_T], /, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> list[_T]: ... - -_AddableT1 = TypeVar("_AddableT1", bound=SupportsAdd[Any, Any]) -_AddableT2 = TypeVar("_AddableT2", bound=SupportsAdd[Any, Any]) - -class _SupportsSumWithNoDefaultGiven(SupportsAdd[Any, Any], SupportsRAdd[int, Any], Protocol): ... - -_SupportsSumNoDefaultT = TypeVar("_SupportsSumNoDefaultT", bound=_SupportsSumWithNoDefaultGiven) - -# In general, the return type of `x + x` is *not* guaranteed to be the same type as x. -# However, we can't express that in the stub for `sum()` -# without creating many false-positive errors (see #7578). -# Instead, we special-case the most common examples of this: bool and literal integers. -@overload -def sum(iterable: Iterable[bool | _LiteralInteger], /, start: int = 0) -> int: ... -@overload -def sum(iterable: Iterable[_SupportsSumNoDefaultT], /) -> _SupportsSumNoDefaultT | Literal[0]: ... -@overload -def sum(iterable: Iterable[_AddableT1], /, start: _AddableT2) -> _AddableT1 | _AddableT2: ... - -# The argument to `vars()` has to have a `__dict__` attribute, so the second overload can't be annotated with `object` -# (A "SupportsDunderDict" protocol doesn't work) -@overload -def vars(object: type, /) -> types.MappingProxyType[str, Any]: ... -@overload -def vars(object: Any = ..., /) -> dict[str, Any]: ... - -class zip(Generic[_T_co]): - if sys.version_info >= (3, 10): - @overload - def __new__(cls, *, strict: bool = ...) -> zip[Any]: ... - @overload - def __new__(cls, iter1: Iterable[_T1], /, *, strict: bool = ...) -> zip[tuple[_T1]]: ... - @overload - def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], /, *, strict: bool = ...) -> zip[tuple[_T1, _T2]]: ... - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /, *, strict: bool = ... - ) -> zip[tuple[_T1, _T2, _T3]]: ... - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], /, *, strict: bool = ... - ) -> zip[tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def __new__( - cls, - iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5], - /, - *, - strict: bool = ..., - ) -> zip[tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def __new__( - cls, - iter1: Iterable[Any], - iter2: Iterable[Any], - iter3: Iterable[Any], - iter4: Iterable[Any], - iter5: Iterable[Any], - iter6: Iterable[Any], - /, - *iterables: Iterable[Any], - strict: bool = ..., - ) -> zip[tuple[Any, ...]]: ... - else: - @overload - def __new__(cls) -> zip[Any]: ... - @overload - def __new__(cls, iter1: Iterable[_T1], /) -> zip[tuple[_T1]]: ... - @overload - def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], /) -> zip[tuple[_T1, _T2]]: ... - @overload - def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /) -> zip[tuple[_T1, _T2, _T3]]: ... - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], / - ) -> zip[tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], / - ) -> zip[tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def __new__( - cls, - iter1: Iterable[Any], - iter2: Iterable[Any], - iter3: Iterable[Any], - iter4: Iterable[Any], - iter5: Iterable[Any], - iter6: Iterable[Any], - /, - *iterables: Iterable[Any], - ) -> zip[tuple[Any, ...]]: ... - - def __iter__(self) -> Self: ... - def __next__(self) -> _T_co: ... - -# Signature of `builtins.__import__` should be kept identical to `importlib.__import__` -# Return type of `__import__` should be kept the same as return type of `importlib.import_module` -def __import__( - name: str, - globals: Mapping[str, object] | None = None, - locals: Mapping[str, object] | None = None, - fromlist: Sequence[str] = (), - level: int = 0, -) -> types.ModuleType: ... -def __build_class__(func: Callable[[], CellType | Any], name: str, /, *bases: Any, metaclass: Any = ..., **kwds: Any) -> Any: ... - -if sys.version_info >= (3, 10): - from types import EllipsisType - - # Backwards compatibility hack for folks who relied on the ellipsis type - # existing in typeshed in Python 3.9 and earlier. - ellipsis = EllipsisType - - Ellipsis: EllipsisType - -else: - # Actually the type of Ellipsis is , but since it's - # not exposed anywhere under that name, we make it private here. - @final - @type_check_only - class ellipsis: ... - - Ellipsis: ellipsis - -class BaseException: - args: tuple[Any, ...] - __cause__: BaseException | None - __context__: BaseException | None - __suppress_context__: bool - __traceback__: TracebackType | None - def __init__(self, *args: object) -> None: ... - def __new__(cls, *args: Any, **kwds: Any) -> Self: ... - def __setstate__(self, state: dict[str, Any] | None, /) -> None: ... - def with_traceback(self, tb: TracebackType | None, /) -> Self: ... - if sys.version_info >= (3, 11): - # only present after add_note() is called - __notes__: list[str] - def add_note(self, note: str, /) -> None: ... - -class GeneratorExit(BaseException): ... -class KeyboardInterrupt(BaseException): ... - -class SystemExit(BaseException): - code: sys._ExitCode - -class Exception(BaseException): ... - -class StopIteration(Exception): - value: Any - -class OSError(Exception): - errno: int | None - strerror: str | None - # filename, filename2 are actually str | bytes | None - filename: Any - filename2: Any - if sys.platform == "win32": - winerror: int - -EnvironmentError = OSError -IOError = OSError -if sys.platform == "win32": - WindowsError = OSError - -class ArithmeticError(Exception): ... -class AssertionError(Exception): ... - -class AttributeError(Exception): - if sys.version_info >= (3, 10): - def __init__(self, *args: object, name: str | None = ..., obj: object = ...) -> None: ... - name: str - obj: object - -class BufferError(Exception): ... -class EOFError(Exception): ... - -class ImportError(Exception): - def __init__(self, *args: object, name: str | None = ..., path: str | None = ...) -> None: ... - name: str | None - path: str | None - msg: str # undocumented - if sys.version_info >= (3, 12): - name_from: str | None # undocumented - -class LookupError(Exception): ... -class MemoryError(Exception): ... - -class NameError(Exception): - if sys.version_info >= (3, 10): - def __init__(self, *args: object, name: str | None = ...) -> None: ... - name: str - -class ReferenceError(Exception): ... -class RuntimeError(Exception): ... -class StopAsyncIteration(Exception): ... - -class SyntaxError(Exception): - msg: str - filename: str | None - lineno: int | None - offset: int | None - text: str | None - # Errors are displayed differently if this attribute exists on the exception. - # The value is always None. - print_file_and_line: None - if sys.version_info >= (3, 10): - end_lineno: int | None - end_offset: int | None - - @overload - def __init__(self) -> None: ... - @overload - def __init__(self, msg: object, /) -> None: ... - # Second argument is the tuple (filename, lineno, offset, text) - @overload - def __init__(self, msg: str, info: tuple[str | None, int | None, int | None, str | None], /) -> None: ... - if sys.version_info >= (3, 10): - # end_lineno and end_offset must both be provided if one is. - @overload - def __init__( - self, msg: str, info: tuple[str | None, int | None, int | None, str | None, int | None, int | None], / - ) -> None: ... - # If you provide more than two arguments, it still creates the SyntaxError, but - # the arguments from the info tuple are not parsed. This form is omitted. - -class SystemError(Exception): ... -class TypeError(Exception): ... -class ValueError(Exception): ... -class FloatingPointError(ArithmeticError): ... -class OverflowError(ArithmeticError): ... -class ZeroDivisionError(ArithmeticError): ... -class ModuleNotFoundError(ImportError): ... -class IndexError(LookupError): ... -class KeyError(LookupError): ... -class UnboundLocalError(NameError): ... - -class BlockingIOError(OSError): - characters_written: int - -class ChildProcessError(OSError): ... -class ConnectionError(OSError): ... -class BrokenPipeError(ConnectionError): ... -class ConnectionAbortedError(ConnectionError): ... -class ConnectionRefusedError(ConnectionError): ... -class ConnectionResetError(ConnectionError): ... -class FileExistsError(OSError): ... -class FileNotFoundError(OSError): ... -class InterruptedError(OSError): ... -class IsADirectoryError(OSError): ... -class NotADirectoryError(OSError): ... -class PermissionError(OSError): ... -class ProcessLookupError(OSError): ... -class TimeoutError(OSError): ... -class NotImplementedError(RuntimeError): ... -class RecursionError(RuntimeError): ... -class IndentationError(SyntaxError): ... -class TabError(IndentationError): ... -class UnicodeError(ValueError): ... - -class UnicodeDecodeError(UnicodeError): - encoding: str - object: bytes - start: int - end: int - reason: str - def __init__(self, encoding: str, object: ReadableBuffer, start: int, end: int, reason: str, /) -> None: ... - -class UnicodeEncodeError(UnicodeError): - encoding: str - object: str - start: int - end: int - reason: str - def __init__(self, encoding: str, object: str, start: int, end: int, reason: str, /) -> None: ... - -class UnicodeTranslateError(UnicodeError): - encoding: None - object: str - start: int - end: int - reason: str - def __init__(self, object: str, start: int, end: int, reason: str, /) -> None: ... - -class Warning(Exception): ... -class UserWarning(Warning): ... -class DeprecationWarning(Warning): ... -class SyntaxWarning(Warning): ... -class RuntimeWarning(Warning): ... -class FutureWarning(Warning): ... -class PendingDeprecationWarning(Warning): ... -class ImportWarning(Warning): ... -class UnicodeWarning(Warning): ... -class BytesWarning(Warning): ... -class ResourceWarning(Warning): ... - -if sys.version_info >= (3, 10): - class EncodingWarning(Warning): ... - -if sys.version_info >= (3, 11): - _BaseExceptionT_co = TypeVar("_BaseExceptionT_co", bound=BaseException, covariant=True, default=BaseException) - _BaseExceptionT = TypeVar("_BaseExceptionT", bound=BaseException) - _ExceptionT_co = TypeVar("_ExceptionT_co", bound=Exception, covariant=True, default=Exception) - _ExceptionT = TypeVar("_ExceptionT", bound=Exception) - - # See `check_exception_group.py` for use-cases and comments. - class BaseExceptionGroup(BaseException, Generic[_BaseExceptionT_co]): - def __new__(cls, message: str, exceptions: Sequence[_BaseExceptionT_co], /) -> Self: ... - def __init__(self, message: str, exceptions: Sequence[_BaseExceptionT_co], /) -> None: ... - @property - def message(self) -> str: ... - @property - def exceptions(self) -> tuple[_BaseExceptionT_co | BaseExceptionGroup[_BaseExceptionT_co], ...]: ... - @overload - def subgroup( - self, condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / - ) -> ExceptionGroup[_ExceptionT] | None: ... - @overload - def subgroup( - self, condition: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...], / - ) -> BaseExceptionGroup[_BaseExceptionT] | None: ... - @overload - def subgroup( - self, condition: Callable[[_BaseExceptionT_co | Self], bool], / - ) -> BaseExceptionGroup[_BaseExceptionT_co] | None: ... - @overload - def split( - self, condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / - ) -> tuple[ExceptionGroup[_ExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... - @overload - def split( - self, condition: type[_BaseExceptionT] | tuple[type[_BaseExceptionT], ...], / - ) -> tuple[BaseExceptionGroup[_BaseExceptionT] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... - @overload - def split( - self, condition: Callable[[_BaseExceptionT_co | Self], bool], / - ) -> tuple[BaseExceptionGroup[_BaseExceptionT_co] | None, BaseExceptionGroup[_BaseExceptionT_co] | None]: ... - # In reality it is `NonEmptySequence`: - @overload - def derive(self, excs: Sequence[_ExceptionT], /) -> ExceptionGroup[_ExceptionT]: ... - @overload - def derive(self, excs: Sequence[_BaseExceptionT], /) -> BaseExceptionGroup[_BaseExceptionT]: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - - class ExceptionGroup(BaseExceptionGroup[_ExceptionT_co], Exception): - def __new__(cls, message: str, exceptions: Sequence[_ExceptionT_co], /) -> Self: ... - def __init__(self, message: str, exceptions: Sequence[_ExceptionT_co], /) -> None: ... - @property - def exceptions(self) -> tuple[_ExceptionT_co | ExceptionGroup[_ExceptionT_co], ...]: ... - # We accept a narrower type, but that's OK. - @overload # type: ignore[override] - def subgroup( - self, condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / - ) -> ExceptionGroup[_ExceptionT] | None: ... - @overload - def subgroup(self, condition: Callable[[_ExceptionT_co | Self], bool], /) -> ExceptionGroup[_ExceptionT_co] | None: ... - @overload # type: ignore[override] - def split( - self, condition: type[_ExceptionT] | tuple[type[_ExceptionT], ...], / - ) -> tuple[ExceptionGroup[_ExceptionT] | None, ExceptionGroup[_ExceptionT_co] | None]: ... - @overload - def split( - self, condition: Callable[[_ExceptionT_co | Self], bool], / - ) -> tuple[ExceptionGroup[_ExceptionT_co] | None, ExceptionGroup[_ExceptionT_co] | None]: ... - -if sys.version_info >= (3, 13): - class PythonFinalizationError(RuntimeError): ... +class type: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/bz2.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/bz2.pyi deleted file mode 100644 index 3b21fbcf71..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/bz2.pyi +++ /dev/null @@ -1,112 +0,0 @@ -import _compression -from _bz2 import BZ2Compressor as BZ2Compressor, BZ2Decompressor as BZ2Decompressor -from _compression import BaseStream -from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer -from collections.abc import Iterable -from typing import IO, Literal, Protocol, SupportsIndex, TextIO, overload -from typing_extensions import Self, TypeAlias - -__all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor", "open", "compress", "decompress"] - -# The following attributes and methods are optional: -# def fileno(self) -> int: ... -# def close(self) -> object: ... -class _ReadableFileobj(_compression._Reader, Protocol): ... - -class _WritableFileobj(Protocol): - def write(self, b: bytes, /) -> object: ... - # The following attributes and methods are optional: - # def fileno(self) -> int: ... - # def close(self) -> object: ... - -def compress(data: ReadableBuffer, compresslevel: int = 9) -> bytes: ... -def decompress(data: ReadableBuffer) -> bytes: ... - -_ReadBinaryMode: TypeAlias = Literal["", "r", "rb"] -_WriteBinaryMode: TypeAlias = Literal["w", "wb", "x", "xb", "a", "ab"] -_ReadTextMode: TypeAlias = Literal["rt"] -_WriteTextMode: TypeAlias = Literal["wt", "xt", "at"] - -@overload -def open( - filename: _ReadableFileobj, - mode: _ReadBinaryMode = "rb", - compresslevel: int = 9, - encoding: None = None, - errors: None = None, - newline: None = None, -) -> BZ2File: ... -@overload -def open( - filename: _ReadableFileobj, - mode: _ReadTextMode, - compresslevel: int = 9, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, -) -> TextIO: ... -@overload -def open( - filename: _WritableFileobj, - mode: _WriteBinaryMode, - compresslevel: int = 9, - encoding: None = None, - errors: None = None, - newline: None = None, -) -> BZ2File: ... -@overload -def open( - filename: _WritableFileobj, - mode: _WriteTextMode, - compresslevel: int = 9, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, -) -> TextIO: ... -@overload -def open( - filename: StrOrBytesPath, - mode: _ReadBinaryMode | _WriteBinaryMode = "rb", - compresslevel: int = 9, - encoding: None = None, - errors: None = None, - newline: None = None, -) -> BZ2File: ... -@overload -def open( - filename: StrOrBytesPath, - mode: _ReadTextMode | _WriteTextMode, - compresslevel: int = 9, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, -) -> TextIO: ... -@overload -def open( - filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj, - mode: str, - compresslevel: int = 9, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, -) -> BZ2File | TextIO: ... - -class BZ2File(BaseStream, IO[bytes]): - def __enter__(self) -> Self: ... - @overload - def __init__(self, filename: _WritableFileobj, mode: _WriteBinaryMode, *, compresslevel: int = 9) -> None: ... - @overload - def __init__(self, filename: _ReadableFileobj, mode: _ReadBinaryMode = "r", *, compresslevel: int = 9) -> None: ... - @overload - def __init__( - self, filename: StrOrBytesPath, mode: _ReadBinaryMode | _WriteBinaryMode = "r", *, compresslevel: int = 9 - ) -> None: ... - def read(self, size: int | None = -1) -> bytes: ... - def read1(self, size: int = -1) -> bytes: ... - def readline(self, size: SupportsIndex = -1) -> bytes: ... # type: ignore[override] - def readinto(self, b: WriteableBuffer) -> int: ... - def readlines(self, size: SupportsIndex = -1) -> list[bytes]: ... - def peek(self, n: int = 0) -> bytes: ... - def seek(self, offset: int, whence: int = 0) -> int: ... - def write(self, data: ReadableBuffer) -> int: ... - def writelines(self, seq: Iterable[ReadableBuffer]) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/cProfile.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/cProfile.pyi deleted file mode 100644 index e921584d43..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/cProfile.pyi +++ /dev/null @@ -1,31 +0,0 @@ -import _lsprof -from _typeshed import StrOrBytesPath, Unused -from collections.abc import Callable, Mapping -from types import CodeType -from typing import Any, TypeVar -from typing_extensions import ParamSpec, Self, TypeAlias - -__all__ = ["run", "runctx", "Profile"] - -def run(statement: str, filename: str | None = None, sort: str | int = -1) -> None: ... -def runctx( - statement: str, globals: dict[str, Any], locals: Mapping[str, Any], filename: str | None = None, sort: str | int = -1 -) -> None: ... - -_T = TypeVar("_T") -_P = ParamSpec("_P") -_Label: TypeAlias = tuple[str, int, str] - -class Profile(_lsprof.Profiler): - stats: dict[_Label, tuple[int, int, int, int, dict[_Label, tuple[int, int, int, int]]]] # undocumented - def print_stats(self, sort: str | int = -1) -> None: ... - def dump_stats(self, file: StrOrBytesPath) -> None: ... - def create_stats(self) -> None: ... - def snapshot_stats(self) -> None: ... - def run(self, cmd: str) -> Self: ... - def runctx(self, cmd: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> Self: ... - def runcall(self, func: Callable[_P, _T], /, *args: _P.args, **kw: _P.kwargs) -> _T: ... - def __enter__(self) -> Self: ... - def __exit__(self, *exc_info: Unused) -> None: ... - -def label(code: str | CodeType) -> _Label: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/calendar.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/calendar.pyi deleted file mode 100644 index cabf3b881c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/calendar.pyi +++ /dev/null @@ -1,208 +0,0 @@ -import datetime -import enum -import sys -from _typeshed import Unused -from collections.abc import Iterable, Sequence -from time import struct_time -from typing import ClassVar, Final -from typing_extensions import TypeAlias - -__all__ = [ - "IllegalMonthError", - "IllegalWeekdayError", - "setfirstweekday", - "firstweekday", - "isleap", - "leapdays", - "weekday", - "monthrange", - "monthcalendar", - "prmonth", - "month", - "prcal", - "calendar", - "timegm", - "month_name", - "month_abbr", - "day_name", - "day_abbr", - "Calendar", - "TextCalendar", - "HTMLCalendar", - "LocaleTextCalendar", - "LocaleHTMLCalendar", - "weekheader", -] - -if sys.version_info >= (3, 10): - __all__ += ["FRIDAY", "MONDAY", "SATURDAY", "SUNDAY", "THURSDAY", "TUESDAY", "WEDNESDAY"] -if sys.version_info >= (3, 12): - __all__ += [ - "Day", - "Month", - "JANUARY", - "FEBRUARY", - "MARCH", - "APRIL", - "MAY", - "JUNE", - "JULY", - "AUGUST", - "SEPTEMBER", - "OCTOBER", - "NOVEMBER", - "DECEMBER", - ] - -_LocaleType: TypeAlias = tuple[str | None, str | None] - -class IllegalMonthError(ValueError): - def __init__(self, month: int) -> None: ... - -class IllegalWeekdayError(ValueError): - def __init__(self, weekday: int) -> None: ... - -def isleap(year: int) -> bool: ... -def leapdays(y1: int, y2: int) -> int: ... -def weekday(year: int, month: int, day: int) -> int: ... -def monthrange(year: int, month: int) -> tuple[int, int]: ... - -class Calendar: - firstweekday: int - def __init__(self, firstweekday: int = 0) -> None: ... - def getfirstweekday(self) -> int: ... - def setfirstweekday(self, firstweekday: int) -> None: ... - def iterweekdays(self) -> Iterable[int]: ... - def itermonthdates(self, year: int, month: int) -> Iterable[datetime.date]: ... - def itermonthdays2(self, year: int, month: int) -> Iterable[tuple[int, int]]: ... - def itermonthdays(self, year: int, month: int) -> Iterable[int]: ... - def monthdatescalendar(self, year: int, month: int) -> list[list[datetime.date]]: ... - def monthdays2calendar(self, year: int, month: int) -> list[list[tuple[int, int]]]: ... - def monthdayscalendar(self, year: int, month: int) -> list[list[int]]: ... - def yeardatescalendar(self, year: int, width: int = 3) -> list[list[list[list[datetime.date]]]]: ... - def yeardays2calendar(self, year: int, width: int = 3) -> list[list[list[list[tuple[int, int]]]]]: ... - def yeardayscalendar(self, year: int, width: int = 3) -> list[list[list[list[int]]]]: ... - def itermonthdays3(self, year: int, month: int) -> Iterable[tuple[int, int, int]]: ... - def itermonthdays4(self, year: int, month: int) -> Iterable[tuple[int, int, int, int]]: ... - -class TextCalendar(Calendar): - def prweek(self, theweek: int, width: int) -> None: ... - def formatday(self, day: int, weekday: int, width: int) -> str: ... - def formatweek(self, theweek: int, width: int) -> str: ... - def formatweekday(self, day: int, width: int) -> str: ... - def formatweekheader(self, width: int) -> str: ... - def formatmonthname(self, theyear: int, themonth: int, width: int, withyear: bool = True) -> str: ... - def prmonth(self, theyear: int, themonth: int, w: int = 0, l: int = 0) -> None: ... - def formatmonth(self, theyear: int, themonth: int, w: int = 0, l: int = 0) -> str: ... - def formatyear(self, theyear: int, w: int = 2, l: int = 1, c: int = 6, m: int = 3) -> str: ... - def pryear(self, theyear: int, w: int = 0, l: int = 0, c: int = 6, m: int = 3) -> None: ... - -def firstweekday() -> int: ... -def monthcalendar(year: int, month: int) -> list[list[int]]: ... -def prweek(theweek: int, width: int) -> None: ... -def week(theweek: int, width: int) -> str: ... -def weekheader(width: int) -> str: ... -def prmonth(theyear: int, themonth: int, w: int = 0, l: int = 0) -> None: ... -def month(theyear: int, themonth: int, w: int = 0, l: int = 0) -> str: ... -def calendar(theyear: int, w: int = 2, l: int = 1, c: int = 6, m: int = 3) -> str: ... -def prcal(theyear: int, w: int = 0, l: int = 0, c: int = 6, m: int = 3) -> None: ... - -class HTMLCalendar(Calendar): - cssclasses: ClassVar[list[str]] - cssclass_noday: ClassVar[str] - cssclasses_weekday_head: ClassVar[list[str]] - cssclass_month_head: ClassVar[str] - cssclass_month: ClassVar[str] - cssclass_year: ClassVar[str] - cssclass_year_head: ClassVar[str] - def formatday(self, day: int, weekday: int) -> str: ... - def formatweek(self, theweek: int) -> str: ... - def formatweekday(self, day: int) -> str: ... - def formatweekheader(self) -> str: ... - def formatmonthname(self, theyear: int, themonth: int, withyear: bool = True) -> str: ... - def formatmonth(self, theyear: int, themonth: int, withyear: bool = True) -> str: ... - def formatyear(self, theyear: int, width: int = 3) -> str: ... - def formatyearpage( - self, theyear: int, width: int = 3, css: str | None = "calendar.css", encoding: str | None = None - ) -> bytes: ... - -class different_locale: - def __init__(self, locale: _LocaleType) -> None: ... - def __enter__(self) -> None: ... - def __exit__(self, *args: Unused) -> None: ... - -class LocaleTextCalendar(TextCalendar): - def __init__(self, firstweekday: int = 0, locale: _LocaleType | None = None) -> None: ... - -class LocaleHTMLCalendar(HTMLCalendar): - def __init__(self, firstweekday: int = 0, locale: _LocaleType | None = None) -> None: ... - def formatweekday(self, day: int) -> str: ... - def formatmonthname(self, theyear: int, themonth: int, withyear: bool = True) -> str: ... - -c: TextCalendar - -def setfirstweekday(firstweekday: int) -> None: ... -def format(cols: int, colwidth: int = 20, spacing: int = 6) -> str: ... -def formatstring(cols: int, colwidth: int = 20, spacing: int = 6) -> str: ... -def timegm(tuple: tuple[int, ...] | struct_time) -> int: ... - -# Data attributes -day_name: Sequence[str] -day_abbr: Sequence[str] -month_name: Sequence[str] -month_abbr: Sequence[str] - -if sys.version_info >= (3, 12): - class Month(enum.IntEnum): - JANUARY = 1 - FEBRUARY = 2 - MARCH = 3 - APRIL = 4 - MAY = 5 - JUNE = 6 - JULY = 7 - AUGUST = 8 - SEPTEMBER = 9 - OCTOBER = 10 - NOVEMBER = 11 - DECEMBER = 12 - - JANUARY = Month.JANUARY - FEBRUARY = Month.FEBRUARY - MARCH = Month.MARCH - APRIL = Month.APRIL - MAY = Month.MAY - JUNE = Month.JUNE - JULY = Month.JULY - AUGUST = Month.AUGUST - SEPTEMBER = Month.SEPTEMBER - OCTOBER = Month.OCTOBER - NOVEMBER = Month.NOVEMBER - DECEMBER = Month.DECEMBER - - class Day(enum.IntEnum): - MONDAY = 0 - TUESDAY = 1 - WEDNESDAY = 2 - THURSDAY = 3 - FRIDAY = 4 - SATURDAY = 5 - SUNDAY = 6 - - MONDAY = Day.MONDAY - TUESDAY = Day.TUESDAY - WEDNESDAY = Day.WEDNESDAY - THURSDAY = Day.THURSDAY - FRIDAY = Day.FRIDAY - SATURDAY = Day.SATURDAY - SUNDAY = Day.SUNDAY -else: - MONDAY: Final = 0 - TUESDAY: Final = 1 - WEDNESDAY: Final = 2 - THURSDAY: Final = 3 - FRIDAY: Final = 4 - SATURDAY: Final = 5 - SUNDAY: Final = 6 - -EPOCH: Final = 1970 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/cgi.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/cgi.pyi deleted file mode 100644 index 3a2e2a91b2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/cgi.pyi +++ /dev/null @@ -1,118 +0,0 @@ -from _typeshed import SupportsContainsAndGetItem, SupportsGetItem, SupportsItemAccess, Unused -from builtins import list as _list, type as _type -from collections.abc import Iterable, Iterator, Mapping -from email.message import Message -from types import TracebackType -from typing import IO, Any, Protocol -from typing_extensions import Self - -__all__ = [ - "MiniFieldStorage", - "FieldStorage", - "parse", - "parse_multipart", - "parse_header", - "test", - "print_exception", - "print_environ", - "print_form", - "print_directory", - "print_arguments", - "print_environ_usage", -] - -def parse( - fp: IO[Any] | None = None, - environ: SupportsItemAccess[str, str] = ..., - keep_blank_values: bool = ..., - strict_parsing: bool = ..., - separator: str = "&", -) -> dict[str, list[str]]: ... -def parse_multipart( - fp: IO[Any], pdict: SupportsGetItem[str, bytes], encoding: str = "utf-8", errors: str = "replace", separator: str = "&" -) -> dict[str, list[Any]]: ... - -class _Environ(Protocol): - def __getitem__(self, k: str, /) -> str: ... - def keys(self) -> Iterable[str]: ... - -def parse_header(line: str) -> tuple[str, dict[str, str]]: ... -def test(environ: _Environ = ...) -> None: ... -def print_environ(environ: _Environ = ...) -> None: ... -def print_form(form: dict[str, Any]) -> None: ... -def print_directory() -> None: ... -def print_environ_usage() -> None: ... - -class MiniFieldStorage: - # The first five "Any" attributes here are always None, but mypy doesn't support that - filename: Any - list: Any - type: Any - file: IO[bytes] | None - type_options: dict[Any, Any] - disposition: Any - disposition_options: dict[Any, Any] - headers: dict[Any, Any] - name: Any - value: Any - def __init__(self, name: Any, value: Any) -> None: ... - -class FieldStorage: - FieldStorageClass: _type | None - keep_blank_values: int - strict_parsing: int - qs_on_post: str | None - headers: Mapping[str, str] | Message - fp: IO[bytes] - encoding: str - errors: str - outerboundary: bytes - bytes_read: int - limit: int | None - disposition: str - disposition_options: dict[str, str] - filename: str | None - file: IO[bytes] | None - type: str - type_options: dict[str, str] - innerboundary: bytes - length: int - done: int - list: _list[Any] | None - value: None | bytes | _list[Any] - def __init__( - self, - fp: IO[Any] | None = None, - headers: Mapping[str, str] | Message | None = None, - outerboundary: bytes = b"", - environ: SupportsContainsAndGetItem[str, str] = ..., - keep_blank_values: int = 0, - strict_parsing: int = 0, - limit: int | None = None, - encoding: str = "utf-8", - errors: str = "replace", - max_num_fields: int | None = None, - separator: str = "&", - ) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - def __iter__(self) -> Iterator[str]: ... - def __getitem__(self, key: str) -> Any: ... - def getvalue(self, key: str, default: Any = None) -> Any: ... - def getfirst(self, key: str, default: Any = None) -> Any: ... - def getlist(self, key: str) -> _list[Any]: ... - def keys(self) -> _list[str]: ... - def __contains__(self, key: str) -> bool: ... - def __len__(self) -> int: ... - def __bool__(self) -> bool: ... - def __del__(self) -> None: ... - # Returns bytes or str IO depending on an internal flag - def make_file(self) -> IO[Any]: ... - -def print_exception( - type: type[BaseException] | None = None, - value: BaseException | None = None, - tb: TracebackType | None = None, - limit: int | None = None, -) -> None: ... -def print_arguments() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/cgitb.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/cgitb.pyi deleted file mode 100644 index 5657258011..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/cgitb.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from _typeshed import OptExcInfo, StrOrBytesPath -from collections.abc import Callable -from types import FrameType, TracebackType -from typing import IO, Any, Final - -__UNDEF__: Final[object] # undocumented sentinel - -def reset() -> str: ... # undocumented -def small(text: str) -> str: ... # undocumented -def strong(text: str) -> str: ... # undocumented -def grey(text: str) -> str: ... # undocumented -def lookup(name: str, frame: FrameType, locals: dict[str, Any]) -> tuple[str | None, Any]: ... # undocumented -def scanvars( - reader: Callable[[], bytes], frame: FrameType, locals: dict[str, Any] -) -> list[tuple[str, str | None, Any]]: ... # undocumented -def html(einfo: OptExcInfo, context: int = 5) -> str: ... -def text(einfo: OptExcInfo, context: int = 5) -> str: ... - -class Hook: # undocumented - def __init__( - self, - display: int = 1, - logdir: StrOrBytesPath | None = None, - context: int = 5, - file: IO[str] | None = None, - format: str = "html", - ) -> None: ... - def __call__(self, etype: type[BaseException] | None, evalue: BaseException | None, etb: TracebackType | None) -> None: ... - def handle(self, info: OptExcInfo | None = None) -> None: ... - -def handler(info: OptExcInfo | None = None) -> None: ... -def enable(display: int = 1, logdir: StrOrBytesPath | None = None, context: int = 5, format: str = "html") -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/chunk.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/chunk.pyi deleted file mode 100644 index 9788d35f68..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/chunk.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from typing import IO - -class Chunk: - closed: bool - align: bool - file: IO[bytes] - chunkname: bytes - chunksize: int - size_read: int - offset: int - seekable: bool - def __init__(self, file: IO[bytes], align: bool = True, bigendian: bool = True, inclheader: bool = False) -> None: ... - def getname(self) -> bytes: ... - def getsize(self) -> int: ... - def close(self) -> None: ... - def isatty(self) -> bool: ... - def seek(self, pos: int, whence: int = 0) -> None: ... - def tell(self) -> int: ... - def read(self, size: int = -1) -> bytes: ... - def skip(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/cmath.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/cmath.pyi deleted file mode 100644 index a08addcf54..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/cmath.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from typing import Final, SupportsComplex, SupportsFloat, SupportsIndex -from typing_extensions import TypeAlias - -e: Final[float] -pi: Final[float] -inf: Final[float] -infj: Final[complex] -nan: Final[float] -nanj: Final[complex] -tau: Final[float] - -_C: TypeAlias = SupportsFloat | SupportsComplex | SupportsIndex | complex - -def acos(z: _C, /) -> complex: ... -def acosh(z: _C, /) -> complex: ... -def asin(z: _C, /) -> complex: ... -def asinh(z: _C, /) -> complex: ... -def atan(z: _C, /) -> complex: ... -def atanh(z: _C, /) -> complex: ... -def cos(z: _C, /) -> complex: ... -def cosh(z: _C, /) -> complex: ... -def exp(z: _C, /) -> complex: ... -def isclose(a: _C, b: _C, *, rel_tol: SupportsFloat = 1e-09, abs_tol: SupportsFloat = 0.0) -> bool: ... -def isinf(z: _C, /) -> bool: ... -def isnan(z: _C, /) -> bool: ... -def log(x: _C, base: _C = ..., /) -> complex: ... -def log10(z: _C, /) -> complex: ... -def phase(z: _C, /) -> float: ... -def polar(z: _C, /) -> tuple[float, float]: ... -def rect(r: float, phi: float, /) -> complex: ... -def sin(z: _C, /) -> complex: ... -def sinh(z: _C, /) -> complex: ... -def sqrt(z: _C, /) -> complex: ... -def tan(z: _C, /) -> complex: ... -def tanh(z: _C, /) -> complex: ... -def isfinite(z: _C, /) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/cmd.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/cmd.pyi deleted file mode 100644 index 6e84133572..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/cmd.pyi +++ /dev/null @@ -1,46 +0,0 @@ -from collections.abc import Callable -from typing import IO, Any, Final -from typing_extensions import LiteralString - -__all__ = ["Cmd"] - -PROMPT: Final = "(Cmd) " -IDENTCHARS: Final[LiteralString] # Too big to be `Literal` - -class Cmd: - prompt: str - identchars: str - ruler: str - lastcmd: str - intro: Any | None - doc_leader: str - doc_header: str - misc_header: str - undoc_header: str - nohelp: str - use_rawinput: bool - stdin: IO[str] - stdout: IO[str] - cmdqueue: list[str] - completekey: str - def __init__(self, completekey: str = "tab", stdin: IO[str] | None = None, stdout: IO[str] | None = None) -> None: ... - old_completer: Callable[[str, int], str | None] | None - def cmdloop(self, intro: Any | None = None) -> None: ... - def precmd(self, line: str) -> str: ... - def postcmd(self, stop: bool, line: str) -> bool: ... - def preloop(self) -> None: ... - def postloop(self) -> None: ... - def parseline(self, line: str) -> tuple[str | None, str | None, str]: ... - def onecmd(self, line: str) -> bool: ... - def emptyline(self) -> bool: ... - def default(self, line: str) -> None: ... - def completedefault(self, *ignored: Any) -> list[str]: ... - def completenames(self, text: str, *ignored: Any) -> list[str]: ... - completion_matches: list[str] | None - def complete(self, text: str, state: int) -> list[str] | None: ... - def get_names(self) -> list[str]: ... - # Only the first element of args matters. - def complete_help(self, *args: Any) -> list[str]: ... - def do_help(self, arg: str) -> bool | None: ... - def print_topics(self, header: str, cmds: list[str] | None, cmdlen: Any, maxcol: int) -> None: ... - def columnize(self, list: list[str] | None, displaywidth: int = 80) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/code.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/code.pyi deleted file mode 100644 index 16721927c2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/code.pyi +++ /dev/null @@ -1,56 +0,0 @@ -import sys -from codeop import CommandCompiler -from collections.abc import Callable -from types import CodeType -from typing import Any - -__all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_command"] - -class InteractiveInterpreter: - locals: dict[str, Any] # undocumented - compile: CommandCompiler # undocumented - def __init__(self, locals: dict[str, Any] | None = None) -> None: ... - def runsource(self, source: str, filename: str = "", symbol: str = "single") -> bool: ... - def runcode(self, code: CodeType) -> None: ... - if sys.version_info >= (3, 13): - def showsyntaxerror(self, filename: str | None = None, *, source: str = "") -> None: ... - else: - def showsyntaxerror(self, filename: str | None = None) -> None: ... - - def showtraceback(self) -> None: ... - def write(self, data: str) -> None: ... - -class InteractiveConsole(InteractiveInterpreter): - buffer: list[str] # undocumented - filename: str # undocumented - if sys.version_info >= (3, 13): - def __init__( - self, locals: dict[str, Any] | None = None, filename: str = "", *, local_exit: bool = False - ) -> None: ... - def push(self, line: str, filename: str | None = None) -> bool: ... - else: - def __init__(self, locals: dict[str, Any] | None = None, filename: str = "") -> None: ... - def push(self, line: str) -> bool: ... - - def interact(self, banner: str | None = None, exitmsg: str | None = None) -> None: ... - def resetbuffer(self) -> None: ... - def raw_input(self, prompt: str = "") -> str: ... - -if sys.version_info >= (3, 13): - def interact( - banner: str | None = None, - readfunc: Callable[[str], str] | None = None, - local: dict[str, Any] | None = None, - exitmsg: str | None = None, - local_exit: bool = False, - ) -> None: ... - -else: - def interact( - banner: str | None = None, - readfunc: Callable[[str], str] | None = None, - local: dict[str, Any] | None = None, - exitmsg: str | None = None, - ) -> None: ... - -def compile_command(source: str, filename: str = "", symbol: str = "single") -> CodeType | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/codecs.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/codecs.pyi deleted file mode 100644 index 579d09c66a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/codecs.pyi +++ /dev/null @@ -1,312 +0,0 @@ -import types -from _codecs import * -from _typeshed import ReadableBuffer -from abc import abstractmethod -from collections.abc import Callable, Generator, Iterable -from typing import Any, BinaryIO, ClassVar, Final, Literal, Protocol, TextIO, overload -from typing_extensions import Self, TypeAlias - -__all__ = [ - "register", - "lookup", - "open", - "EncodedFile", - "BOM", - "BOM_BE", - "BOM_LE", - "BOM32_BE", - "BOM32_LE", - "BOM64_BE", - "BOM64_LE", - "BOM_UTF8", - "BOM_UTF16", - "BOM_UTF16_LE", - "BOM_UTF16_BE", - "BOM_UTF32", - "BOM_UTF32_LE", - "BOM_UTF32_BE", - "CodecInfo", - "Codec", - "IncrementalEncoder", - "IncrementalDecoder", - "StreamReader", - "StreamWriter", - "StreamReaderWriter", - "StreamRecoder", - "getencoder", - "getdecoder", - "getincrementalencoder", - "getincrementaldecoder", - "getreader", - "getwriter", - "encode", - "decode", - "iterencode", - "iterdecode", - "strict_errors", - "ignore_errors", - "replace_errors", - "xmlcharrefreplace_errors", - "backslashreplace_errors", - "namereplace_errors", - "register_error", - "lookup_error", -] - -BOM32_BE: Final = b"\xfe\xff" -BOM32_LE: Final = b"\xff\xfe" -BOM64_BE: Final = b"\x00\x00\xfe\xff" -BOM64_LE: Final = b"\xff\xfe\x00\x00" - -_BufferedEncoding: TypeAlias = Literal[ - "idna", - "raw-unicode-escape", - "unicode-escape", - "utf-16", - "utf-16-be", - "utf-16-le", - "utf-32", - "utf-32-be", - "utf-32-le", - "utf-7", - "utf-8", - "utf-8-sig", -] - -class _WritableStream(Protocol): - def write(self, data: bytes, /) -> object: ... - def seek(self, offset: int, whence: int, /) -> object: ... - def close(self) -> object: ... - -class _ReadableStream(Protocol): - def read(self, size: int = ..., /) -> bytes: ... - def seek(self, offset: int, whence: int, /) -> object: ... - def close(self) -> object: ... - -class _Stream(_WritableStream, _ReadableStream, Protocol): ... - -# TODO: this only satisfies the most common interface, where -# bytes is the raw form and str is the cooked form. -# In the long run, both should become template parameters maybe? -# There *are* bytes->bytes and str->str encodings in the standard library. -# They were much more common in Python 2 than in Python 3. - -class _Encoder(Protocol): - def __call__(self, input: str, errors: str = ..., /) -> tuple[bytes, int]: ... # signature of Codec().encode - -class _Decoder(Protocol): - def __call__(self, input: ReadableBuffer, errors: str = ..., /) -> tuple[str, int]: ... # signature of Codec().decode - -class _StreamReader(Protocol): - def __call__(self, stream: _ReadableStream, errors: str = ..., /) -> StreamReader: ... - -class _StreamWriter(Protocol): - def __call__(self, stream: _WritableStream, errors: str = ..., /) -> StreamWriter: ... - -class _IncrementalEncoder(Protocol): - def __call__(self, errors: str = ...) -> IncrementalEncoder: ... - -class _IncrementalDecoder(Protocol): - def __call__(self, errors: str = ...) -> IncrementalDecoder: ... - -class _BufferedIncrementalDecoder(Protocol): - def __call__(self, errors: str = ...) -> BufferedIncrementalDecoder: ... - -class CodecInfo(tuple[_Encoder, _Decoder, _StreamReader, _StreamWriter]): - _is_text_encoding: bool - @property - def encode(self) -> _Encoder: ... - @property - def decode(self) -> _Decoder: ... - @property - def streamreader(self) -> _StreamReader: ... - @property - def streamwriter(self) -> _StreamWriter: ... - @property - def incrementalencoder(self) -> _IncrementalEncoder: ... - @property - def incrementaldecoder(self) -> _IncrementalDecoder: ... - name: str - def __new__( - cls, - encode: _Encoder, - decode: _Decoder, - streamreader: _StreamReader | None = None, - streamwriter: _StreamWriter | None = None, - incrementalencoder: _IncrementalEncoder | None = None, - incrementaldecoder: _IncrementalDecoder | None = None, - name: str | None = None, - *, - _is_text_encoding: bool | None = None, - ) -> Self: ... - -def getencoder(encoding: str) -> _Encoder: ... -def getdecoder(encoding: str) -> _Decoder: ... -def getincrementalencoder(encoding: str) -> _IncrementalEncoder: ... -@overload -def getincrementaldecoder(encoding: _BufferedEncoding) -> _BufferedIncrementalDecoder: ... -@overload -def getincrementaldecoder(encoding: str) -> _IncrementalDecoder: ... -def getreader(encoding: str) -> _StreamReader: ... -def getwriter(encoding: str) -> _StreamWriter: ... -def open( - filename: str, mode: str = "r", encoding: str | None = None, errors: str = "strict", buffering: int = -1 -) -> StreamReaderWriter: ... -def EncodedFile(file: _Stream, data_encoding: str, file_encoding: str | None = None, errors: str = "strict") -> StreamRecoder: ... -def iterencode(iterator: Iterable[str], encoding: str, errors: str = "strict") -> Generator[bytes, None, None]: ... -def iterdecode(iterator: Iterable[bytes], encoding: str, errors: str = "strict") -> Generator[str, None, None]: ... - -BOM: Final[Literal[b"\xff\xfe", b"\xfe\xff"]] # depends on `sys.byteorder` -BOM_BE: Final = b"\xfe\xff" -BOM_LE: Final = b"\xff\xfe" -BOM_UTF8: Final = b"\xef\xbb\xbf" -BOM_UTF16: Final[Literal[b"\xff\xfe", b"\xfe\xff"]] # depends on `sys.byteorder` -BOM_UTF16_BE: Final = b"\xfe\xff" -BOM_UTF16_LE: Final = b"\xff\xfe" -BOM_UTF32: Final[Literal[b"\xff\xfe\x00\x00", b"\x00\x00\xfe\xff"]] # depends on `sys.byteorder` -BOM_UTF32_BE: Final = b"\x00\x00\xfe\xff" -BOM_UTF32_LE: Final = b"\xff\xfe\x00\x00" - -def strict_errors(exception: UnicodeError, /) -> tuple[str | bytes, int]: ... -def replace_errors(exception: UnicodeError, /) -> tuple[str | bytes, int]: ... -def ignore_errors(exception: UnicodeError, /) -> tuple[str | bytes, int]: ... -def xmlcharrefreplace_errors(exception: UnicodeError, /) -> tuple[str | bytes, int]: ... -def backslashreplace_errors(exception: UnicodeError, /) -> tuple[str | bytes, int]: ... -def namereplace_errors(exception: UnicodeError, /) -> tuple[str | bytes, int]: ... - -class Codec: - # These are sort of @abstractmethod but sort of not. - # The StreamReader and StreamWriter subclasses only implement one. - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder: - errors: str - def __init__(self, errors: str = "strict") -> None: ... - @abstractmethod - def encode(self, input: str, final: bool = False) -> bytes: ... - def reset(self) -> None: ... - # documentation says int but str is needed for the subclass. - def getstate(self) -> int | str: ... - def setstate(self, state: int | str) -> None: ... - -class IncrementalDecoder: - errors: str - def __init__(self, errors: str = "strict") -> None: ... - @abstractmethod - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - def reset(self) -> None: ... - def getstate(self) -> tuple[bytes, int]: ... - def setstate(self, state: tuple[bytes, int]) -> None: ... - -# These are not documented but used in encodings/*.py implementations. -class BufferedIncrementalEncoder(IncrementalEncoder): - buffer: str - def __init__(self, errors: str = "strict") -> None: ... - @abstractmethod - def _buffer_encode(self, input: str, errors: str, final: bool) -> tuple[bytes, int]: ... - def encode(self, input: str, final: bool = False) -> bytes: ... - -class BufferedIncrementalDecoder(IncrementalDecoder): - buffer: bytes - def __init__(self, errors: str = "strict") -> None: ... - @abstractmethod - def _buffer_decode(self, input: ReadableBuffer, errors: str, final: bool) -> tuple[str, int]: ... - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -# TODO: it is not possible to specify the requirement that all other -# attributes and methods are passed-through from the stream. -class StreamWriter(Codec): - stream: _WritableStream - errors: str - def __init__(self, stream: _WritableStream, errors: str = "strict") -> None: ... - def write(self, object: str) -> None: ... - def writelines(self, list: Iterable[str]) -> None: ... - def reset(self) -> None: ... - def seek(self, offset: int, whence: int = 0) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ... - def __getattr__(self, name: str, getattr: Callable[[Any, str], Any] = ...) -> Any: ... - -class StreamReader(Codec): - stream: _ReadableStream - errors: str - # This is set to str, but some subclasses set to bytes instead. - charbuffertype: ClassVar[type] = ... - def __init__(self, stream: _ReadableStream, errors: str = "strict") -> None: ... - def read(self, size: int = -1, chars: int = -1, firstline: bool = False) -> str: ... - def readline(self, size: int | None = None, keepends: bool = True) -> str: ... - def readlines(self, sizehint: int | None = None, keepends: bool = True) -> list[str]: ... - def reset(self) -> None: ... - def seek(self, offset: int, whence: int = 0) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ... - def __iter__(self) -> Self: ... - def __next__(self) -> str: ... - def __getattr__(self, name: str, getattr: Callable[[Any, str], Any] = ...) -> Any: ... - -# Doesn't actually inherit from TextIO, but wraps a BinaryIO to provide text reading and writing -# and delegates attributes to the underlying binary stream with __getattr__. -class StreamReaderWriter(TextIO): - stream: _Stream - def __init__(self, stream: _Stream, Reader: _StreamReader, Writer: _StreamWriter, errors: str = "strict") -> None: ... - def read(self, size: int = -1) -> str: ... - def readline(self, size: int | None = None) -> str: ... - def readlines(self, sizehint: int | None = None) -> list[str]: ... - def __next__(self) -> str: ... - def __iter__(self) -> Self: ... - def write(self, data: str) -> None: ... # type: ignore[override] - def writelines(self, list: Iterable[str]) -> None: ... - def reset(self) -> None: ... - def seek(self, offset: int, whence: int = 0) -> None: ... # type: ignore[override] - def __enter__(self) -> Self: ... - def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ... - def __getattr__(self, name: str) -> Any: ... - # These methods don't actually exist directly, but they are needed to satisfy the TextIO - # interface. At runtime, they are delegated through __getattr__. - def close(self) -> None: ... - def fileno(self) -> int: ... - def flush(self) -> None: ... - def isatty(self) -> bool: ... - def readable(self) -> bool: ... - def truncate(self, size: int | None = ...) -> int: ... - def seekable(self) -> bool: ... - def tell(self) -> int: ... - def writable(self) -> bool: ... - -class StreamRecoder(BinaryIO): - data_encoding: str - file_encoding: str - def __init__( - self, - stream: _Stream, - encode: _Encoder, - decode: _Decoder, - Reader: _StreamReader, - Writer: _StreamWriter, - errors: str = "strict", - ) -> None: ... - def read(self, size: int = -1) -> bytes: ... - def readline(self, size: int | None = None) -> bytes: ... - def readlines(self, sizehint: int | None = None) -> list[bytes]: ... - def __next__(self) -> bytes: ... - def __iter__(self) -> Self: ... - # Base class accepts more types than just bytes - def write(self, data: bytes) -> None: ... # type: ignore[override] - def writelines(self, list: Iterable[bytes]) -> None: ... # type: ignore[override] - def reset(self) -> None: ... - def __getattr__(self, name: str) -> Any: ... - def __enter__(self) -> Self: ... - def __exit__(self, type: type[BaseException] | None, value: BaseException | None, tb: types.TracebackType | None) -> None: ... - def seek(self, offset: int, whence: int = 0) -> None: ... # type: ignore[override] - # These methods don't actually exist directly, but they are needed to satisfy the BinaryIO - # interface. At runtime, they are delegated through __getattr__. - def close(self) -> None: ... - def fileno(self) -> int: ... - def flush(self) -> None: ... - def isatty(self) -> bool: ... - def readable(self) -> bool: ... - def truncate(self, size: int | None = ...) -> int: ... - def seekable(self) -> bool: ... - def tell(self) -> int: ... - def writable(self) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/codeop.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/codeop.pyi deleted file mode 100644 index cfe52e9b35..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/codeop.pyi +++ /dev/null @@ -1,17 +0,0 @@ -import sys -from types import CodeType - -__all__ = ["compile_command", "Compile", "CommandCompiler"] - -def compile_command(source: str, filename: str = "", symbol: str = "single") -> CodeType | None: ... - -class Compile: - flags: int - if sys.version_info >= (3, 13): - def __call__(self, source: str, filename: str, symbol: str, flags: int = 0) -> CodeType: ... - else: - def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ... - -class CommandCompiler: - compiler: Compile - def __call__(self, source: str, filename: str = "", symbol: str = "single") -> CodeType | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/collections/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/collections/__init__.pyi deleted file mode 100644 index b9e4f84ec0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/collections/__init__.pyi +++ /dev/null @@ -1,495 +0,0 @@ -import sys -from _collections_abc import dict_items, dict_keys, dict_values -from _typeshed import SupportsItems, SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT -from types import GenericAlias -from typing import Any, ClassVar, Generic, NoReturn, SupportsIndex, TypeVar, final, overload -from typing_extensions import Self - -if sys.version_info >= (3, 10): - from collections.abc import ( - Callable, - ItemsView, - Iterable, - Iterator, - KeysView, - Mapping, - MutableMapping, - MutableSequence, - Sequence, - ValuesView, - ) -else: - from _collections_abc import * - -__all__ = ["ChainMap", "Counter", "OrderedDict", "UserDict", "UserList", "UserString", "defaultdict", "deque", "namedtuple"] - -_S = TypeVar("_S") -_T = TypeVar("_T") -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") -_KT = TypeVar("_KT") -_VT = TypeVar("_VT") -_KT_co = TypeVar("_KT_co", covariant=True) -_VT_co = TypeVar("_VT_co", covariant=True) - -# namedtuple is special-cased in the type checker; the initializer is ignored. -def namedtuple( - typename: str, - field_names: str | Iterable[str], - *, - rename: bool = False, - module: str | None = None, - defaults: Iterable[Any] | None = None, -) -> type[tuple[Any, ...]]: ... - -class UserDict(MutableMapping[_KT, _VT]): - data: dict[_KT, _VT] - # __init__ should be kept roughly in line with `dict.__init__`, which has the same semantics - @overload - def __init__(self, dict: None = None, /) -> None: ... - @overload - def __init__( - self: UserDict[str, _VT], dict: None = None, /, **kwargs: _VT # pyright: ignore[reportInvalidTypeVarUse] #11780 - ) -> None: ... - @overload - def __init__(self, dict: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ... - @overload - def __init__( - self: UserDict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 - dict: SupportsKeysAndGetItem[str, _VT], - /, - **kwargs: _VT, - ) -> None: ... - @overload - def __init__(self, iterable: Iterable[tuple[_KT, _VT]], /) -> None: ... - @overload - def __init__( - self: UserDict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 - iterable: Iterable[tuple[str, _VT]], - /, - **kwargs: _VT, - ) -> None: ... - @overload - def __init__(self: UserDict[str, str], iterable: Iterable[list[str]], /) -> None: ... - @overload - def __init__(self: UserDict[bytes, bytes], iterable: Iterable[list[bytes]], /) -> None: ... - def __len__(self) -> int: ... - def __getitem__(self, key: _KT) -> _VT: ... - def __setitem__(self, key: _KT, item: _VT) -> None: ... - def __delitem__(self, key: _KT) -> None: ... - def __iter__(self) -> Iterator[_KT]: ... - def __contains__(self, key: object) -> bool: ... - def copy(self) -> Self: ... - def __copy__(self) -> Self: ... - - # `UserDict.fromkeys` has the same semantics as `dict.fromkeys`, so should be kept in line with `dict.fromkeys`. - # TODO: Much like `dict.fromkeys`, the true signature of `UserDict.fromkeys` is inexpressible in the current type system. - # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. - @classmethod - @overload - def fromkeys(cls, iterable: Iterable[_T], value: None = None) -> UserDict[_T, Any | None]: ... - @classmethod - @overload - def fromkeys(cls, iterable: Iterable[_T], value: _S) -> UserDict[_T, _S]: ... - @overload - def __or__(self, other: UserDict[_KT, _VT] | dict[_KT, _VT]) -> Self: ... - @overload - def __or__(self, other: UserDict[_T1, _T2] | dict[_T1, _T2]) -> UserDict[_KT | _T1, _VT | _T2]: ... - @overload - def __ror__(self, other: UserDict[_KT, _VT] | dict[_KT, _VT]) -> Self: ... - @overload - def __ror__(self, other: UserDict[_T1, _T2] | dict[_T1, _T2]) -> UserDict[_KT | _T1, _VT | _T2]: ... - # UserDict.__ior__ should be kept roughly in line with MutableMapping.update() - @overload # type: ignore[misc] - def __ior__(self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... - @overload - def __ior__(self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... - if sys.version_info >= (3, 12): - @overload - def get(self, key: _KT, default: None = None) -> _VT | None: ... - @overload - def get(self, key: _KT, default: _T) -> _VT | _T: ... - -class UserList(MutableSequence[_T]): - data: list[_T] - @overload - def __init__(self, initlist: None = None) -> None: ... - @overload - def __init__(self, initlist: Iterable[_T]) -> None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __lt__(self, other: list[_T] | UserList[_T]) -> bool: ... - def __le__(self, other: list[_T] | UserList[_T]) -> bool: ... - def __gt__(self, other: list[_T] | UserList[_T]) -> bool: ... - def __ge__(self, other: list[_T] | UserList[_T]) -> bool: ... - def __eq__(self, other: object) -> bool: ... - def __contains__(self, item: object) -> bool: ... - def __len__(self) -> int: ... - @overload - def __getitem__(self, i: SupportsIndex) -> _T: ... - @overload - def __getitem__(self, i: slice) -> Self: ... - @overload - def __setitem__(self, i: SupportsIndex, item: _T) -> None: ... - @overload - def __setitem__(self, i: slice, item: Iterable[_T]) -> None: ... - def __delitem__(self, i: SupportsIndex | slice) -> None: ... - def __add__(self, other: Iterable[_T]) -> Self: ... - def __radd__(self, other: Iterable[_T]) -> Self: ... - def __iadd__(self, other: Iterable[_T]) -> Self: ... - def __mul__(self, n: int) -> Self: ... - def __rmul__(self, n: int) -> Self: ... - def __imul__(self, n: int) -> Self: ... - def append(self, item: _T) -> None: ... - def insert(self, i: int, item: _T) -> None: ... - def pop(self, i: int = -1) -> _T: ... - def remove(self, item: _T) -> None: ... - def copy(self) -> Self: ... - def __copy__(self) -> Self: ... - def count(self, item: _T) -> int: ... - # The runtime signature is "item, *args", and the arguments are then passed - # to `list.index`. In order to give more precise types, we pretend that the - # `item` argument is positional-only. - def index(self, item: _T, start: SupportsIndex = 0, stop: SupportsIndex = sys.maxsize, /) -> int: ... - # All arguments are passed to `list.sort` at runtime, so the signature should be kept in line with `list.sort`. - @overload - def sort(self: UserList[SupportsRichComparisonT], *, key: None = None, reverse: bool = False) -> None: ... - @overload - def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = False) -> None: ... - def extend(self, other: Iterable[_T]) -> None: ... - -class UserString(Sequence[UserString]): - data: str - def __init__(self, seq: object) -> None: ... - def __int__(self) -> int: ... - def __float__(self) -> float: ... - def __complex__(self) -> complex: ... - def __getnewargs__(self) -> tuple[str]: ... - def __lt__(self, string: str | UserString) -> bool: ... - def __le__(self, string: str | UserString) -> bool: ... - 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: ... - def __iter__(self) -> Iterator[Self]: ... - def __reversed__(self) -> Iterator[Self]: ... - def __add__(self, other: object) -> Self: ... - def __radd__(self, other: object) -> Self: ... - def __mul__(self, n: int) -> Self: ... - def __rmul__(self, n: int) -> Self: ... - def __mod__(self, args: Any) -> Self: ... - def __rmod__(self, template: object) -> Self: ... - def capitalize(self) -> Self: ... - def casefold(self) -> Self: ... - def center(self, width: int, *args: Any) -> Self: ... - def count(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... - def encode(self: UserString, encoding: str | None = "utf-8", errors: str | None = "strict") -> bytes: ... - def endswith(self, suffix: str | tuple[str, ...], start: int | None = 0, end: int | None = sys.maxsize) -> bool: ... - def expandtabs(self, tabsize: int = 8) -> Self: ... - def find(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... - def format(self, *args: Any, **kwds: Any) -> str: ... - def format_map(self, mapping: Mapping[str, Any]) -> str: ... - def index(self, sub: str, start: int = 0, end: int = sys.maxsize) -> int: ... - def isalpha(self) -> bool: ... - def isalnum(self) -> bool: ... - def isdecimal(self) -> bool: ... - def isdigit(self) -> bool: ... - def isidentifier(self) -> bool: ... - def islower(self) -> bool: ... - def isnumeric(self) -> bool: ... - def isprintable(self) -> bool: ... - def isspace(self) -> bool: ... - def istitle(self) -> bool: ... - def isupper(self) -> bool: ... - def isascii(self) -> bool: ... - def join(self, seq: Iterable[str]) -> str: ... - def ljust(self, width: int, *args: Any) -> Self: ... - def lower(self) -> Self: ... - def lstrip(self, chars: str | None = None) -> Self: ... - maketrans = str.maketrans - def partition(self, sep: str) -> tuple[str, str, str]: ... - def removeprefix(self, prefix: str | UserString, /) -> Self: ... - def removesuffix(self, suffix: str | UserString, /) -> Self: ... - def replace(self, old: str | UserString, new: str | UserString, maxsplit: int = -1) -> Self: ... - def rfind(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... - def rindex(self, sub: str | UserString, start: int = 0, end: int = sys.maxsize) -> int: ... - def rjust(self, width: int, *args: Any) -> Self: ... - def rpartition(self, sep: str) -> tuple[str, str, str]: ... - def rstrip(self, chars: str | None = None) -> Self: ... - def split(self, sep: str | None = None, maxsplit: int = -1) -> list[str]: ... - def rsplit(self, sep: str | None = None, maxsplit: int = -1) -> list[str]: ... - def splitlines(self, keepends: bool = False) -> list[str]: ... - def startswith(self, prefix: str | tuple[str, ...], start: int | None = 0, end: int | None = sys.maxsize) -> bool: ... - def strip(self, chars: str | None = None) -> Self: ... - def swapcase(self) -> Self: ... - def title(self) -> Self: ... - def translate(self, *args: Any) -> Self: ... - def upper(self) -> Self: ... - def zfill(self, width: int) -> Self: ... - -class deque(MutableSequence[_T]): - @property - def maxlen(self) -> int | None: ... - @overload - def __init__(self, *, maxlen: int | None = None) -> None: ... - @overload - def __init__(self, iterable: Iterable[_T], maxlen: int | None = None) -> None: ... - def append(self, x: _T, /) -> None: ... - def appendleft(self, x: _T, /) -> None: ... - def copy(self) -> Self: ... - def count(self, x: _T, /) -> int: ... - def extend(self, iterable: Iterable[_T], /) -> None: ... - def extendleft(self, iterable: Iterable[_T], /) -> None: ... - def insert(self, i: int, x: _T, /) -> None: ... - def index(self, x: _T, start: int = 0, stop: int = ..., /) -> int: ... - def pop(self) -> _T: ... # type: ignore[override] - def popleft(self) -> _T: ... - def remove(self, value: _T, /) -> None: ... - def rotate(self, n: int = 1, /) -> None: ... - def __copy__(self) -> Self: ... - def __len__(self) -> int: ... - __hash__: ClassVar[None] # type: ignore[assignment] - # These methods of deque don't take slices, unlike MutableSequence, hence the type: ignores - def __getitem__(self, key: SupportsIndex, /) -> _T: ... # type: ignore[override] - def __setitem__(self, key: SupportsIndex, value: _T, /) -> None: ... # type: ignore[override] - def __delitem__(self, key: SupportsIndex, /) -> None: ... # type: ignore[override] - def __contains__(self, key: object, /) -> bool: ... - def __reduce__(self) -> tuple[type[Self], tuple[()], None, Iterator[_T]]: ... - def __iadd__(self, value: Iterable[_T], /) -> Self: ... - def __add__(self, value: Self, /) -> Self: ... - def __mul__(self, value: int, /) -> Self: ... - def __imul__(self, value: int, /) -> Self: ... - def __lt__(self, value: deque[_T], /) -> bool: ... - 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: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class Counter(dict[_T, int], Generic[_T]): - @overload - def __init__(self, iterable: None = None, /) -> None: ... - @overload - def __init__(self: Counter[str], iterable: None = None, /, **kwargs: int) -> None: ... - @overload - def __init__(self, mapping: SupportsKeysAndGetItem[_T, int], /) -> None: ... - @overload - def __init__(self, iterable: Iterable[_T], /) -> None: ... - def copy(self) -> Self: ... - def elements(self) -> Iterator[_T]: ... - def most_common(self, n: int | None = None) -> list[tuple[_T, int]]: ... - @classmethod - def fromkeys(cls, iterable: Any, v: int | None = None) -> NoReturn: ... # type: ignore[override] - @overload - def subtract(self, iterable: None = None, /) -> None: ... - @overload - def subtract(self, mapping: Mapping[_T, int], /) -> None: ... - @overload - def subtract(self, iterable: Iterable[_T], /) -> None: ... - # Unlike dict.update(), use Mapping instead of SupportsKeysAndGetItem for the first overload - # (source code does an `isinstance(other, Mapping)` check) - # - # The second overload is also deliberately different to dict.update() - # (if it were `Iterable[_T] | Iterable[tuple[_T, int]]`, - # the tuples would be added as keys, breaking type safety) - @overload # type: ignore[override] - def update(self, m: Mapping[_T, int], /, **kwargs: int) -> None: ... - @overload - def update(self, iterable: Iterable[_T], /, **kwargs: int) -> None: ... - @overload - def update(self, iterable: None = None, /, **kwargs: int) -> None: ... - def __missing__(self, key: _T) -> int: ... - def __delitem__(self, elem: object) -> None: ... - if sys.version_info >= (3, 10): - def __eq__(self, other: object) -> bool: ... - def __ne__(self, other: object) -> bool: ... - - def __add__(self, other: Counter[_S]) -> Counter[_T | _S]: ... - def __sub__(self, other: Counter[_T]) -> Counter[_T]: ... - def __and__(self, other: Counter[_T]) -> Counter[_T]: ... - def __or__(self, other: Counter[_S]) -> Counter[_T | _S]: ... # type: ignore[override] - def __pos__(self) -> Counter[_T]: ... - def __neg__(self) -> Counter[_T]: ... - # several type: ignores because __iadd__ is supposedly incompatible with __add__, etc. - def __iadd__(self, other: SupportsItems[_T, int]) -> Self: ... # type: ignore[misc] - def __isub__(self, other: SupportsItems[_T, int]) -> Self: ... - def __iand__(self, other: SupportsItems[_T, int]) -> Self: ... - def __ior__(self, other: SupportsItems[_T, int]) -> Self: ... # type: ignore[override,misc] - if sys.version_info >= (3, 10): - def total(self) -> int: ... - def __le__(self, other: Counter[Any]) -> bool: ... - def __lt__(self, other: Counter[Any]) -> bool: ... - def __ge__(self, other: Counter[Any]) -> bool: ... - def __gt__(self, other: Counter[Any]) -> bool: ... - -# The pure-Python implementations of the "views" classes -# These are exposed at runtime in `collections/__init__.py` -class _OrderedDictKeysView(KeysView[_KT_co]): - def __reversed__(self) -> Iterator[_KT_co]: ... - -class _OrderedDictItemsView(ItemsView[_KT_co, _VT_co]): - def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ... - -class _OrderedDictValuesView(ValuesView[_VT_co]): - def __reversed__(self) -> Iterator[_VT_co]: ... - -# The C implementations of the "views" classes -# (At runtime, these are called `odict_keys`, `odict_items` and `odict_values`, -# but they are not exposed anywhere) -# pyright doesn't have a specific error code for subclassing error! -@final -class _odict_keys(dict_keys[_KT_co, _VT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __reversed__(self) -> Iterator[_KT_co]: ... - -@final -class _odict_items(dict_items[_KT_co, _VT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __reversed__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ... - -@final -class _odict_values(dict_values[_KT_co, _VT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __reversed__(self) -> Iterator[_VT_co]: ... - -class OrderedDict(dict[_KT, _VT]): - def popitem(self, last: bool = True) -> tuple[_KT, _VT]: ... - def move_to_end(self, key: _KT, last: bool = True) -> None: ... - def copy(self) -> Self: ... - def __reversed__(self) -> Iterator[_KT]: ... - def keys(self) -> _odict_keys[_KT, _VT]: ... - def items(self) -> _odict_items[_KT, _VT]: ... - def values(self) -> _odict_values[_KT, _VT]: ... - # The signature of OrderedDict.fromkeys should be kept in line with `dict.fromkeys`, modulo positional-only differences. - # Like dict.fromkeys, its true signature is not expressible in the current type system. - # See #3800 & https://github.com/python/typing/issues/548#issuecomment-683336963. - @classmethod - @overload - def fromkeys(cls, iterable: Iterable[_T], value: None = None) -> OrderedDict[_T, Any | None]: ... - @classmethod - @overload - def fromkeys(cls, iterable: Iterable[_T], value: _S) -> OrderedDict[_T, _S]: ... - # Keep OrderedDict.setdefault in line with MutableMapping.setdefault, modulo positional-only differences. - @overload - def setdefault(self: OrderedDict[_KT, _T | None], key: _KT, default: None = None) -> _T | None: ... - @overload - def setdefault(self, key: _KT, default: _VT) -> _VT: ... - # Same as dict.pop, but accepts keyword arguments - @overload - def pop(self, key: _KT) -> _VT: ... - @overload - def pop(self, key: _KT, default: _VT) -> _VT: ... - @overload - def pop(self, key: _KT, default: _T) -> _VT | _T: ... - def __eq__(self, value: object, /) -> bool: ... - @overload - def __or__(self, value: dict[_KT, _VT], /) -> Self: ... - @overload - def __or__(self, value: dict[_T1, _T2], /) -> OrderedDict[_KT | _T1, _VT | _T2]: ... - @overload - def __ror__(self, value: dict[_KT, _VT], /) -> Self: ... - @overload - def __ror__(self, value: dict[_T1, _T2], /) -> OrderedDict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc] - -class defaultdict(dict[_KT, _VT]): - default_factory: Callable[[], _VT] | None - @overload - def __init__(self) -> None: ... - @overload - def __init__(self: defaultdict[str, _VT], **kwargs: _VT) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 - @overload - def __init__(self, default_factory: Callable[[], _VT] | None, /) -> None: ... - @overload - def __init__( - self: defaultdict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 - default_factory: Callable[[], _VT] | None, - /, - **kwargs: _VT, - ) -> None: ... - @overload - def __init__(self, default_factory: Callable[[], _VT] | None, map: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ... - @overload - def __init__( - self: defaultdict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 - default_factory: Callable[[], _VT] | None, - map: SupportsKeysAndGetItem[str, _VT], - /, - **kwargs: _VT, - ) -> None: ... - @overload - def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[tuple[_KT, _VT]], /) -> None: ... - @overload - def __init__( - self: defaultdict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 - default_factory: Callable[[], _VT] | None, - iterable: Iterable[tuple[str, _VT]], - /, - **kwargs: _VT, - ) -> None: ... - def __missing__(self, key: _KT, /) -> _VT: ... - def __copy__(self) -> Self: ... - def copy(self) -> Self: ... - @overload - def __or__(self, value: dict[_KT, _VT], /) -> Self: ... - @overload - def __or__(self, value: dict[_T1, _T2], /) -> defaultdict[_KT | _T1, _VT | _T2]: ... - @overload - def __ror__(self, value: dict[_KT, _VT], /) -> Self: ... - @overload - def __ror__(self, value: dict[_T1, _T2], /) -> defaultdict[_KT | _T1, _VT | _T2]: ... # type: ignore[misc] - -class ChainMap(MutableMapping[_KT, _VT]): - maps: list[MutableMapping[_KT, _VT]] - def __init__(self, *maps: MutableMapping[_KT, _VT]) -> None: ... - def new_child(self, m: MutableMapping[_KT, _VT] | None = None) -> Self: ... - @property - def parents(self) -> Self: ... - def __setitem__(self, key: _KT, value: _VT) -> None: ... - def __delitem__(self, key: _KT) -> None: ... - def __getitem__(self, key: _KT) -> _VT: ... - def __iter__(self) -> Iterator[_KT]: ... - def __len__(self) -> int: ... - def __contains__(self, key: object) -> bool: ... - @overload - def get(self, key: _KT, default: None = None) -> _VT | None: ... - @overload - def get(self, key: _KT, default: _T) -> _VT | _T: ... - def __missing__(self, key: _KT) -> _VT: ... # undocumented - def __bool__(self) -> bool: ... - # Keep ChainMap.setdefault in line with MutableMapping.setdefault, modulo positional-only differences. - @overload - def setdefault(self: ChainMap[_KT, _T | None], key: _KT, default: None = None) -> _T | None: ... - @overload - def setdefault(self, key: _KT, default: _VT) -> _VT: ... - @overload - def pop(self, key: _KT) -> _VT: ... - @overload - def pop(self, key: _KT, default: _VT) -> _VT: ... - @overload - def pop(self, key: _KT, default: _T) -> _VT | _T: ... - def copy(self) -> Self: ... - __copy__ = copy - # All arguments to `fromkeys` are passed to `dict.fromkeys` at runtime, - # so the signature should be kept in line with `dict.fromkeys`. - @classmethod - @overload - def fromkeys(cls, iterable: Iterable[_T]) -> ChainMap[_T, Any | None]: ... - @classmethod - @overload - # Special-case None: the user probably wants to add non-None values later. - def fromkeys(cls, iterable: Iterable[_T], value: None, /) -> ChainMap[_T, Any | None]: ... - @classmethod - @overload - def fromkeys(cls, iterable: Iterable[_T], value: _S, /) -> ChainMap[_T, _S]: ... - @overload - def __or__(self, other: Mapping[_KT, _VT]) -> Self: ... - @overload - def __or__(self, other: Mapping[_T1, _T2]) -> ChainMap[_KT | _T1, _VT | _T2]: ... - @overload - def __ror__(self, other: Mapping[_KT, _VT]) -> Self: ... - @overload - def __ror__(self, other: Mapping[_T1, _T2]) -> ChainMap[_KT | _T1, _VT | _T2]: ... - # ChainMap.__ior__ should be kept roughly in line with MutableMapping.update() - @overload # type: ignore[misc] - def __ior__(self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... - @overload - def __ior__(self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/collections/abc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/collections/abc.pyi deleted file mode 100644 index 3df2a1d9eb..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/collections/abc.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from _collections_abc import * -from _collections_abc import __all__ as __all__ diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/colorsys.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/colorsys.pyi deleted file mode 100644 index 7842f80284..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/colorsys.pyi +++ /dev/null @@ -1,13 +0,0 @@ -__all__ = ["rgb_to_yiq", "yiq_to_rgb", "rgb_to_hls", "hls_to_rgb", "rgb_to_hsv", "hsv_to_rgb"] - -def rgb_to_yiq(r: float, g: float, b: float) -> tuple[float, float, float]: ... -def yiq_to_rgb(y: float, i: float, q: float) -> tuple[float, float, float]: ... -def rgb_to_hls(r: float, g: float, b: float) -> tuple[float, float, float]: ... -def hls_to_rgb(h: float, l: float, s: float) -> tuple[float, float, float]: ... -def rgb_to_hsv(r: float, g: float, b: float) -> tuple[float, float, float]: ... -def hsv_to_rgb(h: float, s: float, v: float) -> tuple[float, float, float]: ... - -# TODO: undocumented -ONE_SIXTH: float -ONE_THIRD: float -TWO_THIRD: float diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/compileall.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/compileall.pyi deleted file mode 100644 index a599b1b235..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/compileall.pyi +++ /dev/null @@ -1,87 +0,0 @@ -import sys -from _typeshed import StrPath -from py_compile import PycInvalidationMode -from typing import Any, Protocol - -__all__ = ["compile_dir", "compile_file", "compile_path"] - -class _SupportsSearch(Protocol): - def search(self, string: str, /) -> Any: ... - -if sys.version_info >= (3, 10): - def compile_dir( - dir: StrPath, - maxlevels: int | None = None, - ddir: StrPath | None = None, - force: bool = False, - rx: _SupportsSearch | None = None, - quiet: int = 0, - legacy: bool = False, - optimize: int = -1, - workers: int = 1, - invalidation_mode: PycInvalidationMode | None = None, - *, - stripdir: StrPath | None = None, - prependdir: StrPath | None = None, - limit_sl_dest: StrPath | None = None, - hardlink_dupes: bool = False, - ) -> bool: ... - def compile_file( - fullname: StrPath, - ddir: StrPath | None = None, - force: bool = False, - rx: _SupportsSearch | None = None, - quiet: int = 0, - legacy: bool = False, - optimize: int = -1, - invalidation_mode: PycInvalidationMode | None = None, - *, - stripdir: StrPath | None = None, - prependdir: StrPath | None = None, - limit_sl_dest: StrPath | None = None, - hardlink_dupes: bool = False, - ) -> bool: ... - -else: - def compile_dir( - dir: StrPath, - maxlevels: int | None = None, - ddir: StrPath | None = None, - force: bool = False, - rx: _SupportsSearch | None = None, - quiet: int = 0, - legacy: bool = False, - optimize: int = -1, - workers: int = 1, - invalidation_mode: PycInvalidationMode | None = None, - *, - stripdir: str | None = None, # https://bugs.python.org/issue40447 - prependdir: StrPath | None = None, - limit_sl_dest: StrPath | None = None, - hardlink_dupes: bool = False, - ) -> bool: ... - def compile_file( - fullname: StrPath, - ddir: StrPath | None = None, - force: bool = False, - rx: _SupportsSearch | None = None, - quiet: int = 0, - legacy: bool = False, - optimize: int = -1, - invalidation_mode: PycInvalidationMode | None = None, - *, - stripdir: str | None = None, # https://bugs.python.org/issue40447 - prependdir: StrPath | None = None, - limit_sl_dest: StrPath | None = None, - hardlink_dupes: bool = False, - ) -> bool: ... - -def compile_path( - skip_curdir: bool = ..., - maxlevels: int = 0, - force: bool = False, - quiet: int = 0, - legacy: bool = False, - optimize: int = -1, - invalidation_mode: PycInvalidationMode | None = None, -) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/__init__.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/__init__.pyi deleted file mode 100644 index 68fd0bc5ac..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/__init__.pyi +++ /dev/null @@ -1,51 +0,0 @@ -import sys - -from ._base import ( - ALL_COMPLETED as ALL_COMPLETED, - FIRST_COMPLETED as FIRST_COMPLETED, - FIRST_EXCEPTION as FIRST_EXCEPTION, - BrokenExecutor as BrokenExecutor, - CancelledError as CancelledError, - Executor as Executor, - Future as Future, - InvalidStateError as InvalidStateError, - TimeoutError as TimeoutError, - as_completed as as_completed, - wait as wait, -) -from .process import ProcessPoolExecutor as ProcessPoolExecutor -from .thread import ThreadPoolExecutor as ThreadPoolExecutor - -if sys.version_info >= (3, 13): - __all__ = ( - "FIRST_COMPLETED", - "FIRST_EXCEPTION", - "ALL_COMPLETED", - "CancelledError", - "TimeoutError", - "InvalidStateError", - "BrokenExecutor", - "Future", - "Executor", - "wait", - "as_completed", - "ProcessPoolExecutor", - "ThreadPoolExecutor", - ) -else: - __all__ = ( - "FIRST_COMPLETED", - "FIRST_EXCEPTION", - "ALL_COMPLETED", - "CancelledError", - "TimeoutError", - "BrokenExecutor", - "Future", - "Executor", - "wait", - "as_completed", - "ProcessPoolExecutor", - "ThreadPoolExecutor", - ) - -def __dir__() -> tuple[str, ...]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/_base.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/_base.pyi deleted file mode 100644 index 7294b69567..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/_base.pyi +++ /dev/null @@ -1,108 +0,0 @@ -import sys -import threading -from _typeshed import Unused -from collections.abc import Callable, Iterable, Iterator -from logging import Logger -from types import GenericAlias, TracebackType -from typing import Any, Final, Generic, NamedTuple, Protocol, TypeVar -from typing_extensions import ParamSpec, Self - -FIRST_COMPLETED: Final = "FIRST_COMPLETED" -FIRST_EXCEPTION: Final = "FIRST_EXCEPTION" -ALL_COMPLETED: Final = "ALL_COMPLETED" -PENDING: Final = "PENDING" -RUNNING: Final = "RUNNING" -CANCELLED: Final = "CANCELLED" -CANCELLED_AND_NOTIFIED: Final = "CANCELLED_AND_NOTIFIED" -FINISHED: Final = "FINISHED" -_FUTURE_STATES: list[str] -_STATE_TO_DESCRIPTION_MAP: dict[str, str] -LOGGER: Logger - -class Error(Exception): ... -class CancelledError(Error): ... - -if sys.version_info >= (3, 11): - from builtins import TimeoutError as TimeoutError -else: - class TimeoutError(Error): ... - -class InvalidStateError(Error): ... -class BrokenExecutor(RuntimeError): ... - -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True) -_P = ParamSpec("_P") - -class Future(Generic[_T]): - _condition: threading.Condition - _state: str - _result: _T | None - _exception: BaseException | None - _waiters: list[_Waiter] - def cancel(self) -> bool: ... - def cancelled(self) -> bool: ... - def running(self) -> bool: ... - def done(self) -> bool: ... - def add_done_callback(self, fn: Callable[[Future[_T]], object]) -> None: ... - def result(self, timeout: float | None = None) -> _T: ... - def set_running_or_notify_cancel(self) -> bool: ... - def set_result(self, result: _T) -> None: ... - def exception(self, timeout: float | None = None) -> BaseException | None: ... - def set_exception(self, exception: BaseException | None) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class Executor: - def submit(self, fn: Callable[_P, _T], /, *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]: ... - def map( - self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = None, chunksize: int = 1 - ) -> Iterator[_T]: ... - def shutdown(self, wait: bool = True, *, cancel_futures: bool = False) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> bool | None: ... - -class _AsCompletedFuture(Protocol[_T_co]): - # as_completed only mutates non-generic aspects of passed Futures and does not do any nominal - # checks. Therefore, we can use a Protocol here to allow as_completed to act covariantly. - # See the tests for concurrent.futures - _condition: threading.Condition - _state: str - _waiters: list[_Waiter] - # Not used by as_completed, but needed to propagate the generic type - def result(self, timeout: float | None = None) -> _T_co: ... - -def as_completed(fs: Iterable[_AsCompletedFuture[_T]], timeout: float | None = None) -> Iterator[Future[_T]]: ... - -class DoneAndNotDoneFutures(NamedTuple, Generic[_T]): - done: set[Future[_T]] - not_done: set[Future[_T]] - -def wait( - fs: Iterable[Future[_T]], timeout: float | None = None, return_when: str = "ALL_COMPLETED" -) -> DoneAndNotDoneFutures[_T]: ... - -class _Waiter: - event: threading.Event - finished_futures: list[Future[Any]] - def add_result(self, future: Future[Any]) -> None: ... - def add_exception(self, future: Future[Any]) -> None: ... - def add_cancelled(self, future: Future[Any]) -> None: ... - -class _AsCompletedWaiter(_Waiter): - lock: threading.Lock - -class _FirstCompletedWaiter(_Waiter): ... - -class _AllCompletedWaiter(_Waiter): - num_pending_calls: int - stop_on_exception: bool - lock: threading.Lock - def __init__(self, num_pending_calls: int, stop_on_exception: bool) -> None: ... - -class _AcquireFutures: - futures: Iterable[Future[Any]] - def __init__(self, futures: Iterable[Future[Any]]) -> None: ... - def __enter__(self) -> None: ... - def __exit__(self, *args: Unused) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/process.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/process.pyi deleted file mode 100644 index 9c904f793f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/process.pyi +++ /dev/null @@ -1,238 +0,0 @@ -import sys -from collections.abc import Callable, Generator, Iterable, Mapping, MutableMapping, MutableSequence -from multiprocessing.connection import Connection -from multiprocessing.context import BaseContext, Process -from multiprocessing.queues import Queue, SimpleQueue -from threading import Lock, Semaphore, Thread -from types import TracebackType -from typing import Any, Generic, TypeVar, overload -from typing_extensions import TypeVarTuple, Unpack -from weakref import ref - -from ._base import BrokenExecutor, Executor, Future - -_T = TypeVar("_T") -_Ts = TypeVarTuple("_Ts") - -_threads_wakeups: MutableMapping[Any, Any] -_global_shutdown: bool - -class _ThreadWakeup: - _closed: bool - # Any: Unused send and recv methods - _reader: Connection[Any, Any] - _writer: Connection[Any, Any] - def close(self) -> None: ... - def wakeup(self) -> None: ... - def clear(self) -> None: ... - -def _python_exit() -> None: ... - -EXTRA_QUEUED_CALLS: int - -_MAX_WINDOWS_WORKERS: int - -class _RemoteTraceback(Exception): - tb: str - def __init__(self, tb: TracebackType) -> None: ... - -class _ExceptionWithTraceback: - exc: BaseException - tb: TracebackType - def __init__(self, exc: BaseException, tb: TracebackType) -> None: ... - def __reduce__(self) -> str | tuple[Any, ...]: ... - -def _rebuild_exc(exc: Exception, tb: str) -> Exception: ... - -class _WorkItem(Generic[_T]): - future: Future[_T] - fn: Callable[..., _T] - args: Iterable[Any] - kwargs: Mapping[str, Any] - def __init__(self, future: Future[_T], fn: Callable[..., _T], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ... - -class _ResultItem: - work_id: int - exception: Exception - result: Any - if sys.version_info >= (3, 11): - exit_pid: int | None - def __init__( - self, work_id: int, exception: Exception | None = None, result: Any | None = None, exit_pid: int | None = None - ) -> None: ... - else: - def __init__(self, work_id: int, exception: Exception | None = None, result: Any | None = None) -> None: ... - -class _CallItem: - work_id: int - fn: Callable[..., Any] - args: Iterable[Any] - kwargs: Mapping[str, Any] - def __init__(self, work_id: int, fn: Callable[..., Any], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ... - -class _SafeQueue(Queue[Future[Any]]): - pending_work_items: dict[int, _WorkItem[Any]] - if sys.version_info < (3, 12): - shutdown_lock: Lock - thread_wakeup: _ThreadWakeup - if sys.version_info >= (3, 12): - def __init__( - self, - max_size: int | None = 0, - *, - ctx: BaseContext, - pending_work_items: dict[int, _WorkItem[Any]], - thread_wakeup: _ThreadWakeup, - ) -> None: ... - else: - def __init__( - self, - max_size: int | None = 0, - *, - ctx: BaseContext, - pending_work_items: dict[int, _WorkItem[Any]], - shutdown_lock: Lock, - thread_wakeup: _ThreadWakeup, - ) -> None: ... - - def _on_queue_feeder_error(self, e: Exception, obj: _CallItem) -> None: ... - -def _get_chunks(*iterables: Any, chunksize: int) -> Generator[tuple[Any, ...], None, None]: ... -def _process_chunk(fn: Callable[..., _T], chunk: Iterable[tuple[Any, ...]]) -> list[_T]: ... - -if sys.version_info >= (3, 11): - def _sendback_result( - result_queue: SimpleQueue[_WorkItem[Any]], - work_id: int, - result: Any | None = None, - exception: Exception | None = None, - exit_pid: int | None = None, - ) -> None: ... - -else: - def _sendback_result( - result_queue: SimpleQueue[_WorkItem[Any]], work_id: int, result: Any | None = None, exception: Exception | None = None - ) -> None: ... - -if sys.version_info >= (3, 11): - def _process_worker( - call_queue: Queue[_CallItem], - result_queue: SimpleQueue[_ResultItem], - initializer: Callable[[Unpack[_Ts]], object] | None, - initargs: tuple[Unpack[_Ts]], - max_tasks: int | None = None, - ) -> None: ... - -else: - def _process_worker( - call_queue: Queue[_CallItem], - result_queue: SimpleQueue[_ResultItem], - initializer: Callable[[Unpack[_Ts]], object] | None, - initargs: tuple[Unpack[_Ts]], - ) -> None: ... - -class _ExecutorManagerThread(Thread): - thread_wakeup: _ThreadWakeup - shutdown_lock: Lock - executor_reference: ref[Any] - processes: MutableMapping[int, Process] - call_queue: Queue[_CallItem] - result_queue: SimpleQueue[_ResultItem] - work_ids_queue: Queue[int] - pending_work_items: dict[int, _WorkItem[Any]] - def __init__(self, executor: ProcessPoolExecutor) -> None: ... - def run(self) -> None: ... - def add_call_item_to_queue(self) -> None: ... - def wait_result_broken_or_wakeup(self) -> tuple[Any, bool, str]: ... - def process_result_item(self, result_item: int | _ResultItem) -> None: ... - def is_shutting_down(self) -> bool: ... - def terminate_broken(self, cause: str) -> None: ... - def flag_executor_shutting_down(self) -> None: ... - def shutdown_workers(self) -> None: ... - def join_executor_internals(self) -> None: ... - def get_n_children_alive(self) -> int: ... - -_system_limits_checked: bool -_system_limited: bool | None - -def _check_system_limits() -> None: ... -def _chain_from_iterable_of_lists(iterable: Iterable[MutableSequence[Any]]) -> Any: ... - -class BrokenProcessPool(BrokenExecutor): ... - -class ProcessPoolExecutor(Executor): - _mp_context: BaseContext | None - _initializer: Callable[..., None] | None - _initargs: tuple[Any, ...] - _executor_manager_thread: _ThreadWakeup - _processes: MutableMapping[int, Process] - _shutdown_thread: bool - _shutdown_lock: Lock - _idle_worker_semaphore: Semaphore - _broken: bool - _queue_count: int - _pending_work_items: dict[int, _WorkItem[Any]] - _cancel_pending_futures: bool - _executor_manager_thread_wakeup: _ThreadWakeup - _result_queue: SimpleQueue[Any] - _work_ids: Queue[Any] - if sys.version_info >= (3, 11): - @overload - def __init__( - self, - max_workers: int | None = None, - mp_context: BaseContext | None = None, - initializer: Callable[[], object] | None = None, - initargs: tuple[()] = (), - *, - max_tasks_per_child: int | None = None, - ) -> None: ... - @overload - def __init__( - self, - max_workers: int | None = None, - mp_context: BaseContext | None = None, - *, - initializer: Callable[[Unpack[_Ts]], object], - initargs: tuple[Unpack[_Ts]], - max_tasks_per_child: int | None = None, - ) -> None: ... - @overload - def __init__( - self, - max_workers: int | None, - mp_context: BaseContext | None, - initializer: Callable[[Unpack[_Ts]], object], - initargs: tuple[Unpack[_Ts]], - *, - max_tasks_per_child: int | None = None, - ) -> None: ... - else: - @overload - def __init__( - self, - max_workers: int | None = None, - mp_context: BaseContext | None = None, - initializer: Callable[[], object] | None = None, - initargs: tuple[()] = (), - ) -> None: ... - @overload - def __init__( - self, - max_workers: int | None = None, - mp_context: BaseContext | None = None, - *, - initializer: Callable[[Unpack[_Ts]], object], - initargs: tuple[Unpack[_Ts]], - ) -> None: ... - @overload - def __init__( - self, - max_workers: int | None, - mp_context: BaseContext | None, - initializer: Callable[[Unpack[_Ts]], object], - initargs: tuple[Unpack[_Ts]], - ) -> None: ... - - def _start_executor_manager_thread(self) -> None: ... - def _adjust_process_count(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/thread.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/thread.pyi deleted file mode 100644 index da3e006b6f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/concurrent/futures/thread.pyi +++ /dev/null @@ -1,76 +0,0 @@ -import queue -from collections.abc import Callable, Iterable, Mapping, Set as AbstractSet -from threading import Lock, Semaphore, Thread -from types import GenericAlias -from typing import Any, Generic, TypeVar, overload -from typing_extensions import TypeVarTuple, Unpack -from weakref import ref - -from ._base import BrokenExecutor, Executor, Future - -_Ts = TypeVarTuple("_Ts") - -_threads_queues: Mapping[Any, Any] -_shutdown: bool -_global_shutdown_lock: Lock - -def _python_exit() -> None: ... - -_S = TypeVar("_S") - -class _WorkItem(Generic[_S]): - future: Future[_S] - fn: Callable[..., _S] - args: Iterable[Any] - kwargs: Mapping[str, Any] - def __init__(self, future: Future[_S], fn: Callable[..., _S], args: Iterable[Any], kwargs: Mapping[str, Any]) -> None: ... - def run(self) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -def _worker( - executor_reference: ref[Any], - work_queue: queue.SimpleQueue[Any], - initializer: Callable[[Unpack[_Ts]], object], - initargs: tuple[Unpack[_Ts]], -) -> None: ... - -class BrokenThreadPool(BrokenExecutor): ... - -class ThreadPoolExecutor(Executor): - _max_workers: int - _idle_semaphore: Semaphore - _threads: AbstractSet[Thread] - _broken: bool - _shutdown: bool - _shutdown_lock: Lock - _thread_name_prefix: str | None - _initializer: Callable[..., None] | None - _initargs: tuple[Any, ...] - _work_queue: queue.SimpleQueue[_WorkItem[Any]] - @overload - def __init__( - self, - max_workers: int | None = None, - thread_name_prefix: str = "", - initializer: Callable[[], object] | None = None, - initargs: tuple[()] = (), - ) -> None: ... - @overload - def __init__( - self, - max_workers: int | None = None, - thread_name_prefix: str = "", - *, - initializer: Callable[[Unpack[_Ts]], object], - initargs: tuple[Unpack[_Ts]], - ) -> None: ... - @overload - def __init__( - self, - max_workers: int | None, - thread_name_prefix: str, - initializer: Callable[[Unpack[_Ts]], object], - initargs: tuple[Unpack[_Ts]], - ) -> None: ... - def _adjust_thread_count(self) -> None: ... - def _initializer_failed(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/configparser.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/configparser.pyi deleted file mode 100644 index 8996c85d9a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/configparser.pyi +++ /dev/null @@ -1,431 +0,0 @@ -import sys -from _typeshed import MaybeNone, StrOrBytesPath, SupportsWrite -from collections.abc import Callable, ItemsView, Iterable, Iterator, Mapping, MutableMapping, Sequence -from re import Pattern -from typing import Any, ClassVar, Final, Literal, TypeVar, overload -from typing_extensions import TypeAlias - -if sys.version_info >= (3, 13): - __all__ = ( - "NoSectionError", - "DuplicateOptionError", - "DuplicateSectionError", - "NoOptionError", - "InterpolationError", - "InterpolationDepthError", - "InterpolationMissingOptionError", - "InterpolationSyntaxError", - "ParsingError", - "MissingSectionHeaderError", - "ConfigParser", - "RawConfigParser", - "Interpolation", - "BasicInterpolation", - "ExtendedInterpolation", - "SectionProxy", - "ConverterMapping", - "DEFAULTSECT", - "MAX_INTERPOLATION_DEPTH", - "UNNAMED_SECTION", - "MultilineContinuationError", - ) -elif sys.version_info >= (3, 12): - __all__ = ( - "NoSectionError", - "DuplicateOptionError", - "DuplicateSectionError", - "NoOptionError", - "InterpolationError", - "InterpolationDepthError", - "InterpolationMissingOptionError", - "InterpolationSyntaxError", - "ParsingError", - "MissingSectionHeaderError", - "ConfigParser", - "RawConfigParser", - "Interpolation", - "BasicInterpolation", - "ExtendedInterpolation", - "LegacyInterpolation", - "SectionProxy", - "ConverterMapping", - "DEFAULTSECT", - "MAX_INTERPOLATION_DEPTH", - ) -else: - __all__ = [ - "NoSectionError", - "DuplicateOptionError", - "DuplicateSectionError", - "NoOptionError", - "InterpolationError", - "InterpolationDepthError", - "InterpolationMissingOptionError", - "InterpolationSyntaxError", - "ParsingError", - "MissingSectionHeaderError", - "ConfigParser", - "SafeConfigParser", - "RawConfigParser", - "Interpolation", - "BasicInterpolation", - "ExtendedInterpolation", - "LegacyInterpolation", - "SectionProxy", - "ConverterMapping", - "DEFAULTSECT", - "MAX_INTERPOLATION_DEPTH", - ] - -if sys.version_info >= (3, 13): - class _UNNAMED_SECTION: ... - UNNAMED_SECTION: _UNNAMED_SECTION - - _SectionName: TypeAlias = str | _UNNAMED_SECTION - # A list of sections can only include an unnamed section if the parser was initialized with - # allow_unnamed_section=True. Any prevents users from having to use explicit - # type checks if allow_unnamed_section is False (the default). - _SectionNameList: TypeAlias = list[Any] -else: - _SectionName: TypeAlias = str - _SectionNameList: TypeAlias = list[str] - -_Section: TypeAlias = Mapping[str, str] -_Parser: TypeAlias = MutableMapping[str, _Section] -_ConverterCallback: TypeAlias = Callable[[str], Any] -_ConvertersMap: TypeAlias = dict[str, _ConverterCallback] -_T = TypeVar("_T") - -DEFAULTSECT: Final = "DEFAULT" -MAX_INTERPOLATION_DEPTH: Final = 10 - -class Interpolation: - def before_get(self, parser: _Parser, section: _SectionName, option: str, value: str, defaults: _Section) -> str: ... - def before_set(self, parser: _Parser, section: _SectionName, option: str, value: str) -> str: ... - def before_read(self, parser: _Parser, section: _SectionName, option: str, value: str) -> str: ... - def before_write(self, parser: _Parser, section: _SectionName, option: str, value: str) -> str: ... - -class BasicInterpolation(Interpolation): ... -class ExtendedInterpolation(Interpolation): ... - -if sys.version_info < (3, 13): - class LegacyInterpolation(Interpolation): - def before_get(self, parser: _Parser, section: _SectionName, option: str, value: str, vars: _Section) -> str: ... - -class RawConfigParser(_Parser): - _SECT_TMPL: ClassVar[str] # undocumented - _OPT_TMPL: ClassVar[str] # undocumented - _OPT_NV_TMPL: ClassVar[str] # undocumented - - SECTCRE: Pattern[str] - OPTCRE: ClassVar[Pattern[str]] - OPTCRE_NV: ClassVar[Pattern[str]] # undocumented - NONSPACECRE: ClassVar[Pattern[str]] # undocumented - - BOOLEAN_STATES: ClassVar[Mapping[str, bool]] # undocumented - default_section: str - if sys.version_info >= (3, 13): - @overload - def __init__( - self, - defaults: Mapping[str, str | None] | None = None, - dict_type: type[Mapping[str, str]] = ..., - *, - allow_no_value: Literal[True], - delimiters: Sequence[str] = ("=", ":"), - comment_prefixes: Sequence[str] = ("#", ";"), - inline_comment_prefixes: Sequence[str] | None = None, - strict: bool = True, - empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", - interpolation: Interpolation | None = ..., - converters: _ConvertersMap = ..., - allow_unnamed_section: bool = False, - ) -> None: ... - @overload - def __init__( - self, - defaults: Mapping[str, str | None] | None, - dict_type: type[Mapping[str, str]], - allow_no_value: Literal[True], - *, - delimiters: Sequence[str] = ("=", ":"), - comment_prefixes: Sequence[str] = ("#", ";"), - inline_comment_prefixes: Sequence[str] | None = None, - strict: bool = True, - empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", - interpolation: Interpolation | None = ..., - converters: _ConvertersMap = ..., - allow_unnamed_section: bool = False, - ) -> None: ... - @overload - def __init__( - self, - defaults: _Section | None = None, - dict_type: type[Mapping[str, str]] = ..., - allow_no_value: bool = False, - *, - delimiters: Sequence[str] = ("=", ":"), - comment_prefixes: Sequence[str] = ("#", ";"), - inline_comment_prefixes: Sequence[str] | None = None, - strict: bool = True, - empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", - interpolation: Interpolation | None = ..., - converters: _ConvertersMap = ..., - allow_unnamed_section: bool = False, - ) -> None: ... - else: - @overload - def __init__( - self, - defaults: Mapping[str, str | None] | None = None, - dict_type: type[Mapping[str, str]] = ..., - *, - allow_no_value: Literal[True], - delimiters: Sequence[str] = ("=", ":"), - comment_prefixes: Sequence[str] = ("#", ";"), - inline_comment_prefixes: Sequence[str] | None = None, - strict: bool = True, - empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", - interpolation: Interpolation | None = ..., - converters: _ConvertersMap = ..., - ) -> None: ... - @overload - def __init__( - self, - defaults: Mapping[str, str | None] | None, - dict_type: type[Mapping[str, str]], - allow_no_value: Literal[True], - *, - delimiters: Sequence[str] = ("=", ":"), - comment_prefixes: Sequence[str] = ("#", ";"), - inline_comment_prefixes: Sequence[str] | None = None, - strict: bool = True, - empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", - interpolation: Interpolation | None = ..., - converters: _ConvertersMap = ..., - ) -> None: ... - @overload - def __init__( - self, - defaults: _Section | None = None, - dict_type: type[Mapping[str, str]] = ..., - allow_no_value: bool = False, - *, - delimiters: Sequence[str] = ("=", ":"), - comment_prefixes: Sequence[str] = ("#", ";"), - inline_comment_prefixes: Sequence[str] | None = None, - strict: bool = True, - empty_lines_in_values: bool = True, - default_section: str = "DEFAULT", - interpolation: Interpolation | None = ..., - converters: _ConvertersMap = ..., - ) -> None: ... - - def __len__(self) -> int: ... - def __getitem__(self, key: str) -> SectionProxy: ... - def __setitem__(self, key: str, value: _Section) -> None: ... - def __delitem__(self, key: str) -> None: ... - def __iter__(self) -> Iterator[str]: ... - def __contains__(self, key: object) -> bool: ... - def defaults(self) -> _Section: ... - def sections(self) -> _SectionNameList: ... - def add_section(self, section: _SectionName) -> None: ... - def has_section(self, section: _SectionName) -> bool: ... - def options(self, section: _SectionName) -> list[str]: ... - def has_option(self, section: _SectionName, option: str) -> bool: ... - def read(self, filenames: StrOrBytesPath | Iterable[StrOrBytesPath], encoding: str | None = None) -> list[str]: ... - def read_file(self, f: Iterable[str], source: str | None = None) -> None: ... - def read_string(self, string: str, source: str = "") -> None: ... - def read_dict(self, dictionary: Mapping[str, Mapping[str, Any]], source: str = "") -> None: ... - if sys.version_info < (3, 12): - def readfp(self, fp: Iterable[str], filename: str | None = None) -> None: ... - # These get* methods are partially applied (with the same names) in - # SectionProxy; the stubs should be kept updated together - @overload - def getint(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> int: ... - @overload - def getint( - self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... - ) -> int | _T: ... - @overload - def getfloat(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> float: ... - @overload - def getfloat( - self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... - ) -> float | _T: ... - @overload - def getboolean(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> bool: ... - @overload - def getboolean( - self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T = ... - ) -> bool | _T: ... - def _get_conv( - self, - section: _SectionName, - option: str, - conv: Callable[[str], _T], - *, - raw: bool = False, - vars: _Section | None = None, - fallback: _T = ..., - ) -> _T: ... - # This is incompatible with MutableMapping so we ignore the type - @overload # type: ignore[override] - def get(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> str | MaybeNone: ... - @overload - def get( - self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T - ) -> str | _T | MaybeNone: ... - @overload - def items(self, *, raw: bool = False, vars: _Section | None = None) -> ItemsView[str, SectionProxy]: ... - @overload - def items(self, section: _SectionName, raw: bool = False, vars: _Section | None = None) -> list[tuple[str, str]]: ... - def set(self, section: _SectionName, option: str, value: str | None = None) -> None: ... - def write(self, fp: SupportsWrite[str], space_around_delimiters: bool = True) -> None: ... - def remove_option(self, section: _SectionName, option: str) -> bool: ... - def remove_section(self, section: _SectionName) -> bool: ... - def optionxform(self, optionstr: str) -> str: ... - @property - def converters(self) -> ConverterMapping: ... - -class ConfigParser(RawConfigParser): - # This is incompatible with MutableMapping so we ignore the type - @overload # type: ignore[override] - def get(self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None) -> str: ... - @overload - def get( - self, section: _SectionName, option: str, *, raw: bool = False, vars: _Section | None = None, fallback: _T - ) -> str | _T: ... - -if sys.version_info < (3, 12): - class SafeConfigParser(ConfigParser): ... # deprecated alias - -class SectionProxy(MutableMapping[str, str]): - def __init__(self, parser: RawConfigParser, name: str) -> None: ... - def __getitem__(self, key: str) -> str: ... - def __setitem__(self, key: str, value: str) -> None: ... - def __delitem__(self, key: str) -> None: ... - def __contains__(self, key: object) -> bool: ... - def __len__(self) -> int: ... - def __iter__(self) -> Iterator[str]: ... - @property - def parser(self) -> RawConfigParser: ... - @property - def name(self) -> str: ... - # This is incompatible with MutableMapping so we ignore the type - @overload # type: ignore[override] - def get( - self, - option: str, - fallback: None = None, - *, - raw: bool = False, - vars: _Section | None = None, - _impl: Any | None = None, - **kwargs: Any, # passed to the underlying parser's get() method - ) -> str | None: ... - @overload - def get( - self, - option: str, - fallback: _T, - *, - raw: bool = False, - vars: _Section | None = None, - _impl: Any | None = None, - **kwargs: Any, # passed to the underlying parser's get() method - ) -> str | _T: ... - # These are partially-applied version of the methods with the same names in - # RawConfigParser; the stubs should be kept updated together - @overload - def getint(self, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> int | None: ... - @overload - def getint(self, option: str, fallback: _T = ..., *, raw: bool = ..., vars: _Section | None = ...) -> int | _T: ... - @overload - def getfloat(self, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> float | None: ... - @overload - def getfloat(self, option: str, fallback: _T = ..., *, raw: bool = ..., vars: _Section | None = ...) -> float | _T: ... - @overload - def getboolean(self, option: str, *, raw: bool = ..., vars: _Section | None = ...) -> bool | None: ... - @overload - def getboolean(self, option: str, fallback: _T = ..., *, raw: bool = ..., vars: _Section | None = ...) -> bool | _T: ... - # SectionProxy can have arbitrary attributes when custom converters are used - def __getattr__(self, key: str) -> Callable[..., Any]: ... - -class ConverterMapping(MutableMapping[str, _ConverterCallback | None]): - GETTERCRE: ClassVar[Pattern[Any]] - def __init__(self, parser: RawConfigParser) -> None: ... - def __getitem__(self, key: str) -> _ConverterCallback: ... - def __setitem__(self, key: str, value: _ConverterCallback | None) -> None: ... - def __delitem__(self, key: str) -> None: ... - def __iter__(self) -> Iterator[str]: ... - def __len__(self) -> int: ... - -class Error(Exception): - message: str - def __init__(self, msg: str = "") -> None: ... - -class NoSectionError(Error): - section: _SectionName - def __init__(self, section: _SectionName) -> None: ... - -class DuplicateSectionError(Error): - section: _SectionName - source: str | None - lineno: int | None - def __init__(self, section: _SectionName, source: str | None = None, lineno: int | None = None) -> None: ... - -class DuplicateOptionError(Error): - section: _SectionName - option: str - source: str | None - lineno: int | None - def __init__(self, section: _SectionName, option: str, source: str | None = None, lineno: int | None = None) -> None: ... - -class NoOptionError(Error): - section: _SectionName - option: str - def __init__(self, option: str, section: _SectionName) -> None: ... - -class InterpolationError(Error): - section: _SectionName - option: str - def __init__(self, option: str, section: _SectionName, msg: str) -> None: ... - -class InterpolationDepthError(InterpolationError): - def __init__(self, option: str, section: _SectionName, rawval: object) -> None: ... - -class InterpolationMissingOptionError(InterpolationError): - reference: str - def __init__(self, option: str, section: _SectionName, rawval: object, reference: str) -> None: ... - -class InterpolationSyntaxError(InterpolationError): ... - -class ParsingError(Error): - source: str - errors: list[tuple[int, str]] - if sys.version_info >= (3, 13): - def __init__(self, source: str, *args: object) -> None: ... - def combine(self, others: Iterable[ParsingError]) -> ParsingError: ... - elif sys.version_info >= (3, 12): - def __init__(self, source: str) -> None: ... - else: - def __init__(self, source: str | None = None, filename: str | None = None) -> None: ... - - def append(self, lineno: int, line: str) -> None: ... - -class MissingSectionHeaderError(ParsingError): - lineno: int - line: str - def __init__(self, filename: str, lineno: int, line: str) -> None: ... - -if sys.version_info >= (3, 13): - class MultilineContinuationError(ParsingError): - lineno: int - line: str - def __init__(self, filename: str, lineno: int, line: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/contextlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/contextlib.pyi deleted file mode 100644 index 70d0dbdcb2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/contextlib.pyi +++ /dev/null @@ -1,213 +0,0 @@ -import abc -import sys -from _typeshed import FileDescriptorOrPath, Unused -from abc import ABC, abstractmethod -from collections.abc import AsyncGenerator, AsyncIterator, Awaitable, Callable, Generator, Iterator -from types import TracebackType -from typing import IO, Any, Generic, Protocol, TypeVar, overload, runtime_checkable -from typing_extensions import ParamSpec, Self, TypeAlias - -__all__ = [ - "contextmanager", - "closing", - "AbstractContextManager", - "ContextDecorator", - "ExitStack", - "redirect_stdout", - "redirect_stderr", - "suppress", - "AbstractAsyncContextManager", - "AsyncExitStack", - "asynccontextmanager", - "nullcontext", -] - -if sys.version_info >= (3, 10): - __all__ += ["aclosing"] - -if sys.version_info >= (3, 11): - __all__ += ["chdir"] - -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True) -_T_io = TypeVar("_T_io", bound=IO[str] | None) -_ExitT_co = TypeVar("_ExitT_co", covariant=True, bound=bool | None, default=bool | None) -_F = TypeVar("_F", bound=Callable[..., Any]) -_G_co = TypeVar("_G_co", bound=Generator[Any, Any, Any] | AsyncGenerator[Any, Any], covariant=True) -_P = ParamSpec("_P") - -_SendT_contra = TypeVar("_SendT_contra", contravariant=True, default=None) -_ReturnT_co = TypeVar("_ReturnT_co", covariant=True, default=None) - -_ExitFunc: TypeAlias = Callable[[type[BaseException] | None, BaseException | None, TracebackType | None], bool | None] -_CM_EF = TypeVar("_CM_EF", bound=AbstractContextManager[Any, Any] | _ExitFunc) - -# mypy and pyright object to this being both ABC and Protocol. -# At runtime it inherits from ABC and is not a Protocol, but it is on the -# allowlist for use as a Protocol. -@runtime_checkable -class AbstractContextManager(ABC, Protocol[_T_co, _ExitT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __enter__(self) -> _T_co: ... - @abstractmethod - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, / - ) -> _ExitT_co: ... - -# mypy and pyright object to this being both ABC and Protocol. -# At runtime it inherits from ABC and is not a Protocol, but it is on the -# allowlist for use as a Protocol. -@runtime_checkable -class AbstractAsyncContextManager(ABC, Protocol[_T_co, _ExitT_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - async def __aenter__(self) -> _T_co: ... - @abstractmethod - async def __aexit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, / - ) -> _ExitT_co: ... - -class ContextDecorator: - def _recreate_cm(self) -> Self: ... - def __call__(self, func: _F) -> _F: ... - -class _GeneratorContextManagerBase(Generic[_G_co]): - # Ideally this would use ParamSpec, but that requires (*args, **kwargs), which this isn't. see #6676 - def __init__(self, func: Callable[..., _G_co], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ... - gen: _G_co - func: Callable[..., _G_co] - args: tuple[Any, ...] - kwds: dict[str, Any] - -class _GeneratorContextManager( - _GeneratorContextManagerBase[Generator[_T_co, _SendT_contra, _ReturnT_co]], - AbstractContextManager[_T_co, bool | None], - ContextDecorator, -): - def __exit__( - self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> bool | None: ... - -def contextmanager(func: Callable[_P, Iterator[_T_co]]) -> Callable[_P, _GeneratorContextManager[_T_co]]: ... - -if sys.version_info >= (3, 10): - _AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]]) - - class AsyncContextDecorator: - def _recreate_cm(self) -> Self: ... - def __call__(self, func: _AF) -> _AF: ... - - class _AsyncGeneratorContextManager( - _GeneratorContextManagerBase[AsyncGenerator[_T_co, _SendT_contra]], - AbstractAsyncContextManager[_T_co, bool | None], - AsyncContextDecorator, - ): - async def __aexit__( - self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> bool | None: ... - -else: - class _AsyncGeneratorContextManager( - _GeneratorContextManagerBase[AsyncGenerator[_T_co, _SendT_contra]], AbstractAsyncContextManager[_T_co, bool | None] - ): - async def __aexit__( - self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> bool | None: ... - -def asynccontextmanager(func: Callable[_P, AsyncIterator[_T_co]]) -> Callable[_P, _AsyncGeneratorContextManager[_T_co]]: ... - -class _SupportsClose(Protocol): - def close(self) -> object: ... - -_SupportsCloseT = TypeVar("_SupportsCloseT", bound=_SupportsClose) - -class closing(AbstractContextManager[_SupportsCloseT, None]): - def __init__(self, thing: _SupportsCloseT) -> None: ... - def __exit__(self, *exc_info: Unused) -> None: ... - -if sys.version_info >= (3, 10): - class _SupportsAclose(Protocol): - def aclose(self) -> Awaitable[object]: ... - - _SupportsAcloseT = TypeVar("_SupportsAcloseT", bound=_SupportsAclose) - - class aclosing(AbstractAsyncContextManager[_SupportsAcloseT, None]): - def __init__(self, thing: _SupportsAcloseT) -> None: ... - async def __aexit__(self, *exc_info: Unused) -> None: ... - -class suppress(AbstractContextManager[None, bool]): - def __init__(self, *exceptions: type[BaseException]) -> None: ... - def __exit__( - self, exctype: type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None - ) -> bool: ... - -class _RedirectStream(AbstractContextManager[_T_io, None]): - def __init__(self, new_target: _T_io) -> None: ... - def __exit__( - self, exctype: type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None - ) -> None: ... - -class redirect_stdout(_RedirectStream[_T_io]): ... -class redirect_stderr(_RedirectStream[_T_io]): ... - -class _BaseExitStack(Generic[_ExitT_co]): - def enter_context(self, cm: AbstractContextManager[_T, _ExitT_co]) -> _T: ... - def push(self, exit: _CM_EF) -> _CM_EF: ... - def callback(self, callback: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ... - def pop_all(self) -> Self: ... - -# In reality this is a subclass of `AbstractContextManager`; -# see #7961 for why we don't do that in the stub -class ExitStack(_BaseExitStack[_ExitT_co], metaclass=abc.ABCMeta): - def close(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, / - ) -> _ExitT_co: ... - -_ExitCoroFunc: TypeAlias = Callable[ - [type[BaseException] | None, BaseException | None, TracebackType | None], Awaitable[bool | None] -] -_ACM_EF = TypeVar("_ACM_EF", bound=AbstractAsyncContextManager[Any, Any] | _ExitCoroFunc) - -# In reality this is a subclass of `AbstractAsyncContextManager`; -# see #7961 for why we don't do that in the stub -class AsyncExitStack(_BaseExitStack[_ExitT_co], metaclass=abc.ABCMeta): - async def enter_async_context(self, cm: AbstractAsyncContextManager[_T, _ExitT_co]) -> _T: ... - def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ... - def push_async_callback( - self, callback: Callable[_P, Awaitable[_T]], /, *args: _P.args, **kwds: _P.kwargs - ) -> Callable[_P, Awaitable[_T]]: ... - async def aclose(self) -> None: ... - async def __aenter__(self) -> Self: ... - async def __aexit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, / - ) -> bool: ... - -if sys.version_info >= (3, 10): - class nullcontext(AbstractContextManager[_T, None], AbstractAsyncContextManager[_T, None]): - enter_result: _T - @overload - def __init__(self: nullcontext[None], enter_result: None = None) -> None: ... - @overload - def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 - def __enter__(self) -> _T: ... - def __exit__(self, *exctype: Unused) -> None: ... - async def __aenter__(self) -> _T: ... - async def __aexit__(self, *exctype: Unused) -> None: ... - -else: - class nullcontext(AbstractContextManager[_T, None]): - enter_result: _T - @overload - def __init__(self: nullcontext[None], enter_result: None = None) -> None: ... - @overload - def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 - def __enter__(self) -> _T: ... - def __exit__(self, *exctype: Unused) -> None: ... - -if sys.version_info >= (3, 11): - _T_fd_or_any_path = TypeVar("_T_fd_or_any_path", bound=FileDescriptorOrPath) - - class chdir(AbstractContextManager[None, None], Generic[_T_fd_or_any_path]): - path: _T_fd_or_any_path - def __init__(self, path: _T_fd_or_any_path) -> None: ... - def __enter__(self) -> None: ... - def __exit__(self, *excinfo: Unused) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/contextvars.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/contextvars.pyi deleted file mode 100644 index 22dc33006e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/contextvars.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from _contextvars import Context as Context, ContextVar as ContextVar, Token as Token, copy_context as copy_context - -__all__ = ("Context", "ContextVar", "Token", "copy_context") diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/copy.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/copy.pyi deleted file mode 100644 index 2cceec6a22..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/copy.pyi +++ /dev/null @@ -1,27 +0,0 @@ -import sys -from typing import Any, Protocol, TypeVar -from typing_extensions import Self - -__all__ = ["Error", "copy", "deepcopy"] - -_T = TypeVar("_T") -_SR = TypeVar("_SR", bound=_SupportsReplace) - -class _SupportsReplace(Protocol): - # In reality doesn't support args, but there's no other great way to express this. - def __replace__(self, *args: Any, **kwargs: Any) -> Self: ... - -# None in CPython but non-None in Jython -PyStringMap: Any - -# Note: memo and _nil are internal kwargs. -def deepcopy(x: _T, memo: dict[int, Any] | None = None, _nil: Any = []) -> _T: ... -def copy(x: _T) -> _T: ... - -if sys.version_info >= (3, 13): - __all__ += ["replace"] - def replace(obj: _SR, /, **changes: Any) -> _SR: ... - -class Error(Exception): ... - -error = Error diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/copyreg.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/copyreg.pyi deleted file mode 100644 index 8f7fd957fc..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/copyreg.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from collections.abc import Callable, Hashable -from typing import Any, SupportsInt, TypeVar -from typing_extensions import TypeAlias - -_T = TypeVar("_T") -_Reduce: TypeAlias = tuple[Callable[..., _T], tuple[Any, ...]] | tuple[Callable[..., _T], tuple[Any, ...], Any | None] - -__all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] - -def pickle( - ob_type: type[_T], - pickle_function: Callable[[_T], str | _Reduce[_T]], - constructor_ob: Callable[[_Reduce[_T]], _T] | None = None, -) -> None: ... -def constructor(object: Callable[[_Reduce[_T]], _T]) -> None: ... -def add_extension(module: Hashable, name: Hashable, code: SupportsInt) -> None: ... -def remove_extension(module: Hashable, name: Hashable, code: int) -> None: ... -def clear_extension_cache() -> None: ... - -_DispatchTableType: TypeAlias = dict[type, Callable[[Any], str | _Reduce[Any]]] # imported by multiprocessing.reduction -dispatch_table: _DispatchTableType # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/crypt.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/crypt.pyi deleted file mode 100644 index bd22b5f8da..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/crypt.pyi +++ /dev/null @@ -1,20 +0,0 @@ -import sys -from typing import Final, NamedTuple, type_check_only - -if sys.platform != "win32": - @type_check_only - class _MethodBase(NamedTuple): - name: str - ident: str | None - salt_chars: int - total_size: int - - class _Method(_MethodBase): ... - METHOD_CRYPT: Final[_Method] - METHOD_MD5: Final[_Method] - METHOD_SHA256: Final[_Method] - METHOD_SHA512: Final[_Method] - METHOD_BLOWFISH: Final[_Method] - methods: list[_Method] - def mksalt(method: _Method | None = None, *, rounds: int | None = None) -> str: ... - def crypt(word: str, salt: str | _Method | None = None) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/csv.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/csv.pyi deleted file mode 100644 index 2c8e7109cd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/csv.pyi +++ /dev/null @@ -1,155 +0,0 @@ -import sys -from _csv import ( - QUOTE_ALL as QUOTE_ALL, - QUOTE_MINIMAL as QUOTE_MINIMAL, - QUOTE_NONE as QUOTE_NONE, - QUOTE_NONNUMERIC as QUOTE_NONNUMERIC, - Error as Error, - __version__ as __version__, - _DialectLike, - _QuotingType, - field_size_limit as field_size_limit, - get_dialect as get_dialect, - list_dialects as list_dialects, - reader as reader, - register_dialect as register_dialect, - unregister_dialect as unregister_dialect, - writer as writer, -) - -if sys.version_info >= (3, 12): - from _csv import QUOTE_NOTNULL as QUOTE_NOTNULL, QUOTE_STRINGS as QUOTE_STRINGS -if sys.version_info >= (3, 10): - from _csv import Reader, Writer -else: - from _csv import _reader as Reader, _writer as Writer - -from _typeshed import SupportsWrite -from collections.abc import Collection, Iterable, Mapping, Sequence -from types import GenericAlias -from typing import Any, Generic, Literal, TypeVar, overload -from typing_extensions import Self - -__all__ = [ - "QUOTE_MINIMAL", - "QUOTE_ALL", - "QUOTE_NONNUMERIC", - "QUOTE_NONE", - "Error", - "Dialect", - "excel", - "excel_tab", - "field_size_limit", - "reader", - "writer", - "register_dialect", - "get_dialect", - "list_dialects", - "Sniffer", - "unregister_dialect", - "DictReader", - "DictWriter", - "unix_dialect", -] -if sys.version_info >= (3, 12): - __all__ += ["QUOTE_STRINGS", "QUOTE_NOTNULL"] -if sys.version_info < (3, 13): - __all__ += ["__doc__", "__version__"] - -_T = TypeVar("_T") - -class Dialect: - delimiter: str - quotechar: str | None - escapechar: str | None - doublequote: bool - skipinitialspace: bool - lineterminator: str - quoting: _QuotingType - strict: bool - def __init__(self) -> None: ... - -class excel(Dialect): ... -class excel_tab(excel): ... -class unix_dialect(Dialect): ... - -class DictReader(Generic[_T]): - fieldnames: Sequence[_T] | None - restkey: _T | None - restval: str | Any | None - reader: Reader - dialect: _DialectLike - line_num: int - @overload - def __init__( - self, - f: Iterable[str], - fieldnames: Sequence[_T], - restkey: _T | None = None, - restval: str | Any | None = None, - dialect: _DialectLike = "excel", - *, - delimiter: str = ",", - quotechar: str | None = '"', - escapechar: str | None = None, - doublequote: bool = True, - skipinitialspace: bool = False, - lineterminator: str = "\r\n", - quoting: _QuotingType = 0, - strict: bool = False, - ) -> None: ... - @overload - def __init__( - self: DictReader[str], - f: Iterable[str], - fieldnames: Sequence[str] | None = None, - restkey: str | None = None, - restval: str | None = None, - dialect: _DialectLike = "excel", - *, - delimiter: str = ",", - quotechar: str | None = '"', - escapechar: str | None = None, - doublequote: bool = True, - skipinitialspace: bool = False, - lineterminator: str = "\r\n", - quoting: _QuotingType = 0, - strict: bool = False, - ) -> None: ... - def __iter__(self) -> Self: ... - def __next__(self) -> dict[_T | Any, str | Any]: ... - if sys.version_info >= (3, 12): - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class DictWriter(Generic[_T]): - fieldnames: Collection[_T] - restval: Any | None - extrasaction: Literal["raise", "ignore"] - writer: Writer - def __init__( - self, - f: SupportsWrite[str], - fieldnames: Collection[_T], - restval: Any | None = "", - extrasaction: Literal["raise", "ignore"] = "raise", - dialect: _DialectLike = "excel", - *, - delimiter: str = ",", - quotechar: str | None = '"', - escapechar: str | None = None, - doublequote: bool = True, - skipinitialspace: bool = False, - lineterminator: str = "\r\n", - quoting: _QuotingType = 0, - strict: bool = False, - ) -> None: ... - def writeheader(self) -> Any: ... - def writerow(self, rowdict: Mapping[_T, Any]) -> Any: ... - def writerows(self, rowdicts: Iterable[Mapping[_T, Any]]) -> None: ... - if sys.version_info >= (3, 12): - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class Sniffer: - preferred: list[str] - def sniff(self, sample: str, delimiters: str | None = None) -> type[Dialect]: ... - def has_header(self, sample: str) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/__init__.pyi deleted file mode 100644 index a7e1948330..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/__init__.pyi +++ /dev/null @@ -1,306 +0,0 @@ -import sys -from _ctypes import ( - POINTER as POINTER, - RTLD_GLOBAL as RTLD_GLOBAL, - RTLD_LOCAL as RTLD_LOCAL, - Array as Array, - CFuncPtr as _CFuncPtr, - Structure as Structure, - Union as Union, - _CanCastTo as _CanCastTo, - _CArgObject as _CArgObject, - _CData as _CData, - _CDataType as _CDataType, - _CField as _CField, - _Pointer as _Pointer, - _PointerLike as _PointerLike, - _SimpleCData as _SimpleCData, - addressof as addressof, - alignment as alignment, - byref as byref, - get_errno as get_errno, - pointer as pointer, - resize as resize, - set_errno as set_errno, - sizeof as sizeof, -) -from _typeshed import StrPath -from ctypes._endian import BigEndianStructure as BigEndianStructure, LittleEndianStructure as LittleEndianStructure -from types import GenericAlias -from typing import Any, ClassVar, Generic, Literal, TypeVar, type_check_only -from typing_extensions import Self, TypeAlias, deprecated - -if sys.platform == "win32": - from _ctypes import FormatError as FormatError, get_last_error as get_last_error, set_last_error as set_last_error - -if sys.version_info >= (3, 11): - from ctypes._endian import BigEndianUnion as BigEndianUnion, LittleEndianUnion as LittleEndianUnion - -_T = TypeVar("_T", default=Any) -_DLLT = TypeVar("_DLLT", bound=CDLL) -_CT = TypeVar("_CT", bound=_CData) - -DEFAULT_MODE: int - -class ArgumentError(Exception): ... - -# defined within CDLL.__init__ -# Runtime name is ctypes.CDLL.__init__.._FuncPtr -@type_check_only -class _CDLLFuncPointer(_CFuncPtr): - _flags_: ClassVar[int] - _restype_: ClassVar[type[_CDataType]] - -# Not a real class; _CDLLFuncPointer with a __name__ set on it. -@type_check_only -class _NamedFuncPointer(_CDLLFuncPointer): - __name__: str - -if sys.version_info >= (3, 12): - _NameTypes: TypeAlias = StrPath | None -else: - _NameTypes: TypeAlias = str | None - -class CDLL: - _func_flags_: ClassVar[int] - _func_restype_: ClassVar[type[_CDataType]] - _name: str - _handle: int - _FuncPtr: type[_CDLLFuncPointer] - def __init__( - self, - name: _NameTypes, - mode: int = ..., - handle: int | None = None, - use_errno: bool = False, - use_last_error: bool = False, - winmode: int | None = None, - ) -> None: ... - def __getattr__(self, name: str) -> _NamedFuncPointer: ... - def __getitem__(self, name_or_ordinal: str) -> _NamedFuncPointer: ... - -if sys.platform == "win32": - class OleDLL(CDLL): ... - class WinDLL(CDLL): ... - -class PyDLL(CDLL): ... - -class LibraryLoader(Generic[_DLLT]): - def __init__(self, dlltype: type[_DLLT]) -> None: ... - def __getattr__(self, name: str) -> _DLLT: ... - def __getitem__(self, name: str) -> _DLLT: ... - def LoadLibrary(self, name: str) -> _DLLT: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -cdll: LibraryLoader[CDLL] -if sys.platform == "win32": - windll: LibraryLoader[WinDLL] - oledll: LibraryLoader[OleDLL] -pydll: LibraryLoader[PyDLL] -pythonapi: PyDLL - -# Class definition within CFUNCTYPE / WINFUNCTYPE / PYFUNCTYPE -# Names at runtime are -# ctypes.CFUNCTYPE..CFunctionType -# ctypes.WINFUNCTYPE..WinFunctionType -# ctypes.PYFUNCTYPE..CFunctionType -@type_check_only -class _CFunctionType(_CFuncPtr): - _argtypes_: ClassVar[list[type[_CData | _CDataType]]] - _restype_: ClassVar[type[_CData | _CDataType] | None] - _flags_: ClassVar[int] - -# Alias for either function pointer type -_FuncPointer: TypeAlias = _CDLLFuncPointer | _CFunctionType # noqa: Y047 # not used here - -def CFUNCTYPE( - restype: type[_CData | _CDataType] | None, - *argtypes: type[_CData | _CDataType], - use_errno: bool = False, - use_last_error: bool = False, -) -> type[_CFunctionType]: ... - -if sys.platform == "win32": - def WINFUNCTYPE( - restype: type[_CData | _CDataType] | None, - *argtypes: type[_CData | _CDataType], - use_errno: bool = False, - use_last_error: bool = False, - ) -> type[_CFunctionType]: ... - -def PYFUNCTYPE(restype: type[_CData | _CDataType] | None, *argtypes: type[_CData | _CDataType]) -> type[_CFunctionType]: ... - -# Any type that can be implicitly converted to c_void_p when passed as a C function argument. -# (bytes is not included here, see below.) -_CVoidPLike: TypeAlias = _PointerLike | Array[Any] | _CArgObject | int -# Same as above, but including types known to be read-only (i. e. bytes). -# This distinction is not strictly necessary (ctypes doesn't differentiate between const -# and non-const pointers), but it catches errors like memmove(b'foo', buf, 4) -# when memmove(buf, b'foo', 4) was intended. -_CVoidConstPLike: TypeAlias = _CVoidPLike | bytes - -_CastT = TypeVar("_CastT", bound=_CanCastTo) - -def cast(obj: _CData | _CDataType | _CArgObject | int, typ: type[_CastT]) -> _CastT: ... -def create_string_buffer(init: int | bytes, size: int | None = None) -> Array[c_char]: ... - -c_buffer = create_string_buffer - -def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_wchar]: ... -@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") -def SetPointerType(pointer: type[_Pointer[Any]], cls: Any) -> None: ... # noqa: F811 -def ARRAY(typ: _CT, len: int) -> Array[_CT]: ... # Soft Deprecated, no plans to remove - -if sys.platform == "win32": - def DllCanUnloadNow() -> int: ... - def DllGetClassObject(rclsid: Any, riid: Any, ppv: Any) -> int: ... # TODO: not documented - - # Actually just an instance of _NamedFuncPointer (aka _CDLLFuncPointer), - # but we want to set a more specific __call__ - @type_check_only - class _GetLastErrorFunctionType(_NamedFuncPointer): - def __call__(self) -> int: ... - - GetLastError: _GetLastErrorFunctionType - -# Actually just an instance of _CFunctionType, but we want to set a more -# specific __call__. -@type_check_only -class _MemmoveFunctionType(_CFunctionType): - def __call__(self, dst: _CVoidPLike, src: _CVoidConstPLike, count: int) -> int: ... - -memmove: _MemmoveFunctionType - -# Actually just an instance of _CFunctionType, but we want to set a more -# specific __call__. -@type_check_only -class _MemsetFunctionType(_CFunctionType): - def __call__(self, dst: _CVoidPLike, c: int, count: int) -> int: ... - -memset: _MemsetFunctionType - -def string_at(ptr: _CVoidConstPLike, size: int = -1) -> bytes: ... - -if sys.platform == "win32": - def WinError(code: int | None = None, descr: str | None = None) -> OSError: ... - -def wstring_at(ptr: _CVoidConstPLike, size: int = -1) -> str: ... - -class py_object(_CanCastTo, _SimpleCData[_T]): - _type_: ClassVar[Literal["O"]] - -class c_bool(_SimpleCData[bool]): - _type_: ClassVar[Literal["?"]] - def __init__(self, value: bool = ...) -> None: ... - -class c_byte(_SimpleCData[int]): - _type_: ClassVar[Literal["b"]] - -class c_ubyte(_SimpleCData[int]): - _type_: ClassVar[Literal["B"]] - -class c_short(_SimpleCData[int]): - _type_: ClassVar[Literal["h"]] - -class c_ushort(_SimpleCData[int]): - _type_: ClassVar[Literal["H"]] - -class c_long(_SimpleCData[int]): - _type_: ClassVar[Literal["l"]] - -class c_ulong(_SimpleCData[int]): - _type_: ClassVar[Literal["L"]] - -class c_int(_SimpleCData[int]): # can be an alias for c_long - _type_: ClassVar[Literal["i", "l"]] - -class c_uint(_SimpleCData[int]): # can be an alias for c_ulong - _type_: ClassVar[Literal["I", "L"]] - -class c_longlong(_SimpleCData[int]): # can be an alias for c_long - _type_: ClassVar[Literal["q", "l"]] - -class c_ulonglong(_SimpleCData[int]): # can be an alias for c_ulong - _type_: ClassVar[Literal["Q", "L"]] - -c_int8 = c_byte -c_uint8 = c_ubyte - -class c_int16(_SimpleCData[int]): # can be an alias for c_short or c_int - _type_: ClassVar[Literal["h", "i"]] - -class c_uint16(_SimpleCData[int]): # can be an alias for c_ushort or c_uint - _type_: ClassVar[Literal["H", "I"]] - -class c_int32(_SimpleCData[int]): # can be an alias for c_int or c_long - _type_: ClassVar[Literal["i", "l"]] - -class c_uint32(_SimpleCData[int]): # can be an alias for c_uint or c_ulong - _type_: ClassVar[Literal["I", "L"]] - -class c_int64(_SimpleCData[int]): # can be an alias for c_long or c_longlong - _type_: ClassVar[Literal["l", "q"]] - -class c_uint64(_SimpleCData[int]): # can be an alias for c_ulong or c_ulonglong - _type_: ClassVar[Literal["L", "Q"]] - -class c_ssize_t(_SimpleCData[int]): # alias for c_int, c_long, or c_longlong - _type_: ClassVar[Literal["i", "l", "q"]] - -class c_size_t(_SimpleCData[int]): # alias for c_uint, c_ulong, or c_ulonglong - _type_: ClassVar[Literal["I", "L", "Q"]] - -class c_float(_SimpleCData[float]): - _type_: ClassVar[Literal["f"]] - -class c_double(_SimpleCData[float]): - _type_: ClassVar[Literal["d"]] - -class c_longdouble(_SimpleCData[float]): # can be an alias for c_double - _type_: ClassVar[Literal["d", "g"]] - -if sys.version_info >= (3, 14): - class c_float_complex(_SimpleCData[complex]): - _type_: ClassVar[Literal["E"]] - - class c_double_complex(_SimpleCData[complex]): - _type_: ClassVar[Literal["C"]] - - class c_longdouble_complex(_SimpleCData[complex]): - _type_: ClassVar[Literal["F"]] - -class c_char(_SimpleCData[bytes]): - _type_: ClassVar[Literal["c"]] - def __init__(self, value: int | bytes | bytearray = ...) -> None: ... - -class c_char_p(_PointerLike, _SimpleCData[bytes | None]): - _type_: ClassVar[Literal["z"]] - def __init__(self, value: int | bytes | None = ...) -> None: ... - @classmethod - def from_param(cls, value: Any, /) -> Self | _CArgObject: ... - -class c_void_p(_PointerLike, _SimpleCData[int | None]): - _type_: ClassVar[Literal["P"]] - @classmethod - def from_param(cls, value: Any, /) -> Self | _CArgObject: ... - -c_voidp = c_void_p # backwards compatibility (to a bug) - -class c_wchar(_SimpleCData[str]): - _type_: ClassVar[Literal["u"]] - -class c_wchar_p(_PointerLike, _SimpleCData[str | None]): - _type_: ClassVar[Literal["Z"]] - def __init__(self, value: int | str | None = ...) -> None: ... - @classmethod - def from_param(cls, value: Any, /) -> Self | _CArgObject: ... - -if sys.platform == "win32": - class HRESULT(_SimpleCData[int]): # TODO: undocumented - _type_: ClassVar[Literal["l"]] - -if sys.version_info >= (3, 12): - # At runtime, this is an alias for either c_int32 or c_int64, - # which are themselves an alias for one of c_int, c_long, or c_longlong - # This covers all our bases. - c_time_t: type[c_int32 | c_int64 | c_int | c_long | c_longlong] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/_endian.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/_endian.pyi deleted file mode 100644 index 144f5ba5dd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/_endian.pyi +++ /dev/null @@ -1,12 +0,0 @@ -import sys -from ctypes import Structure, Union - -# At runtime, the native endianness is an alias for Structure, -# while the other is a subclass with a metaclass added in. -class BigEndianStructure(Structure): ... -class LittleEndianStructure(Structure): ... - -# Same thing for these: one is an alias of Union at runtime -if sys.version_info >= (3, 11): - class BigEndianUnion(Union): ... - class LittleEndianUnion(Union): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/__init__.pyi deleted file mode 100644 index bda5b5a7f4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/__init__.pyi +++ /dev/null @@ -1 +0,0 @@ -__version__: str diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/dyld.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/dyld.pyi deleted file mode 100644 index c7e94daa21..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/dyld.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from collections.abc import Mapping -from ctypes.macholib.dylib import dylib_info as dylib_info -from ctypes.macholib.framework import framework_info as framework_info - -__all__ = ["dyld_find", "framework_find", "framework_info", "dylib_info"] - -def dyld_find(name: str, executable_path: str | None = None, env: Mapping[str, str] | None = None) -> str: ... -def framework_find(fn: str, executable_path: str | None = None, env: Mapping[str, str] | None = None) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/dylib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/dylib.pyi deleted file mode 100644 index 95945edfd1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/dylib.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from typing import TypedDict, type_check_only - -__all__ = ["dylib_info"] - -# Actual result is produced by re.match.groupdict() -@type_check_only -class _DylibInfo(TypedDict): - location: str - name: str - shortname: str - version: str | None - suffix: str | None - -def dylib_info(filename: str) -> _DylibInfo | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/framework.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/framework.pyi deleted file mode 100644 index e92bf3700e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/macholib/framework.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from typing import TypedDict, type_check_only - -__all__ = ["framework_info"] - -# Actual result is produced by re.match.groupdict() -@type_check_only -class _FrameworkInfo(TypedDict): - location: str - name: str - shortname: str - version: str | None - suffix: str | None - -def framework_info(filename: str) -> _FrameworkInfo | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/util.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/util.pyi deleted file mode 100644 index 316f7a2b3e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/util.pyi +++ /dev/null @@ -1,8 +0,0 @@ -import sys - -def find_library(name: str) -> str | None: ... - -if sys.platform == "win32": - def find_msvcrt() -> str | None: ... - -def test() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/wintypes.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/wintypes.pyi deleted file mode 100644 index 63f117787a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ctypes/wintypes.pyi +++ /dev/null @@ -1,312 +0,0 @@ -import sys -from _ctypes import _CArgObject, _CField -from ctypes import ( - Array, - Structure, - _Pointer, - _SimpleCData, - c_char, - c_char_p, - c_double, - c_float, - c_int, - c_long, - c_longlong, - c_short, - c_uint, - c_ulong, - c_ulonglong, - c_ushort, - c_void_p, - c_wchar, - c_wchar_p, -) -from typing import Any, TypeVar -from typing_extensions import Self, TypeAlias - -if sys.version_info >= (3, 12): - from ctypes import c_ubyte - - BYTE = c_ubyte -else: - from ctypes import c_byte - - BYTE = c_byte - -WORD = c_ushort -DWORD = c_ulong -CHAR = c_char -WCHAR = c_wchar -UINT = c_uint -INT = c_int -DOUBLE = c_double -FLOAT = c_float -BOOLEAN = BYTE -BOOL = c_long - -class VARIANT_BOOL(_SimpleCData[bool]): ... - -ULONG = c_ulong -LONG = c_long -USHORT = c_ushort -SHORT = c_short -LARGE_INTEGER = c_longlong -_LARGE_INTEGER = c_longlong -ULARGE_INTEGER = c_ulonglong -_ULARGE_INTEGER = c_ulonglong - -OLESTR = c_wchar_p -LPOLESTR = c_wchar_p -LPCOLESTR = c_wchar_p -LPWSTR = c_wchar_p -LPCWSTR = c_wchar_p -LPSTR = c_char_p -LPCSTR = c_char_p -LPVOID = c_void_p -LPCVOID = c_void_p - -# These two types are pointer-sized unsigned and signed ints, respectively. -# At runtime, they are either c_[u]long or c_[u]longlong, depending on the host's pointer size -# (they are not really separate classes). -class WPARAM(_SimpleCData[int]): ... -class LPARAM(_SimpleCData[int]): ... - -ATOM = WORD -LANGID = WORD -COLORREF = DWORD -LGRPID = DWORD -LCTYPE = DWORD -LCID = DWORD - -HANDLE = c_void_p -HACCEL = HANDLE -HBITMAP = HANDLE -HBRUSH = HANDLE -HCOLORSPACE = HANDLE -HDC = HANDLE -HDESK = HANDLE -HDWP = HANDLE -HENHMETAFILE = HANDLE -HFONT = HANDLE -HGDIOBJ = HANDLE -HGLOBAL = HANDLE -HHOOK = HANDLE -HICON = HANDLE -HINSTANCE = HANDLE -HKEY = HANDLE -HKL = HANDLE -HLOCAL = HANDLE -HMENU = HANDLE -HMETAFILE = HANDLE -HMODULE = HANDLE -HMONITOR = HANDLE -HPALETTE = HANDLE -HPEN = HANDLE -HRGN = HANDLE -HRSRC = HANDLE -HSTR = HANDLE -HTASK = HANDLE -HWINSTA = HANDLE -HWND = HANDLE -SC_HANDLE = HANDLE -SERVICE_STATUS_HANDLE = HANDLE - -_CIntLikeT = TypeVar("_CIntLikeT", bound=_SimpleCData[int]) -_CIntLikeField: TypeAlias = _CField[_CIntLikeT, int, _CIntLikeT | int] - -class RECT(Structure): - left: _CIntLikeField[LONG] - top: _CIntLikeField[LONG] - right: _CIntLikeField[LONG] - bottom: _CIntLikeField[LONG] - -RECTL = RECT -_RECTL = RECT -tagRECT = RECT - -class _SMALL_RECT(Structure): - Left: _CIntLikeField[SHORT] - Top: _CIntLikeField[SHORT] - Right: _CIntLikeField[SHORT] - Bottom: _CIntLikeField[SHORT] - -SMALL_RECT = _SMALL_RECT - -class _COORD(Structure): - X: _CIntLikeField[SHORT] - Y: _CIntLikeField[SHORT] - -class POINT(Structure): - x: _CIntLikeField[LONG] - y: _CIntLikeField[LONG] - -POINTL = POINT -_POINTL = POINT -tagPOINT = POINT - -class SIZE(Structure): - cx: _CIntLikeField[LONG] - cy: _CIntLikeField[LONG] - -SIZEL = SIZE -tagSIZE = SIZE - -def RGB(red: int, green: int, blue: int) -> int: ... - -class FILETIME(Structure): - dwLowDateTime: _CIntLikeField[DWORD] - dwHighDateTime: _CIntLikeField[DWORD] - -_FILETIME = FILETIME - -class MSG(Structure): - hWnd: _CField[HWND, int | None, HWND | int | None] - message: _CIntLikeField[UINT] - wParam: _CIntLikeField[WPARAM] - lParam: _CIntLikeField[LPARAM] - time: _CIntLikeField[DWORD] - pt: _CField[POINT, POINT, POINT] - -tagMSG = MSG -MAX_PATH: int - -class WIN32_FIND_DATAA(Structure): - dwFileAttributes: _CIntLikeField[DWORD] - ftCreationTime: _CField[FILETIME, FILETIME, FILETIME] - ftLastAccessTime: _CField[FILETIME, FILETIME, FILETIME] - ftLastWriteTime: _CField[FILETIME, FILETIME, FILETIME] - nFileSizeHigh: _CIntLikeField[DWORD] - nFileSizeLow: _CIntLikeField[DWORD] - dwReserved0: _CIntLikeField[DWORD] - dwReserved1: _CIntLikeField[DWORD] - cFileName: _CField[Array[CHAR], bytes, bytes] - cAlternateFileName: _CField[Array[CHAR], bytes, bytes] - -class WIN32_FIND_DATAW(Structure): - dwFileAttributes: _CIntLikeField[DWORD] - ftCreationTime: _CField[FILETIME, FILETIME, FILETIME] - ftLastAccessTime: _CField[FILETIME, FILETIME, FILETIME] - ftLastWriteTime: _CField[FILETIME, FILETIME, FILETIME] - nFileSizeHigh: _CIntLikeField[DWORD] - nFileSizeLow: _CIntLikeField[DWORD] - dwReserved0: _CIntLikeField[DWORD] - dwReserved1: _CIntLikeField[DWORD] - cFileName: _CField[Array[WCHAR], str, str] - cAlternateFileName: _CField[Array[WCHAR], str, str] - -# These are all defined with the POINTER() function, which keeps a cache and will -# return a previously created class if it can. The self-reported __name__ -# of these classes is f"LP_{typ.__name__}", where typ is the original class -# passed in to the POINTER() function. - -# LP_c_short -class PSHORT(_Pointer[SHORT]): ... - -# LP_c_ushort -class PUSHORT(_Pointer[USHORT]): ... - -PWORD = PUSHORT -LPWORD = PUSHORT - -# LP_c_long -class PLONG(_Pointer[LONG]): ... - -LPLONG = PLONG -PBOOL = PLONG -LPBOOL = PLONG - -# LP_c_ulong -class PULONG(_Pointer[ULONG]): ... - -PDWORD = PULONG -LPDWORD = PDWORD -LPCOLORREF = PDWORD -PLCID = PDWORD - -# LP_c_int (or LP_c_long if int and long have the same size) -class PINT(_Pointer[INT]): ... - -LPINT = PINT - -# LP_c_uint (or LP_c_ulong if int and long have the same size) -class PUINT(_Pointer[UINT]): ... - -LPUINT = PUINT - -# LP_c_float -class PFLOAT(_Pointer[FLOAT]): ... - -# LP_c_longlong (or LP_c_long if long and long long have the same size) -class PLARGE_INTEGER(_Pointer[LARGE_INTEGER]): ... - -# LP_c_ulonglong (or LP_c_ulong if long and long long have the same size) -class PULARGE_INTEGER(_Pointer[ULARGE_INTEGER]): ... - -# LP_c_byte types -class PBYTE(_Pointer[BYTE]): ... - -LPBYTE = PBYTE -PBOOLEAN = PBYTE - -# LP_c_char -class PCHAR(_Pointer[CHAR]): - # this is inherited from ctypes.c_char_p, kind of. - @classmethod - def from_param(cls, value: Any, /) -> Self | _CArgObject: ... - -# LP_c_wchar -class PWCHAR(_Pointer[WCHAR]): - # inherited from ctypes.c_wchar_p, kind of - @classmethod - def from_param(cls, value: Any, /) -> Self | _CArgObject: ... - -# LP_c_void_p -class PHANDLE(_Pointer[HANDLE]): ... - -LPHANDLE = PHANDLE -PHKEY = PHANDLE -LPHKL = PHANDLE -LPSC_HANDLE = PHANDLE - -# LP_FILETIME -class PFILETIME(_Pointer[FILETIME]): ... - -LPFILETIME = PFILETIME - -# LP_MSG -class PMSG(_Pointer[MSG]): ... - -LPMSG = PMSG - -# LP_POINT -class PPOINT(_Pointer[POINT]): ... - -LPPOINT = PPOINT -PPOINTL = PPOINT - -# LP_RECT -class PRECT(_Pointer[RECT]): ... - -LPRECT = PRECT -PRECTL = PRECT -LPRECTL = PRECT - -# LP_SIZE -class PSIZE(_Pointer[SIZE]): ... - -LPSIZE = PSIZE -PSIZEL = PSIZE -LPSIZEL = PSIZE - -# LP__SMALL_RECT -class PSMALL_RECT(_Pointer[SMALL_RECT]): ... - -# LP_WIN32_FIND_DATAA -class PWIN32_FIND_DATAA(_Pointer[WIN32_FIND_DATAA]): ... - -LPWIN32_FIND_DATAA = PWIN32_FIND_DATAA - -# LP_WIN32_FIND_DATAW -class PWIN32_FIND_DATAW(_Pointer[WIN32_FIND_DATAW]): ... - -LPWIN32_FIND_DATAW = PWIN32_FIND_DATAW diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/__init__.pyi deleted file mode 100644 index edc64a00cd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/__init__.pyi +++ /dev/null @@ -1,45 +0,0 @@ -import sys -from _curses import * -from _curses import window as window -from _typeshed import structseq -from collections.abc import Callable -from typing import Final, TypeVar, final, type_check_only -from typing_extensions import Concatenate, ParamSpec - -# NOTE: The _curses module is ordinarily only available on Unix, but the -# windows-curses package makes it available on Windows as well with the same -# contents. - -_T = TypeVar("_T") -_P = ParamSpec("_P") - -# available after calling `curses.initscr()` -LINES: int -COLS: int - -# available after calling `curses.start_color()` -COLORS: int -COLOR_PAIRS: int - -def wrapper(func: Callable[Concatenate[window, _P], _T], /, *arg: _P.args, **kwds: _P.kwargs) -> _T: ... - -# typeshed used the name _CursesWindow for the underlying C class before -# it was mapped to the name 'window' in 3.8. -# Kept here as a legacy alias in case any third-party code is relying on it. -_CursesWindow = window - -# At runtime this class is unexposed and calls itself curses.ncurses_version. -# That name would conflict with the actual curses.ncurses_version, which is -# an instance of this class. -@final -@type_check_only -class _ncurses_version(structseq[int], tuple[int, int, int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("major", "minor", "patch") - - @property - def major(self) -> int: ... - @property - def minor(self) -> int: ... - @property - def patch(self) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/ascii.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/ascii.pyi deleted file mode 100644 index 66efbe36a7..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/ascii.pyi +++ /dev/null @@ -1,62 +0,0 @@ -from typing import TypeVar - -_CharT = TypeVar("_CharT", str, int) - -NUL: int -SOH: int -STX: int -ETX: int -EOT: int -ENQ: int -ACK: int -BEL: int -BS: int -TAB: int -HT: int -LF: int -NL: int -VT: int -FF: int -CR: int -SO: int -SI: int -DLE: int -DC1: int -DC2: int -DC3: int -DC4: int -NAK: int -SYN: int -ETB: int -CAN: int -EM: int -SUB: int -ESC: int -FS: int -GS: int -RS: int -US: int -SP: int -DEL: int - -controlnames: list[int] - -def isalnum(c: str | int) -> bool: ... -def isalpha(c: str | int) -> bool: ... -def isascii(c: str | int) -> bool: ... -def isblank(c: str | int) -> bool: ... -def iscntrl(c: str | int) -> bool: ... -def isdigit(c: str | int) -> bool: ... -def isgraph(c: str | int) -> bool: ... -def islower(c: str | int) -> bool: ... -def isprint(c: str | int) -> bool: ... -def ispunct(c: str | int) -> bool: ... -def isspace(c: str | int) -> bool: ... -def isupper(c: str | int) -> bool: ... -def isxdigit(c: str | int) -> bool: ... -def isctrl(c: str | int) -> bool: ... -def ismeta(c: str | int) -> bool: ... -def ascii(c: _CharT) -> _CharT: ... -def ctrl(c: _CharT) -> _CharT: ... -def alt(c: _CharT) -> _CharT: ... -def unctrl(c: str | int) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/has_key.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/has_key.pyi deleted file mode 100644 index 3811060b91..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/has_key.pyi +++ /dev/null @@ -1 +0,0 @@ -def has_key(ch: int | str) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/panel.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/panel.pyi deleted file mode 100644 index 861559d38b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/panel.pyi +++ /dev/null @@ -1 +0,0 @@ -from _curses_panel import * diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/textpad.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/textpad.pyi deleted file mode 100644 index 48ef67c9d8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/curses/textpad.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from _curses import window -from collections.abc import Callable - -def rectangle(win: window, uly: int, ulx: int, lry: int, lrx: int) -> None: ... - -class Textbox: - stripspaces: bool - def __init__(self, win: window, insert_mode: bool = False) -> None: ... - def edit(self, validate: Callable[[int], int] | None = None) -> str: ... - def do_command(self, ch: str | int) -> None: ... - def gather(self) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/dataclasses.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/dataclasses.pyi deleted file mode 100644 index e08b1919d8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/dataclasses.pyi +++ /dev/null @@ -1,312 +0,0 @@ -import enum -import sys -import types -from _typeshed import DataclassInstance -from builtins import type as Type # alias to avoid name clashes with fields named "type" -from collections.abc import Callable, Iterable, Mapping -from types import GenericAlias -from typing import Any, Generic, Literal, Protocol, TypeVar, overload -from typing_extensions import Never, TypeIs - -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True) - -__all__ = [ - "dataclass", - "field", - "Field", - "FrozenInstanceError", - "InitVar", - "MISSING", - "fields", - "asdict", - "astuple", - "make_dataclass", - "replace", - "is_dataclass", -] - -if sys.version_info >= (3, 10): - __all__ += ["KW_ONLY"] - -_DataclassT = TypeVar("_DataclassT", bound=DataclassInstance) - -# define _MISSING_TYPE as an enum within the type stubs, -# even though that is not really its type at runtime -# this allows us to use Literal[_MISSING_TYPE.MISSING] -# for background, see: -# https://github.com/python/typeshed/pull/5900#issuecomment-895513797 -class _MISSING_TYPE(enum.Enum): - MISSING = enum.auto() - -MISSING = _MISSING_TYPE.MISSING - -if sys.version_info >= (3, 10): - class KW_ONLY: ... - -@overload -def asdict(obj: DataclassInstance) -> dict[str, Any]: ... -@overload -def asdict(obj: DataclassInstance, *, dict_factory: Callable[[list[tuple[str, Any]]], _T]) -> _T: ... -@overload -def astuple(obj: DataclassInstance) -> tuple[Any, ...]: ... -@overload -def astuple(obj: DataclassInstance, *, tuple_factory: Callable[[list[Any]], _T]) -> _T: ... -@overload -def dataclass(cls: None, /) -> Callable[[type[_T]], type[_T]]: ... -@overload -def dataclass(cls: type[_T], /) -> type[_T]: ... - -if sys.version_info >= (3, 11): - @overload - def dataclass( - *, - init: bool = True, - repr: bool = True, - eq: bool = True, - order: bool = False, - unsafe_hash: bool = False, - frozen: bool = False, - match_args: bool = True, - kw_only: bool = False, - slots: bool = False, - weakref_slot: bool = False, - ) -> Callable[[type[_T]], type[_T]]: ... - -elif sys.version_info >= (3, 10): - @overload - def dataclass( - *, - init: bool = True, - repr: bool = True, - eq: bool = True, - order: bool = False, - unsafe_hash: bool = False, - frozen: bool = False, - match_args: bool = True, - kw_only: bool = False, - slots: bool = False, - ) -> Callable[[type[_T]], type[_T]]: ... - -else: - @overload - def dataclass( - *, - init: bool = True, - repr: bool = True, - eq: bool = True, - order: bool = False, - unsafe_hash: bool = False, - frozen: bool = False, - ) -> Callable[[type[_T]], type[_T]]: ... - -# See https://github.com/python/mypy/issues/10750 -class _DefaultFactory(Protocol[_T_co]): - def __call__(self) -> _T_co: ... - -class Field(Generic[_T]): - name: str - type: Type[_T] | str | Any - default: _T | Literal[_MISSING_TYPE.MISSING] - default_factory: _DefaultFactory[_T] | Literal[_MISSING_TYPE.MISSING] - repr: bool - hash: bool | None - init: bool - compare: bool - metadata: types.MappingProxyType[Any, Any] - if sys.version_info >= (3, 10): - kw_only: bool | Literal[_MISSING_TYPE.MISSING] - def __init__( - self, - default: _T, - default_factory: Callable[[], _T], - init: bool, - repr: bool, - hash: bool | None, - compare: bool, - metadata: Mapping[Any, Any], - kw_only: bool, - ) -> None: ... - else: - def __init__( - self, - default: _T, - default_factory: Callable[[], _T], - init: bool, - repr: bool, - hash: bool | None, - compare: bool, - metadata: Mapping[Any, Any], - ) -> None: ... - - def __set_name__(self, owner: Type[Any], name: str) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -# NOTE: Actual return type is 'Field[_T]', but we want to help type checkers -# to understand the magic that happens at runtime. -if sys.version_info >= (3, 10): - @overload # `default` and `default_factory` are optional and mutually exclusive. - def field( - *, - default: _T, - default_factory: Literal[_MISSING_TYPE.MISSING] = ..., - init: bool = True, - repr: bool = True, - hash: bool | None = None, - compare: bool = True, - metadata: Mapping[Any, Any] | None = None, - kw_only: bool | Literal[_MISSING_TYPE.MISSING] = ..., - ) -> _T: ... - @overload - def field( - *, - default: Literal[_MISSING_TYPE.MISSING] = ..., - default_factory: Callable[[], _T], - init: bool = True, - repr: bool = True, - hash: bool | None = None, - compare: bool = True, - metadata: Mapping[Any, Any] | None = None, - kw_only: bool | Literal[_MISSING_TYPE.MISSING] = ..., - ) -> _T: ... - @overload - def field( - *, - default: Literal[_MISSING_TYPE.MISSING] = ..., - default_factory: Literal[_MISSING_TYPE.MISSING] = ..., - init: bool = True, - repr: bool = True, - hash: bool | None = None, - compare: bool = True, - metadata: Mapping[Any, Any] | None = None, - kw_only: bool | Literal[_MISSING_TYPE.MISSING] = ..., - ) -> Any: ... - -else: - @overload # `default` and `default_factory` are optional and mutually exclusive. - def field( - *, - default: _T, - default_factory: Literal[_MISSING_TYPE.MISSING] = ..., - init: bool = True, - repr: bool = True, - hash: bool | None = None, - compare: bool = True, - metadata: Mapping[Any, Any] | None = None, - ) -> _T: ... - @overload - def field( - *, - default: Literal[_MISSING_TYPE.MISSING] = ..., - default_factory: Callable[[], _T], - init: bool = True, - repr: bool = True, - hash: bool | None = None, - compare: bool = True, - metadata: Mapping[Any, Any] | None = None, - ) -> _T: ... - @overload - def field( - *, - default: Literal[_MISSING_TYPE.MISSING] = ..., - default_factory: Literal[_MISSING_TYPE.MISSING] = ..., - init: bool = True, - repr: bool = True, - hash: bool | None = None, - compare: bool = True, - metadata: Mapping[Any, Any] | None = None, - ) -> Any: ... - -def fields(class_or_instance: DataclassInstance | type[DataclassInstance]) -> tuple[Field[Any], ...]: ... - -# HACK: `obj: Never` typing matches if object argument is using `Any` type. -@overload -def is_dataclass(obj: Never) -> TypeIs[DataclassInstance | type[DataclassInstance]]: ... # type: ignore[narrowed-type-not-subtype] # pyright: ignore[reportGeneralTypeIssues] -@overload -def is_dataclass(obj: type) -> TypeIs[type[DataclassInstance]]: ... -@overload -def is_dataclass(obj: object) -> TypeIs[DataclassInstance | type[DataclassInstance]]: ... - -class FrozenInstanceError(AttributeError): ... - -class InitVar(Generic[_T], metaclass=type): - type: Type[_T] - def __init__(self, type: Type[_T]) -> None: ... - @overload - def __class_getitem__(cls, type: Type[_T]) -> InitVar[_T]: ... # pyright: ignore[reportInvalidTypeForm] - @overload - def __class_getitem__(cls, type: Any) -> InitVar[Any]: ... # pyright: ignore[reportInvalidTypeForm] - -if sys.version_info >= (3, 12): - def make_dataclass( - cls_name: str, - fields: Iterable[str | tuple[str, Any] | tuple[str, Any, Any]], - *, - bases: tuple[type, ...] = (), - namespace: dict[str, Any] | None = None, - init: bool = True, - repr: bool = True, - eq: bool = True, - order: bool = False, - unsafe_hash: bool = False, - frozen: bool = False, - match_args: bool = True, - kw_only: bool = False, - slots: bool = False, - weakref_slot: bool = False, - module: str | None = None, - ) -> type: ... - -elif sys.version_info >= (3, 11): - def make_dataclass( - cls_name: str, - fields: Iterable[str | tuple[str, Any] | tuple[str, Any, Any]], - *, - bases: tuple[type, ...] = (), - namespace: dict[str, Any] | None = None, - init: bool = True, - repr: bool = True, - eq: bool = True, - order: bool = False, - unsafe_hash: bool = False, - frozen: bool = False, - match_args: bool = True, - kw_only: bool = False, - slots: bool = False, - weakref_slot: bool = False, - ) -> type: ... - -elif sys.version_info >= (3, 10): - def make_dataclass( - cls_name: str, - fields: Iterable[str | tuple[str, Any] | tuple[str, Any, Any]], - *, - bases: tuple[type, ...] = (), - namespace: dict[str, Any] | None = None, - init: bool = True, - repr: bool = True, - eq: bool = True, - order: bool = False, - unsafe_hash: bool = False, - frozen: bool = False, - match_args: bool = True, - kw_only: bool = False, - slots: bool = False, - ) -> type: ... - -else: - def make_dataclass( - cls_name: str, - fields: Iterable[str | tuple[str, Any] | tuple[str, Any, Any]], - *, - bases: tuple[type, ...] = (), - namespace: dict[str, Any] | None = None, - init: bool = True, - repr: bool = True, - eq: bool = True, - order: bool = False, - unsafe_hash: bool = False, - frozen: bool = False, - ) -> type: ... - -def replace(obj: _DataclassT, /, **changes: Any) -> _DataclassT: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/datetime.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/datetime.pyi deleted file mode 100644 index 72fb5fceb1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/datetime.pyi +++ /dev/null @@ -1,332 +0,0 @@ -import sys -from abc import abstractmethod -from time import struct_time -from typing import ClassVar, Final, NoReturn, SupportsIndex, final, overload, type_check_only -from typing_extensions import CapsuleType, Self, TypeAlias, deprecated - -if sys.version_info >= (3, 11): - __all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", "MINYEAR", "MAXYEAR", "UTC") -else: - __all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", "MINYEAR", "MAXYEAR") - -MINYEAR: Final = 1 -MAXYEAR: Final = 9999 - -class tzinfo: - @abstractmethod - def tzname(self, dt: datetime | None, /) -> str | None: ... - @abstractmethod - def utcoffset(self, dt: datetime | None, /) -> timedelta | None: ... - @abstractmethod - def dst(self, dt: datetime | None, /) -> timedelta | None: ... - def fromutc(self, dt: datetime, /) -> datetime: ... - -# Alias required to avoid name conflicts with date(time).tzinfo. -_TzInfo: TypeAlias = tzinfo - -@final -class timezone(tzinfo): - utc: ClassVar[timezone] - min: ClassVar[timezone] - max: ClassVar[timezone] - def __new__(cls, offset: timedelta, name: str = ...) -> Self: ... - def tzname(self, dt: datetime | None, /) -> str: ... - 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 - -# This class calls itself datetime.IsoCalendarDate. It's neither -# NamedTuple nor structseq. -@final -@type_check_only -class _IsoCalendarDate(tuple[int, int, int]): - @property - def year(self) -> int: ... - @property - def week(self) -> int: ... - @property - def weekday(self) -> int: ... - -class date: - min: ClassVar[date] - max: ClassVar[date] - resolution: ClassVar[timedelta] - def __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex) -> Self: ... - @classmethod - def fromtimestamp(cls, timestamp: float, /) -> Self: ... - @classmethod - def today(cls) -> Self: ... - @classmethod - def fromordinal(cls, n: int, /) -> Self: ... - @classmethod - def fromisoformat(cls, date_string: str, /) -> Self: ... - @classmethod - def fromisocalendar(cls, year: int, week: int, day: int) -> Self: ... - @property - def year(self) -> int: ... - @property - def month(self) -> int: ... - @property - def day(self) -> int: ... - def ctime(self) -> str: ... - # On <3.12, the name of the parameter in the pure-Python implementation - # didn't match the name in the C implementation, - # meaning it is only *safe* to pass it as a keyword argument on 3.12+ - if sys.version_info >= (3, 12): - def strftime(self, format: str) -> str: ... - else: - def strftime(self, format: str, /) -> str: ... - - def __format__(self, fmt: str, /) -> str: ... - def isoformat(self) -> str: ... - def timetuple(self) -> struct_time: ... - def toordinal(self) -> int: ... - if sys.version_info >= (3, 13): - def __replace__(self, /, *, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ... - - def replace(self, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ... - def __le__(self, value: date, /) -> bool: ... - def __lt__(self, value: date, /) -> bool: ... - def __ge__(self, value: date, /) -> bool: ... - def __gt__(self, value: date, /) -> bool: ... - def __eq__(self, value: object, /) -> bool: ... - def __add__(self, value: timedelta, /) -> Self: ... - def __radd__(self, value: timedelta, /) -> Self: ... - @overload - def __sub__(self, value: datetime, /) -> NoReturn: ... - @overload - def __sub__(self, value: Self, /) -> timedelta: ... - @overload - def __sub__(self, value: timedelta, /) -> Self: ... - def __hash__(self) -> int: ... - def weekday(self) -> int: ... - def isoweekday(self) -> int: ... - def isocalendar(self) -> _IsoCalendarDate: ... - -class time: - min: ClassVar[time] - max: ClassVar[time] - resolution: ClassVar[timedelta] - def __new__( - cls, - hour: SupportsIndex = ..., - minute: SupportsIndex = ..., - second: SupportsIndex = ..., - microsecond: SupportsIndex = ..., - tzinfo: _TzInfo | None = ..., - *, - fold: int = ..., - ) -> Self: ... - @property - def hour(self) -> int: ... - @property - def minute(self) -> int: ... - @property - def second(self) -> int: ... - @property - def microsecond(self) -> int: ... - @property - def tzinfo(self) -> _TzInfo | None: ... - @property - def fold(self) -> int: ... - def __le__(self, value: time, /) -> bool: ... - 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 - def fromisoformat(cls, time_string: str, /) -> Self: ... - # On <3.12, the name of the parameter in the pure-Python implementation - # didn't match the name in the C implementation, - # meaning it is only *safe* to pass it as a keyword argument on 3.12+ - if sys.version_info >= (3, 12): - def strftime(self, format: str) -> str: ... - else: - def strftime(self, format: str, /) -> str: ... - - def __format__(self, fmt: str, /) -> str: ... - def utcoffset(self) -> timedelta | None: ... - def tzname(self) -> str | None: ... - def dst(self) -> timedelta | None: ... - if sys.version_info >= (3, 13): - def __replace__( - self, - /, - *, - hour: SupportsIndex = ..., - minute: SupportsIndex = ..., - second: SupportsIndex = ..., - microsecond: SupportsIndex = ..., - tzinfo: _TzInfo | None = ..., - fold: int = ..., - ) -> Self: ... - - def replace( - self, - hour: SupportsIndex = ..., - minute: SupportsIndex = ..., - second: SupportsIndex = ..., - microsecond: SupportsIndex = ..., - tzinfo: _TzInfo | None = ..., - *, - fold: int = ..., - ) -> Self: ... - -_Date: TypeAlias = date -_Time: TypeAlias = time - -class timedelta: - min: ClassVar[timedelta] - max: ClassVar[timedelta] - resolution: ClassVar[timedelta] - def __new__( - cls, - days: float = ..., - seconds: float = ..., - microseconds: float = ..., - milliseconds: float = ..., - minutes: float = ..., - hours: float = ..., - weeks: float = ..., - ) -> Self: ... - @property - def days(self) -> int: ... - @property - def seconds(self) -> int: ... - @property - def microseconds(self) -> int: ... - def total_seconds(self) -> float: ... - def __add__(self, value: timedelta, /) -> timedelta: ... - def __radd__(self, value: timedelta, /) -> timedelta: ... - def __sub__(self, value: timedelta, /) -> timedelta: ... - def __rsub__(self, value: timedelta, /) -> timedelta: ... - def __neg__(self) -> timedelta: ... - def __pos__(self) -> timedelta: ... - def __abs__(self) -> timedelta: ... - def __mul__(self, value: float, /) -> timedelta: ... - def __rmul__(self, value: float, /) -> timedelta: ... - @overload - def __floordiv__(self, value: timedelta, /) -> int: ... - @overload - def __floordiv__(self, value: int, /) -> timedelta: ... - @overload - def __truediv__(self, value: timedelta, /) -> float: ... - @overload - def __truediv__(self, value: float, /) -> timedelta: ... - def __mod__(self, value: timedelta, /) -> timedelta: ... - def __divmod__(self, value: timedelta, /) -> tuple[int, timedelta]: ... - def __le__(self, value: timedelta, /) -> bool: ... - 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: ... - -class datetime(date): - min: ClassVar[datetime] - max: ClassVar[datetime] - def __new__( - cls, - year: SupportsIndex, - month: SupportsIndex, - day: SupportsIndex, - hour: SupportsIndex = ..., - minute: SupportsIndex = ..., - second: SupportsIndex = ..., - microsecond: SupportsIndex = ..., - tzinfo: _TzInfo | None = ..., - *, - fold: int = ..., - ) -> Self: ... - @property - def hour(self) -> int: ... - @property - def minute(self) -> int: ... - @property - def second(self) -> int: ... - @property - def microsecond(self) -> int: ... - @property - def tzinfo(self) -> _TzInfo | None: ... - @property - def fold(self) -> int: ... - # On <3.12, the name of the first parameter in the pure-Python implementation - # didn't match the name in the C implementation, - # meaning it is only *safe* to pass it as a keyword argument on 3.12+ - if sys.version_info >= (3, 12): - @classmethod - def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = ...) -> Self: ... - else: - @classmethod - def fromtimestamp(cls, timestamp: float, /, tz: _TzInfo | None = ...) -> Self: ... - - @classmethod - @deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)") - def utcfromtimestamp(cls, t: float, /) -> Self: ... - @classmethod - def now(cls, tz: _TzInfo | None = None) -> Self: ... - @classmethod - @deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .now(datetime.timezone.utc)") - def utcnow(cls) -> Self: ... - @classmethod - def combine(cls, date: _Date, time: _Time, tzinfo: _TzInfo | None = ...) -> Self: ... - def timestamp(self) -> float: ... - def utctimetuple(self) -> struct_time: ... - def date(self) -> _Date: ... - def time(self) -> _Time: ... - def timetz(self) -> _Time: ... - if sys.version_info >= (3, 13): - def __replace__( - self, - /, - *, - year: SupportsIndex = ..., - month: SupportsIndex = ..., - day: SupportsIndex = ..., - hour: SupportsIndex = ..., - minute: SupportsIndex = ..., - second: SupportsIndex = ..., - microsecond: SupportsIndex = ..., - tzinfo: _TzInfo | None = ..., - fold: int = ..., - ) -> Self: ... - - def replace( - self, - year: SupportsIndex = ..., - month: SupportsIndex = ..., - day: SupportsIndex = ..., - hour: SupportsIndex = ..., - minute: SupportsIndex = ..., - second: SupportsIndex = ..., - microsecond: SupportsIndex = ..., - tzinfo: _TzInfo | None = ..., - *, - fold: int = ..., - ) -> Self: ... - def astimezone(self, tz: _TzInfo | None = ...) -> Self: ... - def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ... - @classmethod - def strptime(cls, date_string: str, format: str, /) -> Self: ... - def utcoffset(self) -> timedelta | None: ... - def tzname(self) -> str | None: ... - def dst(self) -> timedelta | None: ... - def __le__(self, value: datetime, /) -> bool: ... # type: ignore[override] - 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: ... - @overload # type: ignore[override] - def __sub__(self, value: Self, /) -> timedelta: ... - @overload - def __sub__(self, value: timedelta, /) -> Self: ... - -datetime_CAPI: CapsuleType diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/__init__.pyi deleted file mode 100644 index 7f344060f9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/__init__.pyi +++ /dev/null @@ -1,104 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from collections.abc import Iterator, MutableMapping -from types import TracebackType -from typing import Literal, type_check_only -from typing_extensions import Self, TypeAlias - -__all__ = ["open", "whichdb", "error"] - -_KeyType: TypeAlias = str | bytes -_ValueType: TypeAlias = str | bytes | bytearray -_TFlags: TypeAlias = Literal[ - "r", - "w", - "c", - "n", - "rf", - "wf", - "cf", - "nf", - "rs", - "ws", - "cs", - "ns", - "ru", - "wu", - "cu", - "nu", - "rfs", - "wfs", - "cfs", - "nfs", - "rfu", - "wfu", - "cfu", - "nfu", - "rsf", - "wsf", - "csf", - "nsf", - "rsu", - "wsu", - "csu", - "nsu", - "ruf", - "wuf", - "cuf", - "nuf", - "rus", - "wus", - "cus", - "nus", - "rfsu", - "wfsu", - "cfsu", - "nfsu", - "rfus", - "wfus", - "cfus", - "nfus", - "rsfu", - "wsfu", - "csfu", - "nsfu", - "rsuf", - "wsuf", - "csuf", - "nsuf", - "rufs", - "wufs", - "cufs", - "nufs", - "rusf", - "wusf", - "cusf", - "nusf", -] - -class _Database(MutableMapping[_KeyType, bytes]): - def close(self) -> None: ... - def __getitem__(self, key: _KeyType) -> bytes: ... - def __setitem__(self, key: _KeyType, value: _ValueType) -> None: ... - def __delitem__(self, key: _KeyType) -> None: ... - def __iter__(self) -> Iterator[bytes]: ... - def __len__(self) -> int: ... - def __del__(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - -# This class is not exposed. It calls itself dbm.error. -@type_check_only -class _error(Exception): ... - -error: tuple[type[_error], type[OSError]] - -if sys.version_info >= (3, 11): - def whichdb(filename: StrOrBytesPath) -> str | None: ... - def open(file: StrOrBytesPath, flag: _TFlags = "r", mode: int = 0o666) -> _Database: ... - -else: - def whichdb(filename: str) -> str | None: ... - def open(file: str, flag: _TFlags = "r", mode: int = 0o666) -> _Database: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/dumb.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/dumb.pyi deleted file mode 100644 index 1c0b7756f2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/dumb.pyi +++ /dev/null @@ -1,37 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from collections.abc import Iterator, MutableMapping -from types import TracebackType -from typing_extensions import Self, TypeAlias - -__all__ = ["error", "open"] - -_KeyType: TypeAlias = str | bytes -_ValueType: TypeAlias = str | bytes - -error = OSError - -# This class doesn't exist at runtime. open() can return an instance of -# any of the three implementations of dbm (dumb, gnu, ndbm), and this -# class is intended to represent the common interface supported by all three. -class _Database(MutableMapping[_KeyType, bytes]): - def __init__(self, filebasename: str, mode: str, flag: str = "c") -> None: ... - def sync(self) -> None: ... - def iterkeys(self) -> Iterator[bytes]: ... # undocumented - def close(self) -> None: ... - def __getitem__(self, key: _KeyType) -> bytes: ... - def __setitem__(self, key: _KeyType, val: _ValueType) -> None: ... - def __delitem__(self, key: _KeyType) -> None: ... - def __iter__(self) -> Iterator[bytes]: ... - def __len__(self) -> int: ... - def __del__(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - -if sys.version_info >= (3, 11): - def open(file: StrOrBytesPath, flag: str = "c", mode: int = 0o666) -> _Database: ... - -else: - def open(file: str, flag: str = "c", mode: int = 0o666) -> _Database: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/gnu.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/gnu.pyi deleted file mode 100644 index 2dac3d12b0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/gnu.pyi +++ /dev/null @@ -1 +0,0 @@ -from _gdbm import * diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/ndbm.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/ndbm.pyi deleted file mode 100644 index 66c943ab64..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/ndbm.pyi +++ /dev/null @@ -1 +0,0 @@ -from _dbm import * diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/sqlite3.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/sqlite3.pyi deleted file mode 100644 index 446a0cf155..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/dbm/sqlite3.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from _typeshed import ReadableBuffer, StrOrBytesPath, Unused -from collections.abc import Generator, MutableMapping -from typing import Final, Literal -from typing_extensions import LiteralString, Self, TypeAlias - -BUILD_TABLE: Final[LiteralString] -GET_SIZE: Final[LiteralString] -LOOKUP_KEY: Final[LiteralString] -STORE_KV: Final[LiteralString] -DELETE_KEY: Final[LiteralString] -ITER_KEYS: Final[LiteralString] - -_SqliteData: TypeAlias = str | ReadableBuffer | int | float - -class error(OSError): ... - -class _Database(MutableMapping[bytes, bytes]): - def __init__(self, path: StrOrBytesPath, /, *, flag: Literal["r", "w", "c", "n"], mode: int) -> None: ... - def __len__(self) -> int: ... - def __getitem__(self, key: _SqliteData) -> bytes: ... - def __setitem__(self, key: _SqliteData, value: _SqliteData) -> None: ... - def __delitem__(self, key: _SqliteData) -> None: ... - def __iter__(self) -> Generator[bytes]: ... - def close(self) -> None: ... - def keys(self) -> list[bytes]: ... # type: ignore[override] - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - -def open(filename: StrOrBytesPath, /, flag: Literal["r", "w,", "c", "n"] = "r", mode: int = 0o666) -> _Database: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/decimal.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/decimal.pyi deleted file mode 100644 index 4ded21e0b0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/decimal.pyi +++ /dev/null @@ -1,264 +0,0 @@ -import numbers -from _decimal import ( - HAVE_CONTEXTVAR as HAVE_CONTEXTVAR, - HAVE_THREADS as HAVE_THREADS, - MAX_EMAX as MAX_EMAX, - MAX_PREC as MAX_PREC, - MIN_EMIN as MIN_EMIN, - MIN_ETINY as MIN_ETINY, - ROUND_05UP as ROUND_05UP, - ROUND_CEILING as ROUND_CEILING, - ROUND_DOWN as ROUND_DOWN, - ROUND_FLOOR as ROUND_FLOOR, - ROUND_HALF_DOWN as ROUND_HALF_DOWN, - ROUND_HALF_EVEN as ROUND_HALF_EVEN, - ROUND_HALF_UP as ROUND_HALF_UP, - ROUND_UP as ROUND_UP, - BasicContext as BasicContext, - DefaultContext as DefaultContext, - ExtendedContext as ExtendedContext, - __libmpdec_version__ as __libmpdec_version__, - __version__ as __version__, - getcontext as getcontext, - localcontext as localcontext, - setcontext as setcontext, -) -from collections.abc import Container, Sequence -from types import TracebackType -from typing import Any, ClassVar, Literal, NamedTuple, final, overload, type_check_only -from typing_extensions import Self, TypeAlias - -_Decimal: TypeAlias = Decimal | int -_DecimalNew: TypeAlias = Decimal | float | str | tuple[int, Sequence[int], int] -_ComparableNum: TypeAlias = Decimal | float | numbers.Rational -_TrapType: TypeAlias = type[DecimalException] - -# At runtime, these classes are implemented in C as part of "_decimal". -# However, they consider themselves to live in "decimal", so we'll put them here. - -# This type isn't exposed at runtime. It calls itself decimal.ContextManager -@final -@type_check_only -class _ContextManager: - def __init__(self, new_context: Context) -> None: ... - def __enter__(self) -> Context: ... - def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... - -class DecimalTuple(NamedTuple): - sign: int - digits: tuple[int, ...] - exponent: int | Literal["n", "N", "F"] - -class DecimalException(ArithmeticError): ... -class Clamped(DecimalException): ... -class InvalidOperation(DecimalException): ... -class ConversionSyntax(InvalidOperation): ... -class DivisionByZero(DecimalException, ZeroDivisionError): ... -class DivisionImpossible(InvalidOperation): ... -class DivisionUndefined(InvalidOperation, ZeroDivisionError): ... -class Inexact(DecimalException): ... -class InvalidContext(InvalidOperation): ... -class Rounded(DecimalException): ... -class Subnormal(DecimalException): ... -class Overflow(Inexact, Rounded): ... -class Underflow(Inexact, Rounded, Subnormal): ... -class FloatOperation(DecimalException, TypeError): ... - -class Decimal: - def __new__(cls, value: _DecimalNew = "0", context: Context | None = None) -> Self: ... - @classmethod - def from_float(cls, f: float, /) -> Self: ... - def __bool__(self) -> bool: ... - def compare(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def __hash__(self) -> int: ... - def as_tuple(self) -> DecimalTuple: ... - def as_integer_ratio(self) -> tuple[int, int]: ... - def to_eng_string(self, context: Context | None = None) -> str: ... - def __abs__(self) -> Decimal: ... - def __add__(self, value: _Decimal, /) -> Decimal: ... - def __divmod__(self, value: _Decimal, /) -> tuple[Decimal, Decimal]: ... - def __eq__(self, value: object, /) -> bool: ... - def __floordiv__(self, value: _Decimal, /) -> Decimal: ... - def __ge__(self, value: _ComparableNum, /) -> bool: ... - def __gt__(self, value: _ComparableNum, /) -> bool: ... - def __le__(self, value: _ComparableNum, /) -> bool: ... - def __lt__(self, value: _ComparableNum, /) -> bool: ... - def __mod__(self, value: _Decimal, /) -> Decimal: ... - def __mul__(self, value: _Decimal, /) -> Decimal: ... - def __neg__(self) -> Decimal: ... - def __pos__(self) -> Decimal: ... - def __pow__(self, value: _Decimal, mod: _Decimal | None = None, /) -> Decimal: ... - def __radd__(self, value: _Decimal, /) -> Decimal: ... - def __rdivmod__(self, value: _Decimal, /) -> tuple[Decimal, Decimal]: ... - def __rfloordiv__(self, value: _Decimal, /) -> Decimal: ... - def __rmod__(self, value: _Decimal, /) -> Decimal: ... - def __rmul__(self, value: _Decimal, /) -> Decimal: ... - def __rsub__(self, value: _Decimal, /) -> Decimal: ... - def __rtruediv__(self, value: _Decimal, /) -> Decimal: ... - def __sub__(self, value: _Decimal, /) -> Decimal: ... - def __truediv__(self, value: _Decimal, /) -> Decimal: ... - def remainder_near(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def __float__(self) -> float: ... - def __int__(self) -> int: ... - def __trunc__(self) -> int: ... - @property - def real(self) -> Decimal: ... - @property - def imag(self) -> Decimal: ... - def conjugate(self) -> Decimal: ... - def __complex__(self) -> complex: ... - @overload - def __round__(self) -> int: ... - @overload - def __round__(self, ndigits: int, /) -> Decimal: ... - def __floor__(self) -> int: ... - def __ceil__(self) -> int: ... - def fma(self, other: _Decimal, third: _Decimal, context: Context | None = None) -> Decimal: ... - def __rpow__(self, value: _Decimal, mod: Context | None = None, /) -> Decimal: ... - def normalize(self, context: Context | None = None) -> Decimal: ... - def quantize(self, exp: _Decimal, rounding: str | None = None, context: Context | None = None) -> Decimal: ... - def same_quantum(self, other: _Decimal, context: Context | None = None) -> bool: ... - def to_integral_exact(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ... - def to_integral_value(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ... - def to_integral(self, rounding: str | None = None, context: Context | None = None) -> Decimal: ... - def sqrt(self, context: Context | None = None) -> Decimal: ... - def max(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def min(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def adjusted(self) -> int: ... - def canonical(self) -> Decimal: ... - def compare_signal(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def compare_total(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def compare_total_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def copy_abs(self) -> Decimal: ... - def copy_negate(self) -> Decimal: ... - def copy_sign(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def exp(self, context: Context | None = None) -> Decimal: ... - def is_canonical(self) -> bool: ... - def is_finite(self) -> bool: ... - def is_infinite(self) -> bool: ... - def is_nan(self) -> bool: ... - def is_normal(self, context: Context | None = None) -> bool: ... - def is_qnan(self) -> bool: ... - def is_signed(self) -> bool: ... - def is_snan(self) -> bool: ... - def is_subnormal(self, context: Context | None = None) -> bool: ... - def is_zero(self) -> bool: ... - def ln(self, context: Context | None = None) -> Decimal: ... - def log10(self, context: Context | None = None) -> Decimal: ... - def logb(self, context: Context | None = None) -> Decimal: ... - def logical_and(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def logical_invert(self, context: Context | None = None) -> Decimal: ... - def logical_or(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def logical_xor(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def max_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def min_mag(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def next_minus(self, context: Context | None = None) -> Decimal: ... - def next_plus(self, context: Context | None = None) -> Decimal: ... - def next_toward(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def number_class(self, context: Context | None = None) -> str: ... - def radix(self) -> Decimal: ... - def rotate(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def scaleb(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def shift(self, other: _Decimal, context: Context | None = None) -> Decimal: ... - def __reduce__(self) -> tuple[type[Self], tuple[str]]: ... - def __copy__(self) -> Self: ... - def __deepcopy__(self, memo: Any, /) -> Self: ... - def __format__(self, specifier: str, context: Context | None = None, /) -> str: ... - -class Context: - # TODO: Context doesn't allow you to delete *any* attributes from instances of the class at runtime, - # even settable attributes like `prec` and `rounding`, - # but that's inexpressible in the stub. - # Type checkers either ignore it or misinterpret it - # if you add a `def __delattr__(self, name: str, /) -> NoReturn` method to the stub - prec: int - rounding: str - Emin: int - Emax: int - capitals: int - clamp: int - traps: dict[_TrapType, bool] - flags: dict[_TrapType, bool] - def __init__( - self, - prec: int | None = None, - rounding: str | None = None, - Emin: int | None = None, - Emax: int | None = None, - capitals: int | None = None, - clamp: int | None = None, - flags: dict[_TrapType, bool] | Container[_TrapType] | None = None, - traps: dict[_TrapType, bool] | Container[_TrapType] | None = None, - ) -> None: ... - def __reduce__(self) -> tuple[type[Self], tuple[Any, ...]]: ... - def clear_flags(self) -> None: ... - def clear_traps(self) -> None: ... - def copy(self) -> Context: ... - def __copy__(self) -> Context: ... - # see https://github.com/python/cpython/issues/94107 - __hash__: ClassVar[None] # type: ignore[assignment] - def Etiny(self) -> int: ... - def Etop(self) -> int: ... - def create_decimal(self, num: _DecimalNew = "0", /) -> Decimal: ... - def create_decimal_from_float(self, f: float, /) -> Decimal: ... - def abs(self, x: _Decimal, /) -> Decimal: ... - def add(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def canonical(self, x: Decimal, /) -> Decimal: ... - def compare(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def compare_signal(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def compare_total(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def compare_total_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def copy_abs(self, x: _Decimal, /) -> Decimal: ... - def copy_decimal(self, x: _Decimal, /) -> Decimal: ... - def copy_negate(self, x: _Decimal, /) -> Decimal: ... - def copy_sign(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def divide(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def divide_int(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def divmod(self, x: _Decimal, y: _Decimal, /) -> tuple[Decimal, Decimal]: ... - def exp(self, x: _Decimal, /) -> Decimal: ... - def fma(self, x: _Decimal, y: _Decimal, z: _Decimal, /) -> Decimal: ... - def is_canonical(self, x: _Decimal, /) -> bool: ... - def is_finite(self, x: _Decimal, /) -> bool: ... - def is_infinite(self, x: _Decimal, /) -> bool: ... - def is_nan(self, x: _Decimal, /) -> bool: ... - def is_normal(self, x: _Decimal, /) -> bool: ... - def is_qnan(self, x: _Decimal, /) -> bool: ... - def is_signed(self, x: _Decimal, /) -> bool: ... - def is_snan(self, x: _Decimal, /) -> bool: ... - def is_subnormal(self, x: _Decimal, /) -> bool: ... - def is_zero(self, x: _Decimal, /) -> bool: ... - def ln(self, x: _Decimal, /) -> Decimal: ... - def log10(self, x: _Decimal, /) -> Decimal: ... - def logb(self, x: _Decimal, /) -> Decimal: ... - def logical_and(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def logical_invert(self, x: _Decimal, /) -> Decimal: ... - def logical_or(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def logical_xor(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def max(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def max_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def min(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def min_mag(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def minus(self, x: _Decimal, /) -> Decimal: ... - def multiply(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def next_minus(self, x: _Decimal, /) -> Decimal: ... - def next_plus(self, x: _Decimal, /) -> Decimal: ... - def next_toward(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def normalize(self, x: _Decimal, /) -> Decimal: ... - def number_class(self, x: _Decimal, /) -> str: ... - def plus(self, x: _Decimal, /) -> Decimal: ... - def power(self, a: _Decimal, b: _Decimal, modulo: _Decimal | None = None) -> Decimal: ... - def quantize(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def radix(self) -> Decimal: ... - def remainder(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def remainder_near(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def rotate(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def same_quantum(self, x: _Decimal, y: _Decimal, /) -> bool: ... - def scaleb(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def shift(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def sqrt(self, x: _Decimal, /) -> Decimal: ... - def subtract(self, x: _Decimal, y: _Decimal, /) -> Decimal: ... - def to_eng_string(self, x: _Decimal, /) -> str: ... - def to_sci_string(self, x: _Decimal, /) -> str: ... - def to_integral_exact(self, x: _Decimal, /) -> Decimal: ... - def to_integral_value(self, x: _Decimal, /) -> Decimal: ... - def to_integral(self, x: _Decimal, /) -> Decimal: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/difflib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/difflib.pyi deleted file mode 100644 index 18583a3acf..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/difflib.pyi +++ /dev/null @@ -1,132 +0,0 @@ -from collections.abc import Callable, Iterable, Iterator, Sequence -from types import GenericAlias -from typing import Any, AnyStr, Generic, Literal, NamedTuple, TypeVar, overload - -__all__ = [ - "get_close_matches", - "ndiff", - "restore", - "SequenceMatcher", - "Differ", - "IS_CHARACTER_JUNK", - "IS_LINE_JUNK", - "context_diff", - "unified_diff", - "diff_bytes", - "HtmlDiff", - "Match", -] - -_T = TypeVar("_T") - -class Match(NamedTuple): - a: int - b: int - size: int - -class SequenceMatcher(Generic[_T]): - @overload - def __init__(self, isjunk: Callable[[_T], bool] | None, a: Sequence[_T], b: Sequence[_T], autojunk: bool = True) -> None: ... - @overload - def __init__(self, *, a: Sequence[_T], b: Sequence[_T], autojunk: bool = True) -> None: ... - @overload - def __init__( - self: SequenceMatcher[str], - isjunk: Callable[[str], bool] | None = None, - a: Sequence[str] = "", - b: Sequence[str] = "", - autojunk: bool = True, - ) -> None: ... - def set_seqs(self, a: Sequence[_T], b: Sequence[_T]) -> None: ... - def set_seq1(self, a: Sequence[_T]) -> None: ... - def set_seq2(self, b: Sequence[_T]) -> None: ... - def find_longest_match(self, alo: int = 0, ahi: int | None = None, blo: int = 0, bhi: int | None = None) -> Match: ... - def get_matching_blocks(self) -> list[Match]: ... - def get_opcodes(self) -> list[tuple[Literal["replace", "delete", "insert", "equal"], int, int, int, int]]: ... - def get_grouped_opcodes(self, n: int = 3) -> Iterable[list[tuple[str, int, int, int, int]]]: ... - def ratio(self) -> float: ... - def quick_ratio(self) -> float: ... - def real_quick_ratio(self) -> float: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -@overload -def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = 3, cutoff: float = 0.6) -> list[AnyStr]: ... -@overload -def get_close_matches( - word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = 3, cutoff: float = 0.6 -) -> list[Sequence[_T]]: ... - -class Differ: - def __init__(self, linejunk: Callable[[str], bool] | None = None, charjunk: Callable[[str], bool] | None = None) -> None: ... - def compare(self, a: Sequence[str], b: Sequence[str]) -> Iterator[str]: ... - -def IS_LINE_JUNK(line: str, pat: Any = ...) -> bool: ... # pat is undocumented -def IS_CHARACTER_JUNK(ch: str, ws: str = " \t") -> bool: ... # ws is undocumented -def unified_diff( - a: Sequence[str], - b: Sequence[str], - fromfile: str = "", - tofile: str = "", - fromfiledate: str = "", - tofiledate: str = "", - n: int = 3, - lineterm: str = "\n", -) -> Iterator[str]: ... -def context_diff( - a: Sequence[str], - b: Sequence[str], - fromfile: str = "", - tofile: str = "", - fromfiledate: str = "", - tofiledate: str = "", - n: int = 3, - lineterm: str = "\n", -) -> Iterator[str]: ... -def ndiff( - a: Sequence[str], - b: Sequence[str], - linejunk: Callable[[str], bool] | None = None, - charjunk: Callable[[str], bool] | None = ..., -) -> Iterator[str]: ... - -class HtmlDiff: - def __init__( - self, - tabsize: int = 8, - wrapcolumn: int | None = None, - linejunk: Callable[[str], bool] | None = None, - charjunk: Callable[[str], bool] | None = ..., - ) -> None: ... - def make_file( - self, - fromlines: Sequence[str], - tolines: Sequence[str], - fromdesc: str = "", - todesc: str = "", - context: bool = False, - numlines: int = 5, - *, - charset: str = "utf-8", - ) -> str: ... - def make_table( - self, - fromlines: Sequence[str], - tolines: Sequence[str], - fromdesc: str = "", - todesc: str = "", - context: bool = False, - numlines: int = 5, - ) -> str: ... - -def restore(delta: Iterable[str], which: int) -> Iterator[str]: ... -def diff_bytes( - dfunc: Callable[[Sequence[str], Sequence[str], str, str, str, str, int, str], Iterator[str]], - a: Iterable[bytes | bytearray], - b: Iterable[bytes | bytearray], - fromfile: bytes | bytearray = b"", - tofile: bytes | bytearray = b"", - fromfiledate: bytes | bytearray = b"", - tofiledate: bytes | bytearray = b"", - n: int = 3, - lineterm: bytes | bytearray = b"\n", -) -> Iterator[bytes]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/dis.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/dis.pyi deleted file mode 100644 index cb69eac89c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/dis.pyi +++ /dev/null @@ -1,222 +0,0 @@ -import sys -import types -from collections.abc import Callable, Iterator -from opcode import * # `dis` re-exports it as a part of public API -from typing import IO, Any, NamedTuple -from typing_extensions import Self, TypeAlias - -__all__ = [ - "code_info", - "dis", - "disassemble", - "distb", - "disco", - "findlinestarts", - "findlabels", - "show_code", - "get_instructions", - "Instruction", - "Bytecode", - "cmp_op", - "hasconst", - "hasname", - "hasjrel", - "hasjabs", - "haslocal", - "hascompare", - "hasfree", - "opname", - "opmap", - "HAVE_ARGUMENT", - "EXTENDED_ARG", - "stack_effect", -] -if sys.version_info >= (3, 13): - __all__ += ["hasjump"] - -if sys.version_info >= (3, 12): - __all__ += ["hasarg", "hasexc"] -else: - __all__ += ["hasnargs"] - -# Strictly this should not have to include Callable, but mypy doesn't use FunctionType -# for functions (python/mypy#3171) -_HaveCodeType: TypeAlias = types.MethodType | types.FunctionType | types.CodeType | type | Callable[..., Any] - -if sys.version_info >= (3, 11): - class Positions(NamedTuple): - lineno: int | None = None - end_lineno: int | None = None - col_offset: int | None = None - end_col_offset: int | None = None - -if sys.version_info >= (3, 13): - class _Instruction(NamedTuple): - opname: str - opcode: int - arg: int | None - argval: Any - argrepr: str - offset: int - start_offset: int - starts_line: bool - line_number: int | None - label: int | None = None - positions: Positions | None = None - cache_info: list[tuple[str, int, Any]] | None = None - -elif sys.version_info >= (3, 11): - class _Instruction(NamedTuple): - opname: str - opcode: int - arg: int | None - argval: Any - argrepr: str - offset: int - starts_line: int | None - is_jump_target: bool - positions: Positions | None = None - -else: - class _Instruction(NamedTuple): - opname: str - opcode: int - arg: int | None - argval: Any - argrepr: str - offset: int - starts_line: int | None - is_jump_target: bool - -class Instruction(_Instruction): - if sys.version_info < (3, 13): - def _disassemble(self, lineno_width: int = 3, mark_as_current: bool = False, offset_width: int = 4) -> str: ... - if sys.version_info >= (3, 13): - @property - def oparg(self) -> int: ... - @property - def baseopcode(self) -> int: ... - @property - def baseopname(self) -> str: ... - @property - def cache_offset(self) -> int: ... - @property - def end_offset(self) -> int: ... - @property - def jump_target(self) -> int: ... - @property - def is_jump_target(self) -> bool: ... - -class Bytecode: - codeobj: types.CodeType - first_line: int - if sys.version_info >= (3, 13): - show_offsets: bool - # 3.13 added `show_offsets` - def __init__( - self, - x: _HaveCodeType | str, - *, - first_line: int | None = None, - current_offset: int | None = None, - show_caches: bool = False, - adaptive: bool = False, - show_offsets: bool = False, - ) -> None: ... - elif sys.version_info >= (3, 11): - def __init__( - self, - x: _HaveCodeType | str, - *, - first_line: int | None = None, - current_offset: int | None = None, - show_caches: bool = False, - adaptive: bool = False, - ) -> None: ... - else: - def __init__( - self, x: _HaveCodeType | str, *, first_line: int | None = None, current_offset: int | None = None - ) -> None: ... - - if sys.version_info >= (3, 11): - @classmethod - def from_traceback(cls, tb: types.TracebackType, *, show_caches: bool = False, adaptive: bool = False) -> Self: ... - else: - @classmethod - def from_traceback(cls, tb: types.TracebackType) -> Self: ... - - def __iter__(self) -> Iterator[Instruction]: ... - def info(self) -> str: ... - def dis(self) -> str: ... - -COMPILER_FLAG_NAMES: dict[int, str] - -def findlabels(code: _HaveCodeType) -> list[int]: ... -def findlinestarts(code: _HaveCodeType) -> Iterator[tuple[int, int]]: ... -def pretty_flags(flags: int) -> str: ... -def code_info(x: _HaveCodeType | str) -> str: ... - -if sys.version_info >= (3, 13): - # 3.13 added `show_offsets` - def dis( - x: _HaveCodeType | str | bytes | bytearray | None = None, - *, - file: IO[str] | None = None, - depth: int | None = None, - show_caches: bool = False, - adaptive: bool = False, - show_offsets: bool = False, - ) -> None: ... - def disassemble( - co: _HaveCodeType, - lasti: int = -1, - *, - file: IO[str] | None = None, - show_caches: bool = False, - adaptive: bool = False, - show_offsets: bool = False, - ) -> None: ... - def distb( - tb: types.TracebackType | None = None, - *, - file: IO[str] | None = None, - show_caches: bool = False, - adaptive: bool = False, - show_offsets: bool = False, - ) -> None: ... - # 3.13 made `show_cache` `None` by default - def get_instructions( - x: _HaveCodeType, *, first_line: int | None = None, show_caches: bool | None = None, adaptive: bool = False - ) -> Iterator[Instruction]: ... - -elif sys.version_info >= (3, 11): - # 3.11 added `show_caches` and `adaptive` - def dis( - x: _HaveCodeType | str | bytes | bytearray | None = None, - *, - file: IO[str] | None = None, - depth: int | None = None, - show_caches: bool = False, - adaptive: bool = False, - ) -> None: ... - def disassemble( - co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False - ) -> None: ... - def distb( - tb: types.TracebackType | None = None, *, file: IO[str] | None = None, show_caches: bool = False, adaptive: bool = False - ) -> None: ... - def get_instructions( - x: _HaveCodeType, *, first_line: int | None = None, show_caches: bool = False, adaptive: bool = False - ) -> Iterator[Instruction]: ... - -else: - def dis( - x: _HaveCodeType | str | bytes | bytearray | None = None, *, file: IO[str] | None = None, depth: int | None = None - ) -> None: ... - def disassemble(co: _HaveCodeType, lasti: int = -1, *, file: IO[str] | None = None) -> None: ... - def distb(tb: types.TracebackType | None = None, *, file: IO[str] | None = None) -> None: ... - def get_instructions(x: _HaveCodeType, *, first_line: int | None = None) -> Iterator[Instruction]: ... - -def show_code(co: _HaveCodeType, *, file: IO[str] | None = None) -> None: ... - -disco = disassemble diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/__init__.pyi deleted file mode 100644 index 328a5b7834..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/__init__.pyi +++ /dev/null @@ -1,5 +0,0 @@ -# Attempts to improve these stubs are probably not the best use of time: -# - distutils is deleted in Python 3.12 and newer -# - Most users already do not use stdlib distutils, due to setuptools monkeypatching -# - We have very little quality assurance on these stubs, since due to the two above issues -# we allowlist all distutils errors in stubtest. diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/_msvccompiler.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/_msvccompiler.pyi deleted file mode 100644 index bba9373b72..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/_msvccompiler.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from _typeshed import Incomplete -from distutils.ccompiler import CCompiler -from typing import ClassVar, Final - -PLAT_SPEC_TO_RUNTIME: Final[dict[str, str]] -PLAT_TO_VCVARS: Final[dict[str, str]] - -class MSVCCompiler(CCompiler): - compiler_type: ClassVar[str] - executables: ClassVar[dict[Incomplete, Incomplete]] - res_extension: ClassVar[str] - initialized: bool - def initialize(self, plat_name: str | None = None) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/archive_util.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/archive_util.pyi deleted file mode 100644 index 16684ff069..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/archive_util.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from _typeshed import StrOrBytesPath, StrPath -from typing import Literal, overload - -@overload -def make_archive( - base_name: str, - format: str, - root_dir: StrOrBytesPath | None = None, - base_dir: str | None = None, - verbose: bool | Literal[0, 1] = 0, - dry_run: bool | Literal[0, 1] = 0, - owner: str | None = None, - group: str | None = None, -) -> str: ... -@overload -def make_archive( - base_name: StrPath, - format: str, - root_dir: StrOrBytesPath, - base_dir: str | None = None, - verbose: bool | Literal[0, 1] = 0, - dry_run: bool | Literal[0, 1] = 0, - owner: str | None = None, - group: str | None = None, -) -> str: ... -def make_tarball( - base_name: str, - base_dir: StrPath, - compress: str | None = "gzip", - verbose: bool | Literal[0, 1] = 0, - dry_run: bool | Literal[0, 1] = 0, - owner: str | None = None, - group: str | None = None, -) -> str: ... -def make_zipfile(base_name: str, base_dir: str, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/bcppcompiler.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/bcppcompiler.pyi deleted file mode 100644 index 3e432f94b5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/bcppcompiler.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from distutils.ccompiler import CCompiler - -class BCPPCompiler(CCompiler): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/ccompiler.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/ccompiler.pyi deleted file mode 100644 index 5bff209807..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/ccompiler.pyi +++ /dev/null @@ -1,176 +0,0 @@ -from _typeshed import BytesPath, StrPath, Unused -from collections.abc import Callable, Iterable, Sequence -from distutils.file_util import _BytesPathT, _StrPathT -from typing import Literal, overload -from typing_extensions import TypeAlias, TypeVarTuple, Unpack - -_Macro: TypeAlias = tuple[str] | tuple[str, str | None] -_Ts = TypeVarTuple("_Ts") - -def gen_lib_options( - compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str] -) -> list[str]: ... -def gen_preprocess_options(macros: list[_Macro], include_dirs: list[str]) -> list[str]: ... -def get_default_compiler(osname: str | None = None, platform: str | None = None) -> str: ... -def new_compiler( - plat: str | None = None, - compiler: str | None = None, - verbose: bool | Literal[0, 1] = 0, - dry_run: bool | Literal[0, 1] = 0, - force: bool | Literal[0, 1] = 0, -) -> CCompiler: ... -def show_compilers() -> None: ... - -class CCompiler: - dry_run: bool - force: bool - verbose: bool - output_dir: str | None - macros: list[_Macro] - include_dirs: list[str] - libraries: list[str] - library_dirs: list[str] - runtime_library_dirs: list[str] - objects: list[str] - def __init__( - self, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0, force: bool | Literal[0, 1] = 0 - ) -> None: ... - def add_include_dir(self, dir: str) -> None: ... - def set_include_dirs(self, dirs: list[str]) -> None: ... - def add_library(self, libname: str) -> None: ... - def set_libraries(self, libnames: list[str]) -> None: ... - def add_library_dir(self, dir: str) -> None: ... - def set_library_dirs(self, dirs: list[str]) -> None: ... - def add_runtime_library_dir(self, dir: str) -> None: ... - def set_runtime_library_dirs(self, dirs: list[str]) -> None: ... - def define_macro(self, name: str, value: str | None = None) -> None: ... - def undefine_macro(self, name: str) -> None: ... - def add_link_object(self, object: str) -> None: ... - def set_link_objects(self, objects: list[str]) -> None: ... - def detect_language(self, sources: str | list[str]) -> str | None: ... - def find_library_file(self, dirs: list[str], lib: str, debug: bool | Literal[0, 1] = 0) -> str | None: ... - def has_function( - self, - funcname: str, - includes: list[str] | None = None, - include_dirs: list[str] | None = None, - libraries: list[str] | None = None, - library_dirs: list[str] | None = None, - ) -> bool: ... - def library_dir_option(self, dir: str) -> str: ... - def library_option(self, lib: str) -> str: ... - def runtime_library_dir_option(self, dir: str) -> str: ... - def set_executables(self, **args: str) -> None: ... - def compile( - self, - sources: Sequence[StrPath], - output_dir: str | None = None, - macros: list[_Macro] | None = None, - include_dirs: list[str] | None = None, - debug: bool | Literal[0, 1] = 0, - extra_preargs: list[str] | None = None, - extra_postargs: list[str] | None = None, - depends: list[str] | None = None, - ) -> list[str]: ... - def create_static_lib( - self, - objects: list[str], - output_libname: str, - output_dir: str | None = None, - debug: bool | Literal[0, 1] = 0, - target_lang: str | None = None, - ) -> None: ... - def link( - self, - target_desc: str, - objects: list[str], - output_filename: str, - output_dir: str | None = None, - libraries: list[str] | None = None, - library_dirs: list[str] | None = None, - runtime_library_dirs: list[str] | None = None, - export_symbols: list[str] | None = None, - debug: bool | Literal[0, 1] = 0, - extra_preargs: list[str] | None = None, - extra_postargs: list[str] | None = None, - build_temp: str | None = None, - target_lang: str | None = None, - ) -> None: ... - def link_executable( - self, - objects: list[str], - output_progname: str, - output_dir: str | None = None, - libraries: list[str] | None = None, - library_dirs: list[str] | None = None, - runtime_library_dirs: list[str] | None = None, - debug: bool | Literal[0, 1] = 0, - extra_preargs: list[str] | None = None, - extra_postargs: list[str] | None = None, - target_lang: str | None = None, - ) -> None: ... - def link_shared_lib( - self, - objects: list[str], - output_libname: str, - output_dir: str | None = None, - libraries: list[str] | None = None, - library_dirs: list[str] | None = None, - runtime_library_dirs: list[str] | None = None, - export_symbols: list[str] | None = None, - debug: bool | Literal[0, 1] = 0, - extra_preargs: list[str] | None = None, - extra_postargs: list[str] | None = None, - build_temp: str | None = None, - target_lang: str | None = None, - ) -> None: ... - def link_shared_object( - self, - objects: list[str], - output_filename: str, - output_dir: str | None = None, - libraries: list[str] | None = None, - library_dirs: list[str] | None = None, - runtime_library_dirs: list[str] | None = None, - export_symbols: list[str] | None = None, - debug: bool | Literal[0, 1] = 0, - extra_preargs: list[str] | None = None, - extra_postargs: list[str] | None = None, - build_temp: str | None = None, - target_lang: str | None = None, - ) -> None: ... - def preprocess( - self, - source: str, - output_file: str | None = None, - macros: list[_Macro] | None = None, - include_dirs: list[str] | None = None, - extra_preargs: list[str] | None = None, - extra_postargs: list[str] | None = None, - ) -> None: ... - @overload - def executable_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = "") -> str: ... - @overload - def executable_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = "") -> str: ... - def library_filename( - self, libname: str, lib_type: str = "static", strip_dir: bool | Literal[0, 1] = 0, output_dir: StrPath = "" - ) -> str: ... - def object_filenames( - self, source_filenames: Iterable[StrPath], strip_dir: bool | Literal[0, 1] = 0, output_dir: StrPath | None = "" - ) -> list[str]: ... - @overload - def shared_object_filename(self, basename: str, strip_dir: Literal[0, False] = 0, output_dir: StrPath = "") -> str: ... - @overload - def shared_object_filename(self, basename: StrPath, strip_dir: Literal[1, True], output_dir: StrPath = "") -> str: ... - def execute( - self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = None, level: int = 1 - ) -> None: ... - def spawn(self, cmd: Iterable[str]) -> None: ... - def mkpath(self, name: str, mode: int = 0o777) -> None: ... - @overload - def move_file(self, src: StrPath, dst: _StrPathT) -> _StrPathT | str: ... - @overload - def move_file(self, src: BytesPath, dst: _BytesPathT) -> _BytesPathT | bytes: ... - def announce(self, msg: str, level: int = 1) -> None: ... - def warn(self, msg: str) -> None: ... - def debug_print(self, msg: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/cmd.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/cmd.pyi deleted file mode 100644 index a4e77ddf13..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/cmd.pyi +++ /dev/null @@ -1,229 +0,0 @@ -from _typeshed import BytesPath, Incomplete, StrOrBytesPath, StrPath, Unused -from abc import abstractmethod -from collections.abc import Callable, Iterable -from distutils.command.bdist import bdist -from distutils.command.bdist_dumb import bdist_dumb -from distutils.command.bdist_rpm import bdist_rpm -from distutils.command.build import build -from distutils.command.build_clib import build_clib -from distutils.command.build_ext import build_ext -from distutils.command.build_py import build_py -from distutils.command.build_scripts import build_scripts -from distutils.command.check import check -from distutils.command.clean import clean -from distutils.command.config import config -from distutils.command.install import install -from distutils.command.install_data import install_data -from distutils.command.install_egg_info import install_egg_info -from distutils.command.install_headers import install_headers -from distutils.command.install_lib import install_lib -from distutils.command.install_scripts import install_scripts -from distutils.command.register import register -from distutils.command.sdist import sdist -from distutils.command.upload import upload -from distutils.dist import Distribution -from distutils.file_util import _BytesPathT, _StrPathT -from typing import Any, ClassVar, Literal, TypeVar, overload -from typing_extensions import TypeVarTuple, Unpack - -_CommandT = TypeVar("_CommandT", bound=Command) -_Ts = TypeVarTuple("_Ts") - -class Command: - dry_run: bool | Literal[0, 1] # Exposed from __getattr_. Same as Distribution.dry_run - distribution: Distribution - # Any to work around variance issues - sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] - def __init__(self, dist: Distribution) -> None: ... - @abstractmethod - def initialize_options(self) -> None: ... - @abstractmethod - def finalize_options(self) -> None: ... - @abstractmethod - def run(self) -> None: ... - def announce(self, msg: str, level: int = 1) -> None: ... - def debug_print(self, msg: str) -> None: ... - def ensure_string(self, option: str, default: str | None = None) -> None: ... - def ensure_string_list(self, option: str) -> None: ... - def ensure_filename(self, option: str) -> None: ... - def ensure_dirname(self, option: str) -> None: ... - def get_command_name(self) -> str: ... - def set_undefined_options(self, src_cmd: str, *option_pairs: tuple[str, str]) -> None: ... - # NOTE: This list comes directly from the distutils/command folder. Minus bdist_msi and bdist_wininst. - @overload - def get_finalized_command(self, command: Literal["bdist"], create: bool | Literal[0, 1] = 1) -> bdist: ... - @overload - def get_finalized_command(self, command: Literal["bdist_dumb"], create: bool | Literal[0, 1] = 1) -> bdist_dumb: ... - @overload - def get_finalized_command(self, command: Literal["bdist_rpm"], create: bool | Literal[0, 1] = 1) -> bdist_rpm: ... - @overload - def get_finalized_command(self, command: Literal["build"], create: bool | Literal[0, 1] = 1) -> build: ... - @overload - def get_finalized_command(self, command: Literal["build_clib"], create: bool | Literal[0, 1] = 1) -> build_clib: ... - @overload - def get_finalized_command(self, command: Literal["build_ext"], create: bool | Literal[0, 1] = 1) -> build_ext: ... - @overload - def get_finalized_command(self, command: Literal["build_py"], create: bool | Literal[0, 1] = 1) -> build_py: ... - @overload - def get_finalized_command(self, command: Literal["build_scripts"], create: bool | Literal[0, 1] = 1) -> build_scripts: ... - @overload - def get_finalized_command(self, command: Literal["check"], create: bool | Literal[0, 1] = 1) -> check: ... - @overload - def get_finalized_command(self, command: Literal["clean"], create: bool | Literal[0, 1] = 1) -> clean: ... - @overload - def get_finalized_command(self, command: Literal["config"], create: bool | Literal[0, 1] = 1) -> config: ... - @overload - def get_finalized_command(self, command: Literal["install"], create: bool | Literal[0, 1] = 1) -> install: ... - @overload - def get_finalized_command(self, command: Literal["install_data"], create: bool | Literal[0, 1] = 1) -> install_data: ... - @overload - def get_finalized_command( - self, command: Literal["install_egg_info"], create: bool | Literal[0, 1] = 1 - ) -> install_egg_info: ... - @overload - def get_finalized_command(self, command: Literal["install_headers"], create: bool | Literal[0, 1] = 1) -> install_headers: ... - @overload - def get_finalized_command(self, command: Literal["install_lib"], create: bool | Literal[0, 1] = 1) -> install_lib: ... - @overload - def get_finalized_command(self, command: Literal["install_scripts"], create: bool | Literal[0, 1] = 1) -> install_scripts: ... - @overload - def get_finalized_command(self, command: Literal["register"], create: bool | Literal[0, 1] = 1) -> register: ... - @overload - def get_finalized_command(self, command: Literal["sdist"], create: bool | Literal[0, 1] = 1) -> sdist: ... - @overload - def get_finalized_command(self, command: Literal["upload"], create: bool | Literal[0, 1] = 1) -> upload: ... - @overload - def get_finalized_command(self, command: str, create: bool | Literal[0, 1] = 1) -> Command: ... - @overload - def reinitialize_command(self, command: Literal["bdist"], reinit_subcommands: bool | Literal[0, 1] = 0) -> bdist: ... - @overload - def reinitialize_command( - self, command: Literal["bdist_dumb"], reinit_subcommands: bool | Literal[0, 1] = 0 - ) -> bdist_dumb: ... - @overload - def reinitialize_command(self, command: Literal["bdist_rpm"], reinit_subcommands: bool | Literal[0, 1] = 0) -> bdist_rpm: ... - @overload - def reinitialize_command(self, command: Literal["build"], reinit_subcommands: bool | Literal[0, 1] = 0) -> build: ... - @overload - def reinitialize_command( - self, command: Literal["build_clib"], reinit_subcommands: bool | Literal[0, 1] = 0 - ) -> build_clib: ... - @overload - def reinitialize_command(self, command: Literal["build_ext"], reinit_subcommands: bool | Literal[0, 1] = 0) -> build_ext: ... - @overload - def reinitialize_command(self, command: Literal["build_py"], reinit_subcommands: bool | Literal[0, 1] = 0) -> build_py: ... - @overload - def reinitialize_command( - self, command: Literal["build_scripts"], reinit_subcommands: bool | Literal[0, 1] = 0 - ) -> build_scripts: ... - @overload - def reinitialize_command(self, command: Literal["check"], reinit_subcommands: bool | Literal[0, 1] = 0) -> check: ... - @overload - def reinitialize_command(self, command: Literal["clean"], reinit_subcommands: bool | Literal[0, 1] = 0) -> clean: ... - @overload - def reinitialize_command(self, command: Literal["config"], reinit_subcommands: bool | Literal[0, 1] = 0) -> config: ... - @overload - def reinitialize_command(self, command: Literal["install"], reinit_subcommands: bool | Literal[0, 1] = 0) -> install: ... - @overload - def reinitialize_command( - self, command: Literal["install_data"], reinit_subcommands: bool | Literal[0, 1] = 0 - ) -> install_data: ... - @overload - def reinitialize_command( - self, command: Literal["install_egg_info"], reinit_subcommands: bool | Literal[0, 1] = 0 - ) -> install_egg_info: ... - @overload - def reinitialize_command( - self, command: Literal["install_headers"], reinit_subcommands: bool | Literal[0, 1] = 0 - ) -> install_headers: ... - @overload - def reinitialize_command( - self, command: Literal["install_lib"], reinit_subcommands: bool | Literal[0, 1] = 0 - ) -> install_lib: ... - @overload - def reinitialize_command( - self, command: Literal["install_scripts"], reinit_subcommands: bool | Literal[0, 1] = 0 - ) -> install_scripts: ... - @overload - def reinitialize_command(self, command: Literal["register"], reinit_subcommands: bool | Literal[0, 1] = 0) -> register: ... - @overload - def reinitialize_command(self, command: Literal["sdist"], reinit_subcommands: bool | Literal[0, 1] = 0) -> sdist: ... - @overload - def reinitialize_command(self, command: Literal["upload"], reinit_subcommands: bool | Literal[0, 1] = 0) -> upload: ... - @overload - def reinitialize_command(self, command: str, reinit_subcommands: bool | Literal[0, 1] = 0) -> Command: ... - @overload - def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool | Literal[0, 1] = 0) -> _CommandT: ... - def run_command(self, command: str) -> None: ... - def get_sub_commands(self) -> list[str]: ... - def warn(self, msg: str) -> None: ... - def execute( - self, func: Callable[[Unpack[_Ts]], Unused], args: tuple[Unpack[_Ts]], msg: str | None = None, level: int = 1 - ) -> None: ... - def mkpath(self, name: str, mode: int = 0o777) -> None: ... - @overload - def copy_file( - self, - infile: StrPath, - outfile: _StrPathT, - preserve_mode: bool | Literal[0, 1] = 1, - preserve_times: bool | Literal[0, 1] = 1, - link: str | None = None, - level: Unused = 1, - ) -> tuple[_StrPathT | str, bool]: ... - @overload - def copy_file( - self, - infile: BytesPath, - outfile: _BytesPathT, - preserve_mode: bool | Literal[0, 1] = 1, - preserve_times: bool | Literal[0, 1] = 1, - link: str | None = None, - level: Unused = 1, - ) -> tuple[_BytesPathT | bytes, bool]: ... - def copy_tree( - self, - infile: StrPath, - outfile: str, - preserve_mode: bool | Literal[0, 1] = 1, - preserve_times: bool | Literal[0, 1] = 1, - preserve_symlinks: bool | Literal[0, 1] = 0, - level: Unused = 1, - ) -> list[str]: ... - @overload - def move_file(self, src: StrPath, dst: _StrPathT, level: Unused = 1) -> _StrPathT | str: ... - @overload - def move_file(self, src: BytesPath, dst: _BytesPathT, level: Unused = 1) -> _BytesPathT | bytes: ... - def spawn(self, cmd: Iterable[str], search_path: bool | Literal[0, 1] = 1, level: Unused = 1) -> None: ... - @overload - def make_archive( - self, - base_name: str, - format: str, - root_dir: StrOrBytesPath | None = None, - base_dir: str | None = None, - owner: str | None = None, - group: str | None = None, - ) -> str: ... - @overload - def make_archive( - self, - base_name: StrPath, - format: str, - root_dir: StrOrBytesPath, - base_dir: str | None = None, - owner: str | None = None, - group: str | None = None, - ) -> str: ... - def make_file( - self, - infiles: str | list[str] | tuple[str, ...], - outfile: StrOrBytesPath, - func: Callable[[Unpack[_Ts]], Unused], - args: tuple[Unpack[_Ts]], - exec_msg: str | None = None, - skip_msg: str | None = None, - level: Unused = 1, - ) -> None: ... - def ensure_finalized(self) -> None: ... - def dump_options(self, header: Incomplete | None = None, indent: str = "") -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/__init__.pyi deleted file mode 100644 index 4d7372858a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/__init__.pyi +++ /dev/null @@ -1,48 +0,0 @@ -import sys - -from . import ( - bdist, - bdist_dumb, - bdist_rpm, - build, - build_clib, - build_ext, - build_py, - build_scripts, - check, - clean, - install, - install_data, - install_headers, - install_lib, - install_scripts, - register, - sdist, - upload, -) - -__all__ = [ - "build", - "build_py", - "build_ext", - "build_clib", - "build_scripts", - "clean", - "install", - "install_lib", - "install_headers", - "install_scripts", - "install_data", - "sdist", - "register", - "bdist", - "bdist_dumb", - "bdist_rpm", - "check", - "upload", -] - -if sys.version_info < (3, 10): - from . import bdist_wininst - - __all__ += ["bdist_wininst"] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist.pyi deleted file mode 100644 index 6f99620707..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from _typeshed import Incomplete, Unused -from collections.abc import Callable -from typing import ClassVar - -from ..cmd import Command - -def show_formats() -> None: ... - -class bdist(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]] - no_format_option: ClassVar[tuple[str, ...]] - default_format: ClassVar[dict[str, str]] - format_commands: ClassVar[list[str]] - format_command: ClassVar[dict[str, tuple[str, str]]] - bdist_base: Incomplete - plat_name: Incomplete - formats: Incomplete - dist_dir: Incomplete - skip_build: int - group: Incomplete - owner: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_dumb.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_dumb.pyi deleted file mode 100644 index 297a0c39ed..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_dumb.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from ..cmd import Command - -class bdist_dumb(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - default_format: ClassVar[dict[str, str]] - bdist_dir: Incomplete - plat_name: Incomplete - format: Incomplete - keep_temp: int - dist_dir: Incomplete - skip_build: Incomplete - relative: int - owner: Incomplete - group: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_msi.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_msi.pyi deleted file mode 100644 index d677f81d14..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_msi.pyi +++ /dev/null @@ -1,45 +0,0 @@ -import sys -from _typeshed import Incomplete -from typing import ClassVar, Literal - -from ..cmd import Command - -if sys.platform == "win32": - from msilib import Control, Dialog - - class PyDialog(Dialog): - def __init__(self, *args, **kw) -> None: ... - def title(self, title) -> None: ... - def back(self, title, next, name: str = "Back", active: bool | Literal[0, 1] = 1) -> Control: ... - def cancel(self, title, next, name: str = "Cancel", active: bool | Literal[0, 1] = 1) -> Control: ... - def next(self, title, next, name: str = "Next", active: bool | Literal[0, 1] = 1) -> Control: ... - def xbutton(self, name, title, next, xpos) -> Control: ... - - class bdist_msi(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - all_versions: Incomplete - other_version: str - def __init__(self, *args, **kw) -> None: ... - bdist_dir: Incomplete - plat_name: Incomplete - keep_temp: int - no_target_compile: int - no_target_optimize: int - target_version: Incomplete - dist_dir: Incomplete - skip_build: Incomplete - install_script: Incomplete - pre_install_script: Incomplete - versions: Incomplete - def initialize_options(self) -> None: ... - install_script_key: Incomplete - def finalize_options(self) -> None: ... - db: Incomplete - def run(self) -> None: ... - def add_files(self) -> None: ... - def add_find_python(self) -> None: ... - def add_scripts(self) -> None: ... - def add_ui(self) -> None: ... - def get_installer_filename(self, fullname): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_packager.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_packager.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_rpm.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_rpm.pyi deleted file mode 100644 index 83b4161094..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_rpm.pyi +++ /dev/null @@ -1,53 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from ..cmd import Command - -class bdist_rpm(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - negative_opt: ClassVar[dict[str, str]] - bdist_base: Incomplete - rpm_base: Incomplete - dist_dir: Incomplete - python: Incomplete - fix_python: Incomplete - spec_only: Incomplete - binary_only: Incomplete - source_only: Incomplete - use_bzip2: Incomplete - distribution_name: Incomplete - group: Incomplete - release: Incomplete - serial: Incomplete - vendor: Incomplete - packager: Incomplete - doc_files: Incomplete - changelog: Incomplete - icon: Incomplete - prep_script: Incomplete - build_script: Incomplete - install_script: Incomplete - clean_script: Incomplete - verify_script: Incomplete - pre_install: Incomplete - post_install: Incomplete - pre_uninstall: Incomplete - post_uninstall: Incomplete - prep: Incomplete - provides: Incomplete - requires: Incomplete - conflicts: Incomplete - build_requires: Incomplete - obsoletes: Incomplete - keep_temp: int - use_rpm_opt_flags: int - rpm3_mode: int - no_autoreq: int - force_arch: Incomplete - quiet: int - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def finalize_package_data(self) -> None: ... - def run(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_wininst.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_wininst.pyi deleted file mode 100644 index cf333bc540..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/bdist_wininst.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from _typeshed import StrOrBytesPath -from distutils.cmd import Command -from typing import ClassVar - -class bdist_wininst(Command): - description: ClassVar[str] - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def get_inidata(self) -> str: ... - def create_exe(self, arcname: StrOrBytesPath, fullname: str, bitmap: StrOrBytesPath | None = None) -> None: ... - def get_installer_filename(self, fullname: str) -> str: ... - def get_exe_bytes(self) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build.pyi deleted file mode 100644 index 3ec0c9614d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build.pyi +++ /dev/null @@ -1,34 +0,0 @@ -from _typeshed import Incomplete, Unused -from collections.abc import Callable -from typing import Any, ClassVar - -from ..cmd import Command - -def show_compilers() -> None: ... - -class build(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]] - build_base: str - build_purelib: Incomplete - build_platlib: Incomplete - build_lib: Incomplete - build_temp: Incomplete - build_scripts: Incomplete - compiler: Incomplete - plat_name: Incomplete - debug: Incomplete - force: int - executable: Incomplete - parallel: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def has_pure_modules(self): ... - def has_c_libraries(self): ... - def has_ext_modules(self): ... - def has_scripts(self): ... - # Any to work around variance issues - sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_clib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_clib.pyi deleted file mode 100644 index 69cfbe7120..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_clib.pyi +++ /dev/null @@ -1,29 +0,0 @@ -from _typeshed import Incomplete, Unused -from collections.abc import Callable -from typing import ClassVar - -from ..cmd import Command - -def show_compilers() -> None: ... - -class build_clib(Command): - description: str - user_options: ClassVar[list[tuple[str, str, str]]] - boolean_options: ClassVar[list[str]] - help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]] - build_clib: Incomplete - build_temp: Incomplete - libraries: Incomplete - include_dirs: Incomplete - define: Incomplete - undef: Incomplete - debug: Incomplete - force: int - compiler: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def check_library_list(self, libraries) -> None: ... - def get_library_names(self): ... - def get_source_files(self): ... - def build_libraries(self, libraries) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_ext.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_ext.pyi deleted file mode 100644 index c5a9b5d508..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_ext.pyi +++ /dev/null @@ -1,52 +0,0 @@ -from _typeshed import Incomplete, Unused -from collections.abc import Callable -from typing import ClassVar - -from ..cmd import Command - -extension_name_re: Incomplete - -def show_compilers() -> None: ... - -class build_ext(Command): - description: str - sep_by: Incomplete - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]] - extensions: Incomplete - build_lib: Incomplete - plat_name: Incomplete - build_temp: Incomplete - inplace: int - package: Incomplete - include_dirs: Incomplete - define: Incomplete - undef: Incomplete - libraries: Incomplete - library_dirs: Incomplete - rpath: Incomplete - link_objects: Incomplete - debug: Incomplete - force: Incomplete - compiler: Incomplete - swig: Incomplete - swig_cpp: Incomplete - swig_opts: Incomplete - user: Incomplete - parallel: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def check_extensions_list(self, extensions) -> None: ... - def get_source_files(self): ... - def get_outputs(self): ... - def build_extensions(self) -> None: ... - def build_extension(self, ext) -> None: ... - def swig_sources(self, sources, extension): ... - def find_swig(self): ... - def get_ext_fullpath(self, ext_name: str) -> str: ... - def get_ext_fullname(self, ext_name: str) -> str: ... - def get_ext_filename(self, ext_name: str) -> str: ... - def get_export_symbols(self, ext): ... - def get_libraries(self, ext): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_py.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_py.pyi deleted file mode 100644 index 23ed230bb2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_py.pyi +++ /dev/null @@ -1,45 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar, Literal - -from ..cmd import Command -from ..util import Mixin2to3 as Mixin2to3 - -class build_py(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - negative_opt: ClassVar[dict[str, str]] - build_lib: Incomplete - py_modules: Incomplete - package: Incomplete - package_data: Incomplete - package_dir: Incomplete - compile: int - optimize: int - force: Incomplete - def initialize_options(self) -> None: ... - packages: Incomplete - data_files: Incomplete - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def get_data_files(self): ... - def find_data_files(self, package, src_dir): ... - def build_package_data(self) -> None: ... - def get_package_dir(self, package): ... - def check_package(self, package, package_dir): ... - def check_module(self, module, module_file): ... - def find_package_modules(self, package, package_dir): ... - def find_modules(self): ... - def find_all_modules(self): ... - def get_source_files(self): ... - def get_module_outfile(self, build_dir, package, module): ... - def get_outputs(self, include_bytecode: bool | Literal[0, 1] = 1) -> list[str]: ... - def build_module(self, module, module_file, package): ... - def build_modules(self) -> None: ... - def build_packages(self) -> None: ... - def byte_compile(self, files) -> None: ... - -class build_py_2to3(build_py, Mixin2to3): - updated_files: Incomplete - def run(self) -> None: ... - def build_module(self, module, module_file, package): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_scripts.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_scripts.pyi deleted file mode 100644 index 8372919bbd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/build_scripts.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from ..cmd import Command -from ..util import Mixin2to3 as Mixin2to3 - -first_line_re: Incomplete - -class build_scripts(Command): - description: str - user_options: ClassVar[list[tuple[str, str, str]]] - boolean_options: ClassVar[list[str]] - build_dir: Incomplete - scripts: Incomplete - force: Incomplete - executable: Incomplete - outfiles: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def get_source_files(self): ... - def run(self) -> None: ... - def copy_scripts(self): ... - -class build_scripts_2to3(build_scripts, Mixin2to3): - def copy_scripts(self): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/check.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/check.pyi deleted file mode 100644 index 2c807fd2c4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/check.pyi +++ /dev/null @@ -1,40 +0,0 @@ -from _typeshed import Incomplete -from typing import Any, ClassVar, Final, Literal -from typing_extensions import TypeAlias - -from ..cmd import Command - -_Reporter: TypeAlias = Any # really docutils.utils.Reporter - -# Only defined if docutils is installed. -# Depends on a third-party stub. Since distutils is deprecated anyway, -# it's easier to just suppress the "any subclassing" error. -class SilentReporter(_Reporter): - messages: Incomplete - def __init__( - self, - source, - report_level, - halt_level, - stream: Incomplete | None = ..., - debug: bool | Literal[0, 1] = 0, - encoding: str = ..., - error_handler: str = ..., - ) -> None: ... - def system_message(self, level, message, *children, **kwargs): ... - -HAS_DOCUTILS: Final[bool] - -class check(Command): - description: str - user_options: ClassVar[list[tuple[str, str, str]]] - boolean_options: ClassVar[list[str]] - restructuredtext: int - metadata: int - strict: int - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def warn(self, msg): ... - def run(self) -> None: ... - def check_metadata(self) -> None: ... - def check_restructuredtext(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/clean.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/clean.pyi deleted file mode 100644 index 0f3768d6dc..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/clean.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from ..cmd import Command - -class clean(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - build_base: Incomplete - build_lib: Incomplete - build_temp: Incomplete - build_scripts: Incomplete - bdist_base: Incomplete - all: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/config.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/config.pyi deleted file mode 100644 index 562ff3a527..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/config.pyi +++ /dev/null @@ -1,84 +0,0 @@ -from _typeshed import Incomplete, StrOrBytesPath -from collections.abc import Sequence -from re import Pattern -from typing import ClassVar, Final, Literal - -from ..ccompiler import CCompiler -from ..cmd import Command - -LANG_EXT: Final[dict[str, str]] - -class config(Command): - description: str - # Tuple is full name, short name, description - user_options: ClassVar[list[tuple[str, str | None, str]]] - compiler: str | CCompiler - cc: str | None - include_dirs: Sequence[str] | None - libraries: Sequence[str] | None - library_dirs: Sequence[str] | None - noisy: int - dump_source: int - temp_files: Sequence[str] - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def try_cpp( - self, - body: str | None = None, - headers: Sequence[str] | None = None, - include_dirs: Sequence[str] | None = None, - lang: str = "c", - ) -> bool: ... - def search_cpp( - self, - pattern: Pattern[str] | str, - body: str | None = None, - headers: Sequence[str] | None = None, - include_dirs: Sequence[str] | None = None, - lang: str = "c", - ) -> bool: ... - def try_compile( - self, body: str, headers: Sequence[str] | None = None, include_dirs: Sequence[str] | None = None, lang: str = "c" - ) -> bool: ... - def try_link( - self, - body: str, - headers: Sequence[str] | None = None, - include_dirs: Sequence[str] | None = None, - libraries: Sequence[str] | None = None, - library_dirs: Sequence[str] | None = None, - lang: str = "c", - ) -> bool: ... - def try_run( - self, - body: str, - headers: Sequence[str] | None = None, - include_dirs: Sequence[str] | None = None, - libraries: Sequence[str] | None = None, - library_dirs: Sequence[str] | None = None, - lang: str = "c", - ) -> bool: ... - def check_func( - self, - func: str, - headers: Sequence[str] | None = None, - include_dirs: Sequence[str] | None = None, - libraries: Sequence[str] | None = None, - library_dirs: Sequence[str] | None = None, - decl: bool | Literal[0, 1] = 0, - call: bool | Literal[0, 1] = 0, - ) -> bool: ... - def check_lib( - self, - library: str, - library_dirs: Sequence[str] | None = None, - headers: Sequence[str] | None = None, - include_dirs: Sequence[str] | None = None, - other_libraries: list[str] = [], - ) -> bool: ... - def check_header( - self, header: str, include_dirs: Sequence[str] | None = None, library_dirs: Sequence[str] | None = None, lang: str = "c" - ) -> bool: ... - -def dump_file(filename: StrOrBytesPath, head: Incomplete | None = None) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install.pyi deleted file mode 100644 index 1714e01a2c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install.pyi +++ /dev/null @@ -1,71 +0,0 @@ -import sys -from _typeshed import Incomplete -from collections.abc import Callable -from typing import Any, ClassVar, Final, Literal - -from ..cmd import Command - -HAS_USER_SITE: Final[bool] - -SCHEME_KEYS: Final[tuple[Literal["purelib"], Literal["platlib"], Literal["headers"], Literal["scripts"], Literal["data"]]] -INSTALL_SCHEMES: Final[dict[str, dict[str, str]]] - -if sys.version_info < (3, 10): - WINDOWS_SCHEME: Final[dict[str, str]] - -class install(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - negative_opt: ClassVar[dict[str, str]] - prefix: str | None - exec_prefix: Incomplete - home: str | None - user: bool - install_base: Incomplete - install_platbase: Incomplete - root: str | None - install_purelib: Incomplete - install_platlib: Incomplete - install_headers: Incomplete - install_lib: str | None - install_scripts: Incomplete - install_data: Incomplete - install_userbase: Incomplete - install_usersite: Incomplete - compile: Incomplete - optimize: Incomplete - extra_path: Incomplete - install_path_file: int - force: int - skip_build: int - warn_dir: int - build_base: Incomplete - build_lib: Incomplete - record: Incomplete - def initialize_options(self) -> None: ... - config_vars: Incomplete - install_libbase: Incomplete - def finalize_options(self) -> None: ... - def dump_dirs(self, msg) -> None: ... - def finalize_unix(self) -> None: ... - def finalize_other(self) -> None: ... - def select_scheme(self, name) -> None: ... - def expand_basedirs(self) -> None: ... - def expand_dirs(self) -> None: ... - def convert_paths(self, *names) -> None: ... - path_file: Incomplete - extra_dirs: Incomplete - def handle_extra_path(self) -> None: ... - def change_roots(self, *names) -> None: ... - def create_home_path(self) -> None: ... - def run(self) -> None: ... - def create_path_file(self) -> None: ... - def get_outputs(self): ... - def get_inputs(self): ... - def has_lib(self): ... - def has_headers(self): ... - def has_scripts(self): ... - def has_data(self): ... - # Any to work around variance issues - sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_data.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_data.pyi deleted file mode 100644 index 609de62b04..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_data.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from ..cmd import Command - -class install_data(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - install_dir: Incomplete - outfiles: Incomplete - root: Incomplete - force: int - data_files: Incomplete - warn_dir: int - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def get_inputs(self): ... - def get_outputs(self): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_egg_info.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_egg_info.pyi deleted file mode 100644 index 75bb906ce5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_egg_info.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from ..cmd import Command - -class install_egg_info(Command): - description: ClassVar[str] - user_options: ClassVar[list[tuple[str, str, str]]] - install_dir: Incomplete - def initialize_options(self) -> None: ... - target: Incomplete - outputs: Incomplete - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def get_outputs(self) -> list[str]: ... - -def safe_name(name): ... -def safe_version(version): ... -def to_filename(name): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_headers.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_headers.pyi deleted file mode 100644 index 3caad8a07d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_headers.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from ..cmd import Command - -class install_headers(Command): - description: str - user_options: ClassVar[list[tuple[str, str, str]]] - boolean_options: ClassVar[list[str]] - install_dir: Incomplete - force: int - outfiles: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def get_inputs(self): ... - def get_outputs(self): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_lib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_lib.pyi deleted file mode 100644 index a537e25490..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_lib.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar, Final - -from ..cmd import Command - -PYTHON_SOURCE_EXTENSION: Final = ".py" - -class install_lib(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - negative_opt: ClassVar[dict[str, str]] - install_dir: Incomplete - build_dir: Incomplete - force: int - compile: Incomplete - optimize: Incomplete - skip_build: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def build(self) -> None: ... - def install(self): ... - def byte_compile(self, files) -> None: ... - def get_outputs(self): ... - def get_inputs(self): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_scripts.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_scripts.pyi deleted file mode 100644 index 658594f32e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/install_scripts.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from ..cmd import Command - -class install_scripts(Command): - description: str - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - install_dir: Incomplete - force: int - build_dir: Incomplete - skip_build: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - outfiles: Incomplete - def run(self) -> None: ... - def get_inputs(self): ... - def get_outputs(self): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/register.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/register.pyi deleted file mode 100644 index cf98e178a9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/register.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from _typeshed import Incomplete -from collections.abc import Callable -from typing import Any, ClassVar - -from ..config import PyPIRCCommand - -class register(PyPIRCCommand): - description: str - # Any to work around variance issues - sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] - list_classifiers: int - strict: int - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def check_metadata(self) -> None: ... - def classifiers(self) -> None: ... - def verify_metadata(self) -> None: ... - def send_metadata(self) -> None: ... - def build_post_data(self, action): ... - def post_to_server(self, data, auth: Incomplete | None = None): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/sdist.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/sdist.pyi deleted file mode 100644 index 48a140714d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/sdist.pyi +++ /dev/null @@ -1,45 +0,0 @@ -from _typeshed import Incomplete, Unused -from collections.abc import Callable -from typing import Any, ClassVar - -from ..cmd import Command - -def show_formats() -> None: ... - -class sdist(Command): - description: str - def checking_metadata(self): ... - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - help_options: ClassVar[list[tuple[str, str | None, str, Callable[[], Unused]]]] - negative_opt: ClassVar[dict[str, str]] - # Any to work around variance issues - sub_commands: ClassVar[list[tuple[str, Callable[[Any], bool] | None]]] - READMES: ClassVar[tuple[str, ...]] - template: Incomplete - manifest: Incomplete - use_defaults: int - prune: int - manifest_only: int - force_manifest: int - formats: Incomplete - keep_temp: int - dist_dir: Incomplete - archive_files: Incomplete - metadata_check: int - owner: Incomplete - group: Incomplete - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - filelist: Incomplete - def run(self) -> None: ... - def check_metadata(self) -> None: ... - def get_file_list(self) -> None: ... - def add_defaults(self) -> None: ... - def read_template(self) -> None: ... - def prune_file_list(self) -> None: ... - def write_manifest(self) -> None: ... - def read_manifest(self) -> None: ... - def make_release_tree(self, base_dir, files) -> None: ... - def make_distribution(self) -> None: ... - def get_archive_files(self): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/upload.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/upload.pyi deleted file mode 100644 index afcfbaf486..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/command/upload.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar - -from ..config import PyPIRCCommand - -class upload(PyPIRCCommand): - description: ClassVar[str] - username: str - password: str - show_response: int - sign: bool - identity: Incomplete - def initialize_options(self) -> None: ... - repository: Incomplete - realm: Incomplete - def finalize_options(self) -> None: ... - def run(self) -> None: ... - def upload_file(self, command: str, pyversion: str, filename: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/config.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/config.pyi deleted file mode 100644 index 5814a82841..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/config.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from abc import abstractmethod -from distutils.cmd import Command -from typing import ClassVar - -DEFAULT_PYPIRC: str - -class PyPIRCCommand(Command): - DEFAULT_REPOSITORY: ClassVar[str] - DEFAULT_REALM: ClassVar[str] - repository: None - realm: None - user_options: ClassVar[list[tuple[str, str | None, str]]] - boolean_options: ClassVar[list[str]] - def initialize_options(self) -> None: ... - def finalize_options(self) -> None: ... - @abstractmethod - def run(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/core.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/core.pyi deleted file mode 100644 index 174f249913..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/core.pyi +++ /dev/null @@ -1,58 +0,0 @@ -from _typeshed import Incomplete, StrOrBytesPath -from collections.abc import Mapping -from distutils.cmd import Command as Command -from distutils.dist import Distribution as Distribution -from distutils.extension import Extension as Extension -from typing import Any, Final, Literal - -USAGE: Final[str] - -def gen_usage(script_name: StrOrBytesPath) -> str: ... - -setup_keywords: tuple[str, ...] -extension_keywords: tuple[str, ...] - -def setup( - *, - name: str = ..., - version: str = ..., - description: str = ..., - long_description: str = ..., - author: str = ..., - author_email: str = ..., - maintainer: str = ..., - maintainer_email: str = ..., - url: str = ..., - download_url: str = ..., - packages: list[str] = ..., - py_modules: list[str] = ..., - scripts: list[str] = ..., - ext_modules: list[Extension] = ..., - classifiers: list[str] = ..., - distclass: type[Distribution] = ..., - script_name: str = ..., - script_args: list[str] = ..., - options: Mapping[str, Incomplete] = ..., - license: str = ..., - keywords: list[str] | str = ..., - platforms: list[str] | str = ..., - cmdclass: Mapping[str, type[Command]] = ..., - data_files: list[tuple[str, list[str]]] = ..., - package_dir: Mapping[str, str] = ..., - obsoletes: list[str] = ..., - provides: list[str] = ..., - requires: list[str] = ..., - command_packages: list[str] = ..., - command_options: Mapping[str, Mapping[str, tuple[Incomplete, Incomplete]]] = ..., - package_data: Mapping[str, list[str]] = ..., - include_package_data: bool | Literal[0, 1] = ..., - libraries: list[str] = ..., - headers: list[str] = ..., - ext_package: str = ..., - include_dirs: list[str] = ..., - password: str = ..., - fullname: str = ..., - # Custom Distributions could accept more params - **attrs: Any, -) -> Distribution: ... -def run_setup(script_name: str, script_args: list[str] | None = None, stop_after: str = "run") -> Distribution: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/cygwinccompiler.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/cygwinccompiler.pyi deleted file mode 100644 index 80924d63e4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/cygwinccompiler.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from distutils.unixccompiler import UnixCCompiler -from distutils.version import LooseVersion -from re import Pattern -from typing import Final, Literal - -def get_msvcr() -> list[str] | None: ... - -class CygwinCCompiler(UnixCCompiler): ... -class Mingw32CCompiler(CygwinCCompiler): ... - -CONFIG_H_OK: Final = "ok" -CONFIG_H_NOTOK: Final = "not ok" -CONFIG_H_UNCERTAIN: Final = "uncertain" - -def check_config_h() -> tuple[Literal["ok", "not ok", "uncertain"], str]: ... - -RE_VERSION: Final[Pattern[bytes]] - -def get_versions() -> tuple[LooseVersion | None, ...]: ... -def is_cygwingcc() -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/debug.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/debug.pyi deleted file mode 100644 index 30095883b0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/debug.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from typing import Final - -DEBUG: Final[str | None] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/dep_util.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/dep_util.pyi deleted file mode 100644 index 058377acca..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/dep_util.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from _typeshed import StrOrBytesPath, SupportsLenAndGetItem -from collections.abc import Iterable -from typing import Literal, TypeVar - -_SourcesT = TypeVar("_SourcesT", bound=StrOrBytesPath) -_TargetsT = TypeVar("_TargetsT", bound=StrOrBytesPath) - -def newer(source: StrOrBytesPath, target: StrOrBytesPath) -> bool | Literal[1]: ... -def newer_pairwise( - sources: SupportsLenAndGetItem[_SourcesT], targets: SupportsLenAndGetItem[_TargetsT] -) -> tuple[list[_SourcesT], list[_TargetsT]]: ... -def newer_group( - sources: Iterable[StrOrBytesPath], target: StrOrBytesPath, missing: Literal["error", "ignore", "newer"] = "error" -) -> Literal[0, 1]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/dir_util.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/dir_util.pyi deleted file mode 100644 index 23e2c3bc28..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/dir_util.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from _typeshed import StrOrBytesPath, StrPath -from collections.abc import Iterable -from typing import Literal - -def mkpath(name: str, mode: int = 0o777, verbose: bool | Literal[0, 1] = 1, dry_run: bool | Literal[0, 1] = 0) -> list[str]: ... -def create_tree( - base_dir: StrPath, - files: Iterable[StrPath], - mode: int = 0o777, - verbose: bool | Literal[0, 1] = 1, - dry_run: bool | Literal[0, 1] = 0, -) -> None: ... -def copy_tree( - src: StrPath, - dst: str, - preserve_mode: bool | Literal[0, 1] = 1, - preserve_times: bool | Literal[0, 1] = 1, - preserve_symlinks: bool | Literal[0, 1] = 0, - update: bool | Literal[0, 1] = 0, - verbose: bool | Literal[0, 1] = 1, - dry_run: bool | Literal[0, 1] = 0, -) -> list[str]: ... -def remove_tree(directory: StrOrBytesPath, verbose: bool | Literal[0, 1] = 1, dry_run: bool | Literal[0, 1] = 0) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/dist.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/dist.pyi deleted file mode 100644 index 09f2b456d2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/dist.pyi +++ /dev/null @@ -1,317 +0,0 @@ -from _typeshed import Incomplete, StrOrBytesPath, StrPath, SupportsWrite -from collections.abc import Iterable, MutableMapping -from distutils.cmd import Command -from distutils.command.bdist import bdist -from distutils.command.bdist_dumb import bdist_dumb -from distutils.command.bdist_rpm import bdist_rpm -from distutils.command.build import build -from distutils.command.build_clib import build_clib -from distutils.command.build_ext import build_ext -from distutils.command.build_py import build_py -from distutils.command.build_scripts import build_scripts -from distutils.command.check import check -from distutils.command.clean import clean -from distutils.command.config import config -from distutils.command.install import install -from distutils.command.install_data import install_data -from distutils.command.install_egg_info import install_egg_info -from distutils.command.install_headers import install_headers -from distutils.command.install_lib import install_lib -from distutils.command.install_scripts import install_scripts -from distutils.command.register import register -from distutils.command.sdist import sdist -from distutils.command.upload import upload -from re import Pattern -from typing import IO, ClassVar, Literal, TypeVar, overload -from typing_extensions import TypeAlias - -command_re: Pattern[str] - -_OptionsList: TypeAlias = list[tuple[str, str | None, str, int] | tuple[str, str | None, str]] -_CommandT = TypeVar("_CommandT", bound=Command) - -class DistributionMetadata: - def __init__(self, path: StrOrBytesPath | None = None) -> None: ... - name: str | None - version: str | None - author: str | None - author_email: str | None - maintainer: str | None - maintainer_email: str | None - url: str | None - license: str | None - description: str | None - long_description: str | None - keywords: str | list[str] | None - platforms: str | list[str] | None - classifiers: str | list[str] | None - download_url: str | None - provides: list[str] | None - requires: list[str] | None - obsoletes: list[str] | None - def read_pkg_file(self, file: IO[str]) -> None: ... - def write_pkg_info(self, base_dir: StrPath) -> None: ... - def write_pkg_file(self, file: SupportsWrite[str]) -> None: ... - def get_name(self) -> str: ... - def get_version(self) -> str: ... - def get_fullname(self) -> str: ... - def get_author(self) -> str: ... - def get_author_email(self) -> str: ... - def get_maintainer(self) -> str: ... - def get_maintainer_email(self) -> str: ... - def get_contact(self) -> str: ... - def get_contact_email(self) -> str: ... - def get_url(self) -> str: ... - def get_license(self) -> str: ... - def get_licence(self) -> str: ... - def get_description(self) -> str: ... - def get_long_description(self) -> str: ... - def get_keywords(self) -> str | list[str]: ... - def get_platforms(self) -> str | list[str]: ... - def get_classifiers(self) -> str | list[str]: ... - def get_download_url(self) -> str: ... - def get_requires(self) -> list[str]: ... - def set_requires(self, value: Iterable[str]) -> None: ... - def get_provides(self) -> list[str]: ... - def set_provides(self, value: Iterable[str]) -> None: ... - def get_obsoletes(self) -> list[str]: ... - def set_obsoletes(self, value: Iterable[str]) -> None: ... - -class Distribution: - cmdclass: dict[str, type[Command]] - metadata: DistributionMetadata - def __init__(self, attrs: MutableMapping[str, Incomplete] | None = None) -> None: ... - def get_option_dict(self, command: str) -> dict[str, tuple[str, str]]: ... - def parse_config_files(self, filenames: Iterable[str] | None = None) -> None: ... - global_options: ClassVar[_OptionsList] - common_usage: ClassVar[str] - display_options: ClassVar[_OptionsList] - display_option_names: ClassVar[list[str]] - negative_opt: ClassVar[dict[str, str]] - verbose: bool | Literal[0, 1] - dry_run: bool | Literal[0, 1] - help: bool | Literal[0, 1] - command_packages: list[str] | None - script_name: str | None - script_args: list[str] | None - command_options: dict[str, dict[str, tuple[str, str]]] - dist_files: list[tuple[str, str, str]] - packages: Incomplete - package_data: dict[str, list[str]] - package_dir: Incomplete - py_modules: Incomplete - libraries: Incomplete - headers: Incomplete - ext_modules: Incomplete - ext_package: Incomplete - include_dirs: Incomplete - extra_path: Incomplete - scripts: Incomplete - data_files: Incomplete - password: str - command_obj: Incomplete - have_run: Incomplete - want_user_cfg: bool - def dump_option_dicts( - self, header: Incomplete | None = None, commands: Incomplete | None = None, indent: str = "" - ) -> None: ... - def find_config_files(self): ... - commands: Incomplete - def parse_command_line(self): ... - def finalize_options(self) -> None: ... - def handle_display_options(self, option_order): ... - def print_command_list(self, commands, header, max_length) -> None: ... - def print_commands(self) -> None: ... - def get_command_list(self): ... - def get_command_packages(self): ... - # NOTE: This list comes directly from the distutils/command folder. Minus bdist_msi and bdist_wininst. - @overload - def get_command_obj(self, command: Literal["bdist"], create: Literal[1, True] = 1) -> bdist: ... - @overload - def get_command_obj(self, command: Literal["bdist_dumb"], create: Literal[1, True] = 1) -> bdist_dumb: ... - @overload - def get_command_obj(self, command: Literal["bdist_rpm"], create: Literal[1, True] = 1) -> bdist_rpm: ... - @overload - def get_command_obj(self, command: Literal["build"], create: Literal[1, True] = 1) -> build: ... - @overload - def get_command_obj(self, command: Literal["build_clib"], create: Literal[1, True] = 1) -> build_clib: ... - @overload - def get_command_obj(self, command: Literal["build_ext"], create: Literal[1, True] = 1) -> build_ext: ... - @overload - def get_command_obj(self, command: Literal["build_py"], create: Literal[1, True] = 1) -> build_py: ... - @overload - def get_command_obj(self, command: Literal["build_scripts"], create: Literal[1, True] = 1) -> build_scripts: ... - @overload - def get_command_obj(self, command: Literal["check"], create: Literal[1, True] = 1) -> check: ... - @overload - def get_command_obj(self, command: Literal["clean"], create: Literal[1, True] = 1) -> clean: ... - @overload - def get_command_obj(self, command: Literal["config"], create: Literal[1, True] = 1) -> config: ... - @overload - def get_command_obj(self, command: Literal["install"], create: Literal[1, True] = 1) -> install: ... - @overload - def get_command_obj(self, command: Literal["install_data"], create: Literal[1, True] = 1) -> install_data: ... - @overload - def get_command_obj(self, command: Literal["install_egg_info"], create: Literal[1, True] = 1) -> install_egg_info: ... - @overload - def get_command_obj(self, command: Literal["install_headers"], create: Literal[1, True] = 1) -> install_headers: ... - @overload - def get_command_obj(self, command: Literal["install_lib"], create: Literal[1, True] = 1) -> install_lib: ... - @overload - def get_command_obj(self, command: Literal["install_scripts"], create: Literal[1, True] = 1) -> install_scripts: ... - @overload - def get_command_obj(self, command: Literal["register"], create: Literal[1, True] = 1) -> register: ... - @overload - def get_command_obj(self, command: Literal["sdist"], create: Literal[1, True] = 1) -> sdist: ... - @overload - def get_command_obj(self, command: Literal["upload"], create: Literal[1, True] = 1) -> upload: ... - @overload - def get_command_obj(self, command: str, create: Literal[1, True] = 1) -> Command: ... - # Not replicating the overloads for "Command | None", user may use "isinstance" - @overload - def get_command_obj(self, command: str, create: Literal[0, False]) -> Command | None: ... - @overload - def get_command_class(self, command: Literal["bdist"]) -> type[bdist]: ... - @overload - def get_command_class(self, command: Literal["bdist_dumb"]) -> type[bdist_dumb]: ... - @overload - def get_command_class(self, command: Literal["bdist_rpm"]) -> type[bdist_rpm]: ... - @overload - def get_command_class(self, command: Literal["build"]) -> type[build]: ... - @overload - def get_command_class(self, command: Literal["build_clib"]) -> type[build_clib]: ... - @overload - def get_command_class(self, command: Literal["build_ext"]) -> type[build_ext]: ... - @overload - def get_command_class(self, command: Literal["build_py"]) -> type[build_py]: ... - @overload - def get_command_class(self, command: Literal["build_scripts"]) -> type[build_scripts]: ... - @overload - def get_command_class(self, command: Literal["check"]) -> type[check]: ... - @overload - def get_command_class(self, command: Literal["clean"]) -> type[clean]: ... - @overload - def get_command_class(self, command: Literal["config"]) -> type[config]: ... - @overload - def get_command_class(self, command: Literal["install"]) -> type[install]: ... - @overload - def get_command_class(self, command: Literal["install_data"]) -> type[install_data]: ... - @overload - def get_command_class(self, command: Literal["install_egg_info"]) -> type[install_egg_info]: ... - @overload - def get_command_class(self, command: Literal["install_headers"]) -> type[install_headers]: ... - @overload - def get_command_class(self, command: Literal["install_lib"]) -> type[install_lib]: ... - @overload - def get_command_class(self, command: Literal["install_scripts"]) -> type[install_scripts]: ... - @overload - def get_command_class(self, command: Literal["register"]) -> type[register]: ... - @overload - def get_command_class(self, command: Literal["sdist"]) -> type[sdist]: ... - @overload - def get_command_class(self, command: Literal["upload"]) -> type[upload]: ... - @overload - def get_command_class(self, command: str) -> type[Command]: ... - @overload - def reinitialize_command(self, command: Literal["bdist"], reinit_subcommands: bool = False) -> bdist: ... - @overload - def reinitialize_command(self, command: Literal["bdist_dumb"], reinit_subcommands: bool = False) -> bdist_dumb: ... - @overload - def reinitialize_command(self, command: Literal["bdist_rpm"], reinit_subcommands: bool = False) -> bdist_rpm: ... - @overload - def reinitialize_command(self, command: Literal["build"], reinit_subcommands: bool = False) -> build: ... - @overload - def reinitialize_command(self, command: Literal["build_clib"], reinit_subcommands: bool = False) -> build_clib: ... - @overload - def reinitialize_command(self, command: Literal["build_ext"], reinit_subcommands: bool = False) -> build_ext: ... - @overload - def reinitialize_command(self, command: Literal["build_py"], reinit_subcommands: bool = False) -> build_py: ... - @overload - def reinitialize_command(self, command: Literal["build_scripts"], reinit_subcommands: bool = False) -> build_scripts: ... - @overload - def reinitialize_command(self, command: Literal["check"], reinit_subcommands: bool = False) -> check: ... - @overload - def reinitialize_command(self, command: Literal["clean"], reinit_subcommands: bool = False) -> clean: ... - @overload - def reinitialize_command(self, command: Literal["config"], reinit_subcommands: bool = False) -> config: ... - @overload - def reinitialize_command(self, command: Literal["install"], reinit_subcommands: bool = False) -> install: ... - @overload - def reinitialize_command(self, command: Literal["install_data"], reinit_subcommands: bool = False) -> install_data: ... - @overload - def reinitialize_command( - self, command: Literal["install_egg_info"], reinit_subcommands: bool = False - ) -> install_egg_info: ... - @overload - def reinitialize_command(self, command: Literal["install_headers"], reinit_subcommands: bool = False) -> install_headers: ... - @overload - def reinitialize_command(self, command: Literal["install_lib"], reinit_subcommands: bool = False) -> install_lib: ... - @overload - def reinitialize_command(self, command: Literal["install_scripts"], reinit_subcommands: bool = False) -> install_scripts: ... - @overload - def reinitialize_command(self, command: Literal["register"], reinit_subcommands: bool = False) -> register: ... - @overload - def reinitialize_command(self, command: Literal["sdist"], reinit_subcommands: bool = False) -> sdist: ... - @overload - def reinitialize_command(self, command: Literal["upload"], reinit_subcommands: bool = False) -> upload: ... - @overload - def reinitialize_command(self, command: str, reinit_subcommands: bool = False) -> Command: ... - @overload - def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False) -> _CommandT: ... - def announce(self, msg, level: int = 2) -> None: ... - def run_commands(self) -> None: ... - def run_command(self, command: str) -> None: ... - def has_pure_modules(self) -> bool: ... - def has_ext_modules(self) -> bool: ... - def has_c_libraries(self) -> bool: ... - def has_modules(self) -> bool: ... - def has_headers(self) -> bool: ... - def has_scripts(self) -> bool: ... - def has_data_files(self) -> bool: ... - def is_pure(self) -> bool: ... - - # Default getter methods generated in __init__ from self.metadata._METHOD_BASENAMES - def get_name(self) -> str: ... - def get_version(self) -> str: ... - def get_fullname(self) -> str: ... - def get_author(self) -> str: ... - def get_author_email(self) -> str: ... - def get_maintainer(self) -> str: ... - def get_maintainer_email(self) -> str: ... - def get_contact(self) -> str: ... - def get_contact_email(self) -> str: ... - def get_url(self) -> str: ... - def get_license(self) -> str: ... - def get_licence(self) -> str: ... - def get_description(self) -> str: ... - def get_long_description(self) -> str: ... - def get_keywords(self) -> str | list[str]: ... - def get_platforms(self) -> str | list[str]: ... - def get_classifiers(self) -> str | list[str]: ... - def get_download_url(self) -> str: ... - def get_requires(self) -> list[str]: ... - def get_provides(self) -> list[str]: ... - def get_obsoletes(self) -> list[str]: ... - - # Default attributes generated in __init__ from self.display_option_names - help_commands: bool | Literal[0] - name: str | Literal[0] - version: str | Literal[0] - fullname: str | Literal[0] - author: str | Literal[0] - author_email: str | Literal[0] - maintainer: str | Literal[0] - maintainer_email: str | Literal[0] - contact: str | Literal[0] - contact_email: str | Literal[0] - url: str | Literal[0] - license: str | Literal[0] - licence: str | Literal[0] - description: str | Literal[0] - long_description: str | Literal[0] - platforms: str | list[str] | Literal[0] - classifiers: str | list[str] | Literal[0] - keywords: str | list[str] | Literal[0] - provides: list[str] | Literal[0] - requires: list[str] | Literal[0] - obsoletes: list[str] | Literal[0] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/errors.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/errors.pyi deleted file mode 100644 index e483362bfb..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/errors.pyi +++ /dev/null @@ -1,19 +0,0 @@ -class DistutilsError(Exception): ... -class DistutilsModuleError(DistutilsError): ... -class DistutilsClassError(DistutilsError): ... -class DistutilsGetoptError(DistutilsError): ... -class DistutilsArgError(DistutilsError): ... -class DistutilsFileError(DistutilsError): ... -class DistutilsOptionError(DistutilsError): ... -class DistutilsSetupError(DistutilsError): ... -class DistutilsPlatformError(DistutilsError): ... -class DistutilsExecError(DistutilsError): ... -class DistutilsInternalError(DistutilsError): ... -class DistutilsTemplateError(DistutilsError): ... -class DistutilsByteCompileError(DistutilsError): ... -class CCompilerError(Exception): ... -class PreprocessError(CCompilerError): ... -class CompileError(CCompilerError): ... -class LibError(CCompilerError): ... -class LinkError(CCompilerError): ... -class UnknownFileError(CCompilerError): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/extension.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/extension.pyi deleted file mode 100644 index 789bbf6ec3..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/extension.pyi +++ /dev/null @@ -1,36 +0,0 @@ -class Extension: - name: str - sources: list[str] - include_dirs: list[str] - define_macros: list[tuple[str, str | None]] - undef_macros: list[str] - library_dirs: list[str] - libraries: list[str] - runtime_library_dirs: list[str] - extra_objects: list[str] - extra_compile_args: list[str] - extra_link_args: list[str] - export_symbols: list[str] - swig_opts: list[str] - depends: list[str] - language: str | None - optional: bool | None - def __init__( - self, - name: str, - sources: list[str], - include_dirs: list[str] | None = None, - define_macros: list[tuple[str, str | None]] | None = None, - undef_macros: list[str] | None = None, - library_dirs: list[str] | None = None, - libraries: list[str] | None = None, - runtime_library_dirs: list[str] | None = None, - extra_objects: list[str] | None = None, - extra_compile_args: list[str] | None = None, - extra_link_args: list[str] | None = None, - export_symbols: list[str] | None = None, - swig_opts: list[str] | None = None, - depends: list[str] | None = None, - language: str | None = None, - optional: bool | None = None, - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/fancy_getopt.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/fancy_getopt.pyi deleted file mode 100644 index f3fa2a1255..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/fancy_getopt.pyi +++ /dev/null @@ -1,44 +0,0 @@ -from collections.abc import Iterable, Mapping -from getopt import _SliceableT, _StrSequenceT_co -from re import Pattern -from typing import Any, Final, overload -from typing_extensions import TypeAlias - -_Option: TypeAlias = tuple[str, str | None, str] - -longopt_pat: Final = r"[a-zA-Z](?:[a-zA-Z0-9-]*)" -longopt_re: Final[Pattern[str]] -neg_alias_re: Final[Pattern[str]] -longopt_xlate: Final[dict[int, int]] - -class FancyGetopt: - def __init__(self, option_table: list[_Option] | None = None) -> None: ... - # TODO: kinda wrong, `getopt(object=object())` is invalid - @overload - def getopt( - self, args: _SliceableT[_StrSequenceT_co] | None = None, object: None = None - ) -> tuple[_StrSequenceT_co, OptionDummy]: ... - @overload - def getopt( - self, args: _SliceableT[_StrSequenceT_co] | None, object: Any - ) -> _StrSequenceT_co: ... # object is an arbitrary non-slotted object - def get_option_order(self) -> list[tuple[str, str]]: ... - def generate_help(self, header: str | None = None) -> list[str]: ... - -# Same note as FancyGetopt.getopt -@overload -def fancy_getopt( - options: list[_Option], negative_opt: Mapping[_Option, _Option], object: None, args: _SliceableT[_StrSequenceT_co] | None -) -> tuple[_StrSequenceT_co, OptionDummy]: ... -@overload -def fancy_getopt( - options: list[_Option], negative_opt: Mapping[_Option, _Option], object: Any, args: _SliceableT[_StrSequenceT_co] | None -) -> _StrSequenceT_co: ... - -WS_TRANS: Final[dict[int, str]] - -def wrap_text(text: str, width: int) -> list[str]: ... -def translate_longopt(opt: str) -> str: ... - -class OptionDummy: - def __init__(self, options: Iterable[str] = []) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/file_util.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/file_util.pyi deleted file mode 100644 index 873d23ea7e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/file_util.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from _typeshed import BytesPath, StrOrBytesPath, StrPath -from collections.abc import Iterable -from typing import Literal, TypeVar, overload - -_StrPathT = TypeVar("_StrPathT", bound=StrPath) -_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath) - -@overload -def copy_file( - src: StrPath, - dst: _StrPathT, - preserve_mode: bool | Literal[0, 1] = 1, - preserve_times: bool | Literal[0, 1] = 1, - update: bool | Literal[0, 1] = 0, - link: str | None = None, - verbose: bool | Literal[0, 1] = 1, - dry_run: bool | Literal[0, 1] = 0, -) -> tuple[_StrPathT | str, bool]: ... -@overload -def copy_file( - src: BytesPath, - dst: _BytesPathT, - preserve_mode: bool | Literal[0, 1] = 1, - preserve_times: bool | Literal[0, 1] = 1, - update: bool | Literal[0, 1] = 0, - link: str | None = None, - verbose: bool | Literal[0, 1] = 1, - dry_run: bool | Literal[0, 1] = 0, -) -> tuple[_BytesPathT | bytes, bool]: ... -@overload -def move_file( - src: StrPath, dst: _StrPathT, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0 -) -> _StrPathT | str: ... -@overload -def move_file( - src: BytesPath, dst: _BytesPathT, verbose: bool | Literal[0, 1] = 0, dry_run: bool | Literal[0, 1] = 0 -) -> _BytesPathT | bytes: ... -def write_file(filename: StrOrBytesPath, contents: Iterable[str]) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/filelist.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/filelist.pyi deleted file mode 100644 index 607a78a1fb..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/filelist.pyi +++ /dev/null @@ -1,58 +0,0 @@ -from collections.abc import Iterable -from re import Pattern -from typing import Literal, overload - -# class is entirely undocumented -class FileList: - allfiles: Iterable[str] | None - files: list[str] - def __init__(self, warn: None = None, debug_print: None = None) -> None: ... - def set_allfiles(self, allfiles: Iterable[str]) -> None: ... - def findall(self, dir: str = ".") -> None: ... - def debug_print(self, msg: str) -> None: ... - def append(self, item: str) -> None: ... - def extend(self, items: Iterable[str]) -> None: ... - def sort(self) -> None: ... - def remove_duplicates(self) -> None: ... - def process_template_line(self, line: str) -> None: ... - @overload - def include_pattern( - self, pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[0, False] = 0 - ) -> bool: ... - @overload - def include_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> bool: ... - @overload - def include_pattern( - self, - pattern: str | Pattern[str], - anchor: bool | Literal[0, 1] = 1, - prefix: str | None = None, - is_regex: bool | Literal[0, 1] = 0, - ) -> bool: ... - @overload - def exclude_pattern( - self, pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[0, False] = 0 - ) -> bool: ... - @overload - def exclude_pattern(self, pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> bool: ... - @overload - def exclude_pattern( - self, - pattern: str | Pattern[str], - anchor: bool | Literal[0, 1] = 1, - prefix: str | None = None, - is_regex: bool | Literal[0, 1] = 0, - ) -> bool: ... - -def findall(dir: str = ".") -> list[str]: ... -def glob_to_re(pattern: str) -> str: ... -@overload -def translate_pattern( - pattern: str, anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: Literal[False, 0] = 0 -) -> Pattern[str]: ... -@overload -def translate_pattern(pattern: str | Pattern[str], *, is_regex: Literal[True, 1]) -> Pattern[str]: ... -@overload -def translate_pattern( - pattern: str | Pattern[str], anchor: bool | Literal[0, 1] = 1, prefix: str | None = None, is_regex: bool | Literal[0, 1] = 0 -) -> Pattern[str]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/log.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/log.pyi deleted file mode 100644 index 7246dd6be0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/log.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from typing import Any, Final - -DEBUG: Final = 1 -INFO: Final = 2 -WARN: Final = 3 -ERROR: Final = 4 -FATAL: Final = 5 - -class Log: - def __init__(self, threshold: int = 3) -> None: ... - # Arbitrary msg args' type depends on the format method - def log(self, level: int, msg: str, *args: Any) -> None: ... - def debug(self, msg: str, *args: Any) -> None: ... - def info(self, msg: str, *args: Any) -> None: ... - def warn(self, msg: str, *args: Any) -> None: ... - def error(self, msg: str, *args: Any) -> None: ... - def fatal(self, msg: str, *args: Any) -> None: ... - -def log(level: int, msg: str, *args: Any) -> None: ... -def debug(msg: str, *args: Any) -> None: ... -def info(msg: str, *args: Any) -> None: ... -def warn(msg: str, *args: Any) -> None: ... -def error(msg: str, *args: Any) -> None: ... -def fatal(msg: str, *args: Any) -> None: ... -def set_threshold(level: int) -> int: ... -def set_verbosity(v: int) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/msvccompiler.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/msvccompiler.pyi deleted file mode 100644 index 80872a6b73..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/msvccompiler.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from distutils.ccompiler import CCompiler - -class MSVCCompiler(CCompiler): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/spawn.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/spawn.pyi deleted file mode 100644 index ae07a49504..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/spawn.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from collections.abc import Iterable -from typing import Literal - -def spawn( - cmd: Iterable[str], - search_path: bool | Literal[0, 1] = 1, - verbose: bool | Literal[0, 1] = 0, - dry_run: bool | Literal[0, 1] = 0, -) -> None: ... -def find_executable(executable: str, path: str | None = None) -> str | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/sysconfig.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/sysconfig.pyi deleted file mode 100644 index 4a9c45eb56..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/sysconfig.pyi +++ /dev/null @@ -1,33 +0,0 @@ -import sys -from collections.abc import Mapping -from distutils.ccompiler import CCompiler -from typing import Final, Literal, overload -from typing_extensions import deprecated - -PREFIX: Final[str] -EXEC_PREFIX: Final[str] -BASE_PREFIX: Final[str] -BASE_EXEC_PREFIX: Final[str] -project_base: Final[str] -python_build: Final[bool] - -def expand_makefile_vars(s: str, vars: Mapping[str, str]) -> str: ... -@overload -@deprecated("SO is deprecated, use EXT_SUFFIX. Support is removed in Python 3.11") -def get_config_var(name: Literal["SO"]) -> int | str | None: ... -@overload -def get_config_var(name: str) -> int | str | None: ... -@overload -def get_config_vars() -> dict[str, str | int]: ... -@overload -def get_config_vars(arg: str, /, *args: str) -> list[str | int]: ... -def get_config_h_filename() -> str: ... -def get_makefile_filename() -> str: ... -def get_python_inc(plat_specific: bool | Literal[0, 1] = 0, prefix: str | None = None) -> str: ... -def get_python_lib( - plat_specific: bool | Literal[0, 1] = 0, standard_lib: bool | Literal[0, 1] = 0, prefix: str | None = None -) -> str: ... -def customize_compiler(compiler: CCompiler) -> None: ... - -if sys.version_info < (3, 10): - def get_python_version() -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/text_file.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/text_file.pyi deleted file mode 100644 index 54951af7e5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/text_file.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from typing import IO, Literal - -class TextFile: - def __init__( - self, - filename: str | None = None, - file: IO[str] | None = None, - *, - strip_comments: bool | Literal[0, 1] = ..., - lstrip_ws: bool | Literal[0, 1] = ..., - rstrip_ws: bool | Literal[0, 1] = ..., - skip_blanks: bool | Literal[0, 1] = ..., - join_lines: bool | Literal[0, 1] = ..., - collapse_join: bool | Literal[0, 1] = ..., - ) -> None: ... - def open(self, filename: str) -> None: ... - def close(self) -> None: ... - def warn(self, msg: str, line: list[int] | tuple[int, int] | int | None = None) -> None: ... - def readline(self) -> str | None: ... - def readlines(self) -> list[str]: ... - def unreadline(self, line: str) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/unixccompiler.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/unixccompiler.pyi deleted file mode 100644 index e1d443471a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/unixccompiler.pyi +++ /dev/null @@ -1,3 +0,0 @@ -from distutils.ccompiler import CCompiler - -class UnixCCompiler(CCompiler): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/util.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/util.pyi deleted file mode 100644 index 0e1bb4165d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/util.pyi +++ /dev/null @@ -1,53 +0,0 @@ -from _typeshed import StrPath, Unused -from collections.abc import Callable, Container, Iterable, Mapping -from typing import Any, Literal -from typing_extensions import TypeVarTuple, Unpack - -_Ts = TypeVarTuple("_Ts") - -def get_host_platform() -> str: ... -def get_platform() -> str: ... -def convert_path(pathname: str) -> str: ... -def change_root(new_root: StrPath, pathname: StrPath) -> str: ... -def check_environ() -> None: ... -def subst_vars(s: str, local_vars: Mapping[str, str]) -> None: ... -def split_quoted(s: str) -> list[str]: ... -def execute( - func: Callable[[Unpack[_Ts]], Unused], - args: tuple[Unpack[_Ts]], - msg: str | None = None, - verbose: bool | Literal[0, 1] = 0, - dry_run: bool | Literal[0, 1] = 0, -) -> None: ... -def strtobool(val: str) -> Literal[0, 1]: ... -def byte_compile( - py_files: list[str], - optimize: int = 0, - force: bool | Literal[0, 1] = 0, - prefix: str | None = None, - base_dir: str | None = None, - verbose: bool | Literal[0, 1] = 1, - dry_run: bool | Literal[0, 1] = 0, - direct: bool | None = None, -) -> None: ... -def rfc822_escape(header: str) -> str: ... -def run_2to3( - files: Iterable[str], - fixer_names: Iterable[str] | None = None, - options: Mapping[str, Any] | None = None, - explicit: Unused = None, -) -> None: ... -def copydir_run_2to3( - src: StrPath, - dest: StrPath, - template: str | None = None, - fixer_names: Iterable[str] | None = None, - options: Mapping[str, Any] | None = None, - explicit: Container[str] | None = None, -) -> list[str]: ... - -class Mixin2to3: - fixer_names: Iterable[str] | None - options: Mapping[str, Any] | None - explicit: Container[str] | None - def run_2to3(self, files: Iterable[str]) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/version.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/version.pyi deleted file mode 100644 index 47da65ef87..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/distutils/version.pyi +++ /dev/null @@ -1,36 +0,0 @@ -from abc import abstractmethod -from re import Pattern -from typing_extensions import Self - -class Version: - def __eq__(self, other: object) -> bool: ... - def __lt__(self, other: Self | str) -> bool: ... - def __le__(self, other: Self | str) -> bool: ... - def __gt__(self, other: Self | str) -> bool: ... - def __ge__(self, other: Self | str) -> bool: ... - @abstractmethod - def __init__(self, vstring: str | None = None) -> None: ... - @abstractmethod - def parse(self, vstring: str) -> Self: ... - @abstractmethod - def __str__(self) -> str: ... - @abstractmethod - def _cmp(self, other: Self | str) -> bool: ... - -class StrictVersion(Version): - version_re: Pattern[str] - version: tuple[int, int, int] - prerelease: tuple[str, int] | None - def __init__(self, vstring: str | None = None) -> None: ... - def parse(self, vstring: str) -> Self: ... - def __str__(self) -> str: ... # noqa: Y029 - def _cmp(self, other: Self | str) -> bool: ... - -class LooseVersion(Version): - component_re: Pattern[str] - vstring: str - version: tuple[str | int, ...] - def __init__(self, vstring: str | None = None) -> None: ... - def parse(self, vstring: str) -> Self: ... - def __str__(self) -> str: ... # noqa: Y029 - def _cmp(self, other: Self | str) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/doctest.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/doctest.pyi deleted file mode 100644 index 562b5a5bda..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/doctest.pyi +++ /dev/null @@ -1,262 +0,0 @@ -import sys -import types -import unittest -from _typeshed import ExcInfo -from collections.abc import Callable -from typing import Any, NamedTuple, type_check_only -from typing_extensions import Self, TypeAlias - -__all__ = [ - "register_optionflag", - "DONT_ACCEPT_TRUE_FOR_1", - "DONT_ACCEPT_BLANKLINE", - "NORMALIZE_WHITESPACE", - "ELLIPSIS", - "SKIP", - "IGNORE_EXCEPTION_DETAIL", - "COMPARISON_FLAGS", - "REPORT_UDIFF", - "REPORT_CDIFF", - "REPORT_NDIFF", - "REPORT_ONLY_FIRST_FAILURE", - "REPORTING_FLAGS", - "FAIL_FAST", - "Example", - "DocTest", - "DocTestParser", - "DocTestFinder", - "DocTestRunner", - "OutputChecker", - "DocTestFailure", - "UnexpectedException", - "DebugRunner", - "testmod", - "testfile", - "run_docstring_examples", - "DocTestSuite", - "DocFileSuite", - "set_unittest_reportflags", - "script_from_examples", - "testsource", - "debug_src", - "debug", -] - -if sys.version_info >= (3, 13): - @type_check_only - class _TestResultsBase(NamedTuple): - failed: int - attempted: int - - class TestResults(_TestResultsBase): - def __new__(cls, failed: int, attempted: int, *, skipped: int = 0) -> Self: ... - skipped: int - -else: - class TestResults(NamedTuple): - failed: int - attempted: int - -OPTIONFLAGS_BY_NAME: dict[str, int] - -def register_optionflag(name: str) -> int: ... - -DONT_ACCEPT_TRUE_FOR_1: int -DONT_ACCEPT_BLANKLINE: int -NORMALIZE_WHITESPACE: int -ELLIPSIS: int -SKIP: int -IGNORE_EXCEPTION_DETAIL: int - -COMPARISON_FLAGS: int - -REPORT_UDIFF: int -REPORT_CDIFF: int -REPORT_NDIFF: int -REPORT_ONLY_FIRST_FAILURE: int -FAIL_FAST: int - -REPORTING_FLAGS: int - -BLANKLINE_MARKER: str -ELLIPSIS_MARKER: str - -class Example: - source: str - want: str - exc_msg: str | None - lineno: int - indent: int - options: dict[int, bool] - def __init__( - self, - source: str, - want: str, - exc_msg: str | None = None, - lineno: int = 0, - indent: int = 0, - options: dict[int, bool] | None = None, - ) -> None: ... - def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: ... - -class DocTest: - examples: list[Example] - globs: dict[str, Any] - name: str - filename: str | None - lineno: int | None - docstring: str | None - def __init__( - self, - examples: list[Example], - globs: dict[str, Any], - name: str, - filename: str | None, - lineno: int | None, - docstring: str | None, - ) -> None: ... - def __hash__(self) -> int: ... - def __lt__(self, other: DocTest) -> bool: ... - def __eq__(self, other: object) -> bool: ... - -class DocTestParser: - def parse(self, string: str, name: str = "") -> list[str | Example]: ... - def get_doctest(self, string: str, globs: dict[str, Any], name: str, filename: str | None, lineno: int | None) -> DocTest: ... - def get_examples(self, string: str, name: str = "") -> list[Example]: ... - -class DocTestFinder: - def __init__( - self, verbose: bool = False, parser: DocTestParser = ..., recurse: bool = True, exclude_empty: bool = True - ) -> None: ... - def find( - self, - obj: object, - name: str | None = None, - module: None | bool | types.ModuleType = None, - globs: dict[str, Any] | None = None, - extraglobs: dict[str, Any] | None = None, - ) -> list[DocTest]: ... - -_Out: TypeAlias = Callable[[str], object] - -class DocTestRunner: - DIVIDER: str - optionflags: int - original_optionflags: int - tries: int - failures: int - if sys.version_info >= (3, 13): - skips: int - test: DocTest - def __init__(self, checker: OutputChecker | None = None, verbose: bool | None = None, optionflags: int = 0) -> None: ... - def report_start(self, out: _Out, test: DocTest, example: Example) -> None: ... - def report_success(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... - def report_failure(self, out: _Out, test: DocTest, example: Example, got: str) -> None: ... - def report_unexpected_exception(self, out: _Out, test: DocTest, example: Example, exc_info: ExcInfo) -> None: ... - def run( - self, test: DocTest, compileflags: int | None = None, out: _Out | None = None, clear_globs: bool = True - ) -> TestResults: ... - def summarize(self, verbose: bool | None = None) -> TestResults: ... - def merge(self, other: DocTestRunner) -> None: ... - -class OutputChecker: - def check_output(self, want: str, got: str, optionflags: int) -> bool: ... - def output_difference(self, example: Example, got: str, optionflags: int) -> str: ... - -class DocTestFailure(Exception): - test: DocTest - example: Example - got: str - def __init__(self, test: DocTest, example: Example, got: str) -> None: ... - -class UnexpectedException(Exception): - test: DocTest - example: Example - exc_info: ExcInfo - def __init__(self, test: DocTest, example: Example, exc_info: ExcInfo) -> None: ... - -class DebugRunner(DocTestRunner): ... - -master: DocTestRunner | None - -def testmod( - m: types.ModuleType | None = None, - name: str | None = None, - globs: dict[str, Any] | None = None, - verbose: bool | None = None, - report: bool = True, - optionflags: int = 0, - extraglobs: dict[str, Any] | None = None, - raise_on_error: bool = False, - exclude_empty: bool = False, -) -> TestResults: ... -def testfile( - filename: str, - module_relative: bool = True, - name: str | None = None, - package: None | str | types.ModuleType = None, - globs: dict[str, Any] | None = None, - verbose: bool | None = None, - report: bool = True, - optionflags: int = 0, - extraglobs: dict[str, Any] | None = None, - raise_on_error: bool = False, - parser: DocTestParser = ..., - encoding: str | None = None, -) -> TestResults: ... -def run_docstring_examples( - f: object, - globs: dict[str, Any], - verbose: bool = False, - name: str = "NoName", - compileflags: int | None = None, - optionflags: int = 0, -) -> None: ... -def set_unittest_reportflags(flags: int) -> int: ... - -class DocTestCase(unittest.TestCase): - def __init__( - self, - test: DocTest, - optionflags: int = 0, - setUp: Callable[[DocTest], object] | None = None, - tearDown: Callable[[DocTest], object] | None = None, - checker: OutputChecker | None = None, - ) -> None: ... - def runTest(self) -> None: ... - def format_failure(self, err: str) -> str: ... - def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: ... - -class SkipDocTestCase(DocTestCase): - def __init__(self, module: types.ModuleType) -> None: ... - def test_skip(self) -> None: ... - -class _DocTestSuite(unittest.TestSuite): ... - -def DocTestSuite( - module: None | str | types.ModuleType = None, - globs: dict[str, Any] | None = None, - extraglobs: dict[str, Any] | None = None, - test_finder: DocTestFinder | None = None, - **options: Any, -) -> _DocTestSuite: ... - -class DocFileCase(DocTestCase): ... - -def DocFileTest( - path: str, - module_relative: bool = True, - package: None | str | types.ModuleType = None, - globs: dict[str, Any] | None = None, - parser: DocTestParser = ..., - encoding: str | None = None, - **options: Any, -) -> DocFileCase: ... -def DocFileSuite(*paths: str, **kw: Any) -> _DocTestSuite: ... -def script_from_examples(s: str) -> str: ... -def testsource(module: None | str | types.ModuleType, name: str) -> str: ... -def debug_src(src: str, pm: bool = False, globs: dict[str, Any] | None = None) -> None: ... -def debug_script(src: str, pm: bool = False, globs: dict[str, Any] | None = None) -> None: ... -def debug(module: None | str | types.ModuleType, name: str, pm: bool = False) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/__init__.pyi deleted file mode 100644 index 628ffb2b79..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/__init__.pyi +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Callable -from email.message import Message -from email.policy import Policy, _MessageT -from typing import IO, overload -from typing_extensions import TypeAlias - -# At runtime, listing submodules in __all__ without them being imported is -# valid, and causes them to be included in a star import. See #6523 - -__all__ = [ # noqa: F822 # Undefined names in __all__ - "base64mime", # pyright: ignore[reportUnsupportedDunderAll] - "charset", # pyright: ignore[reportUnsupportedDunderAll] - "encoders", # pyright: ignore[reportUnsupportedDunderAll] - "errors", # pyright: ignore[reportUnsupportedDunderAll] - "feedparser", # pyright: ignore[reportUnsupportedDunderAll] - "generator", # pyright: ignore[reportUnsupportedDunderAll] - "header", # pyright: ignore[reportUnsupportedDunderAll] - "iterators", # pyright: ignore[reportUnsupportedDunderAll] - "message", # pyright: ignore[reportUnsupportedDunderAll] - "message_from_file", - "message_from_binary_file", - "message_from_string", - "message_from_bytes", - "mime", # pyright: ignore[reportUnsupportedDunderAll] - "parser", # pyright: ignore[reportUnsupportedDunderAll] - "quoprimime", # pyright: ignore[reportUnsupportedDunderAll] - "utils", # pyright: ignore[reportUnsupportedDunderAll] -] - -# Definitions imported by multiple submodules in typeshed -_ParamType: TypeAlias = str | tuple[str | None, str | None, str] # noqa: Y047 -_ParamsType: TypeAlias = str | None | tuple[str, str | None, str] # noqa: Y047 - -@overload -def message_from_string(s: str) -> Message: ... -@overload -def message_from_string(s: str, _class: Callable[[], _MessageT]) -> _MessageT: ... -@overload -def message_from_string(s: str, _class: Callable[[], _MessageT] = ..., *, policy: Policy[_MessageT]) -> _MessageT: ... -@overload -def message_from_bytes(s: bytes | bytearray) -> Message: ... -@overload -def message_from_bytes(s: bytes | bytearray, _class: Callable[[], _MessageT]) -> _MessageT: ... -@overload -def message_from_bytes( - s: bytes | bytearray, _class: Callable[[], _MessageT] = ..., *, policy: Policy[_MessageT] -) -> _MessageT: ... -@overload -def message_from_file(fp: IO[str]) -> Message: ... -@overload -def message_from_file(fp: IO[str], _class: Callable[[], _MessageT]) -> _MessageT: ... -@overload -def message_from_file(fp: IO[str], _class: Callable[[], _MessageT] = ..., *, policy: Policy[_MessageT]) -> _MessageT: ... -@overload -def message_from_binary_file(fp: IO[bytes]) -> Message: ... -@overload -def message_from_binary_file(fp: IO[bytes], _class: Callable[[], _MessageT]) -> _MessageT: ... -@overload -def message_from_binary_file(fp: IO[bytes], _class: Callable[[], _MessageT] = ..., *, policy: Policy[_MessageT]) -> _MessageT: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/_header_value_parser.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/_header_value_parser.pyi deleted file mode 100644 index f4e9ca68d6..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/_header_value_parser.pyi +++ /dev/null @@ -1,401 +0,0 @@ -import sys -from collections.abc import Iterable, Iterator -from email.errors import HeaderParseError, MessageDefect -from email.policy import Policy -from re import Pattern -from typing import Any, Final -from typing_extensions import Self - -WSP: Final[set[str]] -CFWS_LEADER: Final[set[str]] -SPECIALS: Final[set[str]] -ATOM_ENDS: Final[set[str]] -DOT_ATOM_ENDS: Final[set[str]] -PHRASE_ENDS: Final[set[str]] -TSPECIALS: Final[set[str]] -TOKEN_ENDS: Final[set[str]] -ASPECIALS: Final[set[str]] -ATTRIBUTE_ENDS: Final[set[str]] -EXTENDED_ATTRIBUTE_ENDS: Final[set[str]] -# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 -NLSET: Final[set[str]] -# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 -SPECIALSNL: Final[set[str]] - -if sys.version_info >= (3, 10): - # Added in Python 3.10.17, 3.11.12, 3.12.9, 3.13.2 (may still be backported to 3.9) - def make_quoted_pairs(value: Any) -> str: ... - -def quote_string(value: Any) -> str: ... - -rfc2047_matcher: Pattern[str] - -class TokenList(list[TokenList | Terminal]): - token_type: str | None - syntactic_break: bool - ew_combine_allowed: bool - defects: list[MessageDefect] - def __init__(self, *args: Any, **kw: Any) -> None: ... - @property - def value(self) -> str: ... - @property - def all_defects(self) -> list[MessageDefect]: ... - def startswith_fws(self) -> bool: ... - @property - def as_ew_allowed(self) -> bool: ... - @property - def comments(self) -> list[str]: ... - def fold(self, *, policy: Policy) -> str: ... - def pprint(self, indent: str = "") -> None: ... - def ppstr(self, indent: str = "") -> str: ... - -class WhiteSpaceTokenList(TokenList): ... - -class UnstructuredTokenList(TokenList): - token_type: str - -class Phrase(TokenList): - token_type: str - -class Word(TokenList): - token_type: str - -class CFWSList(WhiteSpaceTokenList): - token_type: str - -class Atom(TokenList): - token_type: str - -class Token(TokenList): - token_type: str - encode_as_ew: bool - -class EncodedWord(TokenList): - token_type: str - cte: str | None - charset: str | None - lang: str | None - -class QuotedString(TokenList): - token_type: str - @property - def content(self) -> str: ... - @property - def quoted_value(self) -> str: ... - @property - def stripped_value(self) -> str: ... - -class BareQuotedString(QuotedString): - token_type: str - -class Comment(WhiteSpaceTokenList): - token_type: str - def quote(self, value: Any) -> str: ... - @property - def content(self) -> str: ... - -class AddressList(TokenList): - token_type: str - @property - def addresses(self) -> list[Address]: ... - @property - def mailboxes(self) -> list[Mailbox]: ... - @property - def all_mailboxes(self) -> list[Mailbox]: ... - -class Address(TokenList): - token_type: str - @property - def display_name(self) -> str: ... - @property - def mailboxes(self) -> list[Mailbox]: ... - @property - def all_mailboxes(self) -> list[Mailbox]: ... - -class MailboxList(TokenList): - token_type: str - @property - def mailboxes(self) -> list[Mailbox]: ... - @property - def all_mailboxes(self) -> list[Mailbox]: ... - -class GroupList(TokenList): - token_type: str - @property - def mailboxes(self) -> list[Mailbox]: ... - @property - def all_mailboxes(self) -> list[Mailbox]: ... - -class Group(TokenList): - token_type: str - @property - def mailboxes(self) -> list[Mailbox]: ... - @property - def all_mailboxes(self) -> list[Mailbox]: ... - @property - def display_name(self) -> str: ... - -class NameAddr(TokenList): - token_type: str - @property - def display_name(self) -> str: ... - @property - def local_part(self) -> str: ... - @property - def domain(self) -> str: ... - @property - def route(self) -> list[Domain] | None: ... - @property - def addr_spec(self) -> str: ... - -class AngleAddr(TokenList): - token_type: str - @property - def local_part(self) -> str: ... - @property - def domain(self) -> str: ... - @property - def route(self) -> list[Domain] | None: ... - @property - def addr_spec(self) -> str: ... - -class ObsRoute(TokenList): - token_type: str - @property - def domains(self) -> list[Domain]: ... - -class Mailbox(TokenList): - token_type: str - @property - def display_name(self) -> str: ... - @property - def local_part(self) -> str: ... - @property - def domain(self) -> str: ... - @property - def route(self) -> list[str]: ... - @property - def addr_spec(self) -> str: ... - -class InvalidMailbox(TokenList): - token_type: str - @property - def display_name(self) -> None: ... - @property - def local_part(self) -> None: ... - @property - def domain(self) -> None: ... - @property - def route(self) -> None: ... - @property - def addr_spec(self) -> None: ... - -class Domain(TokenList): - token_type: str - as_ew_allowed: bool - @property - def domain(self) -> str: ... - -class DotAtom(TokenList): - token_type: str - -class DotAtomText(TokenList): - token_type: str - as_ew_allowed: bool - -class NoFoldLiteral(TokenList): - token_type: str - as_ew_allowed: bool - -class AddrSpec(TokenList): - token_type: str - as_ew_allowed: bool - @property - def local_part(self) -> str: ... - @property - def domain(self) -> str: ... - @property - def addr_spec(self) -> str: ... - -class ObsLocalPart(TokenList): - token_type: str - as_ew_allowed: bool - -class DisplayName(Phrase): - token_type: str - @property - def display_name(self) -> str: ... - -class LocalPart(TokenList): - token_type: str - as_ew_allowed: bool - @property - def local_part(self) -> str: ... - -class DomainLiteral(TokenList): - token_type: str - as_ew_allowed: bool - @property - def domain(self) -> str: ... - @property - def ip(self) -> str: ... - -class MIMEVersion(TokenList): - token_type: str - major: int | None - minor: int | None - -class Parameter(TokenList): - token_type: str - sectioned: bool - extended: bool - charset: str - @property - def section_number(self) -> int: ... - @property - def param_value(self) -> str: ... - -class InvalidParameter(Parameter): - token_type: str - -class Attribute(TokenList): - token_type: str - @property - def stripped_value(self) -> str: ... - -class Section(TokenList): - token_type: str - number: int | None - -class Value(TokenList): - token_type: str - @property - def stripped_value(self) -> str: ... - -class MimeParameters(TokenList): - token_type: str - syntactic_break: bool - @property - def params(self) -> Iterator[tuple[str, str]]: ... - -class ParameterizedHeaderValue(TokenList): - syntactic_break: bool - @property - def params(self) -> Iterable[tuple[str, str]]: ... - -class ContentType(ParameterizedHeaderValue): - token_type: str - as_ew_allowed: bool - maintype: str - subtype: str - -class ContentDisposition(ParameterizedHeaderValue): - token_type: str - as_ew_allowed: bool - content_disposition: Any - -class ContentTransferEncoding(TokenList): - token_type: str - as_ew_allowed: bool - cte: str - -class HeaderLabel(TokenList): - token_type: str - as_ew_allowed: bool - -class MsgID(TokenList): - token_type: str - as_ew_allowed: bool - def fold(self, policy: Policy) -> str: ... - -class MessageID(MsgID): - token_type: str - -class InvalidMessageID(MessageID): - token_type: str - -class Header(TokenList): - token_type: str - -class Terminal(str): - as_ew_allowed: bool - ew_combine_allowed: bool - syntactic_break: bool - token_type: str - defects: list[MessageDefect] - def __new__(cls, value: str, token_type: str) -> Self: ... - def pprint(self) -> None: ... - @property - def all_defects(self) -> list[MessageDefect]: ... - def pop_trailing_ws(self) -> None: ... - @property - def comments(self) -> list[str]: ... - def __getnewargs__(self) -> tuple[str, str]: ... # type: ignore[override] - -class WhiteSpaceTerminal(Terminal): - @property - def value(self) -> str: ... - def startswith_fws(self) -> bool: ... - -class ValueTerminal(Terminal): - @property - def value(self) -> ValueTerminal: ... - def startswith_fws(self) -> bool: ... - -class EWWhiteSpaceTerminal(WhiteSpaceTerminal): ... -class _InvalidEwError(HeaderParseError): ... - -DOT: Final[ValueTerminal] -ListSeparator: Final[ValueTerminal] -RouteComponentMarker: Final[ValueTerminal] - -def get_fws(value: str) -> tuple[WhiteSpaceTerminal, str]: ... -def get_encoded_word(value: str, terminal_type: str = "vtext") -> tuple[EncodedWord, str]: ... -def get_unstructured(value: str) -> UnstructuredTokenList: ... -def get_qp_ctext(value: str) -> tuple[WhiteSpaceTerminal, str]: ... -def get_qcontent(value: str) -> tuple[ValueTerminal, str]: ... -def get_atext(value: str) -> tuple[ValueTerminal, str]: ... -def get_bare_quoted_string(value: str) -> tuple[BareQuotedString, str]: ... -def get_comment(value: str) -> tuple[Comment, str]: ... -def get_cfws(value: str) -> tuple[CFWSList, str]: ... -def get_quoted_string(value: str) -> tuple[QuotedString, str]: ... -def get_atom(value: str) -> tuple[Atom, str]: ... -def get_dot_atom_text(value: str) -> tuple[DotAtomText, str]: ... -def get_dot_atom(value: str) -> tuple[DotAtom, str]: ... -def get_word(value: str) -> tuple[Any, str]: ... -def get_phrase(value: str) -> tuple[Phrase, str]: ... -def get_local_part(value: str) -> tuple[LocalPart, str]: ... -def get_obs_local_part(value: str) -> tuple[ObsLocalPart, str]: ... -def get_dtext(value: str) -> tuple[ValueTerminal, str]: ... -def get_domain_literal(value: str) -> tuple[DomainLiteral, str]: ... -def get_domain(value: str) -> tuple[Domain, str]: ... -def get_addr_spec(value: str) -> tuple[AddrSpec, str]: ... -def get_obs_route(value: str) -> tuple[ObsRoute, str]: ... -def get_angle_addr(value: str) -> tuple[AngleAddr, str]: ... -def get_display_name(value: str) -> tuple[DisplayName, str]: ... -def get_name_addr(value: str) -> tuple[NameAddr, str]: ... -def get_mailbox(value: str) -> tuple[Mailbox, str]: ... -def get_invalid_mailbox(value: str, endchars: str) -> tuple[InvalidMailbox, str]: ... -def get_mailbox_list(value: str) -> tuple[MailboxList, str]: ... -def get_group_list(value: str) -> tuple[GroupList, str]: ... -def get_group(value: str) -> tuple[Group, str]: ... -def get_address(value: str) -> tuple[Address, str]: ... -def get_address_list(value: str) -> tuple[AddressList, str]: ... -def get_no_fold_literal(value: str) -> tuple[NoFoldLiteral, str]: ... -def get_msg_id(value: str) -> tuple[MsgID, str]: ... -def parse_message_id(value: str) -> MessageID: ... -def parse_mime_version(value: str) -> MIMEVersion: ... -def get_invalid_parameter(value: str) -> tuple[InvalidParameter, str]: ... -def get_ttext(value: str) -> tuple[ValueTerminal, str]: ... -def get_token(value: str) -> tuple[Token, str]: ... -def get_attrtext(value: str) -> tuple[ValueTerminal, str]: ... -def get_attribute(value: str) -> tuple[Attribute, str]: ... -def get_extended_attrtext(value: str) -> tuple[ValueTerminal, str]: ... -def get_extended_attribute(value: str) -> tuple[Attribute, str]: ... -def get_section(value: str) -> tuple[Section, str]: ... -def get_value(value: str) -> tuple[Value, str]: ... -def get_parameter(value: str) -> tuple[Parameter, str]: ... -def parse_mime_parameters(value: str) -> MimeParameters: ... -def parse_content_type_header(value: str) -> ContentType: ... -def parse_content_disposition_header(value: str) -> ContentDisposition: ... -def parse_content_transfer_encoding_header(value: str) -> ContentTransferEncoding: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/_policybase.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/_policybase.pyi deleted file mode 100644 index f5dbbd96da..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/_policybase.pyi +++ /dev/null @@ -1,77 +0,0 @@ -from abc import ABCMeta, abstractmethod -from email.errors import MessageDefect -from email.header import Header -from email.message import Message -from typing import Generic, Protocol, TypeVar, type_check_only -from typing_extensions import Self - -__all__ = ["Policy", "Compat32", "compat32"] - -_MessageT = TypeVar("_MessageT", bound=Message, default=Message) - -@type_check_only -class _MessageFactory(Protocol[_MessageT]): - def __call__(self, policy: Policy[_MessageT]) -> _MessageT: ... - -# Policy below is the only known direct subclass of _PolicyBase. We therefore -# assume that the __init__ arguments and attributes of _PolicyBase are -# the same as those of Policy. -class _PolicyBase(Generic[_MessageT]): - max_line_length: int | None - linesep: str - cte_type: str - raise_on_defect: bool - mangle_from_: bool - message_factory: _MessageFactory[_MessageT] | None - # Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 - verify_generated_headers: bool - - def __init__( - self, - *, - max_line_length: int | None = 78, - linesep: str = "\n", - cte_type: str = "8bit", - raise_on_defect: bool = False, - mangle_from_: bool = ..., # default depends on sub-class - message_factory: _MessageFactory[_MessageT] | None = None, - # Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 - verify_generated_headers: bool = True, - ) -> None: ... - def clone( - self, - *, - max_line_length: int | None = ..., - linesep: str = ..., - cte_type: str = ..., - raise_on_defect: bool = ..., - mangle_from_: bool = ..., - message_factory: _MessageFactory[_MessageT] | None = ..., - # Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 - verify_generated_headers: bool = ..., - ) -> Self: ... - def __add__(self, other: Policy) -> Self: ... - -class Policy(_PolicyBase[_MessageT], metaclass=ABCMeta): - def handle_defect(self, obj: _MessageT, defect: MessageDefect) -> None: ... - def register_defect(self, obj: _MessageT, defect: MessageDefect) -> None: ... - def header_max_count(self, name: str) -> int | None: ... - @abstractmethod - def header_source_parse(self, sourcelines: list[str]) -> tuple[str, str]: ... - @abstractmethod - def header_store_parse(self, name: str, value: str) -> tuple[str, str]: ... - @abstractmethod - def header_fetch_parse(self, name: str, value: str) -> str: ... - @abstractmethod - def fold(self, name: str, value: str) -> str: ... - @abstractmethod - def fold_binary(self, name: str, value: str) -> bytes: ... - -class Compat32(Policy[_MessageT]): - 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 | Header: ... # type: ignore[override] - def fold(self, name: str, value: str) -> str: ... - def fold_binary(self, name: str, value: str) -> bytes: ... - -compat32: Compat32[Message] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/base64mime.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/base64mime.pyi deleted file mode 100644 index 563cd7f669..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/base64mime.pyi +++ /dev/null @@ -1,13 +0,0 @@ -__all__ = ["body_decode", "body_encode", "decode", "decodestring", "header_encode", "header_length"] - -from _typeshed import ReadableBuffer - -def header_length(bytearray: str | bytes | bytearray) -> int: ... -def header_encode(header_bytes: str | ReadableBuffer, charset: str = "iso-8859-1") -> str: ... - -# First argument should be a buffer that supports slicing and len(). -def body_encode(s: bytes | bytearray, maxlinelen: int = 76, eol: str = "\n") -> str: ... -def decode(string: str | ReadableBuffer) -> bytes: ... - -body_decode = decode -decodestring = decode diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/charset.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/charset.pyi deleted file mode 100644 index 683daa468c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/charset.pyi +++ /dev/null @@ -1,35 +0,0 @@ -from collections.abc import Callable, Iterator -from email.message import Message -from typing import ClassVar, Final, overload - -__all__ = ["Charset", "add_alias", "add_charset", "add_codec"] - -QP: Final[int] # undocumented -BASE64: Final[int] # undocumented -SHORTEST: Final[int] # undocumented - -class Charset: - input_charset: str - header_encoding: int - body_encoding: int - output_charset: str | None - input_codec: str | None - output_codec: str | None - def __init__(self, input_charset: str = "us-ascii") -> None: ... - 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 | None]: ... - @overload - def body_encode(self, string: None) -> None: ... - @overload - def body_encode(self, string: str | bytes) -> str: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __eq__(self, other: object) -> bool: ... - def __ne__(self, value: object, /) -> bool: ... - -def add_charset( - charset: str, header_enc: int | None = None, body_enc: int | None = None, output_charset: str | None = None -) -> None: ... -def add_alias(alias: str, canonical: str) -> None: ... -def add_codec(charset: str, codecname: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/contentmanager.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/contentmanager.pyi deleted file mode 100644 index 3214f1a478..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/contentmanager.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from collections.abc import Callable -from email.message import Message -from typing import Any - -class ContentManager: - def get_content(self, msg: Message, *args: Any, **kw: Any) -> Any: ... - def set_content(self, msg: Message, obj: Any, *args: Any, **kw: Any) -> Any: ... - def add_get_handler(self, key: str, handler: Callable[..., Any]) -> None: ... - def add_set_handler(self, typekey: type, handler: Callable[..., Any]) -> None: ... - -raw_data_manager: ContentManager diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/encoders.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/encoders.pyi deleted file mode 100644 index 55223bdc07..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/encoders.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from email.message import Message - -__all__ = ["encode_7or8bit", "encode_base64", "encode_noop", "encode_quopri"] - -def encode_base64(msg: Message) -> None: ... -def encode_quopri(msg: Message) -> None: ... -def encode_7or8bit(msg: Message) -> None: ... -def encode_noop(msg: Message) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/errors.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/errors.pyi deleted file mode 100644 index f105576c5e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/errors.pyi +++ /dev/null @@ -1,42 +0,0 @@ -import sys - -class MessageError(Exception): ... -class MessageParseError(MessageError): ... -class HeaderParseError(MessageParseError): ... -class BoundaryError(MessageParseError): ... -class MultipartConversionError(MessageError, TypeError): ... -class CharsetError(MessageError): ... - -# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 -class HeaderWriteError(MessageError): ... - -class MessageDefect(ValueError): - def __init__(self, line: str | None = None) -> None: ... - -class NoBoundaryInMultipartDefect(MessageDefect): ... -class StartBoundaryNotFoundDefect(MessageDefect): ... -class FirstHeaderLineIsContinuationDefect(MessageDefect): ... -class MisplacedEnvelopeHeaderDefect(MessageDefect): ... -class MultipartInvariantViolationDefect(MessageDefect): ... -class InvalidMultipartContentTransferEncodingDefect(MessageDefect): ... -class UndecodableBytesDefect(MessageDefect): ... -class InvalidBase64PaddingDefect(MessageDefect): ... -class InvalidBase64CharactersDefect(MessageDefect): ... -class InvalidBase64LengthDefect(MessageDefect): ... -class CloseBoundaryNotFoundDefect(MessageDefect): ... -class MissingHeaderBodySeparatorDefect(MessageDefect): ... - -MalformedHeaderDefect = MissingHeaderBodySeparatorDefect - -class HeaderDefect(MessageDefect): ... -class InvalidHeaderDefect(HeaderDefect): ... -class HeaderMissingRequiredValue(HeaderDefect): ... - -class NonPrintableDefect(HeaderDefect): - def __init__(self, non_printables: str | None) -> None: ... - -class ObsoleteHeaderDefect(HeaderDefect): ... -class NonASCIILocalPartDefect(HeaderDefect): ... - -if sys.version_info >= (3, 10): - class InvalidDateDefect(HeaderDefect): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/feedparser.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/feedparser.pyi deleted file mode 100644 index 8c268ca1ae..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/feedparser.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from collections.abc import Callable -from email.message import Message -from email.policy import Policy -from typing import Generic, TypeVar, overload - -__all__ = ["FeedParser", "BytesFeedParser"] - -_MessageT = TypeVar("_MessageT", bound=Message, default=Message) - -class FeedParser(Generic[_MessageT]): - @overload - def __init__(self: FeedParser[Message], _factory: None = None, *, policy: Policy[Message] = ...) -> None: ... - @overload - def __init__(self, _factory: Callable[[], _MessageT], *, policy: Policy[_MessageT] = ...) -> None: ... - def feed(self, data: str) -> None: ... - def close(self) -> _MessageT: ... - -class BytesFeedParser(FeedParser[_MessageT]): - @overload - def __init__(self: BytesFeedParser[Message], _factory: None = None, *, policy: Policy[Message] = ...) -> None: ... - @overload - def __init__(self, _factory: Callable[[], _MessageT], *, policy: Policy[_MessageT] = ...) -> None: ... - def feed(self, data: bytes | bytearray) -> None: ... # type: ignore[override] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/generator.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/generator.pyi deleted file mode 100644 index dfa0604a20..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/generator.pyi +++ /dev/null @@ -1,77 +0,0 @@ -from _typeshed import SupportsWrite -from email.message import Message -from email.policy import Policy -from typing import Any, Generic, TypeVar, overload -from typing_extensions import Self - -__all__ = ["Generator", "DecodedGenerator", "BytesGenerator"] - -# By default, generators do not have a message policy. -_MessageT = TypeVar("_MessageT", bound=Message, default=Any) - -class Generator(Generic[_MessageT]): - maxheaderlen: int | None - policy: Policy[_MessageT] | None - @overload - def __init__( - self: Generator[Any], # The Policy of the message is used. - outfp: SupportsWrite[str], - mangle_from_: bool | None = None, - maxheaderlen: int | None = None, - *, - policy: None = None, - ) -> None: ... - @overload - def __init__( - self, - outfp: SupportsWrite[str], - mangle_from_: bool | None = None, - maxheaderlen: int | None = None, - *, - policy: Policy[_MessageT], - ) -> None: ... - def write(self, s: str) -> None: ... - def flatten(self, msg: _MessageT, unixfrom: bool = False, linesep: str | None = None) -> None: ... - def clone(self, fp: SupportsWrite[str]) -> Self: ... - -class BytesGenerator(Generator[_MessageT]): - @overload - def __init__( - self: BytesGenerator[Any], # The Policy of the message is used. - outfp: SupportsWrite[bytes], - mangle_from_: bool | None = None, - maxheaderlen: int | None = None, - *, - policy: None = None, - ) -> None: ... - @overload - def __init__( - self, - outfp: SupportsWrite[bytes], - mangle_from_: bool | None = None, - maxheaderlen: int | None = None, - *, - policy: Policy[_MessageT], - ) -> None: ... - -class DecodedGenerator(Generator[_MessageT]): - @overload - def __init__( - self: DecodedGenerator[Any], # The Policy of the message is used. - outfp: SupportsWrite[str], - mangle_from_: bool | None = None, - maxheaderlen: int | None = None, - fmt: str | None = None, - *, - policy: None = None, - ) -> None: ... - @overload - def __init__( - self, - outfp: SupportsWrite[str], - mangle_from_: bool | None = None, - maxheaderlen: int | None = None, - fmt: str | None = None, - *, - policy: Policy[_MessageT], - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/header.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/header.pyi deleted file mode 100644 index a26bbb516e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/header.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from collections.abc import Iterable -from email.charset import Charset -from typing import Any, ClassVar - -__all__ = ["Header", "decode_header", "make_header"] - -class Header: - def __init__( - self, - s: bytes | bytearray | str | None = None, - charset: Charset | str | None = None, - maxlinelen: int | None = None, - header_name: str | None = None, - continuation_ws: str = " ", - errors: str = "strict", - ) -> None: ... - def append(self, s: bytes | bytearray | str, charset: Charset | str | None = None, errors: str = "strict") -> None: ... - def encode(self, splitchars: str = ";, \t", maxlinelen: int | None = None, linesep: str = "\n") -> str: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __eq__(self, other: object) -> bool: ... - def __ne__(self, value: object, /) -> bool: ... - -# decode_header() either returns list[tuple[str, None]] if the header -# contains no encoded parts, or list[tuple[bytes, str | None]] if the header -# contains at least one encoded part. -def decode_header(header: Header | str) -> list[tuple[Any, Any | None]]: ... -def make_header( - decoded_seq: Iterable[tuple[bytes | bytearray | str, str | None]], - maxlinelen: int | None = None, - header_name: str | None = None, - continuation_ws: str = " ", -) -> Header: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/headerregistry.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/headerregistry.pyi deleted file mode 100644 index dc641c8c95..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/headerregistry.pyi +++ /dev/null @@ -1,180 +0,0 @@ -import types -from collections.abc import Iterable, Mapping -from datetime import datetime as _datetime -from email._header_value_parser import ( - AddressList, - ContentDisposition, - ContentTransferEncoding, - ContentType, - MessageID, - MIMEVersion, - TokenList, - UnstructuredTokenList, -) -from email.errors import MessageDefect -from email.policy import Policy -from typing import Any, ClassVar, Literal, Protocol -from typing_extensions import Self - -class BaseHeader(str): - # max_count is actually more of an abstract ClassVar (not defined on the base class, but expected to be defined in subclasses) - max_count: ClassVar[Literal[1] | None] - @property - def name(self) -> str: ... - @property - def defects(self) -> tuple[MessageDefect, ...]: ... - def __new__(cls, name: str, value: Any) -> Self: ... - def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect]) -> None: ... - def fold(self, *, policy: Policy) -> str: ... - -class UnstructuredHeader: - max_count: ClassVar[Literal[1] | None] - @staticmethod - def value_parser(value: str) -> UnstructuredTokenList: ... - @classmethod - def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... - -class UniqueUnstructuredHeader(UnstructuredHeader): - max_count: ClassVar[Literal[1]] - -class DateHeader: - max_count: ClassVar[Literal[1] | None] - def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], datetime: _datetime) -> None: ... - @property - def datetime(self) -> _datetime: ... - @staticmethod - def value_parser(value: str) -> UnstructuredTokenList: ... - @classmethod - def parse(cls, value: str | _datetime, kwds: dict[str, Any]) -> None: ... - -class UniqueDateHeader(DateHeader): - max_count: ClassVar[Literal[1]] - -class AddressHeader: - max_count: ClassVar[Literal[1] | None] - def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], groups: Iterable[Group]) -> None: ... - @property - def groups(self) -> tuple[Group, ...]: ... - @property - def addresses(self) -> tuple[Address, ...]: ... - @staticmethod - def value_parser(value: str) -> AddressList: ... - @classmethod - def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... - -class UniqueAddressHeader(AddressHeader): - max_count: ClassVar[Literal[1]] - -class SingleAddressHeader(AddressHeader): - @property - def address(self) -> Address: ... - -class UniqueSingleAddressHeader(SingleAddressHeader): - max_count: ClassVar[Literal[1]] - -class MIMEVersionHeader: - max_count: ClassVar[Literal[1]] - def init( - self, - name: str, - *, - parse_tree: TokenList, - defects: Iterable[MessageDefect], - version: str | None, - major: int | None, - minor: int | None, - ) -> None: ... - @property - def version(self) -> str | None: ... - @property - def major(self) -> int | None: ... - @property - def minor(self) -> int | None: ... - @staticmethod - def value_parser(value: str) -> MIMEVersion: ... - @classmethod - def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... - -class ParameterizedMIMEHeader: - max_count: ClassVar[Literal[1]] - def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect], params: Mapping[str, Any]) -> None: ... - @property - def params(self) -> types.MappingProxyType[str, Any]: ... - @classmethod - def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... - -class ContentTypeHeader(ParameterizedMIMEHeader): - @property - def content_type(self) -> str: ... - @property - def maintype(self) -> str: ... - @property - def subtype(self) -> str: ... - @staticmethod - def value_parser(value: str) -> ContentType: ... - -class ContentDispositionHeader(ParameterizedMIMEHeader): - # init is redefined but has the same signature as parent class, so is omitted from the stub - @property - def content_disposition(self) -> str | None: ... - @staticmethod - def value_parser(value: str) -> ContentDisposition: ... - -class ContentTransferEncodingHeader: - max_count: ClassVar[Literal[1]] - def init(self, name: str, *, parse_tree: TokenList, defects: Iterable[MessageDefect]) -> None: ... - @property - def cte(self) -> str: ... - @classmethod - def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... - @staticmethod - def value_parser(value: str) -> ContentTransferEncoding: ... - -class MessageIDHeader: - max_count: ClassVar[Literal[1]] - @classmethod - def parse(cls, value: str, kwds: dict[str, Any]) -> None: ... - @staticmethod - def value_parser(value: str) -> MessageID: ... - -class _HeaderParser(Protocol): - max_count: ClassVar[Literal[1] | None] - @staticmethod - def value_parser(value: str, /) -> TokenList: ... - @classmethod - def parse(cls, value: str, kwds: dict[str, Any], /) -> None: ... - -class HeaderRegistry: - registry: dict[str, type[_HeaderParser]] - base_class: type[BaseHeader] - default_class: type[_HeaderParser] - def __init__( - self, base_class: type[BaseHeader] = ..., default_class: type[_HeaderParser] = ..., use_default_map: bool = True - ) -> None: ... - def map_to_type(self, name: str, cls: type[BaseHeader]) -> None: ... - def __getitem__(self, name: str) -> type[BaseHeader]: ... - def __call__(self, name: str, value: Any) -> BaseHeader: ... - -class Address: - @property - def display_name(self) -> str: ... - @property - def username(self) -> str: ... - @property - def domain(self) -> str: ... - @property - def addr_spec(self) -> str: ... - def __init__( - self, display_name: str = "", username: str | None = "", domain: str | None = "", addr_spec: str | None = None - ) -> None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __eq__(self, other: object) -> bool: ... - -class Group: - @property - def display_name(self) -> str | None: ... - @property - def addresses(self) -> tuple[Address, ...]: ... - def __init__(self, display_name: str | None = None, addresses: Iterable[Address] | None = None) -> None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __eq__(self, other: object) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/iterators.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/iterators.pyi deleted file mode 100644 index d964d68438..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/iterators.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from _typeshed import SupportsWrite -from collections.abc import Iterator -from email.message import Message - -__all__ = ["body_line_iterator", "typed_subpart_iterator", "walk"] - -def body_line_iterator(msg: Message, decode: bool = False) -> Iterator[str]: ... -def typed_subpart_iterator(msg: Message, maintype: str = "text", subtype: str | None = None) -> Iterator[str]: ... -def walk(self: Message) -> Iterator[Message]: ... - -# We include the seemingly private function because it is documented in the stdlib documentation. -def _structure(msg: Message, fp: SupportsWrite[str] | None = None, level: int = 0, include_default: bool = False) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/message.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/message.pyi deleted file mode 100644 index ebad05a1cf..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/message.pyi +++ /dev/null @@ -1,172 +0,0 @@ -from _typeshed import MaybeNone -from collections.abc import Generator, Iterator, Sequence -from email import _ParamsType, _ParamType -from email.charset import Charset -from email.contentmanager import ContentManager -from email.errors import MessageDefect -from email.policy import Policy -from typing import Any, Generic, Literal, Protocol, TypeVar, overload -from typing_extensions import Self, TypeAlias - -__all__ = ["Message", "EmailMessage"] - -_T = TypeVar("_T") -# Type returned by Policy.header_fetch_parse, often str or Header. -_HeaderT = TypeVar("_HeaderT", default=str) -_HeaderParamT = TypeVar("_HeaderParamT", default=str) -# Represents headers constructed by HeaderRegistry. Those are sub-classes -# of BaseHeader and another header type. -_HeaderRegistryT = TypeVar("_HeaderRegistryT", default=Any) -_HeaderRegistryParamT = TypeVar("_HeaderRegistryParamT", default=Any) - -_PayloadType: TypeAlias = Message | str -_EncodedPayloadType: TypeAlias = Message | bytes -_MultipartPayloadType: TypeAlias = list[_PayloadType] -_CharsetType: TypeAlias = Charset | str | None - -class _SupportsEncodeToPayload(Protocol): - def encode(self, encoding: str, /) -> _PayloadType | _MultipartPayloadType | _SupportsDecodeToPayload: ... - -class _SupportsDecodeToPayload(Protocol): - def decode(self, encoding: str, errors: str, /) -> _PayloadType | _MultipartPayloadType: ... - -class Message(Generic[_HeaderT, _HeaderParamT]): - # The policy attributes and arguments in this class and its subclasses - # would ideally use Policy[Self], but this is not possible. - policy: Policy[Any] # undocumented - preamble: str | None - epilogue: str | None - defects: list[MessageDefect] - def __init__(self, policy: Policy[Any] = ...) -> None: ... - def is_multipart(self) -> bool: ... - def set_unixfrom(self, unixfrom: str) -> None: ... - def get_unixfrom(self) -> str | None: ... - def attach(self, payload: _PayloadType) -> None: ... - # `i: int` without a multipart payload results in an error - # `| MaybeNone` acts like `| Any`: can be None for cleared or unset payload, but annoying to check - @overload # multipart - def get_payload(self, i: int, decode: Literal[True]) -> None: ... - @overload # multipart - def get_payload(self, i: int, decode: Literal[False] = False) -> _PayloadType | MaybeNone: ... - @overload # either - def get_payload(self, i: None = None, decode: Literal[False] = False) -> _PayloadType | _MultipartPayloadType | MaybeNone: ... - @overload # not multipart - def get_payload(self, i: None = None, *, decode: Literal[True]) -> _EncodedPayloadType | MaybeNone: ... - @overload # not multipart, IDEM but w/o kwarg - def get_payload(self, i: None, decode: Literal[True]) -> _EncodedPayloadType | MaybeNone: ... - # If `charset=None` and payload supports both `encode` AND `decode`, - # then an invalid payload could be passed, but this is unlikely - # Not[_SupportsEncodeToPayload] - @overload - def set_payload( - self, payload: _SupportsDecodeToPayload | _PayloadType | _MultipartPayloadType, charset: None = None - ) -> None: ... - @overload - def set_payload( - self, - payload: _SupportsEncodeToPayload | _SupportsDecodeToPayload | _PayloadType | _MultipartPayloadType, - charset: Charset | str, - ) -> None: ... - def set_charset(self, charset: _CharsetType) -> None: ... - def get_charset(self) -> _CharsetType: ... - def __len__(self) -> int: ... - def __contains__(self, name: str) -> bool: ... - def __iter__(self) -> Iterator[str]: ... - # Same as `get` with `failobj=None`, but with the expectation that it won't return None in most scenarios - # This is important for protocols using __getitem__, like SupportsKeysAndGetItem - # Morally, the return type should be `AnyOf[_HeaderType, None]`, - # so using "the Any trick" instead. - def __getitem__(self, name: str) -> _HeaderT | MaybeNone: ... - def __setitem__(self, name: str, val: _HeaderParamT) -> None: ... - def __delitem__(self, name: str) -> None: ... - def keys(self) -> list[str]: ... - def values(self) -> list[_HeaderT]: ... - def items(self) -> list[tuple[str, _HeaderT]]: ... - @overload - def get(self, name: str, failobj: None = None) -> _HeaderT | None: ... - @overload - def get(self, name: str, failobj: _T) -> _HeaderT | _T: ... - @overload - def get_all(self, name: str, failobj: None = None) -> list[_HeaderT] | None: ... - @overload - def get_all(self, name: str, failobj: _T) -> list[_HeaderT] | _T: ... - def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ... - def replace_header(self, _name: str, _value: _HeaderParamT) -> None: ... - def get_content_type(self) -> str: ... - def get_content_maintype(self) -> str: ... - def get_content_subtype(self) -> str: ... - def get_default_type(self) -> str: ... - def set_default_type(self, ctype: str) -> None: ... - @overload - def get_params( - self, failobj: None = None, header: str = "content-type", unquote: bool = True - ) -> list[tuple[str, str]] | None: ... - @overload - def get_params(self, failobj: _T, header: str = "content-type", unquote: bool = True) -> list[tuple[str, str]] | _T: ... - @overload - def get_param( - self, param: str, failobj: None = None, header: str = "content-type", unquote: bool = True - ) -> _ParamType | None: ... - @overload - def get_param(self, param: str, failobj: _T, header: str = "content-type", unquote: bool = True) -> _ParamType | _T: ... - def del_param(self, param: str, header: str = "content-type", requote: bool = True) -> None: ... - def set_type(self, type: str, header: str = "Content-Type", requote: bool = True) -> None: ... - @overload - def get_filename(self, failobj: None = None) -> str | None: ... - @overload - def get_filename(self, failobj: _T) -> str | _T: ... - @overload - def get_boundary(self, failobj: None = None) -> str | None: ... - @overload - def get_boundary(self, failobj: _T) -> str | _T: ... - def set_boundary(self, boundary: str) -> None: ... - @overload - def get_content_charset(self) -> str | None: ... - @overload - def get_content_charset(self, failobj: _T) -> str | _T: ... - @overload - def get_charsets(self, failobj: None = None) -> list[str | None]: ... - @overload - def get_charsets(self, failobj: _T) -> list[str | _T]: ... - def walk(self) -> Generator[Self, None, None]: ... - def get_content_disposition(self) -> str | None: ... - def as_string(self, unixfrom: bool = False, maxheaderlen: int = 0, policy: Policy[Any] | None = None) -> str: ... - def as_bytes(self, unixfrom: bool = False, policy: Policy[Any] | None = None) -> bytes: ... - def __bytes__(self) -> bytes: ... - def set_param( - self, - param: str, - value: str, - header: str = "Content-Type", - requote: bool = True, - charset: str | None = None, - language: str = "", - replace: bool = False, - ) -> None: ... - # The following two methods are undocumented, but a source code comment states that they are public API - def set_raw(self, name: str, value: _HeaderParamT) -> None: ... - def raw_items(self) -> Iterator[tuple[str, _HeaderT]]: ... - -class MIMEPart(Message[_HeaderRegistryT, _HeaderRegistryParamT]): - def __init__(self, policy: Policy[Any] | None = None) -> None: ... - def get_body(self, preferencelist: Sequence[str] = ("related", "html", "plain")) -> MIMEPart[_HeaderRegistryT] | None: ... - def attach(self, payload: Self) -> None: ... # type: ignore[override] - # The attachments are created via type(self) in the attach method. It's theoretically - # possible to sneak other attachment types into a MIMEPart instance, but could cause - # cause unforseen consequences. - def iter_attachments(self) -> Iterator[Self]: ... - def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT]]: ... - def get_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> Any: ... - def set_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> None: ... - def make_related(self, boundary: str | None = None) -> None: ... - def make_alternative(self, boundary: str | None = None) -> None: ... - def make_mixed(self, boundary: str | None = None) -> None: ... - def add_related(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ... - def add_alternative(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ... - def add_attachment(self, *args: Any, content_manager: ContentManager | None = ..., **kw: Any) -> None: ... - def clear(self) -> None: ... - def clear_content(self) -> None: ... - def as_string(self, unixfrom: bool = False, maxheaderlen: int | None = None, policy: Policy[Any] | None = None) -> str: ... - def is_attachment(self) -> bool: ... - -class EmailMessage(MIMEPart): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/__init__.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/application.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/application.pyi deleted file mode 100644 index a7ab9dc75c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/application.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Callable -from email import _ParamsType -from email.mime.nonmultipart import MIMENonMultipart -from email.policy import Policy - -__all__ = ["MIMEApplication"] - -class MIMEApplication(MIMENonMultipart): - def __init__( - self, - _data: str | bytes | bytearray, - _subtype: str = "octet-stream", - _encoder: Callable[[MIMEApplication], object] = ..., - *, - policy: Policy | None = None, - **_params: _ParamsType, - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/audio.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/audio.pyi deleted file mode 100644 index 090dfb960d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/audio.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Callable -from email import _ParamsType -from email.mime.nonmultipart import MIMENonMultipart -from email.policy import Policy - -__all__ = ["MIMEAudio"] - -class MIMEAudio(MIMENonMultipart): - def __init__( - self, - _audiodata: str | bytes | bytearray, - _subtype: str | None = None, - _encoder: Callable[[MIMEAudio], object] = ..., - *, - policy: Policy | None = None, - **_params: _ParamsType, - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/base.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/base.pyi deleted file mode 100644 index b733709f1b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/base.pyi +++ /dev/null @@ -1,8 +0,0 @@ -import email.message -from email import _ParamsType -from email.policy import Policy - -__all__ = ["MIMEBase"] - -class MIMEBase(email.message.Message): - def __init__(self, _maintype: str, _subtype: str, *, policy: Policy | None = None, **_params: _ParamsType) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/image.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/image.pyi deleted file mode 100644 index b47afa6ce5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/image.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Callable -from email import _ParamsType -from email.mime.nonmultipart import MIMENonMultipart -from email.policy import Policy - -__all__ = ["MIMEImage"] - -class MIMEImage(MIMENonMultipart): - def __init__( - self, - _imagedata: str | bytes | bytearray, - _subtype: str | None = None, - _encoder: Callable[[MIMEImage], object] = ..., - *, - policy: Policy | None = None, - **_params: _ParamsType, - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/message.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/message.pyi deleted file mode 100644 index 2a5f462961..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/message.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from email.mime.nonmultipart import MIMENonMultipart -from email.policy import Policy, _MessageT - -__all__ = ["MIMEMessage"] - -class MIMEMessage(MIMENonMultipart): - def __init__(self, _msg: _MessageT, _subtype: str = "rfc822", *, policy: Policy[_MessageT] | None = None) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/multipart.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/multipart.pyi deleted file mode 100644 index 1c229f7436..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/multipart.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Sequence -from email import _ParamsType -from email.mime.base import MIMEBase -from email.policy import Policy, _MessageT - -__all__ = ["MIMEMultipart"] - -class MIMEMultipart(MIMEBase): - def __init__( - self, - _subtype: str = "mixed", - boundary: str | None = None, - _subparts: Sequence[_MessageT] | None = None, - *, - policy: Policy[_MessageT] | None = None, - **_params: _ParamsType, - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/nonmultipart.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/nonmultipart.pyi deleted file mode 100644 index 5497d89b10..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/nonmultipart.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from email.mime.base import MIMEBase - -__all__ = ["MIMENonMultipart"] - -class MIMENonMultipart(MIMEBase): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/text.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/text.pyi deleted file mode 100644 index 74d5ef4c5c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/mime/text.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from email.mime.nonmultipart import MIMENonMultipart -from email.policy import Policy - -__all__ = ["MIMEText"] - -class MIMEText(MIMENonMultipart): - def __init__( - self, _text: str, _subtype: str = "plain", _charset: str | None = None, *, policy: Policy | None = None - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/parser.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/parser.pyi deleted file mode 100644 index a1a57b4eef..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/parser.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from _typeshed import SupportsRead -from collections.abc import Callable -from email.feedparser import BytesFeedParser as BytesFeedParser, FeedParser as FeedParser -from email.message import Message -from email.policy import Policy -from io import _WrappedBuffer -from typing import Generic, TypeVar, overload - -__all__ = ["Parser", "HeaderParser", "BytesParser", "BytesHeaderParser", "FeedParser", "BytesFeedParser"] - -_MessageT = TypeVar("_MessageT", bound=Message, default=Message) - -class Parser(Generic[_MessageT]): - @overload - def __init__(self: Parser[Message[str, str]], _class: None = None, *, policy: Policy[Message[str, str]] = ...) -> None: ... - @overload - def __init__(self, _class: Callable[[], _MessageT], *, policy: Policy[_MessageT] = ...) -> None: ... - def parse(self, fp: SupportsRead[str], headersonly: bool = False) -> _MessageT: ... - def parsestr(self, text: str, headersonly: bool = False) -> _MessageT: ... - -class HeaderParser(Parser[_MessageT]): - def parse(self, fp: SupportsRead[str], headersonly: bool = True) -> _MessageT: ... - def parsestr(self, text: str, headersonly: bool = True) -> _MessageT: ... - -class BytesParser(Generic[_MessageT]): - parser: Parser[_MessageT] - @overload - def __init__( - self: BytesParser[Message[str, str]], _class: None = None, *, policy: Policy[Message[str, str]] = ... - ) -> None: ... - @overload - def __init__(self, _class: Callable[[], _MessageT], *, policy: Policy[_MessageT] = ...) -> None: ... - def parse(self, fp: _WrappedBuffer, headersonly: bool = False) -> _MessageT: ... - def parsebytes(self, text: bytes | bytearray, headersonly: bool = False) -> _MessageT: ... - -class BytesHeaderParser(BytesParser[_MessageT]): - def parse(self, fp: _WrappedBuffer, headersonly: bool = True) -> _MessageT: ... - def parsebytes(self, text: bytes | bytearray, headersonly: bool = True) -> _MessageT: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/policy.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/policy.pyi deleted file mode 100644 index 5b145bcf23..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/policy.pyi +++ /dev/null @@ -1,77 +0,0 @@ -from collections.abc import Callable -from email._policybase import Compat32 as Compat32, Policy as Policy, _MessageFactory, compat32 as compat32 -from email.contentmanager import ContentManager -from email.message import EmailMessage, Message -from typing import Any, TypeVar, overload -from typing_extensions import Self - -__all__ = ["Compat32", "compat32", "Policy", "EmailPolicy", "default", "strict", "SMTP", "HTTP"] - -_MessageT = TypeVar("_MessageT", bound=Message, default=Message) - -class EmailPolicy(Policy[_MessageT]): - utf8: bool - refold_source: str - header_factory: Callable[[str, Any], Any] - content_manager: ContentManager - @overload - def __init__( - self: EmailPolicy[EmailMessage], - *, - max_line_length: int | None = ..., - linesep: str = ..., - cte_type: str = ..., - raise_on_defect: bool = ..., - mangle_from_: bool = ..., - message_factory: None = None, - # Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 - verify_generated_headers: bool = ..., - utf8: bool = ..., - refold_source: str = ..., - header_factory: Callable[[str, str], str] = ..., - content_manager: ContentManager = ..., - ) -> None: ... - @overload - def __init__( - self, - *, - max_line_length: int | None = ..., - linesep: str = ..., - cte_type: str = ..., - raise_on_defect: bool = ..., - mangle_from_: bool = ..., - message_factory: _MessageFactory[_MessageT] | None = ..., - # Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 - verify_generated_headers: bool = ..., - utf8: bool = ..., - refold_source: str = ..., - header_factory: Callable[[str, str], str] = ..., - content_manager: ContentManager = ..., - ) -> None: ... - def header_source_parse(self, sourcelines: list[str]) -> tuple[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: ... - def clone( - self, - *, - max_line_length: int | None = ..., - linesep: str = ..., - cte_type: str = ..., - raise_on_defect: bool = ..., - mangle_from_: bool = ..., - message_factory: _MessageFactory[_MessageT] | None = ..., - # Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 - verify_generated_headers: bool = ..., - utf8: bool = ..., - refold_source: str = ..., - header_factory: Callable[[str, str], str] = ..., - content_manager: ContentManager = ..., - ) -> Self: ... - -default: EmailPolicy[EmailMessage] -SMTP: EmailPolicy[EmailMessage] -SMTPUTF8: EmailPolicy[EmailMessage] -HTTP: EmailPolicy[EmailMessage] -strict: EmailPolicy[EmailMessage] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/quoprimime.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/quoprimime.pyi deleted file mode 100644 index 87d08eecc7..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/quoprimime.pyi +++ /dev/null @@ -1,28 +0,0 @@ -from collections.abc import Iterable - -__all__ = [ - "body_decode", - "body_encode", - "body_length", - "decode", - "decodestring", - "header_decode", - "header_encode", - "header_length", - "quote", - "unquote", -] - -def header_check(octet: int) -> bool: ... -def body_check(octet: int) -> bool: ... -def header_length(bytearray: Iterable[int]) -> int: ... -def body_length(bytearray: Iterable[int]) -> int: ... -def unquote(s: str | bytes | bytearray) -> str: ... -def quote(c: str | bytes | bytearray) -> str: ... -def header_encode(header_bytes: bytes | bytearray, charset: str = "iso-8859-1") -> str: ... -def body_encode(body: str, maxlinelen: int = 76, eol: str = "\n") -> str: ... -def decode(encoded: str, eol: str = "\n") -> str: ... -def header_decode(s: str) -> str: ... - -body_decode = decode -decodestring = decode diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/utils.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/email/utils.pyi deleted file mode 100644 index dc3eecb5ef..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/email/utils.pyi +++ /dev/null @@ -1,78 +0,0 @@ -import datetime -import sys -from _typeshed import Unused -from collections.abc import Iterable -from email import _ParamType -from email.charset import Charset -from typing import overload -from typing_extensions import TypeAlias, deprecated - -__all__ = [ - "collapse_rfc2231_value", - "decode_params", - "decode_rfc2231", - "encode_rfc2231", - "formataddr", - "formatdate", - "format_datetime", - "getaddresses", - "make_msgid", - "mktime_tz", - "parseaddr", - "parsedate", - "parsedate_tz", - "parsedate_to_datetime", - "unquote", -] - -_PDTZ: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int | None] - -def quote(str: str) -> str: ... -def unquote(str: str) -> str: ... - -# `strict` parameter added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 -def parseaddr(addr: str | list[str], *, strict: bool = True) -> tuple[str, str]: ... -def formataddr(pair: tuple[str | None, str], charset: str | Charset = "utf-8") -> str: ... - -# `strict` parameter added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 -def getaddresses(fieldvalues: Iterable[str], *, strict: bool = True) -> list[tuple[str, str]]: ... -@overload -def parsedate(data: None) -> None: ... -@overload -def parsedate(data: str) -> tuple[int, int, int, int, int, int, int, int, int] | None: ... -@overload -def parsedate_tz(data: None) -> None: ... -@overload -def parsedate_tz(data: str) -> _PDTZ | None: ... - -if sys.version_info >= (3, 10): - @overload - def parsedate_to_datetime(data: None) -> None: ... - @overload - def parsedate_to_datetime(data: str) -> datetime.datetime: ... - -else: - def parsedate_to_datetime(data: str) -> datetime.datetime: ... - -def mktime_tz(data: _PDTZ) -> int: ... -def formatdate(timeval: float | None = None, localtime: bool = False, usegmt: bool = False) -> str: ... -def format_datetime(dt: datetime.datetime, usegmt: bool = False) -> str: ... - -if sys.version_info >= (3, 14): - def localtime(dt: datetime.datetime | None = None) -> datetime.datetime: ... - -elif sys.version_info >= (3, 12): - @overload - def localtime(dt: datetime.datetime | None = None) -> datetime.datetime: ... - @overload - @deprecated("The `isdst` parameter does nothing and will be removed in Python 3.14.") - def localtime(dt: datetime.datetime | None = None, isdst: Unused = None) -> datetime.datetime: ... - -else: - def localtime(dt: datetime.datetime | None = None, isdst: int = -1) -> datetime.datetime: ... - -def make_msgid(idstring: str | None = None, domain: str | None = None) -> str: ... -def decode_rfc2231(s: str) -> tuple[str | None, str | None, str]: ... # May return list[str]. See issue #10431 for details. -def encode_rfc2231(s: str, charset: str | None = None, language: str | None = None) -> str: ... -def collapse_rfc2231_value(value: _ParamType, errors: str = "replace", fallback_charset: str = "us-ascii") -> str: ... -def decode_params(params: list[tuple[str, str]]) -> list[tuple[str, _ParamType]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/__init__.pyi deleted file mode 100644 index 2e83f0f65a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/__init__.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from _typeshed import Incomplete -from codecs import CodecInfo - -class CodecRegistryError(LookupError, SystemError): ... - -def normalize_encoding(encoding: str | bytes) -> str: ... -def search_function(encoding: str) -> CodecInfo | None: ... - -# Needed for submodules -def __getattr__(name: str) -> Incomplete: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/aliases.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/aliases.pyi deleted file mode 100644 index 079af85d51..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/aliases.pyi +++ /dev/null @@ -1 +0,0 @@ -aliases: dict[str, str] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/ascii.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/ascii.pyi deleted file mode 100644 index a85585af32..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/ascii.pyi +++ /dev/null @@ -1,30 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - # At runtime, this is codecs.ascii_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - # At runtime, this is codecs.ascii_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -# Note: encode being a decode function and decode being an encode function is accurate to runtime. -class StreamConverter(StreamWriter, StreamReader): # type: ignore[misc] # incompatible methods in base classes - # At runtime, this is codecs.ascii_decode - @staticmethod - def encode(data: ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ... # type: ignore[override] - # At runtime, this is codecs.ascii_encode - @staticmethod - def decode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... # type: ignore[override] - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/base64_codec.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/base64_codec.pyi deleted file mode 100644 index 0c4f1cb1fe..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/base64_codec.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer -from typing import ClassVar - -# This codec is bytes to bytes. - -def base64_encode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... -def base64_decode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... - -class Codec(codecs.Codec): - def encode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class StreamWriter(Codec, codecs.StreamWriter): - charbuffertype: ClassVar[type] = ... - -class StreamReader(Codec, codecs.StreamReader): - charbuffertype: ClassVar[type] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/big5.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/big5.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/big5.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/big5hkscs.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/big5hkscs.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/big5hkscs.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/bz2_codec.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/bz2_codec.pyi deleted file mode 100644 index 468346a93d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/bz2_codec.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer -from typing import ClassVar - -# This codec is bytes to bytes. - -def bz2_encode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... -def bz2_decode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... - -class Codec(codecs.Codec): - def encode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class StreamWriter(Codec, codecs.StreamWriter): - charbuffertype: ClassVar[type] = ... - -class StreamReader(Codec, codecs.StreamReader): - charbuffertype: ClassVar[type] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/charmap.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/charmap.pyi deleted file mode 100644 index a971a15860..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/charmap.pyi +++ /dev/null @@ -1,33 +0,0 @@ -import codecs -from _codecs import _CharMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - # At runtime, this is codecs.charmap_encode - @staticmethod - def encode(str: str, errors: str | None = None, mapping: _CharMap | None = None, /) -> tuple[bytes, int]: ... - # At runtime, this is codecs.charmap_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, mapping: _CharMap | None = None, /) -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - mapping: _CharMap | None - def __init__(self, errors: str = "strict", mapping: _CharMap | None = None) -> None: ... - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - mapping: _CharMap | None - def __init__(self, errors: str = "strict", mapping: _CharMap | None = None) -> None: ... - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): - mapping: _CharMap | None - def __init__(self, stream: codecs._WritableStream, errors: str = "strict", mapping: _CharMap | None = None) -> None: ... - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - -class StreamReader(Codec, codecs.StreamReader): - mapping: _CharMap | None - def __init__(self, stream: codecs._ReadableStream, errors: str = "strict", mapping: _CharMap | None = None) -> None: ... - def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[str, int]: ... # type: ignore[override] - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp037.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp037.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp037.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1006.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1006.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1006.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1026.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1026.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1026.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1125.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1125.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1125.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1140.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1140.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1140.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1250.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1250.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1250.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1251.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1251.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1251.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1252.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1252.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1252.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1253.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1253.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1253.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1254.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1254.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1254.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1255.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1255.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1255.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1256.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1256.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1256.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1257.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1257.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1257.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1258.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1258.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp1258.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp273.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp273.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp273.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp424.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp424.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp424.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp437.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp437.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp437.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp500.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp500.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp500.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp720.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp720.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp720.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp737.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp737.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp737.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp775.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp775.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp775.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp850.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp850.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp850.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp852.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp852.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp852.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp855.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp855.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp855.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp856.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp856.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp856.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp857.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp857.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp857.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp858.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp858.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp858.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp860.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp860.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp860.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp861.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp861.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp861.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp862.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp862.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp862.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp863.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp863.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp863.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp864.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp864.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp864.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp865.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp865.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp865.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp866.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp866.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp866.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp869.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp869.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp869.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp874.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp874.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp874.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp875.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp875.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp875.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp932.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp932.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp932.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp949.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp949.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp949.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp950.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp950.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/cp950.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_jis_2004.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_jis_2004.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_jis_2004.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_jisx0213.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_jisx0213.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_jisx0213.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_jp.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_jp.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_jp.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_kr.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_kr.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/euc_kr.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/gb18030.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/gb18030.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/gb18030.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/gb2312.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/gb2312.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/gb2312.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/gbk.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/gbk.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/gbk.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/hex_codec.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/hex_codec.pyi deleted file mode 100644 index 3fd4fe3889..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/hex_codec.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer -from typing import ClassVar - -# This codec is bytes to bytes. - -def hex_encode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... -def hex_decode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... - -class Codec(codecs.Codec): - def encode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class StreamWriter(Codec, codecs.StreamWriter): - charbuffertype: ClassVar[type] = ... - -class StreamReader(Codec, codecs.StreamReader): - charbuffertype: ClassVar[type] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/hp_roman8.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/hp_roman8.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/hp_roman8.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/hz.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/hz.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/hz.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/idna.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/idna.pyi deleted file mode 100644 index 3e2c8baf1c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/idna.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -import re -from _typeshed import ReadableBuffer - -dots: re.Pattern[str] -ace_prefix: bytes -sace_prefix: str - -def nameprep(label: str) -> str: ... -def ToASCII(label: str) -> bytes: ... -def ToUnicode(label: bytes | str) -> str: ... - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: ReadableBuffer | str, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.BufferedIncrementalEncoder): - def _buffer_encode(self, input: str, errors: str, final: bool) -> tuple[bytes, int]: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - def _buffer_decode(self, input: ReadableBuffer | str, errors: str, final: bool) -> tuple[str, int]: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_1.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_1.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_1.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_2.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_2.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_2.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_2004.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_2004.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_2004.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_3.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_3.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_3.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_ext.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_ext.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_jp_ext.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_kr.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_kr.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso2022_kr.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_1.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_1.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_1.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_10.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_10.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_10.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_11.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_11.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_11.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_13.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_13.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_13.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_14.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_14.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_14.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_15.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_15.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_15.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_16.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_16.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_16.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_2.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_2.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_2.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_3.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_3.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_3.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_4.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_4.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_4.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_5.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_5.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_5.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_6.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_6.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_6.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_7.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_7.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_7.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_8.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_8.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_8.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_9.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_9.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/iso8859_9.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/johab.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/johab.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/johab.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/koi8_r.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/koi8_r.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/koi8_r.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/koi8_t.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/koi8_t.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/koi8_t.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/koi8_u.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/koi8_u.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/koi8_u.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/kz1048.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/kz1048.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/kz1048.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/latin_1.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/latin_1.pyi deleted file mode 100644 index 3b06773eac..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/latin_1.pyi +++ /dev/null @@ -1,30 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - # At runtime, this is codecs.latin_1_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - # At runtime, this is codecs.latin_1_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -# Note: encode being a decode function and decode being an encode function is accurate to runtime. -class StreamConverter(StreamWriter, StreamReader): # type: ignore[misc] # incompatible methods in base classes - # At runtime, this is codecs.latin_1_decode - @staticmethod - def encode(data: ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ... # type: ignore[override] - # At runtime, this is codecs.latin_1_encode - @staticmethod - def decode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... # type: ignore[override] - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_arabic.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_arabic.pyi deleted file mode 100644 index 42781b4892..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_arabic.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_map: dict[int, int | None] -decoding_table: str -encoding_map: dict[int, int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_croatian.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_croatian.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_croatian.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_cyrillic.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_cyrillic.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_cyrillic.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_farsi.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_farsi.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_farsi.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_greek.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_greek.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_greek.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_iceland.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_iceland.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_iceland.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_latin2.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_latin2.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_latin2.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_roman.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_roman.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_roman.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_romanian.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_romanian.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_romanian.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_turkish.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_turkish.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mac_turkish.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mbcs.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mbcs.pyi deleted file mode 100644 index 2c2917d63f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/mbcs.pyi +++ /dev/null @@ -1,28 +0,0 @@ -import codecs -import sys -from _typeshed import ReadableBuffer - -if sys.platform == "win32": - encode = codecs.mbcs_encode - - def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - - class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - - class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - # At runtime, this is codecs.mbcs_decode - @staticmethod - def _buffer_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - - class StreamWriter(codecs.StreamWriter): - # At runtime, this is codecs.mbcs_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - - class StreamReader(codecs.StreamReader): - # At runtime, this is codecs.mbcs_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - - def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/oem.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/oem.pyi deleted file mode 100644 index 376c12c445..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/oem.pyi +++ /dev/null @@ -1,28 +0,0 @@ -import codecs -import sys -from _typeshed import ReadableBuffer - -if sys.platform == "win32": - encode = codecs.oem_encode - - def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - - class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - - class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - # At runtime, this is codecs.oem_decode - @staticmethod - def _buffer_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - - class StreamWriter(codecs.StreamWriter): - # At runtime, this is codecs.oem_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - - class StreamReader(codecs.StreamReader): - # At runtime, this is codecs.oem_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - - def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/palmos.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/palmos.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/palmos.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/ptcp154.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/ptcp154.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/ptcp154.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/punycode.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/punycode.pyi deleted file mode 100644 index eb99e667b4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/punycode.pyi +++ /dev/null @@ -1,33 +0,0 @@ -import codecs -from typing import Literal - -def segregate(str: str) -> tuple[bytes, list[int]]: ... -def selective_len(str: str, max: int) -> int: ... -def selective_find(str: str, char: str, index: int, pos: int) -> tuple[int, int]: ... -def insertion_unsort(str: str, extended: list[int]) -> list[int]: ... -def T(j: int, bias: int) -> int: ... - -digits: Literal[b"abcdefghijklmnopqrstuvwxyz0123456789"] - -def generate_generalized_integer(N: int, bias: int) -> bytes: ... -def adapt(delta: int, first: bool, numchars: int) -> int: ... -def generate_integers(baselen: int, deltas: list[int]) -> bytes: ... -def punycode_encode(text: str) -> bytes: ... -def decode_generalized_number(extended: bytes, extpos: int, bias: int, errors: str) -> tuple[int, int | None]: ... -def insertion_sort(base: str, extended: bytes, errors: str) -> str: ... -def punycode_decode(text: memoryview | bytes | bytearray | str, errors: str) -> str: ... - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: memoryview | bytes | bytearray | str, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: memoryview | bytes | bytearray | str, final: bool = False) -> str: ... # type: ignore[override] - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/quopri_codec.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/quopri_codec.pyi deleted file mode 100644 index e9deadd8d4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/quopri_codec.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer -from typing import ClassVar - -# This codec is bytes to bytes. - -def quopri_encode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... -def quopri_decode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... - -class Codec(codecs.Codec): - def encode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class StreamWriter(Codec, codecs.StreamWriter): - charbuffertype: ClassVar[type] = ... - -class StreamReader(Codec, codecs.StreamReader): - charbuffertype: ClassVar[type] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/raw_unicode_escape.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/raw_unicode_escape.pyi deleted file mode 100644 index 2887739468..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/raw_unicode_escape.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - # At runtime, this is codecs.raw_unicode_escape_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - # At runtime, this is codecs.raw_unicode_escape_decode - @staticmethod - def decode(data: str | ReadableBuffer, errors: str | None = None, final: bool = True, /) -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - def _buffer_decode(self, input: str | ReadableBuffer, errors: str | None, final: bool) -> tuple[str, int]: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... - -class StreamReader(Codec, codecs.StreamReader): - def decode(self, input: str | ReadableBuffer, errors: str = "strict") -> tuple[str, int]: ... # type: ignore[override] - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/rot_13.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/rot_13.pyi deleted file mode 100644 index 8d71bc9575..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/rot_13.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import codecs -from _typeshed import SupportsRead, SupportsWrite - -# This codec is string to string. - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[str, int]: ... # type: ignore[override] - def decode(self, input: str, errors: str = "strict") -> tuple[str, int]: ... # type: ignore[override] - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> str: ... # type: ignore[override] - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: str, final: bool = False) -> str: ... # type: ignore[override] - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -rot13_map: dict[int, int] - -def rot13(infile: SupportsRead[str], outfile: SupportsWrite[str]) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/shift_jis.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/shift_jis.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/shift_jis.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/shift_jis_2004.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/shift_jis_2004.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/shift_jis_2004.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/shift_jisx0213.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/shift_jisx0213.pyi deleted file mode 100644 index d613026a5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/shift_jisx0213.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import _multibytecodec as mbc -import codecs -from typing import ClassVar - -codec: mbc._MultibyteCodec - -class Codec(codecs.Codec): - encode = codec.encode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - decode = codec.decode # type: ignore[assignment] # pyright: ignore[reportAssignmentType] - -class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, codecs.IncrementalEncoder): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, codecs.IncrementalDecoder): - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): # type: ignore[misc] - codec: ClassVar[mbc._MultibyteCodec] = ... - -class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): - codec: ClassVar[mbc._MultibyteCodec] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/tis_620.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/tis_620.pyi deleted file mode 100644 index f62195662c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/tis_620.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import codecs -from _codecs import _EncodingMap -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: bytes, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... - -decoding_table: str -encoding_table: _EncodingMap diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/undefined.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/undefined.pyi deleted file mode 100644 index 4775dac752..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/undefined.pyi +++ /dev/null @@ -1,20 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -# These return types are just to match the base types. In reality, these always -# raise an error. - -class Codec(codecs.Codec): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> str: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... -class StreamReader(Codec, codecs.StreamReader): ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/unicode_escape.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/unicode_escape.pyi deleted file mode 100644 index ceaa39a385..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/unicode_escape.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class Codec(codecs.Codec): - # At runtime, this is codecs.unicode_escape_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - # At runtime, this is codecs.unicode_escape_decode - @staticmethod - def decode(data: str | ReadableBuffer, errors: str | None = None, final: bool = True, /) -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - def _buffer_decode(self, input: str | ReadableBuffer, errors: str | None, final: bool) -> tuple[str, int]: ... - -class StreamWriter(Codec, codecs.StreamWriter): ... - -class StreamReader(Codec, codecs.StreamReader): - def decode(self, input: str | ReadableBuffer, errors: str = "strict") -> tuple[str, int]: ... # type: ignore[override] - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_16.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_16.pyi deleted file mode 100644 index 3b712cde42..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_16.pyi +++ /dev/null @@ -1,20 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -encode = codecs.utf_16_encode - -def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - def _buffer_decode(self, input: ReadableBuffer, errors: str, final: bool) -> tuple[str, int]: ... - -class StreamWriter(codecs.StreamWriter): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - -class StreamReader(codecs.StreamReader): - def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[str, int]: ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_16_be.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_16_be.pyi deleted file mode 100644 index cc7d1534fc..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_16_be.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -encode = codecs.utf_16_be_encode - -def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - # At runtime, this is codecs.utf_16_be_decode - @staticmethod - def _buffer_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -class StreamWriter(codecs.StreamWriter): - # At runtime, this is codecs.utf_16_be_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - -class StreamReader(codecs.StreamReader): - # At runtime, this is codecs.utf_16_be_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_16_le.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_16_le.pyi deleted file mode 100644 index ba103eb088..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_16_le.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -encode = codecs.utf_16_le_encode - -def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - # At runtime, this is codecs.utf_16_le_decode - @staticmethod - def _buffer_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -class StreamWriter(codecs.StreamWriter): - # At runtime, this is codecs.utf_16_le_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - -class StreamReader(codecs.StreamReader): - # At runtime, this is codecs.utf_16_le_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_32.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_32.pyi deleted file mode 100644 index c925be712c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_32.pyi +++ /dev/null @@ -1,20 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -encode = codecs.utf_32_encode - -def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - def _buffer_decode(self, input: ReadableBuffer, errors: str, final: bool) -> tuple[str, int]: ... - -class StreamWriter(codecs.StreamWriter): - def encode(self, input: str, errors: str = "strict") -> tuple[bytes, int]: ... - -class StreamReader(codecs.StreamReader): - def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[str, int]: ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_32_be.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_32_be.pyi deleted file mode 100644 index 9d28f5199c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_32_be.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -encode = codecs.utf_32_be_encode - -def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - # At runtime, this is codecs.utf_32_be_decode - @staticmethod - def _buffer_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -class StreamWriter(codecs.StreamWriter): - # At runtime, this is codecs.utf_32_be_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - -class StreamReader(codecs.StreamReader): - # At runtime, this is codecs.utf_32_be_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_32_le.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_32_le.pyi deleted file mode 100644 index 5be14a91a3..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_32_le.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -encode = codecs.utf_32_le_encode - -def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - # At runtime, this is codecs.utf_32_le_decode - @staticmethod - def _buffer_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -class StreamWriter(codecs.StreamWriter): - # At runtime, this is codecs.utf_32_le_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - -class StreamReader(codecs.StreamReader): - # At runtime, this is codecs.utf_32_le_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_7.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_7.pyi deleted file mode 100644 index dc1162f34c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_7.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -encode = codecs.utf_7_encode - -def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - # At runtime, this is codecs.utf_7_decode - @staticmethod - def _buffer_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -class StreamWriter(codecs.StreamWriter): - # At runtime, this is codecs.utf_7_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - -class StreamReader(codecs.StreamReader): - # At runtime, this is codecs.utf_7_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_8.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_8.pyi deleted file mode 100644 index 918712d804..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_8.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -encode = codecs.utf_8_encode - -def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: str, final: bool = False) -> bytes: ... - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - # At runtime, this is codecs.utf_8_decode - @staticmethod - def _buffer_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -class StreamWriter(codecs.StreamWriter): - # At runtime, this is codecs.utf_8_encode - @staticmethod - def encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ... - -class StreamReader(codecs.StreamReader): - # At runtime, this is codecs.utf_8_decode - @staticmethod - def decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_8_sig.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_8_sig.pyi deleted file mode 100644 index af69217d67..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/utf_8_sig.pyi +++ /dev/null @@ -1,22 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer - -class IncrementalEncoder(codecs.IncrementalEncoder): - def __init__(self, errors: str = "strict") -> None: ... - def encode(self, input: str, final: bool = False) -> bytes: ... - def getstate(self) -> int: ... - def setstate(self, state: int) -> None: ... # type: ignore[override] - -class IncrementalDecoder(codecs.BufferedIncrementalDecoder): - def __init__(self, errors: str = "strict") -> None: ... - def _buffer_decode(self, input: ReadableBuffer, errors: str | None, final: bool) -> tuple[str, int]: ... - -class StreamWriter(codecs.StreamWriter): - def encode(self, input: str, errors: str | None = "strict") -> tuple[bytes, int]: ... - -class StreamReader(codecs.StreamReader): - def decode(self, input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... - -def getregentry() -> codecs.CodecInfo: ... -def encode(input: str, errors: str | None = "strict") -> tuple[bytes, int]: ... -def decode(input: ReadableBuffer, errors: str | None = "strict") -> tuple[str, int]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/uu_codec.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/uu_codec.pyi deleted file mode 100644 index e32ba8ac0a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/uu_codec.pyi +++ /dev/null @@ -1,28 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer -from typing import ClassVar - -# This codec is bytes to bytes. - -def uu_encode( - input: ReadableBuffer, errors: str = "strict", filename: str = "", mode: int = 0o666 -) -> tuple[bytes, int]: ... -def uu_decode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... - -class Codec(codecs.Codec): - def encode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class StreamWriter(Codec, codecs.StreamWriter): - charbuffertype: ClassVar[type] = ... - -class StreamReader(Codec, codecs.StreamReader): - charbuffertype: ClassVar[type] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/zlib_codec.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/zlib_codec.pyi deleted file mode 100644 index 0f13d0e810..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/encodings/zlib_codec.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import codecs -from _typeshed import ReadableBuffer -from typing import ClassVar - -# This codec is bytes to bytes. - -def zlib_encode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... -def zlib_decode(input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... - -class Codec(codecs.Codec): - def encode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - def decode(self, input: ReadableBuffer, errors: str = "strict") -> tuple[bytes, int]: ... # type: ignore[override] - -class IncrementalEncoder(codecs.IncrementalEncoder): - def encode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class IncrementalDecoder(codecs.IncrementalDecoder): - def decode(self, input: ReadableBuffer, final: bool = False) -> bytes: ... # type: ignore[override] - -class StreamWriter(Codec, codecs.StreamWriter): - charbuffertype: ClassVar[type] = ... - -class StreamReader(Codec, codecs.StreamReader): - charbuffertype: ClassVar[type] = ... - -def getregentry() -> codecs.CodecInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ensurepip/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ensurepip/__init__.pyi deleted file mode 100644 index 332fb18459..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ensurepip/__init__.pyi +++ /dev/null @@ -1,12 +0,0 @@ -__all__ = ["version", "bootstrap"] - -def version() -> str: ... -def bootstrap( - *, - root: str | None = None, - upgrade: bool = False, - user: bool = False, - altinstall: bool = False, - default_pip: bool = False, - verbosity: int = 0, -) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/enum.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/enum.pyi deleted file mode 100644 index 8c88b26a3a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/enum.pyi +++ /dev/null @@ -1,336 +0,0 @@ -import _typeshed -import sys -import types -from _typeshed import SupportsKeysAndGetItem, Unused -from builtins import property as _builtins_property -from collections.abc import Callable, Iterable, Iterator, Mapping -from typing import Any, Generic, Literal, TypeVar, overload -from typing_extensions import Self, TypeAlias - -__all__ = ["EnumMeta", "Enum", "IntEnum", "Flag", "IntFlag", "auto", "unique"] - -if sys.version_info >= (3, 11): - __all__ += [ - "CONFORM", - "CONTINUOUS", - "EJECT", - "EnumCheck", - "EnumType", - "FlagBoundary", - "KEEP", - "NAMED_FLAGS", - "ReprEnum", - "STRICT", - "StrEnum", - "UNIQUE", - "global_enum", - "global_enum_repr", - "global_flag_repr", - "global_str", - "member", - "nonmember", - "property", - "verify", - "pickle_by_enum_name", - "pickle_by_global_name", - ] - -if sys.version_info >= (3, 13): - __all__ += ["EnumDict"] - -_EnumMemberT = TypeVar("_EnumMemberT") -_EnumerationT = TypeVar("_EnumerationT", bound=type[Enum]) - -# The following all work: -# >>> from enum import Enum -# >>> from string import ascii_lowercase -# >>> Enum('Foo', names='RED YELLOW GREEN') -# -# >>> Enum('Foo', names=[('RED', 1), ('YELLOW, 2)]) -# -# >>> Enum('Foo', names=((x for x in (ascii_lowercase[i], i)) for i in range(5))) -# -# >>> Enum('Foo', names={'RED': 1, 'YELLOW': 2}) -# -_EnumNames: TypeAlias = str | Iterable[str] | Iterable[Iterable[str | Any]] | Mapping[str, Any] - -if sys.version_info >= (3, 11): - class nonmember(Generic[_EnumMemberT]): - value: _EnumMemberT - def __init__(self, value: _EnumMemberT) -> None: ... - - class member(Generic[_EnumMemberT]): - value: _EnumMemberT - def __init__(self, value: _EnumMemberT) -> None: ... - -class _EnumDict(dict[str, Any]): - if sys.version_info >= (3, 13): - def __init__(self, cls_name: str | None = None) -> None: ... - else: - def __init__(self) -> None: ... - - def __setitem__(self, key: str, value: Any) -> None: ... - if sys.version_info >= (3, 11): - # See comment above `typing.MutableMapping.update` - # for why overloads are preferable to a Union here - # - # Unlike with MutableMapping.update(), the first argument is required, - # hence the type: ignore - @overload # type: ignore[override] - def update(self, members: SupportsKeysAndGetItem[str, Any], **more_members: Any) -> None: ... - @overload - def update(self, members: Iterable[tuple[str, Any]], **more_members: Any) -> None: ... - if sys.version_info >= (3, 13): - @property - def member_names(self) -> list[str]: ... - -if sys.version_info >= (3, 13): - EnumDict = _EnumDict - -# Structurally: Iterable[T], Reversible[T], Container[T] where T is the enum itself -class EnumMeta(type): - if sys.version_info >= (3, 11): - def __new__( - metacls: type[_typeshed.Self], - cls: str, - bases: tuple[type, ...], - classdict: _EnumDict, - *, - boundary: FlagBoundary | None = None, - _simple: bool = False, - **kwds: Any, - ) -> _typeshed.Self: ... - else: - def __new__( - metacls: type[_typeshed.Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, **kwds: Any - ) -> _typeshed.Self: ... - - @classmethod - def __prepare__(metacls, cls: str, bases: tuple[type, ...], **kwds: Any) -> _EnumDict: ... # type: ignore[override] - def __iter__(self: type[_EnumMemberT]) -> Iterator[_EnumMemberT]: ... - def __reversed__(self: type[_EnumMemberT]) -> Iterator[_EnumMemberT]: ... - if sys.version_info >= (3, 12): - def __contains__(self: type[Any], value: object) -> bool: ... - elif sys.version_info >= (3, 11): - def __contains__(self: type[Any], member: object) -> bool: ... - elif sys.version_info >= (3, 10): - def __contains__(self: type[Any], obj: object) -> bool: ... - else: - def __contains__(self: type[Any], member: object) -> bool: ... - - def __getitem__(self: type[_EnumMemberT], name: str) -> _EnumMemberT: ... - @_builtins_property - def __members__(self: type[_EnumMemberT]) -> types.MappingProxyType[str, _EnumMemberT]: ... - def __len__(self) -> int: ... - def __bool__(self) -> Literal[True]: ... - def __dir__(self) -> list[str]: ... - - # Overload 1: Value lookup on an already existing enum class (simple case) - @overload - def __call__(cls: type[_EnumMemberT], value: Any, names: None = None) -> _EnumMemberT: ... - - # Overload 2: Functional API for constructing new enum classes. - if sys.version_info >= (3, 11): - @overload - def __call__( - cls, - value: str, - names: _EnumNames, - *, - module: str | None = None, - qualname: str | None = None, - type: type | None = None, - start: int = 1, - boundary: FlagBoundary | None = None, - ) -> type[Enum]: ... - else: - @overload - def __call__( - cls, - value: str, - names: _EnumNames, - *, - module: str | None = None, - qualname: str | None = None, - type: type | None = None, - start: int = 1, - ) -> type[Enum]: ... - - # Overload 3 (py312+ only): Value lookup on an already existing enum class (complex case) - # - # >>> class Foo(enum.Enum): - # ... X = 1, 2, 3 - # >>> Foo(1, 2, 3) - # - # - if sys.version_info >= (3, 12): - @overload - def __call__(cls: type[_EnumMemberT], value: Any, *values: Any) -> _EnumMemberT: ... - - _member_names_: list[str] # undocumented - _member_map_: dict[str, Enum] # undocumented - _value2member_map_: dict[Any, Enum] # undocumented - -if sys.version_info >= (3, 11): - # In 3.11 `EnumMeta` metaclass is renamed to `EnumType`, but old name also exists. - EnumType = EnumMeta - - class property(types.DynamicClassAttribute): - def __set_name__(self, ownerclass: type[Enum], name: str) -> None: ... - name: str - clsname: str - member: Enum | None - - _magic_enum_attr = property -else: - _magic_enum_attr = types.DynamicClassAttribute - -class Enum(metaclass=EnumMeta): - @_magic_enum_attr - def name(self) -> str: ... - @_magic_enum_attr - def value(self) -> Any: ... - _name_: str - _value_: Any - _ignore_: str | list[str] - _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: ... - # It's not true that `__new__` will accept any argument type, - # so ideally we'd use `Any` to indicate that the argument type is inexpressible. - # However, using `Any` causes too many false-positives for those using mypy's `--disallow-any-expr` - # (see #7752, #2539, mypy/#5788), - # 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, ...]: ... - if sys.version_info >= (3, 11): - def __copy__(self) -> Self: ... - def __deepcopy__(self, memo: Any) -> Self: ... - if sys.version_info >= (3, 12): - @classmethod - def __signature__(cls) -> str: ... - -if sys.version_info >= (3, 11): - class ReprEnum(Enum): ... - -if sys.version_info >= (3, 11): - _IntEnumBase = ReprEnum -else: - _IntEnumBase = Enum - -class IntEnum(int, _IntEnumBase): - _value_: int - @_magic_enum_attr - def value(self) -> int: ... - def __new__(cls, value: int) -> Self: ... - -def unique(enumeration: _EnumerationT) -> _EnumerationT: ... - -_auto_null: Any - -class Flag(Enum): - _name_: str | None # type: ignore[assignment] - _value_: int - @_magic_enum_attr - def name(self) -> str | None: ... # type: ignore[override] - @_magic_enum_attr - def value(self) -> int: ... - def __contains__(self, other: Self) -> bool: ... - def __bool__(self) -> bool: ... - def __or__(self, other: Self) -> Self: ... - def __and__(self, other: Self) -> Self: ... - def __xor__(self, other: Self) -> Self: ... - def __invert__(self) -> Self: ... - if sys.version_info >= (3, 11): - def __iter__(self) -> Iterator[Self]: ... - def __len__(self) -> int: ... - __ror__ = __or__ - __rand__ = __and__ - __rxor__ = __xor__ - -if sys.version_info >= (3, 11): - class StrEnum(str, ReprEnum): - def __new__(cls, value: str) -> Self: ... - _value_: str - @_magic_enum_attr - def value(self) -> str: ... - @staticmethod - def _generate_next_value_(name: str, start: int, count: int, last_values: list[str]) -> str: ... - - class EnumCheck(StrEnum): - CONTINUOUS = "no skipped integer values" - NAMED_FLAGS = "multi-flag aliases may not contain unnamed flags" - UNIQUE = "one name per value" - - CONTINUOUS = EnumCheck.CONTINUOUS - NAMED_FLAGS = EnumCheck.NAMED_FLAGS - UNIQUE = EnumCheck.UNIQUE - - class verify: - def __init__(self, *checks: EnumCheck) -> None: ... - def __call__(self, enumeration: _EnumerationT) -> _EnumerationT: ... - - class FlagBoundary(StrEnum): - STRICT = "strict" - CONFORM = "conform" - EJECT = "eject" - KEEP = "keep" - - STRICT = FlagBoundary.STRICT - CONFORM = FlagBoundary.CONFORM - EJECT = FlagBoundary.EJECT - KEEP = FlagBoundary.KEEP - - def global_str(self: Enum) -> str: ... - def global_enum(cls: _EnumerationT, update_str: bool = False) -> _EnumerationT: ... - def global_enum_repr(self: Enum) -> str: ... - def global_flag_repr(self: Flag) -> str: ... - -if sys.version_info >= (3, 11): - # The body of the class is the same, but the base classes are different. - class IntFlag(int, ReprEnum, Flag, boundary=KEEP): # type: ignore[misc] # complaints about incompatible bases - def __new__(cls, value: int) -> Self: ... - def __or__(self, other: int) -> Self: ... - def __and__(self, other: int) -> Self: ... - def __xor__(self, other: int) -> Self: ... - __ror__ = __or__ - __rand__ = __and__ - __rxor__ = __xor__ - -else: - class IntFlag(int, Flag): # type: ignore[misc] # complaints about incompatible bases - def __new__(cls, value: int) -> Self: ... - def __or__(self, other: int) -> Self: ... - def __and__(self, other: int) -> Self: ... - def __xor__(self, other: int) -> Self: ... - __ror__ = __or__ - __rand__ = __and__ - __rxor__ = __xor__ - -class auto: - _value_: Any - @_magic_enum_attr - def value(self) -> Any: ... - def __new__(cls) -> Self: ... - - # These don't exist, but auto is basically immediately replaced with - # either an int or a str depending on the type of the enum. StrEnum's auto - # shouldn't have these, but they're needed for int versions of auto (mostly the __or__). - # Ideally type checkers would special case auto enough to handle this, - # but until then this is a slightly inaccurate helping hand. - def __or__(self, other: int | Self) -> Self: ... - def __and__(self, other: int | Self) -> Self: ... - def __xor__(self, other: int | Self) -> Self: ... - __ror__ = __or__ - __rand__ = __and__ - __rxor__ = __xor__ - -if sys.version_info >= (3, 11): - def pickle_by_global_name(self: Enum, proto: int) -> str: ... - def pickle_by_enum_name(self: _EnumMemberT, proto: int) -> tuple[Callable[..., Any], tuple[type[_EnumMemberT], str]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/errno.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/errno.pyi deleted file mode 100644 index 84d2b44a6a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/errno.pyi +++ /dev/null @@ -1,222 +0,0 @@ -import sys -from collections.abc import Mapping - -errorcode: Mapping[int, str] - -EPERM: int -ENOENT: int -ESRCH: int -EINTR: int -EIO: int -ENXIO: int -E2BIG: int -ENOEXEC: int -EBADF: int -ECHILD: int -EAGAIN: int -ENOMEM: int -EACCES: int -EFAULT: int -EBUSY: int -EEXIST: int -EXDEV: int -ENODEV: int -ENOTDIR: int -EISDIR: int -EINVAL: int -ENFILE: int -EMFILE: int -ENOTTY: int -ETXTBSY: int -EFBIG: int -ENOSPC: int -ESPIPE: int -EROFS: int -EMLINK: int -EPIPE: int -EDOM: int -ERANGE: int -EDEADLK: int -ENAMETOOLONG: int -ENOLCK: int -ENOSYS: int -ENOTEMPTY: int -ELOOP: int -EWOULDBLOCK: int -ENOMSG: int -EIDRM: int -ENOSTR: int -ENODATA: int -ETIME: int -ENOSR: int -EREMOTE: int -ENOLINK: int -EPROTO: int -EBADMSG: int -EOVERFLOW: int -EILSEQ: int -EUSERS: int -ENOTSOCK: int -EDESTADDRREQ: int -EMSGSIZE: int -EPROTOTYPE: int -ENOPROTOOPT: int -EPROTONOSUPPORT: int -ESOCKTNOSUPPORT: int -ENOTSUP: int -EOPNOTSUPP: int -EPFNOSUPPORT: int -EAFNOSUPPORT: int -EADDRINUSE: int -EADDRNOTAVAIL: int -ENETDOWN: int -ENETUNREACH: int -ENETRESET: int -ECONNABORTED: int -ECONNRESET: int -ENOBUFS: int -EISCONN: int -ENOTCONN: int -ESHUTDOWN: int -ETOOMANYREFS: int -ETIMEDOUT: int -ECONNREFUSED: int -EHOSTDOWN: int -EHOSTUNREACH: int -EALREADY: int -EINPROGRESS: int -ESTALE: int -EDQUOT: int -ECANCELED: int # undocumented -ENOTRECOVERABLE: int # undocumented -EOWNERDEAD: int # undocumented - -if sys.platform == "sunos5" or sys.platform == "solaris": # noqa: Y008 - ELOCKUNMAPPED: int - ENOTACTIVE: int - -if sys.platform != "win32": - ENOTBLK: int - EMULTIHOP: int - -if sys.platform == "darwin": - # All of the below are undocumented - EAUTH: int - EBADARCH: int - EBADEXEC: int - EBADMACHO: int - EBADRPC: int - EDEVERR: int - EFTYPE: int - ENEEDAUTH: int - ENOATTR: int - ENOPOLICY: int - EPROCLIM: int - EPROCUNAVAIL: int - EPROGMISMATCH: int - EPROGUNAVAIL: int - EPWROFF: int - ERPCMISMATCH: int - ESHLIBVERS: int - if sys.version_info >= (3, 11): - EQFULL: int - -if sys.platform != "darwin": - EDEADLOCK: int - -if sys.platform != "win32" and sys.platform != "darwin": - ECHRNG: int - EL2NSYNC: int - EL3HLT: int - EL3RST: int - ELNRNG: int - EUNATCH: int - ENOCSI: int - EL2HLT: int - EBADE: int - EBADR: int - EXFULL: int - ENOANO: int - EBADRQC: int - EBADSLT: int - EBFONT: int - ENONET: int - ENOPKG: int - EADV: int - ESRMNT: int - ECOMM: int - EDOTDOT: int - ENOTUNIQ: int - EBADFD: int - EREMCHG: int - ELIBACC: int - ELIBBAD: int - ELIBSCN: int - ELIBMAX: int - ELIBEXEC: int - ERESTART: int - ESTRPIPE: int - EUCLEAN: int - ENOTNAM: int - ENAVAIL: int - EISNAM: int - EREMOTEIO: int - # All of the below are undocumented - EKEYEXPIRED: int - EKEYREJECTED: int - EKEYREVOKED: int - EMEDIUMTYPE: int - ENOKEY: int - ENOMEDIUM: int - ERFKILL: int - -if sys.platform == "win32": - # All of these are undocumented - WSABASEERR: int - WSAEACCES: int - WSAEADDRINUSE: int - WSAEADDRNOTAVAIL: int - WSAEAFNOSUPPORT: int - WSAEALREADY: int - WSAEBADF: int - WSAECONNABORTED: int - WSAECONNREFUSED: int - WSAECONNRESET: int - WSAEDESTADDRREQ: int - WSAEDISCON: int - WSAEDQUOT: int - WSAEFAULT: int - WSAEHOSTDOWN: int - WSAEHOSTUNREACH: int - WSAEINPROGRESS: int - WSAEINTR: int - WSAEINVAL: int - WSAEISCONN: int - WSAELOOP: int - WSAEMFILE: int - WSAEMSGSIZE: int - WSAENAMETOOLONG: int - WSAENETDOWN: int - WSAENETRESET: int - WSAENETUNREACH: int - WSAENOBUFS: int - WSAENOPROTOOPT: int - WSAENOTCONN: int - WSAENOTEMPTY: int - WSAENOTSOCK: int - WSAEOPNOTSUPP: int - WSAEPFNOSUPPORT: int - WSAEPROCLIM: int - WSAEPROTONOSUPPORT: int - WSAEPROTOTYPE: int - WSAEREMOTE: int - WSAESHUTDOWN: int - WSAESOCKTNOSUPPORT: int - WSAESTALE: int - WSAETIMEDOUT: int - WSAETOOMANYREFS: int - WSAEUSERS: int - WSAEWOULDBLOCK: int - WSANOTINITIALISED: int - WSASYSNOTREADY: int - WSAVERNOTSUPPORTED: int diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/faulthandler.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/faulthandler.pyi deleted file mode 100644 index 320a8b6fad..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/faulthandler.pyi +++ /dev/null @@ -1,13 +0,0 @@ -import sys -from _typeshed import FileDescriptorLike - -def cancel_dump_traceback_later() -> None: ... -def disable() -> None: ... -def dump_traceback(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None: ... -def dump_traceback_later(timeout: float, repeat: bool = ..., file: FileDescriptorLike = ..., exit: bool = ...) -> None: ... -def enable(file: FileDescriptorLike = ..., all_threads: bool = ...) -> None: ... -def is_enabled() -> bool: ... - -if sys.platform != "win32": - def register(signum: int, file: FileDescriptorLike = ..., all_threads: bool = ..., chain: bool = ...) -> None: ... - def unregister(signum: int, /) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/fcntl.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/fcntl.pyi deleted file mode 100644 index 2fe64eb532..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/fcntl.pyi +++ /dev/null @@ -1,158 +0,0 @@ -import sys -from _typeshed import FileDescriptorLike, ReadOnlyBuffer, WriteableBuffer -from typing import Any, Final, Literal, overload -from typing_extensions import Buffer - -if sys.platform != "win32": - FASYNC: int - FD_CLOEXEC: int - F_DUPFD: int - F_DUPFD_CLOEXEC: int - F_GETFD: int - F_GETFL: int - F_GETLK: int - F_GETOWN: int - F_RDLCK: int - F_SETFD: int - F_SETFL: int - F_SETLK: int - F_SETLKW: int - F_SETOWN: int - F_UNLCK: int - F_WRLCK: int - - F_GETLEASE: int - F_SETLEASE: int - if sys.platform == "darwin": - F_FULLFSYNC: int - F_NOCACHE: int - F_GETPATH: int - if sys.platform == "linux": - F_SETLKW64: int - F_SETSIG: int - F_SHLCK: int - F_SETLK64: int - F_GETSIG: int - F_NOTIFY: int - F_EXLCK: int - F_GETLK64: int - F_ADD_SEALS: int - F_GET_SEALS: int - F_SEAL_GROW: int - F_SEAL_SEAL: int - F_SEAL_SHRINK: int - F_SEAL_WRITE: int - F_OFD_GETLK: Final[int] - F_OFD_SETLK: Final[int] - F_OFD_SETLKW: Final[int] - - if sys.version_info >= (3, 10): - F_GETPIPE_SZ: int - F_SETPIPE_SZ: int - - DN_ACCESS: int - DN_ATTRIB: int - DN_CREATE: int - DN_DELETE: int - DN_MODIFY: int - DN_MULTISHOT: int - DN_RENAME: int - - LOCK_EX: int - LOCK_NB: int - LOCK_SH: int - LOCK_UN: int - if sys.platform == "linux": - LOCK_MAND: int - LOCK_READ: int - LOCK_RW: int - LOCK_WRITE: int - - if sys.platform == "linux": - # Constants for the POSIX STREAMS interface. Present in glibc until 2.29 (released February 2019). - # Never implemented on BSD, and considered "obsolescent" starting in POSIX 2008. - # Probably still used on Solaris. - I_ATMARK: int - I_CANPUT: int - I_CKBAND: int - I_FDINSERT: int - I_FIND: int - I_FLUSH: int - I_FLUSHBAND: int - I_GETBAND: int - I_GETCLTIME: int - I_GETSIG: int - I_GRDOPT: int - I_GWROPT: int - I_LINK: int - I_LIST: int - I_LOOK: int - I_NREAD: int - I_PEEK: int - I_PLINK: int - I_POP: int - I_PUNLINK: int - I_PUSH: int - I_RECVFD: int - I_SENDFD: int - I_SETCLTIME: int - I_SETSIG: int - I_SRDOPT: int - I_STR: int - I_SWROPT: int - I_UNLINK: int - - if sys.version_info >= (3, 12) and sys.platform == "linux": - FICLONE: int - FICLONERANGE: int - - if sys.version_info >= (3, 13) and sys.platform == "linux": - F_OWNER_TID: Final = 0 - F_OWNER_PID: Final = 1 - F_OWNER_PGRP: Final = 2 - F_SETOWN_EX: Final = 15 - F_GETOWN_EX: Final = 16 - F_SEAL_FUTURE_WRITE: Final = 16 - F_GET_RW_HINT: Final = 1035 - F_SET_RW_HINT: Final = 1036 - F_GET_FILE_RW_HINT: Final = 1037 - F_SET_FILE_RW_HINT: Final = 1038 - RWH_WRITE_LIFE_NOT_SET: Final = 0 - RWH_WRITE_LIFE_NONE: Final = 1 - RWH_WRITE_LIFE_SHORT: Final = 2 - RWH_WRITE_LIFE_MEDIUM: Final = 3 - RWH_WRITE_LIFE_LONG: Final = 4 - RWH_WRITE_LIFE_EXTREME: Final = 5 - - if sys.version_info >= (3, 11) and sys.platform == "darwin": - F_OFD_SETLK: Final = 90 - F_OFD_SETLKW: Final = 91 - F_OFD_GETLK: Final = 92 - - if sys.version_info >= (3, 13) and sys.platform != "linux": - # OSx and NetBSD - F_GETNOSIGPIPE: Final[int] - F_SETNOSIGPIPE: Final[int] - # OSx and FreeBSD - F_RDAHEAD: Final[int] - - @overload - def fcntl(fd: FileDescriptorLike, cmd: int, arg: int = 0, /) -> int: ... - @overload - def fcntl(fd: FileDescriptorLike, cmd: int, arg: str | ReadOnlyBuffer, /) -> bytes: ... - # If arg is an int, return int - @overload - def ioctl(fd: FileDescriptorLike, request: int, arg: int = 0, mutate_flag: bool = True, /) -> int: ... - # The return type works as follows: - # - If arg is a read-write buffer, return int if mutate_flag is True, otherwise bytes - # - If arg is a read-only buffer, return bytes (and ignore the value of mutate_flag) - # We can't represent that precisely as we can't distinguish between read-write and read-only - # buffers, so we add overloads for a few unambiguous cases and use Any for the rest. - @overload - def ioctl(fd: FileDescriptorLike, request: int, arg: bytes, mutate_flag: bool = True, /) -> bytes: ... - @overload - def ioctl(fd: FileDescriptorLike, request: int, arg: WriteableBuffer, mutate_flag: Literal[False], /) -> bytes: ... - @overload - def ioctl(fd: FileDescriptorLike, request: int, arg: Buffer, mutate_flag: bool = True, /) -> Any: ... - def flock(fd: FileDescriptorLike, operation: int, /) -> None: ... - def lockf(fd: FileDescriptorLike, cmd: int, len: int = 0, start: int = 0, whence: int = 0, /) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/filecmp.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/filecmp.pyi deleted file mode 100644 index a2a2b235fd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/filecmp.pyi +++ /dev/null @@ -1,65 +0,0 @@ -import sys -from _typeshed import GenericPath, StrOrBytesPath -from collections.abc import Callable, Iterable, Sequence -from types import GenericAlias -from typing import Any, AnyStr, Final, Generic, Literal - -__all__ = ["clear_cache", "cmp", "dircmp", "cmpfiles", "DEFAULT_IGNORES"] - -DEFAULT_IGNORES: list[str] -BUFSIZE: Final = 8192 - -def cmp(f1: StrOrBytesPath, f2: StrOrBytesPath, shallow: bool | Literal[0, 1] = True) -> bool: ... -def cmpfiles( - a: GenericPath[AnyStr], b: GenericPath[AnyStr], common: Iterable[GenericPath[AnyStr]], shallow: bool | Literal[0, 1] = True -) -> tuple[list[AnyStr], list[AnyStr], list[AnyStr]]: ... - -class dircmp(Generic[AnyStr]): - if sys.version_info >= (3, 13): - def __init__( - self, - a: GenericPath[AnyStr], - b: GenericPath[AnyStr], - ignore: Sequence[AnyStr] | None = None, - hide: Sequence[AnyStr] | None = None, - *, - shallow: bool = True, - ) -> None: ... - else: - def __init__( - self, - a: GenericPath[AnyStr], - b: GenericPath[AnyStr], - ignore: Sequence[AnyStr] | None = None, - hide: Sequence[AnyStr] | None = None, - ) -> None: ... - left: AnyStr - right: AnyStr - hide: Sequence[AnyStr] - ignore: Sequence[AnyStr] - # These properties are created at runtime by __getattr__ - subdirs: dict[AnyStr, dircmp[AnyStr]] - same_files: list[AnyStr] - diff_files: list[AnyStr] - funny_files: list[AnyStr] - common_dirs: list[AnyStr] - common_files: list[AnyStr] - common_funny: list[AnyStr] - common: list[AnyStr] - left_only: list[AnyStr] - right_only: list[AnyStr] - left_list: list[AnyStr] - right_list: list[AnyStr] - def report(self) -> None: ... - def report_partial_closure(self) -> None: ... - def report_full_closure(self) -> None: ... - methodmap: dict[str, Callable[[], None]] - def phase0(self) -> None: ... - def phase1(self) -> None: ... - def phase2(self) -> None: ... - def phase3(self) -> None: ... - def phase4(self) -> None: ... - def phase4_closure(self) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -def clear_cache() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/fileinput.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/fileinput.pyi deleted file mode 100644 index 948b39ea1e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/fileinput.pyi +++ /dev/null @@ -1,209 +0,0 @@ -import sys -from _typeshed import AnyStr_co, StrOrBytesPath -from collections.abc import Callable, Iterable -from types import GenericAlias, TracebackType -from typing import IO, Any, AnyStr, Generic, Literal, Protocol, overload -from typing_extensions import Self, TypeAlias - -__all__ = [ - "input", - "close", - "nextfile", - "filename", - "lineno", - "filelineno", - "fileno", - "isfirstline", - "isstdin", - "FileInput", - "hook_compressed", - "hook_encoded", -] - -if sys.version_info >= (3, 11): - _TextMode: TypeAlias = Literal["r"] -else: - _TextMode: TypeAlias = Literal["r", "rU", "U"] - -class _HasReadlineAndFileno(Protocol[AnyStr_co]): - def readline(self) -> AnyStr_co: ... - def fileno(self) -> int: ... - -if sys.version_info >= (3, 10): - # encoding and errors are added - @overload - def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: _TextMode = "r", - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, - encoding: str | None = None, - errors: str | None = None, - ) -> FileInput[str]: ... - @overload - def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, - encoding: None = None, - errors: None = None, - ) -> FileInput[bytes]: ... - @overload - def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, - encoding: str | None = None, - errors: str | None = None, - ) -> FileInput[Any]: ... - -else: - # bufsize is dropped and mode and openhook become keyword-only - @overload - def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: _TextMode = "r", - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, - ) -> FileInput[str]: ... - @overload - def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, - ) -> FileInput[bytes]: ... - @overload - def input( - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, - ) -> FileInput[Any]: ... - -def close() -> None: ... -def nextfile() -> None: ... -def filename() -> str: ... -def lineno() -> int: ... -def filelineno() -> int: ... -def fileno() -> int: ... -def isfirstline() -> bool: ... -def isstdin() -> bool: ... - -class FileInput(Generic[AnyStr]): - if sys.version_info >= (3, 10): - # encoding and errors are added - @overload - def __init__( - self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: _TextMode = "r", - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, - encoding: str | None = None, - errors: str | None = None, - ) -> None: ... - @overload - def __init__( - self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, - encoding: None = None, - errors: None = None, - ) -> None: ... - @overload - def __init__( - self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, - encoding: str | None = None, - errors: str | None = None, - ) -> None: ... - - else: - # bufsize is dropped and mode and openhook become keyword-only - @overload - def __init__( - self: FileInput[str], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: _TextMode = "r", - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[str]] | None = None, - ) -> None: ... - @overload - def __init__( - self: FileInput[bytes], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: Literal["rb"], - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[bytes]] | None = None, - ) -> None: ... - @overload - def __init__( - self: FileInput[Any], - files: StrOrBytesPath | Iterable[StrOrBytesPath] | None = None, - inplace: bool = False, - backup: str = "", - *, - mode: str, - openhook: Callable[[StrOrBytesPath, str], _HasReadlineAndFileno[Any]] | None = None, - ) -> None: ... - - def __del__(self) -> None: ... - def close(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> None: ... - def __iter__(self) -> Self: ... - def __next__(self) -> AnyStr: ... - if sys.version_info < (3, 11): - def __getitem__(self, i: int) -> AnyStr: ... - - def nextfile(self) -> None: ... - def readline(self) -> AnyStr: ... - def filename(self) -> str: ... - def lineno(self) -> int: ... - def filelineno(self) -> int: ... - def fileno(self) -> int: ... - def isfirstline(self) -> bool: ... - def isstdin(self) -> bool: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -if sys.version_info >= (3, 10): - def hook_compressed( - filename: StrOrBytesPath, mode: str, *, encoding: str | None = None, errors: str | None = None - ) -> IO[Any]: ... - -else: - def hook_compressed(filename: StrOrBytesPath, mode: str) -> IO[Any]: ... - -def hook_encoded(encoding: str, errors: str | None = None) -> Callable[[StrOrBytesPath, str], IO[Any]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/fnmatch.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/fnmatch.pyi deleted file mode 100644 index 7051c999c4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/fnmatch.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from collections.abc import Iterable -from typing import AnyStr - -__all__ = ["filter", "fnmatch", "fnmatchcase", "translate"] - -def fnmatch(name: AnyStr, pat: AnyStr) -> bool: ... -def fnmatchcase(name: AnyStr, pat: AnyStr) -> bool: ... -def filter(names: Iterable[AnyStr], pat: AnyStr) -> list[AnyStr]: ... -def translate(pat: str) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/formatter.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/formatter.pyi deleted file mode 100644 index 05c3c8b3dd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/formatter.pyi +++ /dev/null @@ -1,88 +0,0 @@ -from collections.abc import Iterable -from typing import IO, Any -from typing_extensions import TypeAlias - -AS_IS: None -_FontType: TypeAlias = tuple[str, bool, bool, bool] -_StylesType: TypeAlias = tuple[Any, ...] - -class NullFormatter: - writer: NullWriter | None - def __init__(self, writer: NullWriter | None = None) -> None: ... - def end_paragraph(self, blankline: int) -> None: ... - def add_line_break(self) -> None: ... - def add_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def add_label_data(self, format: str, counter: int, blankline: int | None = None) -> None: ... - def add_flowing_data(self, data: str) -> None: ... - def add_literal_data(self, data: str) -> None: ... - def flush_softspace(self) -> None: ... - def push_alignment(self, align: str | None) -> None: ... - def pop_alignment(self) -> None: ... - def push_font(self, x: _FontType) -> None: ... - def pop_font(self) -> None: ... - def push_margin(self, margin: int) -> None: ... - def pop_margin(self) -> None: ... - def set_spacing(self, spacing: str | None) -> None: ... - def push_style(self, *styles: _StylesType) -> None: ... - def pop_style(self, n: int = 1) -> None: ... - def assert_line_data(self, flag: int = 1) -> None: ... - -class AbstractFormatter: - writer: NullWriter - align: str | None - align_stack: list[str | None] - font_stack: list[_FontType] - margin_stack: list[int] - spacing: str | None - style_stack: Any - nospace: int - softspace: int - para_end: int - parskip: int - hard_break: int - have_label: int - def __init__(self, writer: NullWriter) -> None: ... - def end_paragraph(self, blankline: int) -> None: ... - def add_line_break(self) -> None: ... - def add_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def add_label_data(self, format: str, counter: int, blankline: int | None = None) -> None: ... - def format_counter(self, format: Iterable[str], counter: int) -> str: ... - def format_letter(self, case: str, counter: int) -> str: ... - def format_roman(self, case: str, counter: int) -> str: ... - def add_flowing_data(self, data: str) -> None: ... - def add_literal_data(self, data: str) -> None: ... - def flush_softspace(self) -> None: ... - def push_alignment(self, align: str | None) -> None: ... - def pop_alignment(self) -> None: ... - def push_font(self, font: _FontType) -> None: ... - def pop_font(self) -> None: ... - def push_margin(self, margin: int) -> None: ... - def pop_margin(self) -> None: ... - def set_spacing(self, spacing: str | None) -> None: ... - def push_style(self, *styles: _StylesType) -> None: ... - def pop_style(self, n: int = 1) -> None: ... - def assert_line_data(self, flag: int = 1) -> None: ... - -class NullWriter: - def flush(self) -> None: ... - def new_alignment(self, align: str | None) -> None: ... - def new_font(self, font: _FontType) -> None: ... - def new_margin(self, margin: int, level: int) -> None: ... - def new_spacing(self, spacing: str | None) -> None: ... - def new_styles(self, styles: tuple[Any, ...]) -> None: ... - def send_paragraph(self, blankline: int) -> None: ... - def send_line_break(self) -> None: ... - def send_hor_rule(self, *args: Any, **kw: Any) -> None: ... - def send_label_data(self, data: str) -> None: ... - def send_flowing_data(self, data: str) -> None: ... - def send_literal_data(self, data: str) -> None: ... - -class AbstractWriter(NullWriter): ... - -class DumbWriter(NullWriter): - file: IO[str] - maxcol: int - def __init__(self, file: IO[str] | None = None, maxcol: int = 72) -> None: ... - def reset(self) -> None: ... - -def test(file: str | None = None) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/fractions.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/fractions.pyi deleted file mode 100644 index 4d5c2160e6..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/fractions.pyi +++ /dev/null @@ -1,147 +0,0 @@ -import sys -from collections.abc import Callable -from decimal import Decimal -from numbers import Rational, Real -from typing import Any, Literal, Protocol, SupportsIndex, overload -from typing_extensions import Self, TypeAlias - -_ComparableNum: TypeAlias = int | float | Decimal | Real - -__all__ = ["Fraction"] - -class _ConvertibleToIntegerRatio(Protocol): - def as_integer_ratio(self) -> tuple[int | Rational, int | Rational]: ... - -class Fraction(Rational): - @overload - def __new__(cls, numerator: int | Rational = 0, denominator: int | Rational | None = None) -> Self: ... - @overload - def __new__(cls, numerator: float | Decimal | str) -> Self: ... - - if sys.version_info >= (3, 14): - @overload - def __new__(cls, numerator: _ConvertibleToIntegerRatio) -> Self: ... - - @classmethod - def from_float(cls, f: float) -> Self: ... - @classmethod - def from_decimal(cls, dec: Decimal) -> Self: ... - def limit_denominator(self, max_denominator: int = 1000000) -> Fraction: ... - def as_integer_ratio(self) -> tuple[int, int]: ... - if sys.version_info >= (3, 12): - def is_integer(self) -> bool: ... - - @property - def numerator(a) -> int: ... - @property - def denominator(a) -> int: ... - @overload - def __add__(a, b: int | Fraction) -> Fraction: ... - @overload - def __add__(a, b: float) -> float: ... - @overload - def __add__(a, b: complex) -> complex: ... - @overload - def __radd__(b, a: int | Fraction) -> Fraction: ... - @overload - def __radd__(b, a: float) -> float: ... - @overload - def __radd__(b, a: complex) -> complex: ... - @overload - def __sub__(a, b: int | Fraction) -> Fraction: ... - @overload - def __sub__(a, b: float) -> float: ... - @overload - def __sub__(a, b: complex) -> complex: ... - @overload - def __rsub__(b, a: int | Fraction) -> Fraction: ... - @overload - def __rsub__(b, a: float) -> float: ... - @overload - def __rsub__(b, a: complex) -> complex: ... - @overload - def __mul__(a, b: int | Fraction) -> Fraction: ... - @overload - def __mul__(a, b: float) -> float: ... - @overload - def __mul__(a, b: complex) -> complex: ... - @overload - def __rmul__(b, a: int | Fraction) -> Fraction: ... - @overload - def __rmul__(b, a: float) -> float: ... - @overload - def __rmul__(b, a: complex) -> complex: ... - @overload - def __truediv__(a, b: int | Fraction) -> Fraction: ... - @overload - def __truediv__(a, b: float) -> float: ... - @overload - def __truediv__(a, b: complex) -> complex: ... - @overload - def __rtruediv__(b, a: int | Fraction) -> Fraction: ... - @overload - def __rtruediv__(b, a: float) -> float: ... - @overload - def __rtruediv__(b, a: complex) -> complex: ... - @overload - def __floordiv__(a, b: int | Fraction) -> int: ... - @overload - def __floordiv__(a, b: float) -> float: ... - @overload - def __rfloordiv__(b, a: int | Fraction) -> int: ... - @overload - def __rfloordiv__(b, a: float) -> float: ... - @overload - def __mod__(a, b: int | Fraction) -> Fraction: ... - @overload - def __mod__(a, b: float) -> float: ... - @overload - def __rmod__(b, a: int | Fraction) -> Fraction: ... - @overload - def __rmod__(b, a: float) -> float: ... - @overload - def __divmod__(a, b: int | Fraction) -> tuple[int, Fraction]: ... - @overload - def __divmod__(a, b: float) -> tuple[float, Fraction]: ... - @overload - def __rdivmod__(a, b: int | Fraction) -> tuple[int, Fraction]: ... - @overload - def __rdivmod__(a, b: float) -> tuple[float, Fraction]: ... - @overload - def __pow__(a, b: int) -> Fraction: ... - @overload - def __pow__(a, b: float | Fraction) -> float: ... - @overload - def __pow__(a, b: complex) -> complex: ... - @overload - def __rpow__(b, a: float | Fraction) -> float: ... - @overload - def __rpow__(b, a: complex) -> complex: ... - def __pos__(a) -> Fraction: ... - def __neg__(a) -> Fraction: ... - def __abs__(a) -> Fraction: ... - def __trunc__(a) -> int: ... - def __floor__(a) -> int: ... - def __ceil__(a) -> int: ... - @overload - def __round__(self, ndigits: None = None) -> int: ... - @overload - def __round__(self, ndigits: int) -> Fraction: ... - def __hash__(self) -> int: ... # type: ignore[override] - def __eq__(a, b: object) -> bool: ... - def __lt__(a, b: _ComparableNum) -> bool: ... - def __gt__(a, b: _ComparableNum) -> bool: ... - def __le__(a, b: _ComparableNum) -> bool: ... - def __ge__(a, b: _ComparableNum) -> bool: ... - def __bool__(a) -> bool: ... - def __copy__(self) -> Self: ... - def __deepcopy__(self, memo: Any) -> Self: ... - if sys.version_info >= (3, 11): - def __int__(a, _index: Callable[[SupportsIndex], int] = ...) -> int: ... - # Not actually defined within fractions.py, but provides more useful - # overrides - @property - def real(self) -> Fraction: ... - @property - def imag(self) -> Literal[0]: ... - def conjugate(self) -> Fraction: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ftplib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ftplib.pyi deleted file mode 100644 index 44bc2165fe..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ftplib.pyi +++ /dev/null @@ -1,153 +0,0 @@ -import sys -from _typeshed import SupportsRead, SupportsReadline -from collections.abc import Callable, Iterable, Iterator -from socket import socket -from ssl import SSLContext -from types import TracebackType -from typing import Any, Final, Literal, TextIO -from typing_extensions import Self - -__all__ = ["FTP", "error_reply", "error_temp", "error_perm", "error_proto", "all_errors", "FTP_TLS"] - -MSG_OOB: Final = 1 -FTP_PORT: Final = 21 -MAXLINE: Final = 8192 -CRLF: Final = "\r\n" -B_CRLF: Final = b"\r\n" - -class Error(Exception): ... -class error_reply(Error): ... -class error_temp(Error): ... -class error_perm(Error): ... -class error_proto(Error): ... - -all_errors: tuple[type[Exception], ...] - -class FTP: - debugging: int - host: str - port: int - maxline: int - sock: socket | None - welcome: str | None - passiveserver: int - timeout: float | None - af: int - lastresp: str - file: TextIO | None - encoding: str - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - source_address: tuple[str, int] | None - def __init__( - self, - host: str = "", - user: str = "", - passwd: str = "", - acct: str = "", - timeout: float | None = ..., - source_address: tuple[str, int] | None = None, - *, - encoding: str = "utf-8", - ) -> None: ... - def connect( - self, host: str = "", port: int = 0, timeout: float = -999, source_address: tuple[str, int] | None = None - ) -> str: ... - def getwelcome(self) -> str: ... - def set_debuglevel(self, level: int) -> None: ... - def debug(self, level: int) -> None: ... - def set_pasv(self, val: bool | Literal[0, 1]) -> None: ... - def sanitize(self, s: str) -> str: ... - def putline(self, line: str) -> None: ... - def putcmd(self, line: str) -> None: ... - def getline(self) -> str: ... - def getmultiline(self) -> str: ... - def getresp(self) -> str: ... - def voidresp(self) -> str: ... - def abort(self) -> str: ... - def sendcmd(self, cmd: str) -> str: ... - def voidcmd(self, cmd: str) -> str: ... - def sendport(self, host: str, port: int) -> str: ... - def sendeprt(self, host: str, port: int) -> str: ... - def makeport(self) -> socket: ... - def makepasv(self) -> tuple[str, int]: ... - def login(self, user: str = "", passwd: str = "", acct: str = "") -> str: ... - # In practice, `rest` can actually be anything whose str() is an integer sequence, so to make it simple we allow integers - def ntransfercmd(self, cmd: str, rest: int | str | None = None) -> tuple[socket, int | None]: ... - def transfercmd(self, cmd: str, rest: int | str | None = None) -> socket: ... - def retrbinary( - self, cmd: str, callback: Callable[[bytes], object], blocksize: int = 8192, rest: int | str | None = None - ) -> str: ... - def storbinary( - self, - cmd: str, - fp: SupportsRead[bytes], - blocksize: int = 8192, - callback: Callable[[bytes], object] | None = None, - rest: int | str | None = None, - ) -> str: ... - def retrlines(self, cmd: str, callback: Callable[[str], object] | None = None) -> str: ... - def storlines(self, cmd: str, fp: SupportsReadline[bytes], callback: Callable[[bytes], object] | None = None) -> str: ... - def acct(self, password: str) -> str: ... - def nlst(self, *args: str) -> list[str]: ... - # Technically only the last arg can be a Callable but ... - def dir(self, *args: str | Callable[[str], object]) -> None: ... - def mlsd(self, path: str = "", facts: Iterable[str] = []) -> Iterator[tuple[str, dict[str, str]]]: ... - def rename(self, fromname: str, toname: str) -> str: ... - def delete(self, filename: str) -> str: ... - def cwd(self, dirname: str) -> str: ... - def size(self, filename: str) -> int | None: ... - def mkd(self, dirname: str) -> str: ... - def rmd(self, dirname: str) -> str: ... - def pwd(self) -> str: ... - def quit(self) -> str: ... - def close(self) -> None: ... - -class FTP_TLS(FTP): - if sys.version_info >= (3, 12): - def __init__( - self, - host: str = "", - user: str = "", - passwd: str = "", - acct: str = "", - *, - context: SSLContext | None = None, - timeout: float | None = ..., - source_address: tuple[str, int] | None = None, - encoding: str = "utf-8", - ) -> None: ... - else: - def __init__( - self, - host: str = "", - user: str = "", - passwd: str = "", - acct: str = "", - keyfile: str | None = None, - certfile: str | None = None, - context: SSLContext | None = None, - timeout: float | None = ..., - source_address: tuple[str, int] | None = None, - *, - encoding: str = "utf-8", - ) -> None: ... - ssl_version: int - keyfile: str | None - certfile: str | None - context: SSLContext - def login(self, user: str = "", passwd: str = "", acct: str = "", secure: bool = True) -> str: ... - def auth(self) -> str: ... - def prot_p(self) -> str: ... - def prot_c(self) -> str: ... - def ccc(self) -> str: ... - -def parse150(resp: str) -> int | None: ... # 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"] = "I" -) -> None: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/functools.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/functools.pyi deleted file mode 100644 index d35c295754..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/functools.pyi +++ /dev/null @@ -1,206 +0,0 @@ -import sys -import types -from _typeshed import SupportsAllComparisons, SupportsItems -from collections.abc import Callable, Hashable, Iterable, Sized -from types import GenericAlias -from typing import Any, Generic, Literal, NamedTuple, TypedDict, TypeVar, final, overload -from typing_extensions import ParamSpec, Self, TypeAlias - -__all__ = [ - "update_wrapper", - "wraps", - "WRAPPER_ASSIGNMENTS", - "WRAPPER_UPDATES", - "total_ordering", - "cmp_to_key", - "lru_cache", - "reduce", - "partial", - "partialmethod", - "singledispatch", - "cached_property", - "singledispatchmethod", - "cache", -] - -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True) -_S = TypeVar("_S") -_PWrapped = ParamSpec("_PWrapped") -_RWrapped = TypeVar("_RWrapped") -_PWrapper = ParamSpec("_PWrapper") -_RWrapper = TypeVar("_RWrapper") - -@overload -def reduce(function: Callable[[_T, _S], _T], sequence: Iterable[_S], initial: _T, /) -> _T: ... -@overload -def reduce(function: Callable[[_T, _T], _T], sequence: Iterable[_T], /) -> _T: ... - -class _CacheInfo(NamedTuple): - hits: int - misses: int - maxsize: int | None - currsize: int - -class _CacheParameters(TypedDict): - maxsize: int - typed: bool - -@final -class _lru_cache_wrapper(Generic[_T]): - __wrapped__: Callable[..., _T] - def __call__(self, *args: Hashable, **kwargs: Hashable) -> _T: ... - def cache_info(self) -> _CacheInfo: ... - def cache_clear(self) -> None: ... - def cache_parameters(self) -> _CacheParameters: ... - def __copy__(self) -> _lru_cache_wrapper[_T]: ... - def __deepcopy__(self, memo: Any, /) -> _lru_cache_wrapper[_T]: ... - -@overload -def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ... -@overload -def lru_cache(maxsize: Callable[..., _T], typed: bool = False) -> _lru_cache_wrapper[_T]: ... - -if sys.version_info >= (3, 12): - WRAPPER_ASSIGNMENTS: tuple[ - Literal["__module__"], - Literal["__name__"], - Literal["__qualname__"], - Literal["__doc__"], - Literal["__annotations__"], - Literal["__type_params__"], - ] -else: - WRAPPER_ASSIGNMENTS: tuple[ - Literal["__module__"], Literal["__name__"], Literal["__qualname__"], Literal["__doc__"], Literal["__annotations__"] - ] -WRAPPER_UPDATES: tuple[Literal["__dict__"]] - -class _Wrapped(Generic[_PWrapped, _RWrapped, _PWrapper, _RWrapper]): - __wrapped__: Callable[_PWrapped, _RWrapped] - def __call__(self, *args: _PWrapper.args, **kwargs: _PWrapper.kwargs) -> _RWrapper: ... - # as with ``Callable``, we'll assume that these attributes exist - __name__: str - __qualname__: str - -class _Wrapper(Generic[_PWrapped, _RWrapped]): - def __call__(self, f: Callable[_PWrapper, _RWrapper]) -> _Wrapped[_PWrapped, _RWrapped, _PWrapper, _RWrapper]: ... - -if sys.version_info >= (3, 12): - def update_wrapper( - wrapper: Callable[_PWrapper, _RWrapper], - wrapped: Callable[_PWrapped, _RWrapped], - assigned: Iterable[str] = ("__module__", "__name__", "__qualname__", "__doc__", "__annotations__", "__type_params__"), - updated: Iterable[str] = ("__dict__",), - ) -> _Wrapped[_PWrapped, _RWrapped, _PWrapper, _RWrapper]: ... - def wraps( - wrapped: Callable[_PWrapped, _RWrapped], - assigned: Iterable[str] = ("__module__", "__name__", "__qualname__", "__doc__", "__annotations__", "__type_params__"), - updated: Iterable[str] = ("__dict__",), - ) -> _Wrapper[_PWrapped, _RWrapped]: ... - -else: - def update_wrapper( - wrapper: Callable[_PWrapper, _RWrapper], - wrapped: Callable[_PWrapped, _RWrapped], - assigned: Iterable[str] = ("__module__", "__name__", "__qualname__", "__doc__", "__annotations__"), - updated: Iterable[str] = ("__dict__",), - ) -> _Wrapped[_PWrapped, _RWrapped, _PWrapper, _RWrapper]: ... - def wraps( - wrapped: Callable[_PWrapped, _RWrapped], - assigned: Iterable[str] = ("__module__", "__name__", "__qualname__", "__doc__", "__annotations__"), - updated: Iterable[str] = ("__dict__",), - ) -> _Wrapper[_PWrapped, _RWrapped]: ... - -def total_ordering(cls: type[_T]) -> type[_T]: ... -def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsAllComparisons]: ... - -class partial(Generic[_T]): - @property - def func(self) -> Callable[..., _T]: ... - @property - def args(self) -> tuple[Any, ...]: ... - @property - def keywords(self) -> dict[str, Any]: ... - def __new__(cls, func: Callable[..., _T], /, *args: Any, **kwargs: Any) -> Self: ... - def __call__(self, /, *args: Any, **kwargs: Any) -> _T: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -# With protocols, this could change into a generic protocol that defines __get__ and returns _T -_Descriptor: TypeAlias = Any - -class partialmethod(Generic[_T]): - func: Callable[..., _T] | _Descriptor - args: tuple[Any, ...] - keywords: dict[str, Any] - @overload - def __init__(self, func: Callable[..., _T], /, *args: Any, **keywords: Any) -> None: ... - @overload - def __init__(self, func: _Descriptor, /, *args: Any, **keywords: Any) -> None: ... - def __get__(self, obj: Any, cls: type[Any] | None = None) -> Callable[..., _T]: ... - @property - def __isabstractmethod__(self) -> bool: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -if sys.version_info >= (3, 11): - _RegType: TypeAlias = type[Any] | types.UnionType -else: - _RegType: TypeAlias = type[Any] - -class _SingleDispatchCallable(Generic[_T]): - registry: types.MappingProxyType[Any, Callable[..., _T]] - def dispatch(self, cls: Any) -> Callable[..., _T]: ... - # @fun.register(complex) - # def _(arg, verbose=False): ... - @overload - def register(self, cls: _RegType, func: None = None) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... - # @fun.register - # def _(arg: int, verbose=False): - @overload - def register(self, cls: Callable[..., _T], func: None = None) -> Callable[..., _T]: ... - # fun.register(int, lambda x: x) - @overload - def register(self, cls: _RegType, func: Callable[..., _T]) -> Callable[..., _T]: ... - def _clear_cache(self) -> None: ... - def __call__(self, /, *args: Any, **kwargs: Any) -> _T: ... - -def singledispatch(func: Callable[..., _T]) -> _SingleDispatchCallable[_T]: ... - -class singledispatchmethod(Generic[_T]): - dispatcher: _SingleDispatchCallable[_T] - func: Callable[..., _T] - def __init__(self, func: Callable[..., _T]) -> None: ... - @property - def __isabstractmethod__(self) -> bool: ... - @overload - def register(self, cls: _RegType, method: None = None) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... - @overload - def register(self, cls: Callable[..., _T], method: None = None) -> Callable[..., _T]: ... - @overload - def register(self, cls: _RegType, method: Callable[..., _T]) -> Callable[..., _T]: ... - def __get__(self, obj: _S, cls: type[_S] | None = None) -> Callable[..., _T]: ... - -class cached_property(Generic[_T_co]): - func: Callable[[Any], _T_co] - attrname: str | None - def __init__(self, func: Callable[[Any], _T_co]) -> None: ... - @overload - def __get__(self, instance: None, owner: type[Any] | None = None) -> Self: ... - @overload - def __get__(self, instance: object, owner: type[Any] | None = None) -> _T_co: ... - def __set_name__(self, owner: type[Any], name: str) -> None: ... - # __set__ is not defined at runtime, but @cached_property is designed to be settable - def __set__(self, instance: object, value: _T_co) -> None: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -def cache(user_function: Callable[..., _T], /) -> _lru_cache_wrapper[_T]: ... -def _make_key( - args: tuple[Hashable, ...], - kwds: SupportsItems[Any, Any], - typed: bool, - kwd_mark: tuple[object, ...] = ..., - fasttypes: set[type] = ..., - tuple: type = ..., - type: Any = ..., - len: Callable[[Sized], int] = ..., -) -> Hashable: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/gc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/gc.pyi deleted file mode 100644 index 06fb6b47c2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/gc.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from collections.abc import Callable -from typing import Any, Final, Literal -from typing_extensions import TypeAlias - -DEBUG_COLLECTABLE: Final = 2 -DEBUG_LEAK: Final = 38 -DEBUG_SAVEALL: Final = 32 -DEBUG_STATS: Final = 1 -DEBUG_UNCOLLECTABLE: Final = 4 - -_CallbackType: TypeAlias = Callable[[Literal["start", "stop"], dict[str, int]], object] - -callbacks: list[_CallbackType] -garbage: list[Any] - -def collect(generation: int = 2) -> int: ... -def disable() -> None: ... -def enable() -> None: ... -def get_count() -> tuple[int, int, int]: ... -def get_debug() -> int: ... -def get_objects(generation: int | None = None) -> list[Any]: ... -def freeze() -> None: ... -def unfreeze() -> None: ... -def get_freeze_count() -> int: ... -def get_referents(*objs: Any) -> list[Any]: ... -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: ... -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: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/genericpath.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/genericpath.pyi deleted file mode 100644 index 9d87c48fd5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/genericpath.pyi +++ /dev/null @@ -1,59 +0,0 @@ -import os -import sys -from _typeshed import BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath, SupportsRichComparisonT -from collections.abc import Sequence -from typing import Literal, overload -from typing_extensions import LiteralString - -__all__ = [ - "commonprefix", - "exists", - "getatime", - "getctime", - "getmtime", - "getsize", - "isdir", - "isfile", - "samefile", - "sameopenfile", - "samestat", -] -if sys.version_info >= (3, 12): - __all__ += ["islink"] -if sys.version_info >= (3, 13): - __all__ += ["isjunction", "isdevdrive", "lexists"] - -# All overloads can return empty string. Ideally, Literal[""] would be a valid -# Iterable[T], so that list[T] | Literal[""] could be used as a return -# type. But because this only works when T is str, we need Sequence[T] instead. -@overload -def commonprefix(m: Sequence[LiteralString]) -> LiteralString: ... -@overload -def commonprefix(m: Sequence[StrPath]) -> str: ... -@overload -def commonprefix(m: Sequence[BytesPath]) -> bytes | Literal[""]: ... -@overload -def commonprefix(m: Sequence[list[SupportsRichComparisonT]]) -> Sequence[SupportsRichComparisonT]: ... -@overload -def commonprefix(m: Sequence[tuple[SupportsRichComparisonT, ...]]) -> Sequence[SupportsRichComparisonT]: ... -def exists(path: FileDescriptorOrPath) -> bool: ... -def getsize(filename: FileDescriptorOrPath) -> int: ... -def isfile(path: FileDescriptorOrPath) -> bool: ... -def isdir(s: FileDescriptorOrPath) -> bool: ... - -if sys.version_info >= (3, 12): - def islink(path: StrOrBytesPath) -> bool: ... - -# These return float if os.stat_float_times() == True, -# but int is a subclass of float. -def getatime(filename: FileDescriptorOrPath) -> float: ... -def getmtime(filename: FileDescriptorOrPath) -> float: ... -def getctime(filename: FileDescriptorOrPath) -> float: ... -def samefile(f1: FileDescriptorOrPath, f2: FileDescriptorOrPath) -> bool: ... -def sameopenfile(fp1: int, fp2: int) -> bool: ... -def samestat(s1: os.stat_result, s2: os.stat_result) -> bool: ... - -if sys.version_info >= (3, 13): - def isjunction(path: StrOrBytesPath) -> bool: ... - def isdevdrive(path: StrOrBytesPath) -> bool: ... - def lexists(path: StrOrBytesPath) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/getopt.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/getopt.pyi deleted file mode 100644 index c15db8122c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/getopt.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from collections.abc import Iterable, Sequence -from typing import Protocol, TypeVar, overload, type_check_only - -_StrSequenceT_co = TypeVar("_StrSequenceT_co", covariant=True, bound=Sequence[str]) - -@type_check_only -class _SliceableT(Protocol[_StrSequenceT_co]): - @overload - def __getitem__(self, key: int, /) -> str: ... - @overload - def __getitem__(self, key: slice, /) -> _StrSequenceT_co: ... - -__all__ = ["GetoptError", "error", "getopt", "gnu_getopt"] - -def getopt( - args: _SliceableT[_StrSequenceT_co], shortopts: str, longopts: Iterable[str] | str = [] -) -> tuple[list[tuple[str, str]], _StrSequenceT_co]: ... -def gnu_getopt( - args: Sequence[str], shortopts: str, longopts: Iterable[str] | str = [] -) -> tuple[list[tuple[str, str]], list[str]]: ... - -class GetoptError(Exception): - msg: str - opt: str - def __init__(self, msg: str, opt: str = "") -> None: ... - -error = GetoptError diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/getpass.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/getpass.pyi deleted file mode 100644 index 6104e0dedf..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/getpass.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import TextIO - -__all__ = ["getpass", "getuser", "GetPassWarning"] - -def getpass(prompt: str = "Password: ", stream: TextIO | None = None) -> str: ... -def getuser() -> str: ... - -class GetPassWarning(UserWarning): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/gettext.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/gettext.pyi deleted file mode 100644 index d8fd92a00e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/gettext.pyi +++ /dev/null @@ -1,171 +0,0 @@ -import io -import sys -from _typeshed import StrPath -from collections.abc import Callable, Container, Iterable, Sequence -from typing import Any, Final, Literal, Protocol, TypeVar, overload - -__all__ = [ - "NullTranslations", - "GNUTranslations", - "Catalog", - "find", - "translation", - "install", - "textdomain", - "bindtextdomain", - "dgettext", - "dngettext", - "gettext", - "ngettext", - "dnpgettext", - "dpgettext", - "npgettext", - "pgettext", -] - -if sys.version_info < (3, 11): - __all__ += ["bind_textdomain_codeset", "ldgettext", "ldngettext", "lgettext", "lngettext"] - -class _TranslationsReader(Protocol): - def read(self) -> bytes: ... - # optional: - # name: str - -class NullTranslations: - def __init__(self, fp: _TranslationsReader | None = None) -> None: ... - def _parse(self, fp: _TranslationsReader) -> None: ... - def add_fallback(self, fallback: NullTranslations) -> None: ... - def gettext(self, message: str) -> str: ... - def ngettext(self, msgid1: str, msgid2: str, n: int) -> str: ... - def pgettext(self, context: str, message: str) -> str: ... - def npgettext(self, context: str, msgid1: str, msgid2: str, n: int) -> str: ... - def info(self) -> dict[str, str]: ... - def charset(self) -> str | None: ... - if sys.version_info < (3, 11): - def output_charset(self) -> str | None: ... - def set_output_charset(self, charset: str) -> None: ... - def lgettext(self, message: str) -> str: ... - def lngettext(self, msgid1: str, msgid2: str, n: int) -> str: ... - - def install(self, names: Container[str] | None = None) -> None: ... - -class GNUTranslations(NullTranslations): - LE_MAGIC: Final[int] - BE_MAGIC: Final[int] - CONTEXT: str - VERSIONS: Sequence[int] - -@overload -def find( - domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: Literal[False] = False -) -> str | None: ... -@overload -def find( - domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, *, all: Literal[True] -) -> list[str]: ... -@overload -def find(domain: str, localedir: StrPath | None, languages: Iterable[str] | None, all: Literal[True]) -> list[str]: ... -@overload -def find(domain: str, localedir: StrPath | None = None, languages: Iterable[str] | None = None, all: bool = False) -> Any: ... - -_NullTranslationsT = TypeVar("_NullTranslationsT", bound=NullTranslations) - -if sys.version_info >= (3, 11): - @overload - def translation( - domain: str, - localedir: StrPath | None = None, - languages: Iterable[str] | None = None, - class_: None = None, - fallback: Literal[False] = False, - ) -> GNUTranslations: ... - @overload - def translation( - domain: str, - localedir: StrPath | None = None, - languages: Iterable[str] | None = None, - *, - class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = False, - ) -> _NullTranslationsT: ... - @overload - def translation( - domain: str, - localedir: StrPath | None, - languages: Iterable[str] | None, - class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = False, - ) -> _NullTranslationsT: ... - @overload - def translation( - domain: str, - localedir: StrPath | None = None, - languages: Iterable[str] | None = None, - class_: Callable[[io.BufferedReader], NullTranslations] | None = None, - fallback: bool = False, - ) -> NullTranslations: ... - def install(domain: str, localedir: StrPath | None = None, *, names: Container[str] | None = None) -> None: ... - -else: - @overload - def translation( - domain: str, - localedir: StrPath | None = None, - languages: Iterable[str] | None = None, - class_: None = None, - fallback: Literal[False] = False, - codeset: str | None = None, - ) -> GNUTranslations: ... - @overload - def translation( - domain: str, - localedir: StrPath | None = None, - languages: Iterable[str] | None = None, - *, - class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = False, - codeset: str | None = None, - ) -> _NullTranslationsT: ... - @overload - def translation( - domain: str, - localedir: StrPath | None, - languages: Iterable[str] | None, - class_: Callable[[io.BufferedReader], _NullTranslationsT], - fallback: Literal[False] = False, - codeset: str | None = None, - ) -> _NullTranslationsT: ... - @overload - def translation( - domain: str, - localedir: StrPath | None = None, - languages: Iterable[str] | None = None, - class_: Callable[[io.BufferedReader], NullTranslations] | None = None, - fallback: bool = False, - codeset: str | None = None, - ) -> NullTranslations: ... - def install( - domain: str, localedir: StrPath | None = None, codeset: str | None = None, names: Container[str] | None = None - ) -> None: ... - -def textdomain(domain: str | None = None) -> str: ... -def bindtextdomain(domain: str, localedir: StrPath | None = None) -> str: ... -def dgettext(domain: str, message: str) -> str: ... -def dngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ... -def gettext(message: str) -> str: ... -def ngettext(msgid1: str, msgid2: str, n: int) -> str: ... -def pgettext(context: str, message: str) -> str: ... -def dpgettext(domain: str, context: str, message: str) -> str: ... -def npgettext(context: str, msgid1: str, msgid2: str, n: int) -> str: ... -def dnpgettext(domain: str, context: str, msgid1: str, msgid2: str, n: int) -> str: ... - -if sys.version_info < (3, 11): - def lgettext(message: str) -> str: ... - def ldgettext(domain: str, message: str) -> str: ... - def lngettext(msgid1: str, msgid2: str, n: int) -> str: ... - def ldngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ... - def bind_textdomain_codeset(domain: str, codeset: str | None = None) -> str: ... - -Catalog = translation - -def c2py(plural: str) -> Callable[[int], int]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/glob.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/glob.pyi deleted file mode 100644 index 03cb5418e2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/glob.pyi +++ /dev/null @@ -1,50 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from collections.abc import Iterator, Sequence -from typing import AnyStr - -__all__ = ["escape", "glob", "iglob"] - -if sys.version_info >= (3, 13): - __all__ += ["translate"] - -def glob0(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ... -def glob1(dirname: AnyStr, pattern: AnyStr) -> list[AnyStr]: ... - -if sys.version_info >= (3, 11): - def glob( - pathname: AnyStr, - *, - root_dir: StrOrBytesPath | None = None, - dir_fd: int | None = None, - recursive: bool = False, - include_hidden: bool = False, - ) -> list[AnyStr]: ... - def iglob( - pathname: AnyStr, - *, - root_dir: StrOrBytesPath | None = None, - dir_fd: int | None = None, - recursive: bool = False, - include_hidden: bool = False, - ) -> Iterator[AnyStr]: ... - -elif sys.version_info >= (3, 10): - def glob( - pathname: AnyStr, *, root_dir: StrOrBytesPath | None = None, dir_fd: int | None = None, recursive: bool = False - ) -> list[AnyStr]: ... - def iglob( - pathname: AnyStr, *, root_dir: StrOrBytesPath | None = None, dir_fd: int | None = None, recursive: bool = False - ) -> Iterator[AnyStr]: ... - -else: - def glob(pathname: AnyStr, *, recursive: bool = False) -> list[AnyStr]: ... - def iglob(pathname: AnyStr, *, recursive: bool = False) -> Iterator[AnyStr]: ... - -def escape(pathname: AnyStr) -> AnyStr: ... -def has_magic(s: str | bytes) -> bool: ... # undocumented - -if sys.version_info >= (3, 13): - def translate( - pat: str, *, recursive: bool = False, include_hidden: bool = False, seps: Sequence[str] | None = None - ) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/graphlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/graphlib.pyi deleted file mode 100644 index 1ca8cbe12b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/graphlib.pyi +++ /dev/null @@ -1,28 +0,0 @@ -import sys -from _typeshed import SupportsItems -from collections.abc import Iterable -from typing import Any, Generic, TypeVar, overload - -__all__ = ["TopologicalSorter", "CycleError"] - -_T = TypeVar("_T") - -if sys.version_info >= (3, 11): - from types import GenericAlias - -class TopologicalSorter(Generic[_T]): - @overload - def __init__(self, graph: None = None) -> None: ... - @overload - def __init__(self, graph: SupportsItems[_T, Iterable[_T]]) -> None: ... - def add(self, node: _T, *predecessors: _T) -> None: ... - def prepare(self) -> None: ... - def is_active(self) -> bool: ... - def __bool__(self) -> bool: ... - def done(self, *nodes: _T) -> None: ... - def get_ready(self) -> tuple[_T, ...]: ... - def static_order(self) -> Iterable[_T]: ... - if sys.version_info >= (3, 11): - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class CycleError(ValueError): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/grp.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/grp.pyi deleted file mode 100644 index 965ecece2a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/grp.pyi +++ /dev/null @@ -1,22 +0,0 @@ -import sys -from _typeshed import structseq -from typing import Any, Final, final - -if sys.platform != "win32": - @final - class struct_group(structseq[Any], tuple[str, str | None, int, list[str]]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("gr_name", "gr_passwd", "gr_gid", "gr_mem") - - @property - def gr_name(self) -> str: ... - @property - def gr_passwd(self) -> str | None: ... - @property - def gr_gid(self) -> int: ... - @property - def gr_mem(self) -> list[str]: ... - - def getgrall() -> list[struct_group]: ... - def getgrgid(id: int) -> struct_group: ... - def getgrnam(name: str) -> struct_group: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/gzip.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/gzip.pyi deleted file mode 100644 index b7fb40fbd8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/gzip.pyi +++ /dev/null @@ -1,160 +0,0 @@ -import _compression -import sys -import zlib -from _typeshed import ReadableBuffer, SizedBuffer, StrOrBytesPath -from io import FileIO, TextIOWrapper -from typing import Final, Literal, Protocol, overload -from typing_extensions import TypeAlias - -__all__ = ["BadGzipFile", "GzipFile", "open", "compress", "decompress"] - -_ReadBinaryMode: TypeAlias = Literal["r", "rb"] -_WriteBinaryMode: TypeAlias = Literal["a", "ab", "w", "wb", "x", "xb"] -_OpenTextMode: TypeAlias = Literal["rt", "at", "wt", "xt"] - -READ: Final[object] # undocumented -WRITE: Final[object] # undocumented - -FTEXT: Final[int] # actually Literal[1] # undocumented -FHCRC: Final[int] # actually Literal[2] # undocumented -FEXTRA: Final[int] # actually Literal[4] # undocumented -FNAME: Final[int] # actually Literal[8] # undocumented -FCOMMENT: Final[int] # actually Literal[16] # undocumented - -class _ReadableFileobj(Protocol): - def read(self, n: int, /) -> bytes: ... - def seek(self, n: int, /) -> object: ... - # The following attributes and methods are optional: - # name: str - # mode: str - # def fileno() -> int: ... - -class _WritableFileobj(Protocol): - def write(self, b: bytes, /) -> object: ... - def flush(self) -> object: ... - # The following attributes and methods are optional: - # name: str - # mode: str - # def fileno() -> int: ... - -@overload -def open( - filename: StrOrBytesPath | _ReadableFileobj, - mode: _ReadBinaryMode = "rb", - compresslevel: int = 9, - encoding: None = None, - errors: None = None, - newline: None = None, -) -> GzipFile: ... -@overload -def open( - filename: StrOrBytesPath | _WritableFileobj, - mode: _WriteBinaryMode, - compresslevel: int = 9, - encoding: None = None, - errors: None = None, - newline: None = None, -) -> GzipFile: ... -@overload -def open( - filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj, - mode: _OpenTextMode, - compresslevel: int = 9, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, -) -> TextIOWrapper: ... -@overload -def open( - filename: StrOrBytesPath | _ReadableFileobj | _WritableFileobj, - mode: str, - compresslevel: int = 9, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, -) -> GzipFile | TextIOWrapper: ... - -class _PaddedFile: - file: _ReadableFileobj - def __init__(self, f: _ReadableFileobj, prepend: bytes = b"") -> None: ... - def read(self, size: int) -> bytes: ... - def prepend(self, prepend: bytes = b"") -> None: ... - def seek(self, off: int) -> int: ... - def seekable(self) -> bool: ... - -class BadGzipFile(OSError): ... - -class GzipFile(_compression.BaseStream): - myfileobj: FileIO | None - mode: object - name: str - compress: zlib._Compress - fileobj: _ReadableFileobj | _WritableFileobj - @overload - def __init__( - self, - filename: StrOrBytesPath | None, - mode: _ReadBinaryMode, - compresslevel: int = 9, - fileobj: _ReadableFileobj | None = None, - mtime: float | None = None, - ) -> None: ... - @overload - def __init__( - self, - *, - mode: _ReadBinaryMode, - compresslevel: int = 9, - fileobj: _ReadableFileobj | None = None, - mtime: float | None = None, - ) -> None: ... - @overload - def __init__( - self, - filename: StrOrBytesPath | None, - mode: _WriteBinaryMode, - compresslevel: int = 9, - fileobj: _WritableFileobj | None = None, - mtime: float | None = None, - ) -> None: ... - @overload - def __init__( - self, - *, - mode: _WriteBinaryMode, - compresslevel: int = 9, - fileobj: _WritableFileobj | None = None, - mtime: float | None = None, - ) -> None: ... - @overload - def __init__( - self, - filename: StrOrBytesPath | None = None, - mode: str | None = None, - compresslevel: int = 9, - fileobj: _ReadableFileobj | _WritableFileobj | None = None, - mtime: float | None = None, - ) -> None: ... - if sys.version_info < (3, 12): - @property - def filename(self) -> str: ... - - @property - def mtime(self) -> int | None: ... - crc: int - def write(self, data: ReadableBuffer) -> int: ... - def read(self, size: int | None = -1) -> bytes: ... - def read1(self, size: int = -1) -> bytes: ... - def peek(self, n: int) -> bytes: ... - def close(self) -> None: ... - def flush(self, zlib_mode: int = 2) -> None: ... - def fileno(self) -> int: ... - def rewind(self) -> None: ... - def seek(self, offset: int, whence: int = 0) -> int: ... - def readline(self, size: int | None = -1) -> bytes: ... - -class _GzipReader(_compression.DecompressReader): - def __init__(self, fp: _ReadableFileobj) -> None: ... - -def compress(data: SizedBuffer, compresslevel: int = 9, *, mtime: float | None = None) -> bytes: ... -def decompress(data: ReadableBuffer) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/hashlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/hashlib.pyi deleted file mode 100644 index b32c0e9925..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/hashlib.pyi +++ /dev/null @@ -1,87 +0,0 @@ -import sys -from _blake2 import blake2b as blake2b, blake2s as blake2s -from _hashlib import ( - HASH, - _HashObject, - openssl_md5 as md5, - openssl_sha1 as sha1, - openssl_sha3_224 as sha3_224, - openssl_sha3_256 as sha3_256, - openssl_sha3_384 as sha3_384, - openssl_sha3_512 as sha3_512, - openssl_sha224 as sha224, - openssl_sha256 as sha256, - openssl_sha384 as sha384, - openssl_sha512 as sha512, - openssl_shake_128 as shake_128, - openssl_shake_256 as shake_256, - pbkdf2_hmac as pbkdf2_hmac, - scrypt as scrypt, -) -from _typeshed import ReadableBuffer -from collections.abc import Callable, Set as AbstractSet -from typing import Protocol - -if sys.version_info >= (3, 11): - __all__ = ( - "md5", - "sha1", - "sha224", - "sha256", - "sha384", - "sha512", - "blake2b", - "blake2s", - "sha3_224", - "sha3_256", - "sha3_384", - "sha3_512", - "shake_128", - "shake_256", - "new", - "algorithms_guaranteed", - "algorithms_available", - "pbkdf2_hmac", - "file_digest", - ) -else: - __all__ = ( - "md5", - "sha1", - "sha224", - "sha256", - "sha384", - "sha512", - "blake2b", - "blake2s", - "sha3_224", - "sha3_256", - "sha3_384", - "sha3_512", - "shake_128", - "shake_256", - "new", - "algorithms_guaranteed", - "algorithms_available", - "pbkdf2_hmac", - ) - -def new(name: str, data: ReadableBuffer = b"", *, usedforsecurity: bool = ...) -> HASH: ... - -algorithms_guaranteed: AbstractSet[str] -algorithms_available: AbstractSet[str] - -if sys.version_info >= (3, 11): - class _BytesIOLike(Protocol): - def getbuffer(self) -> ReadableBuffer: ... - - class _FileDigestFileObj(Protocol): - def readinto(self, buf: bytearray, /) -> int: ... - def readable(self) -> bool: ... - - def file_digest( - fileobj: _BytesIOLike | _FileDigestFileObj, digest: str | Callable[[], _HashObject], /, *, _bufsize: int = 262144 - ) -> HASH: ... - -# Legacy typing-only alias -_Hash = HASH diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/heapq.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/heapq.pyi deleted file mode 100644 index 220c41f303..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/heapq.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from _heapq import * -from _typeshed import SupportsRichComparison -from collections.abc import Callable, Generator, Iterable -from typing import Any, Final, TypeVar - -__all__ = ["heappush", "heappop", "heapify", "heapreplace", "merge", "nlargest", "nsmallest", "heappushpop"] - -_S = TypeVar("_S") - -__about__: Final[str] - -def merge( - *iterables: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None, reverse: bool = False -) -> Generator[_S]: ... -def nlargest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None) -> list[_S]: ... -def nsmallest(n: int, iterable: Iterable[_S], key: Callable[[_S], SupportsRichComparison] | None = None) -> list[_S]: ... -def _heapify_max(heap: list[Any], /) -> None: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/hmac.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/hmac.pyi deleted file mode 100644 index 300ed9eb26..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/hmac.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from _hashlib import _HashObject, compare_digest as compare_digest -from _typeshed import ReadableBuffer, SizedBuffer -from collections.abc import Callable -from types import ModuleType -from typing import overload -from typing_extensions import TypeAlias - -_DigestMod: TypeAlias = str | Callable[[], _HashObject] | ModuleType - -trans_5C: bytes -trans_36: bytes - -digest_size: None - -# In reality digestmod has a default value, but the function always throws an error -# if the argument is not given, so we pretend it is a required argument. -@overload -def new(key: bytes | bytearray, msg: ReadableBuffer | None, digestmod: _DigestMod) -> HMAC: ... -@overload -def new(key: bytes | bytearray, *, digestmod: _DigestMod) -> HMAC: ... - -class HMAC: - digest_size: int - block_size: int - @property - def name(self) -> str: ... - def __init__(self, key: bytes | bytearray, msg: ReadableBuffer | None = None, digestmod: _DigestMod = "") -> None: ... - def update(self, msg: ReadableBuffer) -> None: ... - def digest(self) -> bytes: ... - def hexdigest(self) -> str: ... - def copy(self) -> HMAC: ... - -def digest(key: SizedBuffer, msg: ReadableBuffer, digest: _DigestMod) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/html/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/html/__init__.pyi deleted file mode 100644 index afba908325..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/html/__init__.pyi +++ /dev/null @@ -1,6 +0,0 @@ -from typing import AnyStr - -__all__ = ["escape", "unescape"] - -def escape(s: AnyStr, quote: bool = True) -> AnyStr: ... -def unescape(s: AnyStr) -> AnyStr: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/html/entities.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/html/entities.pyi deleted file mode 100644 index be83fd1135..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/html/entities.pyi +++ /dev/null @@ -1,6 +0,0 @@ -__all__ = ["html5", "name2codepoint", "codepoint2name", "entitydefs"] - -name2codepoint: dict[str, int] -html5: dict[str, str] -codepoint2name: dict[int, str] -entitydefs: dict[str, str] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/html/parser.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/html/parser.pyi deleted file mode 100644 index d322ade965..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/html/parser.pyi +++ /dev/null @@ -1,34 +0,0 @@ -from _markupbase import ParserBase -from re import Pattern - -__all__ = ["HTMLParser"] - -class HTMLParser(ParserBase): - def __init__(self, *, convert_charrefs: bool = True) -> None: ... - def feed(self, data: str) -> None: ... - def close(self) -> None: ... - def get_starttag_text(self) -> str | None: ... - def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: ... - def handle_endtag(self, tag: str) -> None: ... - def handle_startendtag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: ... - def handle_data(self, data: str) -> None: ... - def handle_entityref(self, name: str) -> None: ... - def handle_charref(self, name: str) -> None: ... - def handle_comment(self, data: str) -> None: ... - def handle_decl(self, decl: str) -> None: ... - def handle_pi(self, data: str) -> None: ... - CDATA_CONTENT_ELEMENTS: tuple[str, ...] - def check_for_whole_start_tag(self, i: int) -> int: ... # undocumented - def clear_cdata_mode(self) -> None: ... # undocumented - def goahead(self, end: bool) -> None: ... # undocumented - def parse_bogus_comment(self, i: int, report: bool = ...) -> int: ... # undocumented - def parse_endtag(self, i: int) -> int: ... # undocumented - def parse_html_declaration(self, i: int) -> int: ... # undocumented - def parse_pi(self, i: int) -> int: ... # undocumented - def parse_starttag(self, i: int) -> int: ... # undocumented - def set_cdata_mode(self, elem: str) -> None: ... # undocumented - rawdata: str # undocumented - cdata_elem: str | None # undocumented - convert_charrefs: bool # undocumented - interesting: Pattern[str] # undocumented - lasttag: str # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/http/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/http/__init__.pyi deleted file mode 100644 index f60c390973..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/http/__init__.pyi +++ /dev/null @@ -1,118 +0,0 @@ -import sys -from enum import IntEnum - -if sys.version_info >= (3, 11): - from enum import StrEnum - -if sys.version_info >= (3, 11): - __all__ = ["HTTPStatus", "HTTPMethod"] -else: - __all__ = ["HTTPStatus"] - -class HTTPStatus(IntEnum): - @property - def phrase(self) -> str: ... - @property - def description(self) -> str: ... - - # Keep these synced with the global constants in http/client.pyi. - CONTINUE = 100 - SWITCHING_PROTOCOLS = 101 - PROCESSING = 102 - EARLY_HINTS = 103 - - OK = 200 - CREATED = 201 - ACCEPTED = 202 - NON_AUTHORITATIVE_INFORMATION = 203 - NO_CONTENT = 204 - RESET_CONTENT = 205 - PARTIAL_CONTENT = 206 - MULTI_STATUS = 207 - ALREADY_REPORTED = 208 - IM_USED = 226 - - MULTIPLE_CHOICES = 300 - MOVED_PERMANENTLY = 301 - FOUND = 302 - SEE_OTHER = 303 - NOT_MODIFIED = 304 - USE_PROXY = 305 - TEMPORARY_REDIRECT = 307 - PERMANENT_REDIRECT = 308 - - BAD_REQUEST = 400 - UNAUTHORIZED = 401 - PAYMENT_REQUIRED = 402 - FORBIDDEN = 403 - NOT_FOUND = 404 - METHOD_NOT_ALLOWED = 405 - NOT_ACCEPTABLE = 406 - PROXY_AUTHENTICATION_REQUIRED = 407 - REQUEST_TIMEOUT = 408 - CONFLICT = 409 - GONE = 410 - LENGTH_REQUIRED = 411 - PRECONDITION_FAILED = 412 - if sys.version_info >= (3, 13): - CONTENT_TOO_LARGE = 413 - REQUEST_ENTITY_TOO_LARGE = 413 - if sys.version_info >= (3, 13): - URI_TOO_LONG = 414 - REQUEST_URI_TOO_LONG = 414 - UNSUPPORTED_MEDIA_TYPE = 415 - if sys.version_info >= (3, 13): - RANGE_NOT_SATISFIABLE = 416 - REQUESTED_RANGE_NOT_SATISFIABLE = 416 - EXPECTATION_FAILED = 417 - IM_A_TEAPOT = 418 - MISDIRECTED_REQUEST = 421 - if sys.version_info >= (3, 13): - UNPROCESSABLE_CONTENT = 422 - UNPROCESSABLE_ENTITY = 422 - LOCKED = 423 - FAILED_DEPENDENCY = 424 - TOO_EARLY = 425 - UPGRADE_REQUIRED = 426 - PRECONDITION_REQUIRED = 428 - TOO_MANY_REQUESTS = 429 - REQUEST_HEADER_FIELDS_TOO_LARGE = 431 - UNAVAILABLE_FOR_LEGAL_REASONS = 451 - - INTERNAL_SERVER_ERROR = 500 - NOT_IMPLEMENTED = 501 - BAD_GATEWAY = 502 - SERVICE_UNAVAILABLE = 503 - GATEWAY_TIMEOUT = 504 - HTTP_VERSION_NOT_SUPPORTED = 505 - VARIANT_ALSO_NEGOTIATES = 506 - INSUFFICIENT_STORAGE = 507 - LOOP_DETECTED = 508 - NOT_EXTENDED = 510 - NETWORK_AUTHENTICATION_REQUIRED = 511 - - if sys.version_info >= (3, 12): - @property - def is_informational(self) -> bool: ... - @property - def is_success(self) -> bool: ... - @property - def is_redirection(self) -> bool: ... - @property - def is_client_error(self) -> bool: ... - @property - def is_server_error(self) -> bool: ... - -if sys.version_info >= (3, 11): - class HTTPMethod(StrEnum): - @property - def description(self) -> str: ... - CONNECT = "CONNECT" - DELETE = "DELETE" - GET = "GET" - HEAD = "HEAD" - OPTIONS = "OPTIONS" - PATCH = "PATCH" - POST = "POST" - PUT = "PUT" - TRACE = "TRACE" diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/http/client.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/http/client.pyi deleted file mode 100644 index 9e0f61598c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/http/client.pyi +++ /dev/null @@ -1,265 +0,0 @@ -import email.message -import io -import ssl -import sys -import types -from _typeshed import MaybeNone, ReadableBuffer, SupportsRead, SupportsReadline, WriteableBuffer -from collections.abc import Callable, Iterable, Iterator, Mapping -from socket import socket -from typing import BinaryIO, Literal, TypeVar, overload -from typing_extensions import Self, TypeAlias - -__all__ = [ - "HTTPResponse", - "HTTPConnection", - "HTTPException", - "NotConnected", - "UnknownProtocol", - "UnknownTransferEncoding", - "UnimplementedFileMode", - "IncompleteRead", - "InvalidURL", - "ImproperConnectionState", - "CannotSendRequest", - "CannotSendHeader", - "ResponseNotReady", - "BadStatusLine", - "LineTooLong", - "RemoteDisconnected", - "error", - "responses", - "HTTPSConnection", -] - -_DataType: TypeAlias = SupportsRead[bytes] | Iterable[ReadableBuffer] | ReadableBuffer -_T = TypeVar("_T") -_MessageT = TypeVar("_MessageT", bound=email.message.Message) -_HeaderValue: TypeAlias = ReadableBuffer | str | int - -HTTP_PORT: int -HTTPS_PORT: int - -# Keep these global constants in sync with http.HTTPStatus (http/__init__.pyi). -# They are present for backward compatibility reasons. -CONTINUE: Literal[100] -SWITCHING_PROTOCOLS: Literal[101] -PROCESSING: Literal[102] -EARLY_HINTS: Literal[103] - -OK: Literal[200] -CREATED: Literal[201] -ACCEPTED: Literal[202] -NON_AUTHORITATIVE_INFORMATION: Literal[203] -NO_CONTENT: Literal[204] -RESET_CONTENT: Literal[205] -PARTIAL_CONTENT: Literal[206] -MULTI_STATUS: Literal[207] -ALREADY_REPORTED: Literal[208] -IM_USED: Literal[226] - -MULTIPLE_CHOICES: Literal[300] -MOVED_PERMANENTLY: Literal[301] -FOUND: Literal[302] -SEE_OTHER: Literal[303] -NOT_MODIFIED: Literal[304] -USE_PROXY: Literal[305] -TEMPORARY_REDIRECT: Literal[307] -PERMANENT_REDIRECT: Literal[308] - -BAD_REQUEST: Literal[400] -UNAUTHORIZED: Literal[401] -PAYMENT_REQUIRED: Literal[402] -FORBIDDEN: Literal[403] -NOT_FOUND: Literal[404] -METHOD_NOT_ALLOWED: Literal[405] -NOT_ACCEPTABLE: Literal[406] -PROXY_AUTHENTICATION_REQUIRED: Literal[407] -REQUEST_TIMEOUT: Literal[408] -CONFLICT: Literal[409] -GONE: Literal[410] -LENGTH_REQUIRED: Literal[411] -PRECONDITION_FAILED: Literal[412] -if sys.version_info >= (3, 13): - CONTENT_TOO_LARGE: Literal[413] -REQUEST_ENTITY_TOO_LARGE: Literal[413] -if sys.version_info >= (3, 13): - URI_TOO_LONG: Literal[414] -REQUEST_URI_TOO_LONG: Literal[414] -UNSUPPORTED_MEDIA_TYPE: Literal[415] -if sys.version_info >= (3, 13): - RANGE_NOT_SATISFIABLE: Literal[416] -REQUESTED_RANGE_NOT_SATISFIABLE: Literal[416] -EXPECTATION_FAILED: Literal[417] -IM_A_TEAPOT: Literal[418] -MISDIRECTED_REQUEST: Literal[421] -if sys.version_info >= (3, 13): - UNPROCESSABLE_CONTENT: Literal[422] -UNPROCESSABLE_ENTITY: Literal[422] -LOCKED: Literal[423] -FAILED_DEPENDENCY: Literal[424] -TOO_EARLY: Literal[425] -UPGRADE_REQUIRED: Literal[426] -PRECONDITION_REQUIRED: Literal[428] -TOO_MANY_REQUESTS: Literal[429] -REQUEST_HEADER_FIELDS_TOO_LARGE: Literal[431] -UNAVAILABLE_FOR_LEGAL_REASONS: Literal[451] - -INTERNAL_SERVER_ERROR: Literal[500] -NOT_IMPLEMENTED: Literal[501] -BAD_GATEWAY: Literal[502] -SERVICE_UNAVAILABLE: Literal[503] -GATEWAY_TIMEOUT: Literal[504] -HTTP_VERSION_NOT_SUPPORTED: Literal[505] -VARIANT_ALSO_NEGOTIATES: Literal[506] -INSUFFICIENT_STORAGE: Literal[507] -LOOP_DETECTED: Literal[508] -NOT_EXTENDED: Literal[510] -NETWORK_AUTHENTICATION_REQUIRED: Literal[511] - -responses: dict[int, str] - -class HTTPMessage(email.message.Message[str, str]): - def getallmatchingheaders(self, name: str) -> list[str]: ... # undocumented - -@overload -def parse_headers(fp: SupportsReadline[bytes], _class: Callable[[], _MessageT]) -> _MessageT: ... -@overload -def parse_headers(fp: SupportsReadline[bytes]) -> HTTPMessage: ... - -class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible method definitions in the base classes - msg: HTTPMessage - headers: HTTPMessage - version: int - debuglevel: int - fp: io.BufferedReader - closed: bool - status: int - reason: str - chunked: bool - chunk_left: int | None - length: int | None - will_close: bool - # url is set on instances of the class in urllib.request.AbstractHTTPHandler.do_open - # to match urllib.response.addinfourl's interface. - # It's not set in HTTPResponse.__init__ or any other method on the class - url: str - def __init__(self, sock: socket, debuglevel: int = 0, method: str | None = None, url: str | None = None) -> None: ... - def peek(self, n: int = -1) -> bytes: ... - def read(self, amt: int | None = None) -> bytes: ... - def read1(self, n: int = -1) -> bytes: ... - def readinto(self, b: WriteableBuffer) -> int: ... - def readline(self, limit: int = -1) -> bytes: ... # type: ignore[override] - @overload - def getheader(self, name: str) -> str | None: ... - @overload - def getheader(self, name: str, default: _T) -> str | _T: ... - def getheaders(self) -> list[tuple[str, str]]: ... - def isclosed(self) -> bool: ... - def __iter__(self) -> Iterator[bytes]: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None - ) -> None: ... - def info(self) -> email.message.Message: ... - def geturl(self) -> str: ... - def getcode(self) -> int: ... - def begin(self) -> None: ... - -class HTTPConnection: - auto_open: int # undocumented - debuglevel: int - default_port: int # undocumented - response_class: type[HTTPResponse] # undocumented - timeout: float | None - host: str - port: int - sock: socket | MaybeNone # can be `None` if `.connect()` was not called - def __init__( - self, - host: str, - port: int | None = None, - timeout: float | None = ..., - source_address: tuple[str, int] | None = None, - blocksize: int = 8192, - ) -> None: ... - def request( - self, - method: str, - url: str, - body: _DataType | str | None = None, - headers: Mapping[str, _HeaderValue] = {}, - *, - encode_chunked: bool = False, - ) -> None: ... - def getresponse(self) -> HTTPResponse: ... - def set_debuglevel(self, level: int) -> None: ... - if sys.version_info >= (3, 12): - def get_proxy_response_headers(self) -> HTTPMessage | None: ... - - def set_tunnel(self, host: str, port: int | None = None, headers: Mapping[str, str] | None = None) -> None: ... - def connect(self) -> None: ... - def close(self) -> None: ... - def putrequest(self, method: str, url: str, skip_host: bool = False, skip_accept_encoding: bool = False) -> None: ... - def putheader(self, header: str | bytes, *values: _HeaderValue) -> None: ... - def endheaders(self, message_body: _DataType | None = None, *, encode_chunked: bool = False) -> None: ... - def send(self, data: _DataType | str) -> None: ... - -class HTTPSConnection(HTTPConnection): - # Can be `None` if `.connect()` was not called: - sock: ssl.SSLSocket | MaybeNone - if sys.version_info >= (3, 12): - def __init__( - self, - host: str, - port: int | None = None, - *, - timeout: float | None = ..., - source_address: tuple[str, int] | None = None, - context: ssl.SSLContext | None = None, - blocksize: int = 8192, - ) -> None: ... - else: - def __init__( - self, - host: str, - port: int | None = None, - key_file: str | None = None, - cert_file: str | None = None, - timeout: float | None = ..., - source_address: tuple[str, int] | None = None, - *, - context: ssl.SSLContext | None = None, - check_hostname: bool | None = None, - blocksize: int = 8192, - ) -> None: ... - -class HTTPException(Exception): ... - -error = HTTPException - -class NotConnected(HTTPException): ... -class InvalidURL(HTTPException): ... - -class UnknownProtocol(HTTPException): - def __init__(self, version: str) -> None: ... - -class UnknownTransferEncoding(HTTPException): ... -class UnimplementedFileMode(HTTPException): ... - -class IncompleteRead(HTTPException): - def __init__(self, partial: bytes, expected: int | None = None) -> None: ... - partial: bytes - expected: int | None - -class ImproperConnectionState(HTTPException): ... -class CannotSendRequest(ImproperConnectionState): ... -class CannotSendHeader(ImproperConnectionState): ... -class ResponseNotReady(ImproperConnectionState): ... - -class BadStatusLine(HTTPException): - def __init__(self, line: str) -> None: ... - -class LineTooLong(HTTPException): - def __init__(self, line_type: str) -> None: ... - -class RemoteDisconnected(ConnectionResetError, BadStatusLine): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/http/cookiejar.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/http/cookiejar.pyi deleted file mode 100644 index 31e1d3fc83..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/http/cookiejar.pyi +++ /dev/null @@ -1,159 +0,0 @@ -import sys -from _typeshed import StrPath -from collections.abc import Iterator, Sequence -from http.client import HTTPResponse -from re import Pattern -from typing import ClassVar, TypeVar, overload -from urllib.request import Request - -__all__ = [ - "Cookie", - "CookieJar", - "CookiePolicy", - "DefaultCookiePolicy", - "FileCookieJar", - "LWPCookieJar", - "LoadError", - "MozillaCookieJar", -] - -_T = TypeVar("_T") - -class LoadError(OSError): ... - -class CookieJar: - non_word_re: ClassVar[Pattern[str]] # undocumented - quote_re: ClassVar[Pattern[str]] # undocumented - strict_domain_re: ClassVar[Pattern[str]] # undocumented - domain_re: ClassVar[Pattern[str]] # undocumented - dots_re: ClassVar[Pattern[str]] # undocumented - magic_re: ClassVar[Pattern[str]] # undocumented - def __init__(self, policy: CookiePolicy | None = None) -> None: ... - def add_cookie_header(self, request: Request) -> None: ... - def extract_cookies(self, response: HTTPResponse, request: Request) -> None: ... - def set_policy(self, policy: CookiePolicy) -> None: ... - def make_cookies(self, response: HTTPResponse, request: Request) -> Sequence[Cookie]: ... - def set_cookie(self, cookie: Cookie) -> None: ... - def set_cookie_if_ok(self, cookie: Cookie, request: Request) -> None: ... - def clear(self, domain: str | None = None, path: str | None = None, name: str | None = None) -> None: ... - def clear_session_cookies(self) -> None: ... - def clear_expired_cookies(self) -> None: ... # undocumented - def __iter__(self) -> Iterator[Cookie]: ... - def __len__(self) -> int: ... - -class FileCookieJar(CookieJar): - filename: str | None - delayload: bool - def __init__(self, filename: StrPath | None = None, delayload: bool = False, policy: CookiePolicy | None = None) -> None: ... - def save(self, filename: str | None = None, ignore_discard: bool = False, ignore_expires: bool = False) -> None: ... - def load(self, filename: str | None = None, ignore_discard: bool = False, ignore_expires: bool = False) -> None: ... - def revert(self, filename: str | None = None, ignore_discard: bool = False, ignore_expires: bool = False) -> None: ... - -class MozillaCookieJar(FileCookieJar): - if sys.version_info < (3, 10): - header: ClassVar[str] # undocumented - -class LWPCookieJar(FileCookieJar): - def as_lwp_str(self, ignore_discard: bool = True, ignore_expires: bool = True) -> str: ... # undocumented - -class CookiePolicy: - netscape: bool - rfc2965: bool - hide_cookie2: bool - def set_ok(self, cookie: Cookie, request: Request) -> bool: ... - def return_ok(self, cookie: Cookie, request: Request) -> bool: ... - def domain_return_ok(self, domain: str, request: Request) -> bool: ... - def path_return_ok(self, path: str, request: Request) -> bool: ... - -class DefaultCookiePolicy(CookiePolicy): - rfc2109_as_netscape: bool - strict_domain: bool - strict_rfc2965_unverifiable: bool - strict_ns_unverifiable: bool - strict_ns_domain: int - strict_ns_set_initial_dollar: bool - strict_ns_set_path: bool - DomainStrictNoDots: ClassVar[int] - DomainStrictNonDomain: ClassVar[int] - DomainRFC2965Match: ClassVar[int] - DomainLiberal: ClassVar[int] - DomainStrict: ClassVar[int] - def __init__( - self, - blocked_domains: Sequence[str] | None = None, - allowed_domains: Sequence[str] | None = None, - netscape: bool = True, - rfc2965: bool = False, - rfc2109_as_netscape: bool | None = None, - hide_cookie2: bool = False, - strict_domain: bool = False, - strict_rfc2965_unverifiable: bool = True, - strict_ns_unverifiable: bool = False, - strict_ns_domain: int = 0, - strict_ns_set_initial_dollar: bool = False, - strict_ns_set_path: bool = False, - secure_protocols: Sequence[str] = ("https", "wss"), - ) -> None: ... - def blocked_domains(self) -> tuple[str, ...]: ... - def set_blocked_domains(self, blocked_domains: Sequence[str]) -> None: ... - def is_blocked(self, domain: str) -> bool: ... - def allowed_domains(self) -> tuple[str, ...] | None: ... - def set_allowed_domains(self, allowed_domains: Sequence[str] | None) -> None: ... - def is_not_allowed(self, domain: str) -> bool: ... - def set_ok_version(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def set_ok_verifiability(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def set_ok_name(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def set_ok_path(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def set_ok_domain(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def set_ok_port(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def return_ok_version(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def return_ok_verifiability(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def return_ok_secure(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def return_ok_expires(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def return_ok_port(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - def return_ok_domain(self, cookie: Cookie, request: Request) -> bool: ... # undocumented - -class Cookie: - version: int | None - name: str - value: str | None - port: str | None - path: str - path_specified: bool - secure: bool - expires: int | None - discard: bool - comment: str | None - comment_url: str | None - rfc2109: bool - port_specified: bool - domain: str # undocumented - domain_specified: bool - domain_initial_dot: bool - def __init__( - self, - version: int | None, - name: str, - value: str | None, # undocumented - port: str | None, - port_specified: bool, - domain: str, - domain_specified: bool, - domain_initial_dot: bool, - path: str, - path_specified: bool, - secure: bool, - expires: int | None, - discard: bool, - comment: str | None, - comment_url: str | None, - rest: dict[str, str], - rfc2109: bool = False, - ) -> None: ... - def has_nonstandard_attr(self, name: str) -> bool: ... - @overload - def get_nonstandard_attr(self, name: str) -> str | None: ... - @overload - def get_nonstandard_attr(self, name: str, default: _T) -> str | _T: ... - def set_nonstandard_attr(self, name: str, value: str) -> None: ... - def is_expired(self, now: int | None = None) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/http/cookies.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/http/cookies.pyi deleted file mode 100644 index 4df12e3125..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/http/cookies.pyi +++ /dev/null @@ -1,56 +0,0 @@ -from collections.abc import Iterable, Mapping -from types import GenericAlias -from typing import Any, Generic, TypeVar, overload -from typing_extensions import TypeAlias - -__all__ = ["CookieError", "BaseCookie", "SimpleCookie"] - -_DataType: TypeAlias = str | Mapping[str, str | Morsel[Any]] -_T = TypeVar("_T") - -@overload -def _quote(str: None) -> None: ... -@overload -def _quote(str: str) -> str: ... -@overload -def _unquote(str: None) -> None: ... -@overload -def _unquote(str: str) -> str: ... - -class CookieError(Exception): ... - -class Morsel(dict[str, Any], Generic[_T]): - @property - def value(self) -> str: ... - @property - def coded_value(self) -> _T: ... - @property - def key(self) -> str: ... - def __init__(self) -> None: ... - def set(self, key: str, val: str, coded_val: _T) -> None: ... - def setdefault(self, key: str, val: str | None = None) -> str: ... - # The dict update can also get a keywords argument so this is incompatible - @overload # type: ignore[override] - def update(self, values: Mapping[str, str]) -> None: ... - @overload - def update(self, values: Iterable[tuple[str, str]]) -> None: ... - def isReservedKey(self, K: str) -> bool: ... - def output(self, attrs: list[str] | None = None, header: str = "Set-Cookie:") -> str: ... - __str__ = output - def js_output(self, attrs: list[str] | None = None) -> str: ... - def OutputString(self, attrs: list[str] | None = None) -> str: ... - def __eq__(self, morsel: object) -> bool: ... - def __setitem__(self, K: str, V: Any) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class BaseCookie(dict[str, Morsel[_T]], Generic[_T]): - def __init__(self, input: _DataType | None = None) -> None: ... - def value_decode(self, val: str) -> tuple[_T, str]: ... - def value_encode(self, val: _T) -> tuple[_T, str]: ... - def output(self, attrs: list[str] | None = None, header: str = "Set-Cookie:", sep: str = "\r\n") -> str: ... - __str__ = output - def js_output(self, attrs: list[str] | None = None) -> str: ... - def load(self, rawdata: _DataType) -> None: ... - def __setitem__(self, key: str, value: str | Morsel[_T]) -> None: ... - -class SimpleCookie(BaseCookie[str]): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/http/server.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/http/server.pyi deleted file mode 100644 index 1a6fde6000..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/http/server.pyi +++ /dev/null @@ -1,84 +0,0 @@ -import _socket -import email.message -import io -import socketserver -import sys -from _typeshed import StrPath, SupportsRead, SupportsWrite -from collections.abc import Mapping, Sequence -from typing import Any, AnyStr, BinaryIO, ClassVar -from typing_extensions import deprecated - -__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"] - -class HTTPServer(socketserver.TCPServer): - server_name: str - server_port: int - -class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): ... - -class BaseHTTPRequestHandler(socketserver.StreamRequestHandler): - client_address: tuple[str, int] - close_connection: bool - requestline: str - command: str - path: str - request_version: str - headers: email.message.Message - server_version: str - sys_version: str - error_message_format: str - error_content_type: str - protocol_version: str - MessageClass: type - responses: Mapping[int, tuple[str, str]] - default_request_version: str # undocumented - weekdayname: ClassVar[Sequence[str]] # undocumented - monthname: ClassVar[Sequence[str | None]] # undocumented - def handle_one_request(self) -> None: ... - def handle_expect_100(self) -> bool: ... - def send_error(self, code: int, message: str | None = None, explain: str | None = None) -> None: ... - def send_response(self, code: int, message: str | None = None) -> None: ... - def send_header(self, keyword: str, value: str) -> None: ... - def send_response_only(self, code: int, message: str | None = None) -> None: ... - def end_headers(self) -> None: ... - def flush_headers(self) -> None: ... - def log_request(self, code: int | str = "-", size: int | str = "-") -> None: ... - def log_error(self, format: str, *args: Any) -> None: ... - def log_message(self, format: str, *args: Any) -> None: ... - def version_string(self) -> str: ... - def date_time_string(self, timestamp: float | None = None) -> str: ... - def log_date_time_string(self) -> str: ... - def address_string(self) -> str: ... - def parse_request(self) -> bool: ... # undocumented - -class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): - extensions_map: dict[str, str] - if sys.version_info >= (3, 12): - index_pages: ClassVar[tuple[str, ...]] - directory: str - def __init__( - self, - request: socketserver._RequestType, - client_address: _socket._RetAddress, - server: socketserver.BaseServer, - *, - directory: StrPath | None = None, - ) -> None: ... - def do_GET(self) -> None: ... - def do_HEAD(self) -> None: ... - def send_head(self) -> io.BytesIO | BinaryIO | None: ... # undocumented - def list_directory(self, path: StrPath) -> io.BytesIO | None: ... # undocumented - def translate_path(self, path: str) -> str: ... # undocumented - def copyfile(self, source: SupportsRead[AnyStr], outputfile: SupportsWrite[AnyStr]) -> None: ... # undocumented - def guess_type(self, path: StrPath) -> str: ... # undocumented - -def executable(path: StrPath) -> bool: ... # undocumented -@deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") -class CGIHTTPRequestHandler(SimpleHTTPRequestHandler): - cgi_directories: list[str] - have_fork: bool # undocumented - def do_POST(self) -> None: ... - def is_cgi(self) -> bool: ... # undocumented - def is_executable(self, path: StrPath) -> bool: ... # undocumented - def is_python(self, path: StrPath) -> bool: ... # undocumented - def run_cgi(self) -> None: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/imaplib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/imaplib.pyi deleted file mode 100644 index ccee92bd5e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/imaplib.pyi +++ /dev/null @@ -1,145 +0,0 @@ -import subprocess -import sys -import time -from _typeshed import ReadableBuffer, SizedBuffer -from builtins import list as _list # conflicts with a method named "list" -from collections.abc import Callable -from datetime import datetime -from re import Pattern -from socket import socket as _socket -from ssl import SSLContext, SSLSocket -from types import TracebackType -from typing import IO, Any, Literal, SupportsAbs, SupportsInt -from typing_extensions import Self, TypeAlias - -__all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple", "Int2AP", "ParseFlags", "Time2Internaldate", "IMAP4_SSL"] - -# TODO: Commands should use their actual return types, not this type alias. -# E.g. Tuple[Literal["OK"], List[bytes]] -_CommandResults: TypeAlias = tuple[str, list[Any]] - -_AnyResponseData: TypeAlias = list[None] | list[bytes | tuple[bytes, bytes]] - -Commands: dict[str, tuple[str, ...]] - -class IMAP4: - class error(Exception): ... - class abort(error): ... - class readonly(abort): ... - mustquote: Pattern[str] - debug: int - state: str - literal: str | None - tagged_commands: dict[bytes, _list[bytes] | None] - untagged_responses: dict[str, _list[bytes | tuple[bytes, bytes]]] - continuation_response: str - is_readonly: bool - tagnum: int - tagpre: str - tagre: Pattern[str] - welcome: bytes - capabilities: tuple[str, ...] - PROTOCOL_VERSION: str - def __init__(self, host: str = "", port: int = 143, timeout: float | None = None) -> None: ... - def open(self, host: str = "", port: int = 143, timeout: float | None = None) -> None: ... - def __getattr__(self, attr: str) -> Any: ... - host: str - port: int - sock: _socket - file: IO[str] | IO[bytes] - def read(self, size: int) -> bytes: ... - def readline(self) -> bytes: ... - def send(self, data: ReadableBuffer) -> None: ... - def shutdown(self) -> None: ... - def socket(self) -> _socket: ... - def recent(self) -> _CommandResults: ... - def response(self, code: str) -> _CommandResults: ... - def append(self, mailbox: str, flags: str, date_time: str, message: ReadableBuffer) -> str: ... - def authenticate(self, mechanism: str, authobject: Callable[[bytes], bytes | None]) -> tuple[str, str]: ... - def capability(self) -> _CommandResults: ... - def check(self) -> _CommandResults: ... - def close(self) -> _CommandResults: ... - def copy(self, message_set: str, new_mailbox: str) -> _CommandResults: ... - def create(self, mailbox: str) -> _CommandResults: ... - def delete(self, mailbox: str) -> _CommandResults: ... - def deleteacl(self, mailbox: str, who: str) -> _CommandResults: ... - def enable(self, capability: str) -> _CommandResults: ... - def __enter__(self) -> Self: ... - def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... - def expunge(self) -> _CommandResults: ... - def fetch(self, message_set: str, message_parts: str) -> tuple[str, _AnyResponseData]: ... - def getacl(self, mailbox: str) -> _CommandResults: ... - def getannotation(self, mailbox: str, entry: str, attribute: str) -> _CommandResults: ... - def getquota(self, root: str) -> _CommandResults: ... - def getquotaroot(self, mailbox: str) -> _CommandResults: ... - def list(self, directory: str = '""', pattern: str = "*") -> tuple[str, _AnyResponseData]: ... - def login(self, user: str, password: str) -> tuple[Literal["OK"], _list[bytes]]: ... - def login_cram_md5(self, user: str, password: str) -> _CommandResults: ... - def logout(self) -> tuple[str, _AnyResponseData]: ... - def lsub(self, directory: str = '""', pattern: str = "*") -> _CommandResults: ... - def myrights(self, mailbox: str) -> _CommandResults: ... - def namespace(self) -> _CommandResults: ... - def noop(self) -> tuple[str, _list[bytes]]: ... - def partial(self, message_num: str, message_part: str, start: str, length: str) -> _CommandResults: ... - def proxyauth(self, user: str) -> _CommandResults: ... - def rename(self, oldmailbox: str, newmailbox: str) -> _CommandResults: ... - def search(self, charset: str | None, *criteria: str) -> _CommandResults: ... - def select(self, mailbox: str = "INBOX", readonly: bool = False) -> tuple[str, _list[bytes | None]]: ... - def setacl(self, mailbox: str, who: str, what: str) -> _CommandResults: ... - def setannotation(self, *args: str) -> _CommandResults: ... - def setquota(self, root: str, limits: str) -> _CommandResults: ... - def sort(self, sort_criteria: str, charset: str, *search_criteria: str) -> _CommandResults: ... - def starttls(self, ssl_context: Any | None = None) -> tuple[Literal["OK"], _list[None]]: ... - def status(self, mailbox: str, names: str) -> _CommandResults: ... - def store(self, message_set: str, command: str, flags: str) -> _CommandResults: ... - def subscribe(self, mailbox: str) -> _CommandResults: ... - 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: ... - def unselect(self) -> _CommandResults: ... - def xatom(self, name: str, *args: str) -> _CommandResults: ... - def print_log(self) -> None: ... - -class IMAP4_SSL(IMAP4): - if sys.version_info < (3, 12): - keyfile: str - certfile: str - if sys.version_info >= (3, 12): - def __init__( - self, host: str = "", port: int = 993, *, ssl_context: SSLContext | None = None, timeout: float | None = None - ) -> None: ... - else: - def __init__( - self, - host: str = "", - port: int = 993, - keyfile: str | None = None, - certfile: str | None = None, - ssl_context: SSLContext | None = None, - timeout: float | None = None, - ) -> None: ... - sslobj: SSLSocket - file: IO[Any] - def open(self, host: str = "", port: int | None = 993, timeout: float | None = None) -> None: ... - def ssl(self) -> SSLSocket: ... - -class IMAP4_stream(IMAP4): - command: str - def __init__(self, command: str) -> None: ... - file: IO[Any] - process: subprocess.Popen[bytes] - writefile: IO[Any] - readfile: IO[Any] - def open(self, host: str | None = None, port: int | None = None, timeout: float | None = None) -> None: ... - -class _Authenticator: - mech: Callable[[bytes], bytes | bytearray | memoryview | str | None] - def __init__(self, mechinst: Callable[[bytes], bytes | bytearray | memoryview | str | None]) -> None: ... - def process(self, data: str) -> str: ... - def encode(self, inp: bytes | bytearray | memoryview) -> str: ... - def decode(self, inp: str | SizedBuffer) -> bytes: ... - -def Internaldate2tuple(resp: ReadableBuffer) -> time.struct_time | None: ... -def Int2AP(num: SupportsAbs[SupportsInt]) -> bytes: ... -def ParseFlags(resp: ReadableBuffer) -> tuple[bytes, ...]: ... -def Time2Internaldate(date_time: float | time.struct_time | time._TimeTuple | datetime | str) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/imghdr.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/imghdr.pyi deleted file mode 100644 index 6e1b858b8f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/imghdr.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from _typeshed import StrPath -from collections.abc import Callable -from typing import Any, BinaryIO, Protocol, overload - -__all__ = ["what"] - -class _ReadableBinary(Protocol): - def tell(self) -> int: ... - def read(self, size: int, /) -> bytes: ... - def seek(self, offset: int, /) -> Any: ... - -@overload -def what(file: StrPath | _ReadableBinary, h: None = None) -> str | None: ... -@overload -def what(file: Any, h: bytes) -> str | None: ... - -tests: list[Callable[[bytes, BinaryIO | None], str | None]] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/imp.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/imp.pyi deleted file mode 100644 index ee5a0cd7bc..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/imp.pyi +++ /dev/null @@ -1,62 +0,0 @@ -import types -from _imp import ( - acquire_lock as acquire_lock, - create_dynamic as create_dynamic, - get_frozen_object as get_frozen_object, - init_frozen as init_frozen, - is_builtin as is_builtin, - is_frozen as is_frozen, - is_frozen_package as is_frozen_package, - lock_held as lock_held, - release_lock as release_lock, -) -from _typeshed import StrPath -from os import PathLike -from types import TracebackType -from typing import IO, Any, Protocol - -SEARCH_ERROR: int -PY_SOURCE: int -PY_COMPILED: int -C_EXTENSION: int -PY_RESOURCE: int -PKG_DIRECTORY: int -C_BUILTIN: int -PY_FROZEN: int -PY_CODERESOURCE: int -IMP_HOOK: int - -def new_module(name: str) -> types.ModuleType: ... -def get_magic() -> bytes: ... -def get_tag() -> str: ... -def cache_from_source(path: StrPath, debug_override: bool | None = None) -> str: ... -def source_from_cache(path: StrPath) -> str: ... -def get_suffixes() -> list[tuple[str, str, int]]: ... - -class NullImporter: - def __init__(self, path: StrPath) -> None: ... - def find_module(self, fullname: Any) -> None: ... - -# Technically, a text file has to support a slightly different set of operations than a binary file, -# but we ignore that here. -class _FileLike(Protocol): - closed: bool - mode: str - def read(self) -> str | bytes: ... - def close(self) -> Any: ... - def __enter__(self) -> Any: ... - def __exit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None, /) -> Any: ... - -# PathLike doesn't work for the pathname argument here -def load_source(name: str, pathname: str, file: _FileLike | None = None) -> types.ModuleType: ... -def load_compiled(name: str, pathname: str, file: _FileLike | None = None) -> types.ModuleType: ... -def load_package(name: str, path: StrPath) -> types.ModuleType: ... -def load_module(name: str, file: _FileLike | None, filename: str, details: tuple[str, str, int]) -> types.ModuleType: ... - -# IO[Any] is a TextIOWrapper if name is a .py file, and a FileIO otherwise. -def find_module( - name: str, path: None | list[str] | list[PathLike[str]] | list[StrPath] = None -) -> tuple[IO[Any], str, tuple[str, str, int]]: ... -def reload(module: types.ModuleType) -> types.ModuleType: ... -def init_builtin(name: str) -> types.ModuleType | None: ... -def load_dynamic(name: str, path: str, file: Any = None) -> types.ModuleType: ... # file argument is ignored diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/__init__.pyi deleted file mode 100644 index cab81512e9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/__init__.pyi +++ /dev/null @@ -1,15 +0,0 @@ -import sys -from importlib._bootstrap import __import__ as __import__ -from importlib.abc import Loader -from types import ModuleType - -__all__ = ["__import__", "import_module", "invalidate_caches", "reload"] - -# `importlib.import_module` return type should be kept the same as `builtins.__import__` -def import_module(name: str, package: str | None = None) -> ModuleType: ... - -if sys.version_info < (3, 12): - def find_loader(name: str, path: str | None = None) -> Loader | None: ... - -def invalidate_caches() -> None: ... -def reload(module: ModuleType) -> ModuleType: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/_abc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/_abc.pyi deleted file mode 100644 index 1a21b9a72c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/_abc.pyi +++ /dev/null @@ -1,15 +0,0 @@ -import sys -import types -from abc import ABCMeta -from importlib.machinery import ModuleSpec - -if sys.version_info >= (3, 10): - class Loader(metaclass=ABCMeta): - def load_module(self, fullname: str) -> types.ModuleType: ... - if sys.version_info < (3, 12): - def module_repr(self, module: types.ModuleType) -> str: ... - - def create_module(self, spec: ModuleSpec) -> types.ModuleType | None: ... - # Not defined on the actual class for backwards-compatibility reasons, - # but expected in new code. - def exec_module(self, module: types.ModuleType) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/_bootstrap.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/_bootstrap.pyi deleted file mode 100644 index 02427ff420..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/_bootstrap.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from _frozen_importlib import * -from _frozen_importlib import __import__ as __import__, _init_module_attrs as _init_module_attrs diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/_bootstrap_external.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/_bootstrap_external.pyi deleted file mode 100644 index 6210ce7083..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/_bootstrap_external.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from _frozen_importlib_external import * -from _frozen_importlib_external import _NamespaceLoader as _NamespaceLoader diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/abc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/abc.pyi deleted file mode 100644 index 8a106b3a64..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/abc.pyi +++ /dev/null @@ -1,172 +0,0 @@ -import _ast -import sys -import types -from _typeshed import ReadableBuffer, StrPath -from abc import ABCMeta, abstractmethod -from collections.abc import Iterator, Mapping, Sequence -from importlib import _bootstrap_external -from importlib.machinery import ModuleSpec -from io import BufferedReader -from typing import IO, Any, Literal, Protocol, overload, runtime_checkable - -if sys.version_info >= (3, 11): - __all__ = [ - "Loader", - "MetaPathFinder", - "PathEntryFinder", - "ResourceLoader", - "InspectLoader", - "ExecutionLoader", - "FileLoader", - "SourceLoader", - ] - - if sys.version_info < (3, 12): - __all__ += ["Finder", "ResourceReader", "Traversable", "TraversableResources"] - -if sys.version_info >= (3, 10): - from importlib._abc import Loader as Loader -else: - class Loader(metaclass=ABCMeta): - def load_module(self, fullname: str) -> types.ModuleType: ... - def module_repr(self, module: types.ModuleType) -> str: ... - def create_module(self, spec: ModuleSpec) -> types.ModuleType | None: ... - # Not defined on the actual class for backwards-compatibility reasons, - # but expected in new code. - def exec_module(self, module: types.ModuleType) -> None: ... - -if sys.version_info < (3, 12): - class Finder(metaclass=ABCMeta): ... - -class ResourceLoader(Loader): - @abstractmethod - def get_data(self, path: str) -> bytes: ... - -class InspectLoader(Loader): - def is_package(self, fullname: str) -> bool: ... - def get_code(self, fullname: str) -> types.CodeType | None: ... - @abstractmethod - def get_source(self, fullname: str) -> str | None: ... - def exec_module(self, module: types.ModuleType) -> None: ... - @staticmethod - def source_to_code( - data: ReadableBuffer | str | _ast.Module | _ast.Expression | _ast.Interactive, path: ReadableBuffer | StrPath = "" - ) -> types.CodeType: ... - -class ExecutionLoader(InspectLoader): - @abstractmethod - def get_filename(self, fullname: str) -> str: ... - -class SourceLoader(_bootstrap_external.SourceLoader, ResourceLoader, ExecutionLoader, metaclass=ABCMeta): # type: ignore[misc] # incompatible definitions of source_to_code in the base classes - def path_mtime(self, path: str) -> float: ... - def set_data(self, path: str, data: bytes) -> None: ... - def get_source(self, fullname: str) -> str | None: ... - def path_stats(self, path: str) -> Mapping[str, Any]: ... - -# The base classes differ starting in 3.10: -if sys.version_info >= (3, 10): - # Please keep in sync with _typeshed.importlib.MetaPathFinderProtocol - class MetaPathFinder(metaclass=ABCMeta): - if sys.version_info < (3, 12): - def find_module(self, fullname: str, path: Sequence[str] | None) -> Loader | None: ... - - def invalidate_caches(self) -> None: ... - # Not defined on the actual class, but expected to exist. - def find_spec( - self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = ..., / - ) -> ModuleSpec | None: ... - - class PathEntryFinder(metaclass=ABCMeta): - if sys.version_info < (3, 12): - def find_module(self, fullname: str) -> Loader | None: ... - def find_loader(self, fullname: str) -> tuple[Loader | None, Sequence[str]]: ... - - def invalidate_caches(self) -> None: ... - # Not defined on the actual class, but expected to exist. - def find_spec(self, fullname: str, target: types.ModuleType | None = ...) -> ModuleSpec | None: ... - -else: - # Please keep in sync with _typeshed.importlib.MetaPathFinderProtocol - class MetaPathFinder(Finder): - def find_module(self, fullname: str, path: Sequence[str] | None) -> Loader | None: ... - def invalidate_caches(self) -> None: ... - # Not defined on the actual class, but expected to exist. - def find_spec( - self, fullname: str, path: Sequence[str] | None, target: types.ModuleType | None = ..., / - ) -> ModuleSpec | None: ... - - class PathEntryFinder(Finder): - def find_module(self, fullname: str) -> Loader | None: ... - def find_loader(self, fullname: str) -> tuple[Loader | None, Sequence[str]]: ... - def invalidate_caches(self) -> None: ... - # Not defined on the actual class, but expected to exist. - def find_spec(self, fullname: str, target: types.ModuleType | None = ...) -> ModuleSpec | None: ... - -class FileLoader(_bootstrap_external.FileLoader, ResourceLoader, ExecutionLoader, metaclass=ABCMeta): - name: str - path: str - def __init__(self, fullname: str, path: str) -> None: ... - def get_data(self, path: str) -> bytes: ... - def get_filename(self, name: str | None = None) -> str: ... - def load_module(self, name: str | None = None) -> types.ModuleType: ... - -class ResourceReader(metaclass=ABCMeta): - @abstractmethod - def open_resource(self, resource: str) -> IO[bytes]: ... - @abstractmethod - def resource_path(self, resource: str) -> str: ... - if sys.version_info >= (3, 10): - @abstractmethod - def is_resource(self, path: str) -> bool: ... - else: - @abstractmethod - def is_resource(self, name: str) -> bool: ... - - @abstractmethod - def contents(self) -> Iterator[str]: ... - -@runtime_checkable -class Traversable(Protocol): - @abstractmethod - def is_dir(self) -> bool: ... - @abstractmethod - def is_file(self) -> bool: ... - @abstractmethod - def iterdir(self) -> Iterator[Traversable]: ... - if sys.version_info >= (3, 11): - @abstractmethod - def joinpath(self, *descendants: str) -> Traversable: ... - else: - @abstractmethod - def joinpath(self, child: str, /) -> Traversable: ... - - # The documentation and runtime protocol allows *args, **kwargs arguments, - # but this would mean that all implementers would have to support them, - # which is not the case. - @overload - @abstractmethod - def open(self, mode: Literal["r"] = "r", *, encoding: str | None = None, errors: str | None = None) -> IO[str]: ... - @overload - @abstractmethod - def open(self, mode: Literal["rb"]) -> IO[bytes]: ... - @property - @abstractmethod - def name(self) -> str: ... - if sys.version_info >= (3, 10): - def __truediv__(self, child: str, /) -> Traversable: ... - else: - @abstractmethod - def __truediv__(self, child: str, /) -> Traversable: ... - - @abstractmethod - def read_bytes(self) -> bytes: ... - @abstractmethod - def read_text(self, encoding: str | None = None) -> str: ... - -class TraversableResources(ResourceReader): - @abstractmethod - def files(self) -> Traversable: ... - def open_resource(self, resource: str) -> BufferedReader: ... - def resource_path(self, resource: Any) -> str: ... - def is_resource(self, path: str) -> bool: ... - def contents(self) -> Iterator[str]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/machinery.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/machinery.pyi deleted file mode 100644 index bb1a6f93d0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/machinery.pyi +++ /dev/null @@ -1,20 +0,0 @@ -import sys -from importlib._bootstrap import BuiltinImporter as BuiltinImporter, FrozenImporter as FrozenImporter, ModuleSpec as ModuleSpec -from importlib._bootstrap_external import ( - BYTECODE_SUFFIXES as BYTECODE_SUFFIXES, - DEBUG_BYTECODE_SUFFIXES as DEBUG_BYTECODE_SUFFIXES, - EXTENSION_SUFFIXES as EXTENSION_SUFFIXES, - OPTIMIZED_BYTECODE_SUFFIXES as OPTIMIZED_BYTECODE_SUFFIXES, - SOURCE_SUFFIXES as SOURCE_SUFFIXES, - ExtensionFileLoader as ExtensionFileLoader, - FileFinder as FileFinder, - PathFinder as PathFinder, - SourceFileLoader as SourceFileLoader, - SourcelessFileLoader as SourcelessFileLoader, - WindowsRegistryFinder as WindowsRegistryFinder, -) - -if sys.version_info >= (3, 11): - from importlib._bootstrap_external import NamespaceLoader as NamespaceLoader - -def all_suffixes() -> list[str]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/metadata/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/metadata/__init__.pyi deleted file mode 100644 index 15d8b50b09..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/metadata/__init__.pyi +++ /dev/null @@ -1,290 +0,0 @@ -import abc -import pathlib -import sys -import types -from _collections_abc import dict_keys, dict_values -from _typeshed import StrPath -from collections.abc import Iterable, Iterator, Mapping -from email.message import Message -from importlib.abc import MetaPathFinder -from os import PathLike -from pathlib import Path -from re import Pattern -from typing import Any, ClassVar, Generic, NamedTuple, TypeVar, overload -from typing_extensions import Self, TypeAlias - -_T = TypeVar("_T") -_KT = TypeVar("_KT") -_VT = TypeVar("_VT") - -__all__ = [ - "Distribution", - "DistributionFinder", - "PackageNotFoundError", - "distribution", - "distributions", - "entry_points", - "files", - "metadata", - "requires", - "version", -] - -if sys.version_info >= (3, 10): - __all__ += ["PackageMetadata", "packages_distributions"] - -if sys.version_info >= (3, 10): - from importlib.metadata._meta import PackageMetadata as PackageMetadata, SimplePath - def packages_distributions() -> Mapping[str, list[str]]: ... - - _SimplePath: TypeAlias = SimplePath - -else: - _SimplePath: TypeAlias = Path - -class PackageNotFoundError(ModuleNotFoundError): - @property - def name(self) -> str: ... # type: ignore[override] - -if sys.version_info >= (3, 13): - _EntryPointBase = object -elif sys.version_info >= (3, 11): - class DeprecatedTuple: - def __getitem__(self, item: int) -> str: ... - - _EntryPointBase = DeprecatedTuple -else: - class _EntryPointBase(NamedTuple): - name: str - value: str - group: str - -class EntryPoint(_EntryPointBase): - pattern: ClassVar[Pattern[str]] - if sys.version_info >= (3, 11): - name: str - value: str - group: str - - def __init__(self, name: str, value: str, group: str) -> None: ... - - def load(self) -> Any: ... # Callable[[], Any] or an importable module - @property - def extras(self) -> list[str]: ... - @property - def module(self) -> str: ... - @property - def attr(self) -> str: ... - if sys.version_info >= (3, 10): - dist: ClassVar[Distribution | None] - def matches( - self, - *, - name: str = ..., - value: str = ..., - group: str = ..., - module: str = ..., - attr: str = ..., - extras: list[str] = ..., - ) -> bool: ... # undocumented - - def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: ... - if sys.version_info >= (3, 11): - def __lt__(self, other: object) -> bool: ... - if sys.version_info < (3, 12): - def __iter__(self) -> Iterator[Any]: ... # result of iter((str, Self)), really - -if sys.version_info >= (3, 12): - class EntryPoints(tuple[EntryPoint, ...]): - def __getitem__(self, name: str) -> EntryPoint: ... # type: ignore[override] - def select( - self, - *, - name: str = ..., - value: str = ..., - group: str = ..., - module: str = ..., - attr: str = ..., - extras: list[str] = ..., - ) -> EntryPoints: ... - @property - def names(self) -> set[str]: ... - @property - def groups(self) -> set[str]: ... - -elif sys.version_info >= (3, 10): - class DeprecatedList(list[_T]): ... - - class EntryPoints(DeprecatedList[EntryPoint]): # use as list is deprecated since 3.10 - # int argument is deprecated since 3.10 - def __getitem__(self, name: int | str) -> EntryPoint: ... # type: ignore[override] - def select( - self, - *, - name: str = ..., - value: str = ..., - group: str = ..., - module: str = ..., - attr: str = ..., - extras: list[str] = ..., - ) -> EntryPoints: ... - @property - def names(self) -> set[str]: ... - @property - def groups(self) -> set[str]: ... - -if sys.version_info >= (3, 10) and sys.version_info < (3, 12): - class Deprecated(Generic[_KT, _VT]): - def __getitem__(self, name: _KT) -> _VT: ... - @overload - def get(self, name: _KT, default: None = None) -> _VT | None: ... - @overload - def get(self, name: _KT, default: _T) -> _VT | _T: ... - def __iter__(self) -> Iterator[_KT]: ... - def __contains__(self, *args: object) -> bool: ... - def keys(self) -> dict_keys[_KT, _VT]: ... - def values(self) -> dict_values[_KT, _VT]: ... - - class SelectableGroups(Deprecated[str, EntryPoints], dict[str, EntryPoints]): # use as dict is deprecated since 3.10 - @classmethod - def load(cls, eps: Iterable[EntryPoint]) -> Self: ... - @property - def groups(self) -> set[str]: ... - @property - def names(self) -> set[str]: ... - @overload - def select(self) -> Self: ... - @overload - def select( - self, - *, - name: str = ..., - value: str = ..., - group: str = ..., - module: str = ..., - attr: str = ..., - extras: list[str] = ..., - ) -> EntryPoints: ... - -class PackagePath(pathlib.PurePosixPath): - def read_text(self, encoding: str = "utf-8") -> str: ... - def read_binary(self) -> bytes: ... - def locate(self) -> PathLike[str]: ... - # The following attributes are not defined on PackagePath, but are dynamically added by Distribution.files: - hash: FileHash | None - size: int | None - dist: Distribution - -class FileHash: - mode: str - value: str - def __init__(self, spec: str) -> None: ... - -if sys.version_info >= (3, 12): - class DeprecatedNonAbstract: ... - _distribution_parent = DeprecatedNonAbstract -else: - _distribution_parent = object - -class Distribution(_distribution_parent): - @abc.abstractmethod - def read_text(self, filename: str) -> str | None: ... - @abc.abstractmethod - def locate_file(self, path: StrPath) -> _SimplePath: ... - @classmethod - def from_name(cls, name: str) -> Distribution: ... - @overload - @classmethod - def discover(cls, *, context: DistributionFinder.Context) -> Iterable[Distribution]: ... - @overload - @classmethod - def discover( - cls, *, context: None = None, name: str | None = ..., path: list[str] = ..., **kwargs: Any - ) -> Iterable[Distribution]: ... - @staticmethod - def at(path: StrPath) -> PathDistribution: ... - - if sys.version_info >= (3, 10): - @property - def metadata(self) -> PackageMetadata: ... - @property - def entry_points(self) -> EntryPoints: ... - else: - @property - def metadata(self) -> Message: ... - @property - def entry_points(self) -> list[EntryPoint]: ... - - @property - def version(self) -> str: ... - @property - def files(self) -> list[PackagePath] | None: ... - @property - def requires(self) -> list[str] | None: ... - if sys.version_info >= (3, 10): - @property - def name(self) -> str: ... - if sys.version_info >= (3, 13): - @property - def origin(self) -> types.SimpleNamespace: ... - -class DistributionFinder(MetaPathFinder): - class Context: - name: str | None - def __init__(self, *, name: str | None = ..., path: list[str] = ..., **kwargs: Any) -> None: ... - @property - def path(self) -> list[str]: ... - - @abc.abstractmethod - def find_distributions(self, context: DistributionFinder.Context = ...) -> Iterable[Distribution]: ... - -class MetadataPathFinder(DistributionFinder): - @classmethod - def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ... - if sys.version_info >= (3, 11): - @classmethod - def invalidate_caches(cls) -> None: ... - elif sys.version_info >= (3, 10): - # Yes, this is an instance method that has a parameter named "cls" - def invalidate_caches(cls) -> None: ... - -class PathDistribution(Distribution): - _path: _SimplePath - def __init__(self, path: _SimplePath) -> None: ... - def read_text(self, filename: StrPath) -> str | None: ... - def locate_file(self, path: StrPath) -> _SimplePath: ... - -def distribution(distribution_name: str) -> Distribution: ... -@overload -def distributions(*, context: DistributionFinder.Context) -> Iterable[Distribution]: ... -@overload -def distributions( - *, context: None = None, name: str | None = ..., path: list[str] = ..., **kwargs: Any -) -> Iterable[Distribution]: ... - -if sys.version_info >= (3, 10): - def metadata(distribution_name: str) -> PackageMetadata: ... - -else: - def metadata(distribution_name: str) -> Message: ... - -if sys.version_info >= (3, 12): - def entry_points( - *, name: str = ..., value: str = ..., group: str = ..., module: str = ..., attr: str = ..., extras: list[str] = ... - ) -> EntryPoints: ... - -elif sys.version_info >= (3, 10): - @overload - def entry_points() -> SelectableGroups: ... - @overload - def entry_points( - *, name: str = ..., value: str = ..., group: str = ..., module: str = ..., attr: str = ..., extras: list[str] = ... - ) -> EntryPoints: ... - -else: - def entry_points() -> dict[str, list[EntryPoint]]: ... - -def version(distribution_name: str) -> str: ... -def files(distribution_name: str) -> list[PackagePath] | None: ... -def requires(distribution_name: str) -> list[str] | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/metadata/_meta.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/metadata/_meta.pyi deleted file mode 100644 index 9f791dab25..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/metadata/_meta.pyi +++ /dev/null @@ -1,63 +0,0 @@ -import sys -from _typeshed import StrPath -from collections.abc import Iterator -from os import PathLike -from typing import Any, Protocol, overload -from typing_extensions import TypeVar - -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True, default=Any) - -class PackageMetadata(Protocol): - def __len__(self) -> int: ... - def __contains__(self, item: str) -> bool: ... - def __getitem__(self, key: str) -> str: ... - def __iter__(self) -> Iterator[str]: ... - @property - def json(self) -> dict[str, str | list[str]]: ... - @overload - def get_all(self, name: str, failobj: None = None) -> list[Any] | None: ... - @overload - def get_all(self, name: str, failobj: _T) -> list[Any] | _T: ... - if sys.version_info >= (3, 12): - @overload - def get(self, name: str, failobj: None = None) -> str | None: ... - @overload - def get(self, name: str, failobj: _T) -> _T | str: ... - -if sys.version_info >= (3, 13): - class SimplePath(Protocol): - def joinpath(self, other: StrPath, /) -> SimplePath: ... - def __truediv__(self, other: StrPath, /) -> SimplePath: ... - # Incorrect at runtime - @property - def parent(self) -> PathLike[str]: ... - def read_text(self, encoding: str | None = None) -> str: ... - def read_bytes(self) -> bytes: ... - def exists(self) -> bool: ... - -elif sys.version_info >= (3, 12): - class SimplePath(Protocol[_T_co]): - # At runtime this is defined as taking `str | _T`, but that causes trouble. - # See #11436. - def joinpath(self, other: str, /) -> _T_co: ... - @property - def parent(self) -> _T_co: ... - def read_text(self) -> str: ... - # As with joinpath(), this is annotated as taking `str | _T` at runtime. - def __truediv__(self, other: str, /) -> _T_co: ... - -else: - class SimplePath(Protocol): - # Actually takes only self at runtime, but that's clearly wrong - def joinpath(self, other: Any, /) -> SimplePath: ... - # Not defined as a property at runtime, but it should be - @property - def parent(self) -> Any: ... - def read_text(self) -> str: ... - # There was a bug in `SimplePath` definition in cpython, see #8451 - # Strictly speaking `__div__` was defined in 3.10, not __truediv__, - # but it should have always been `__truediv__`. - # Also, the runtime defines this method as taking no arguments, - # which is obviously wrong. - def __truediv__(self, other: Any, /) -> SimplePath: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/metadata/diagnose.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/metadata/diagnose.pyi deleted file mode 100644 index 565872fd97..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/metadata/diagnose.pyi +++ /dev/null @@ -1,2 +0,0 @@ -def inspect(path: str) -> None: ... -def run() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/readers.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/readers.pyi deleted file mode 100644 index 4a6c739215..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/readers.pyi +++ /dev/null @@ -1,72 +0,0 @@ -# On py311+, things are actually defined in importlib.resources.readers, -# and re-exported here, -# but doing it this way leads to less code duplication for us - -import pathlib -import sys -import zipfile -from _typeshed import StrPath -from collections.abc import Iterable, Iterator -from io import BufferedReader -from typing import Literal, NoReturn, TypeVar -from typing_extensions import Never - -if sys.version_info >= (3, 10): - from importlib._bootstrap_external import FileLoader - from zipimport import zipimporter - -if sys.version_info >= (3, 11): - from importlib.resources import abc -else: - from importlib import abc - -if sys.version_info >= (3, 10): - if sys.version_info >= (3, 11): - __all__ = ["FileReader", "ZipReader", "MultiplexedPath", "NamespaceReader"] - - if sys.version_info < (3, 11): - _T = TypeVar("_T") - - def remove_duplicates(items: Iterable[_T]) -> Iterator[_T]: ... - - class FileReader(abc.TraversableResources): - path: pathlib.Path - def __init__(self, loader: FileLoader) -> None: ... - def resource_path(self, resource: StrPath) -> str: ... - def files(self) -> pathlib.Path: ... - - class ZipReader(abc.TraversableResources): - prefix: str - archive: str - def __init__(self, loader: zipimporter, module: str) -> None: ... - def open_resource(self, resource: str) -> BufferedReader: ... - def is_resource(self, path: StrPath) -> bool: ... - def files(self) -> zipfile.Path: ... - - class MultiplexedPath(abc.Traversable): - def __init__(self, *paths: abc.Traversable) -> None: ... - def iterdir(self) -> Iterator[abc.Traversable]: ... - def read_bytes(self) -> NoReturn: ... - def read_text(self, *args: Never, **kwargs: Never) -> NoReturn: ... # type: ignore[override] - def is_dir(self) -> Literal[True]: ... - def is_file(self) -> Literal[False]: ... - - if sys.version_info >= (3, 12): - def joinpath(self, *descendants: str) -> abc.Traversable: ... - elif sys.version_info >= (3, 11): - def joinpath(self, child: str) -> abc.Traversable: ... # type: ignore[override] - else: - def joinpath(self, child: str) -> abc.Traversable: ... - - if sys.version_info < (3, 12): - __truediv__ = joinpath - - def open(self, *args: Never, **kwargs: Never) -> NoReturn: ... # type: ignore[override] - @property - def name(self) -> str: ... - - class NamespaceReader(abc.TraversableResources): - path: MultiplexedPath - def __init__(self, namespace_path: Iterable[str]) -> None: ... - def resource_path(self, resource: str) -> str: ... - def files(self) -> MultiplexedPath: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/__init__.pyi deleted file mode 100644 index 2cf6366b6c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/__init__.pyi +++ /dev/null @@ -1,76 +0,0 @@ -import os -import sys -from collections.abc import Iterator -from contextlib import AbstractContextManager -from importlib.abc import Traversable -from pathlib import Path -from types import ModuleType -from typing import Any, BinaryIO, Literal, TextIO -from typing_extensions import TypeAlias - -if sys.version_info >= (3, 11): - from importlib.resources._common import Package as Package -else: - Package: TypeAlias = str | ModuleType - -__all__ = [ - "Package", - "as_file", - "contents", - "files", - "is_resource", - "open_binary", - "open_text", - "path", - "read_binary", - "read_text", -] - -if sys.version_info >= (3, 10): - __all__ += ["ResourceReader"] - -if sys.version_info < (3, 13): - __all__ += ["Resource"] - -if sys.version_info < (3, 11): - Resource: TypeAlias = str | os.PathLike[Any] -elif sys.version_info < (3, 13): - Resource: TypeAlias = str - -if sys.version_info >= (3, 12): - from importlib.resources._common import Anchor as Anchor - - __all__ += ["Anchor"] - -if sys.version_info >= (3, 13): - from importlib.resources._functional import ( - contents as contents, - is_resource as is_resource, - open_binary as open_binary, - open_text as open_text, - path as path, - read_binary as read_binary, - read_text as read_text, - ) - -else: - def open_binary(package: Package, resource: Resource) -> BinaryIO: ... - def open_text(package: Package, resource: Resource, encoding: str = "utf-8", errors: str = "strict") -> TextIO: ... - def read_binary(package: Package, resource: Resource) -> bytes: ... - def read_text(package: Package, resource: Resource, encoding: str = "utf-8", errors: str = "strict") -> str: ... - def path(package: Package, resource: Resource) -> AbstractContextManager[Path, Literal[False]]: ... - def is_resource(package: Package, name: str) -> bool: ... - def contents(package: Package) -> Iterator[str]: ... - -if sys.version_info >= (3, 11): - from importlib.resources._common import as_file as as_file -else: - def as_file(path: Traversable) -> AbstractContextManager[Path, Literal[False]]: ... - -if sys.version_info >= (3, 11): - from importlib.resources._common import files as files -else: - def files(package: Package) -> Traversable: ... - -if sys.version_info >= (3, 10): - from importlib.abc import ResourceReader as ResourceReader diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/_common.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/_common.pyi deleted file mode 100644 index d6a9436544..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/_common.pyi +++ /dev/null @@ -1,42 +0,0 @@ -import sys - -# Even though this file is 3.11+ only, Pyright will complain in stubtest for older versions. -if sys.version_info >= (3, 11): - import types - from collections.abc import Callable - from contextlib import AbstractContextManager - from importlib.abc import ResourceReader, Traversable - from pathlib import Path - from typing import Literal, overload - from typing_extensions import TypeAlias, deprecated - - Package: TypeAlias = str | types.ModuleType - - if sys.version_info >= (3, 12): - Anchor: TypeAlias = Package - - def package_to_anchor( - func: Callable[[Anchor | None], Traversable], - ) -> Callable[[Anchor | None, Anchor | None], Traversable]: ... - @overload - def files(anchor: Anchor | None = None) -> Traversable: ... - @overload - @deprecated("First parameter to files is renamed to 'anchor'") - def files(package: Anchor | None = None) -> Traversable: ... - - else: - def files(package: Package) -> Traversable: ... - - def get_resource_reader(package: types.ModuleType) -> ResourceReader | None: ... - - if sys.version_info >= (3, 12): - def resolve(cand: Anchor | None) -> types.ModuleType: ... - - else: - def resolve(cand: Package) -> types.ModuleType: ... - - if sys.version_info < (3, 12): - def get_package(package: Package) -> types.ModuleType: ... - - def from_package(package: types.ModuleType) -> Traversable: ... - def as_file(path: Traversable) -> AbstractContextManager[Path, Literal[False]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/_functional.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/_functional.pyi deleted file mode 100644 index 50f3405f9a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/_functional.pyi +++ /dev/null @@ -1,30 +0,0 @@ -import sys - -# Even though this file is 3.13+ only, Pyright will complain in stubtest for older versions. -if sys.version_info >= (3, 13): - from _typeshed import StrPath - from collections.abc import Iterator - from contextlib import AbstractContextManager - from importlib.resources._common import Anchor - from io import TextIOWrapper - from pathlib import Path - from typing import BinaryIO, Literal, overload - from typing_extensions import Unpack - - def open_binary(anchor: Anchor, *path_names: StrPath) -> BinaryIO: ... - @overload - def open_text( - anchor: Anchor, *path_names: Unpack[tuple[StrPath]], encoding: str | None = "utf-8", errors: str | None = "strict" - ) -> TextIOWrapper: ... - @overload - def open_text(anchor: Anchor, *path_names: StrPath, encoding: str | None, errors: str | None = "strict") -> TextIOWrapper: ... - def read_binary(anchor: Anchor, *path_names: StrPath) -> bytes: ... - @overload - def read_text( - anchor: Anchor, *path_names: Unpack[tuple[StrPath]], encoding: str | None = "utf-8", errors: str | None = "strict" - ) -> str: ... - @overload - def read_text(anchor: Anchor, *path_names: StrPath, encoding: str | None, errors: str | None = "strict") -> str: ... - def path(anchor: Anchor, *path_names: StrPath) -> AbstractContextManager[Path, Literal[False]]: ... - def is_resource(anchor: Anchor, *path_names: StrPath) -> bool: ... - def contents(anchor: Anchor, *path_names: StrPath) -> Iterator[str]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/abc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/abc.pyi deleted file mode 100644 index ad80605f7c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/abc.pyi +++ /dev/null @@ -1,14 +0,0 @@ -import sys - -if sys.version_info >= (3, 11): - # These are all actually defined in this file on 3.11+, - # and re-exported from importlib.abc, - # but it's much less code duplication for typeshed if we pretend that they're still defined - # in importlib.abc on 3.11+, and re-exported from this file - from importlib.abc import ( - ResourceReader as ResourceReader, - Traversable as Traversable, - TraversableResources as TraversableResources, - ) - - __all__ = ["ResourceReader", "Traversable", "TraversableResources"] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/readers.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/readers.pyi deleted file mode 100644 index 0ab21fd291..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/readers.pyi +++ /dev/null @@ -1,14 +0,0 @@ -# On py311+, things are actually defined here -# and re-exported from importlib.readers, -# but doing it this way leads to less code duplication for us - -import sys -from collections.abc import Iterable, Iterator -from typing import TypeVar - -if sys.version_info >= (3, 11): - from importlib.readers import * - - _T = TypeVar("_T") - - def remove_duplicates(items: Iterable[_T]) -> Iterator[_T]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/simple.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/simple.pyi deleted file mode 100644 index c4c758111c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/resources/simple.pyi +++ /dev/null @@ -1,56 +0,0 @@ -import abc -import sys -from collections.abc import Iterator -from io import TextIOWrapper -from typing import IO, Any, BinaryIO, Literal, NoReturn, overload -from typing_extensions import Never - -if sys.version_info >= (3, 11): - from .abc import Traversable, TraversableResources - - class SimpleReader(abc.ABC): - @property - @abc.abstractmethod - def package(self) -> str: ... - @abc.abstractmethod - def children(self) -> list[SimpleReader]: ... - @abc.abstractmethod - def resources(self) -> list[str]: ... - @abc.abstractmethod - def open_binary(self, resource: str) -> BinaryIO: ... - @property - def name(self) -> str: ... - - class ResourceHandle(Traversable, metaclass=abc.ABCMeta): - parent: ResourceContainer - def __init__(self, parent: ResourceContainer, name: str) -> None: ... - def is_file(self) -> Literal[True]: ... - def is_dir(self) -> Literal[False]: ... - @overload - def open( - self, - mode: Literal["r"] = "r", - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - line_buffering: bool = False, - write_through: bool = False, - ) -> TextIOWrapper: ... - @overload - def open(self, mode: Literal["rb"]) -> BinaryIO: ... - @overload - def open(self, mode: str) -> IO[Any]: ... - def joinpath(self, name: Never) -> NoReturn: ... # type: ignore[override] - - class ResourceContainer(Traversable, metaclass=abc.ABCMeta): - reader: SimpleReader - def __init__(self, reader: SimpleReader) -> None: ... - def is_dir(self) -> Literal[True]: ... - def is_file(self) -> Literal[False]: ... - def iterdir(self) -> Iterator[ResourceHandle | ResourceContainer]: ... - def open(self, *args: Never, **kwargs: Never) -> NoReturn: ... # type: ignore[override] - if sys.version_info < (3, 12): - def joinpath(self, *descendants: str) -> Traversable: ... - - class TraversableReader(TraversableResources, SimpleReader, metaclass=abc.ABCMeta): - def files(self) -> ResourceContainer: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/simple.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/simple.pyi deleted file mode 100644 index 58d8c66170..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/simple.pyi +++ /dev/null @@ -1,11 +0,0 @@ -import sys - -if sys.version_info >= (3, 11): - from .resources.simple import ( - ResourceContainer as ResourceContainer, - ResourceHandle as ResourceHandle, - SimpleReader as SimpleReader, - TraversableReader as TraversableReader, - ) - - __all__ = ["SimpleReader", "ResourceHandle", "ResourceContainer", "TraversableReader"] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/util.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/util.pyi deleted file mode 100644 index cc1c98ae4d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/importlib/util.pyi +++ /dev/null @@ -1,33 +0,0 @@ -import importlib.abc -import importlib.machinery -import sys -import types -from _typeshed import ReadableBuffer -from collections.abc import Callable -from importlib._bootstrap import module_from_spec as module_from_spec, spec_from_loader as spec_from_loader -from importlib._bootstrap_external import ( - MAGIC_NUMBER as MAGIC_NUMBER, - cache_from_source as cache_from_source, - decode_source as decode_source, - source_from_cache as source_from_cache, - spec_from_file_location as spec_from_file_location, -) -from typing_extensions import ParamSpec - -_P = ParamSpec("_P") - -if sys.version_info < (3, 12): - def module_for_loader(fxn: Callable[_P, types.ModuleType]) -> Callable[_P, types.ModuleType]: ... - def set_loader(fxn: Callable[_P, types.ModuleType]) -> Callable[_P, types.ModuleType]: ... - def set_package(fxn: Callable[_P, types.ModuleType]) -> Callable[_P, types.ModuleType]: ... - -def resolve_name(name: str, package: str | None) -> str: ... -def find_spec(name: str, package: str | None = None) -> importlib.machinery.ModuleSpec | None: ... - -class LazyLoader(importlib.abc.Loader): - def __init__(self, loader: importlib.abc.Loader) -> None: ... - @classmethod - def factory(cls, loader: importlib.abc.Loader) -> Callable[..., LazyLoader]: ... - def exec_module(self, module: types.ModuleType) -> None: ... - -def source_hash(source_bytes: ReadableBuffer) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/inspect.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/inspect.pyi deleted file mode 100644 index c525418c10..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/inspect.pyi +++ /dev/null @@ -1,641 +0,0 @@ -import dis -import enum -import sys -import types -from _typeshed import StrPath -from collections import OrderedDict -from collections.abc import AsyncGenerator, Awaitable, Callable, Coroutine, Generator, Mapping, Sequence, Set as AbstractSet -from types import ( - AsyncGeneratorType, - BuiltinFunctionType, - BuiltinMethodType, - ClassMethodDescriptorType, - CodeType, - CoroutineType, - FrameType, - FunctionType, - GeneratorType, - GetSetDescriptorType, - LambdaType, - MemberDescriptorType, - MethodDescriptorType, - MethodType, - MethodWrapperType, - ModuleType, - TracebackType, - WrapperDescriptorType, -) -from typing import Any, ClassVar, Final, Literal, NamedTuple, Protocol, TypeVar, overload -from typing_extensions import ParamSpec, Self, TypeAlias, TypeGuard, TypeIs - -if sys.version_info >= (3, 11): - __all__ = [ - "ArgInfo", - "Arguments", - "Attribute", - "BlockFinder", - "BoundArguments", - "CORO_CLOSED", - "CORO_CREATED", - "CORO_RUNNING", - "CORO_SUSPENDED", - "CO_ASYNC_GENERATOR", - "CO_COROUTINE", - "CO_GENERATOR", - "CO_ITERABLE_COROUTINE", - "CO_NESTED", - "CO_NEWLOCALS", - "CO_NOFREE", - "CO_OPTIMIZED", - "CO_VARARGS", - "CO_VARKEYWORDS", - "ClassFoundException", - "ClosureVars", - "EndOfBlock", - "FrameInfo", - "FullArgSpec", - "GEN_CLOSED", - "GEN_CREATED", - "GEN_RUNNING", - "GEN_SUSPENDED", - "Parameter", - "Signature", - "TPFLAGS_IS_ABSTRACT", - "Traceback", - "classify_class_attrs", - "cleandoc", - "currentframe", - "findsource", - "formatannotation", - "formatannotationrelativeto", - "formatargvalues", - "get_annotations", - "getabsfile", - "getargs", - "getargvalues", - "getattr_static", - "getblock", - "getcallargs", - "getclasstree", - "getclosurevars", - "getcomments", - "getcoroutinelocals", - "getcoroutinestate", - "getdoc", - "getfile", - "getframeinfo", - "getfullargspec", - "getgeneratorlocals", - "getgeneratorstate", - "getinnerframes", - "getlineno", - "getmembers", - "getmembers_static", - "getmodule", - "getmodulename", - "getmro", - "getouterframes", - "getsource", - "getsourcefile", - "getsourcelines", - "indentsize", - "isabstract", - "isasyncgen", - "isasyncgenfunction", - "isawaitable", - "isbuiltin", - "isclass", - "iscode", - "iscoroutine", - "iscoroutinefunction", - "isdatadescriptor", - "isframe", - "isfunction", - "isgenerator", - "isgeneratorfunction", - "isgetsetdescriptor", - "ismemberdescriptor", - "ismethod", - "ismethoddescriptor", - "ismethodwrapper", - "ismodule", - "isroutine", - "istraceback", - "signature", - "stack", - "trace", - "unwrap", - "walktree", - ] - - if sys.version_info >= (3, 12): - __all__ += [ - "markcoroutinefunction", - "AGEN_CLOSED", - "AGEN_CREATED", - "AGEN_RUNNING", - "AGEN_SUSPENDED", - "getasyncgenlocals", - "getasyncgenstate", - "BufferFlags", - ] - -_P = ParamSpec("_P") -_T = TypeVar("_T") -_F = TypeVar("_F", bound=Callable[..., Any]) -_T_contra = TypeVar("_T_contra", contravariant=True) -_V_contra = TypeVar("_V_contra", contravariant=True) - -# -# Types and members -# -class EndOfBlock(Exception): ... - -class BlockFinder: - indent: int - islambda: bool - started: bool - passline: bool - indecorator: bool - decoratorhasargs: bool - last: int - def tokeneater(self, type: int, token: str, srowcol: tuple[int, int], erowcol: tuple[int, int], line: str) -> None: ... - -CO_OPTIMIZED: Final = 1 -CO_NEWLOCALS: Final = 2 -CO_VARARGS: Final = 4 -CO_VARKEYWORDS: Final = 8 -CO_NESTED: Final = 16 -CO_GENERATOR: Final = 32 -CO_NOFREE: Final = 64 -CO_COROUTINE: Final = 128 -CO_ITERABLE_COROUTINE: Final = 256 -CO_ASYNC_GENERATOR: Final = 512 -TPFLAGS_IS_ABSTRACT: Final = 1048576 - -modulesbyfile: dict[str, Any] - -_GetMembersPredicateTypeGuard: TypeAlias = Callable[[Any], TypeGuard[_T]] -_GetMembersPredicateTypeIs: TypeAlias = Callable[[Any], TypeIs[_T]] -_GetMembersPredicate: TypeAlias = Callable[[Any], bool] -_GetMembersReturn: TypeAlias = list[tuple[str, _T]] - -@overload -def getmembers(object: object, predicate: _GetMembersPredicateTypeGuard[_T]) -> _GetMembersReturn[_T]: ... -@overload -def getmembers(object: object, predicate: _GetMembersPredicateTypeIs[_T]) -> _GetMembersReturn[_T]: ... -@overload -def getmembers(object: object, predicate: _GetMembersPredicate | None = None) -> _GetMembersReturn[Any]: ... - -if sys.version_info >= (3, 11): - @overload - def getmembers_static(object: object, predicate: _GetMembersPredicateTypeGuard[_T]) -> _GetMembersReturn[_T]: ... - @overload - def getmembers_static(object: object, predicate: _GetMembersPredicateTypeIs[_T]) -> _GetMembersReturn[_T]: ... - @overload - def getmembers_static(object: object, predicate: _GetMembersPredicate | None = None) -> _GetMembersReturn[Any]: ... - -def getmodulename(path: StrPath) -> str | None: ... -def ismodule(object: object) -> TypeIs[ModuleType]: ... -def isclass(object: object) -> TypeIs[type[Any]]: ... -def ismethod(object: object) -> TypeIs[MethodType]: ... -def isfunction(object: object) -> TypeIs[FunctionType]: ... - -if sys.version_info >= (3, 12): - def markcoroutinefunction(func: _F) -> _F: ... - -@overload -def isgeneratorfunction(obj: Callable[..., Generator[Any, Any, Any]]) -> bool: ... -@overload -def isgeneratorfunction(obj: Callable[_P, Any]) -> TypeGuard[Callable[_P, GeneratorType[Any, Any, Any]]]: ... -@overload -def isgeneratorfunction(obj: object) -> TypeGuard[Callable[..., GeneratorType[Any, Any, Any]]]: ... -@overload -def iscoroutinefunction(obj: Callable[..., Coroutine[Any, Any, Any]]) -> bool: ... -@overload -def iscoroutinefunction(obj: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, CoroutineType[Any, Any, _T]]]: ... -@overload -def iscoroutinefunction(obj: Callable[_P, object]) -> TypeGuard[Callable[_P, CoroutineType[Any, Any, Any]]]: ... -@overload -def iscoroutinefunction(obj: object) -> TypeGuard[Callable[..., CoroutineType[Any, Any, Any]]]: ... -def isgenerator(object: object) -> TypeIs[GeneratorType[Any, Any, Any]]: ... -def iscoroutine(object: object) -> TypeIs[CoroutineType[Any, Any, Any]]: ... -def isawaitable(object: object) -> TypeIs[Awaitable[Any]]: ... -@overload -def isasyncgenfunction(obj: Callable[..., AsyncGenerator[Any, Any]]) -> bool: ... -@overload -def isasyncgenfunction(obj: Callable[_P, Any]) -> TypeGuard[Callable[_P, AsyncGeneratorType[Any, Any]]]: ... -@overload -def isasyncgenfunction(obj: object) -> TypeGuard[Callable[..., AsyncGeneratorType[Any, Any]]]: ... - -class _SupportsSet(Protocol[_T_contra, _V_contra]): - def __set__(self, instance: _T_contra, value: _V_contra, /) -> None: ... - -class _SupportsDelete(Protocol[_T_contra]): - def __delete__(self, instance: _T_contra, /) -> None: ... - -def isasyncgen(object: object) -> TypeIs[AsyncGeneratorType[Any, Any]]: ... -def istraceback(object: object) -> TypeIs[TracebackType]: ... -def isframe(object: object) -> TypeIs[FrameType]: ... -def iscode(object: object) -> TypeIs[CodeType]: ... -def isbuiltin(object: object) -> TypeIs[BuiltinFunctionType]: ... - -if sys.version_info >= (3, 11): - def ismethodwrapper(object: object) -> TypeIs[MethodWrapperType]: ... - -def isroutine( - object: object, -) -> TypeIs[ - FunctionType - | LambdaType - | MethodType - | BuiltinFunctionType - | BuiltinMethodType - | WrapperDescriptorType - | MethodDescriptorType - | ClassMethodDescriptorType -]: ... -def ismethoddescriptor(object: object) -> TypeIs[MethodDescriptorType]: ... -def ismemberdescriptor(object: object) -> TypeIs[MemberDescriptorType]: ... -def isabstract(object: object) -> bool: ... -def isgetsetdescriptor(object: object) -> TypeIs[GetSetDescriptorType]: ... -def isdatadescriptor(object: object) -> TypeIs[_SupportsSet[Any, Any] | _SupportsDelete[Any]]: ... - -# -# Retrieving source code -# -_SourceObjectType: TypeAlias = ( - ModuleType | type[Any] | MethodType | FunctionType | TracebackType | FrameType | CodeType | Callable[..., Any] -) - -def findsource(object: _SourceObjectType) -> tuple[list[str], int]: ... -def getabsfile(object: _SourceObjectType, _filename: str | None = None) -> str: ... - -# Special-case the two most common input types here -# to avoid the annoyingly vague `Sequence[str]` return type -@overload -def getblock(lines: list[str]) -> list[str]: ... -@overload -def getblock(lines: tuple[str, ...]) -> tuple[str, ...]: ... -@overload -def getblock(lines: Sequence[str]) -> Sequence[str]: ... -def getdoc(object: object) -> str | None: ... -def getcomments(object: object) -> str | None: ... -def getfile(object: _SourceObjectType) -> str: ... -def getmodule(object: object, _filename: str | None = None) -> ModuleType | None: ... -def getsourcefile(object: _SourceObjectType) -> str | None: ... -def getsourcelines(object: _SourceObjectType) -> tuple[list[str], int]: ... -def getsource(object: _SourceObjectType) -> str: ... -def cleandoc(doc: str) -> str: ... -def indentsize(line: str) -> int: ... - -_IntrospectableCallable: TypeAlias = Callable[..., Any] - -# -# Introspecting callables with the Signature object -# -if sys.version_info >= (3, 10): - def signature( - obj: _IntrospectableCallable, - *, - follow_wrapped: bool = True, - globals: Mapping[str, Any] | None = None, - locals: Mapping[str, Any] | None = None, - eval_str: bool = False, - ) -> Signature: ... - -else: - def signature(obj: _IntrospectableCallable, *, follow_wrapped: bool = True) -> Signature: ... - -class _void: ... -class _empty: ... - -class Signature: - def __init__( - self, parameters: Sequence[Parameter] | None = None, *, return_annotation: Any = ..., __validate_parameters__: bool = True - ) -> None: ... - empty = _empty - @property - def parameters(self) -> types.MappingProxyType[str, Parameter]: ... - @property - def return_annotation(self) -> Any: ... - def bind(self, *args: Any, **kwargs: Any) -> BoundArguments: ... - def bind_partial(self, *args: Any, **kwargs: Any) -> BoundArguments: ... - def replace(self, *, parameters: Sequence[Parameter] | type[_void] | None = ..., return_annotation: Any = ...) -> Self: ... - __replace__ = replace - if sys.version_info >= (3, 10): - @classmethod - def from_callable( - cls, - obj: _IntrospectableCallable, - *, - follow_wrapped: bool = True, - globals: Mapping[str, Any] | None = None, - locals: Mapping[str, Any] | None = None, - eval_str: bool = False, - ) -> Self: ... - else: - @classmethod - def from_callable(cls, obj: _IntrospectableCallable, *, follow_wrapped: bool = True) -> Self: ... - if sys.version_info >= (3, 13): - def format(self, *, max_width: int | None = None) -> str: ... - - def __eq__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... - -if sys.version_info >= (3, 10): - def get_annotations( - obj: Callable[..., object] | type[object] | ModuleType, # any callable, class, or module - *, - globals: Mapping[str, Any] | None = None, # value types depend on the key - locals: Mapping[str, Any] | None = None, # value types depend on the key - eval_str: bool = False, - ) -> dict[str, Any]: ... # values are type expressions - -# The name is the same as the enum's name in CPython -class _ParameterKind(enum.IntEnum): - POSITIONAL_ONLY = 0 - POSITIONAL_OR_KEYWORD = 1 - VAR_POSITIONAL = 2 - KEYWORD_ONLY = 3 - VAR_KEYWORD = 4 - - @property - def description(self) -> str: ... - -if sys.version_info >= (3, 12): - AGEN_CREATED: Final = "AGEN_CREATED" - AGEN_RUNNING: Final = "AGEN_RUNNING" - AGEN_SUSPENDED: Final = "AGEN_SUSPENDED" - AGEN_CLOSED: Final = "AGEN_CLOSED" - - def getasyncgenstate( - agen: AsyncGenerator[Any, Any], - ) -> Literal["AGEN_CREATED", "AGEN_RUNNING", "AGEN_SUSPENDED", "AGEN_CLOSED"]: ... - def getasyncgenlocals(agen: AsyncGeneratorType[Any, Any]) -> dict[str, Any]: ... - -class Parameter: - def __init__(self, name: str, kind: _ParameterKind, *, default: Any = ..., annotation: Any = ...) -> None: ... - empty = _empty - - POSITIONAL_ONLY: ClassVar[Literal[_ParameterKind.POSITIONAL_ONLY]] - POSITIONAL_OR_KEYWORD: ClassVar[Literal[_ParameterKind.POSITIONAL_OR_KEYWORD]] - VAR_POSITIONAL: ClassVar[Literal[_ParameterKind.VAR_POSITIONAL]] - KEYWORD_ONLY: ClassVar[Literal[_ParameterKind.KEYWORD_ONLY]] - VAR_KEYWORD: ClassVar[Literal[_ParameterKind.VAR_KEYWORD]] - @property - def name(self) -> str: ... - @property - def default(self) -> Any: ... - @property - def kind(self) -> _ParameterKind: ... - @property - def annotation(self) -> Any: ... - def replace( - self, - *, - name: str | type[_void] = ..., - kind: _ParameterKind | type[_void] = ..., - default: Any = ..., - annotation: Any = ..., - ) -> Self: ... - if sys.version_info >= (3, 13): - __replace__ = replace - - def __eq__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... - -class BoundArguments: - arguments: OrderedDict[str, Any] - @property - def args(self) -> tuple[Any, ...]: ... - @property - def kwargs(self) -> dict[str, Any]: ... - @property - def signature(self) -> Signature: ... - def __init__(self, signature: Signature, arguments: OrderedDict[str, Any]) -> None: ... - def apply_defaults(self) -> None: ... - def __eq__(self, other: object) -> bool: ... - __hash__: ClassVar[None] # type: ignore[assignment] - -# -# Classes and functions -# - -_ClassTreeItem: TypeAlias = list[tuple[type, ...]] | list[_ClassTreeItem] - -def getclasstree(classes: list[type], unique: bool = False) -> _ClassTreeItem: ... -def walktree(classes: list[type], children: Mapping[type[Any], list[type]], parent: type[Any] | None) -> _ClassTreeItem: ... - -class Arguments(NamedTuple): - args: list[str] - varargs: str | None - varkw: str | None - -def getargs(co: CodeType) -> Arguments: ... - -if sys.version_info < (3, 11): - class ArgSpec(NamedTuple): - args: list[str] - varargs: str | None - keywords: str | None - defaults: tuple[Any, ...] - - def getargspec(func: object) -> ArgSpec: ... - -class FullArgSpec(NamedTuple): - args: list[str] - varargs: str | None - varkw: str | None - defaults: tuple[Any, ...] | None - kwonlyargs: list[str] - kwonlydefaults: dict[str, Any] | None - annotations: dict[str, Any] - -def getfullargspec(func: object) -> FullArgSpec: ... - -class ArgInfo(NamedTuple): - args: list[str] - varargs: str | None - keywords: str | None - locals: dict[str, Any] - -def getargvalues(frame: FrameType) -> ArgInfo: ... -def formatannotation(annotation: object, base_module: str | None = None) -> str: ... -def formatannotationrelativeto(object: object) -> Callable[[object], str]: ... - -if sys.version_info < (3, 11): - def formatargspec( - args: list[str], - varargs: str | None = None, - varkw: str | None = None, - defaults: tuple[Any, ...] | None = None, - kwonlyargs: Sequence[str] | None = (), - kwonlydefaults: Mapping[str, Any] | None = {}, - annotations: Mapping[str, Any] = {}, - formatarg: Callable[[str], str] = ..., - formatvarargs: Callable[[str], str] = ..., - formatvarkw: Callable[[str], str] = ..., - formatvalue: Callable[[Any], str] = ..., - formatreturns: Callable[[Any], str] = ..., - formatannotation: Callable[[Any], str] = ..., - ) -> str: ... - -def formatargvalues( - args: list[str], - varargs: str | None, - varkw: str | None, - locals: Mapping[str, Any] | None, - formatarg: Callable[[str], str] | None = ..., - formatvarargs: Callable[[str], str] | None = ..., - formatvarkw: Callable[[str], str] | None = ..., - formatvalue: Callable[[Any], str] | None = ..., -) -> str: ... -def getmro(cls: type) -> tuple[type, ...]: ... -def getcallargs(func: Callable[_P, Any], /, *args: _P.args, **kwds: _P.kwargs) -> dict[str, Any]: ... - -class ClosureVars(NamedTuple): - nonlocals: Mapping[str, Any] - globals: Mapping[str, Any] - builtins: Mapping[str, Any] - unbound: AbstractSet[str] - -def getclosurevars(func: _IntrospectableCallable) -> ClosureVars: ... -def unwrap(func: Callable[..., Any], *, stop: Callable[[Callable[..., Any]], Any] | None = None) -> Any: ... - -# -# The interpreter stack -# - -if sys.version_info >= (3, 11): - class _Traceback(NamedTuple): - filename: str - lineno: int - function: str - code_context: list[str] | None - index: int | None # type: ignore[assignment] - - class Traceback(_Traceback): - positions: dis.Positions | None - def __new__( - cls, - filename: str, - lineno: int, - function: str, - code_context: list[str] | None, - index: int | None, - *, - positions: dis.Positions | None = None, - ) -> Self: ... - - class _FrameInfo(NamedTuple): - frame: FrameType - filename: str - lineno: int - function: str - code_context: list[str] | None - index: int | None # type: ignore[assignment] - - class FrameInfo(_FrameInfo): - positions: dis.Positions | None - def __new__( - cls, - frame: FrameType, - filename: str, - lineno: int, - function: str, - code_context: list[str] | None, - index: int | None, - *, - positions: dis.Positions | None = None, - ) -> Self: ... - -else: - class Traceback(NamedTuple): - filename: str - lineno: int - function: str - code_context: list[str] | None - index: int | None # type: ignore[assignment] - - class FrameInfo(NamedTuple): - frame: FrameType - filename: str - lineno: int - function: str - code_context: list[str] | None - index: int | None # type: ignore[assignment] - -def getframeinfo(frame: FrameType | TracebackType, context: int = 1) -> Traceback: ... -def getouterframes(frame: Any, context: int = 1) -> list[FrameInfo]: ... -def getinnerframes(tb: TracebackType, context: int = 1) -> list[FrameInfo]: ... -def getlineno(frame: FrameType) -> int: ... -def currentframe() -> FrameType | None: ... -def stack(context: int = 1) -> list[FrameInfo]: ... -def trace(context: int = 1) -> list[FrameInfo]: ... - -# -# Fetching attributes statically -# - -def getattr_static(obj: object, attr: str, default: Any | None = ...) -> Any: ... - -# -# Current State of Generators and Coroutines -# - -GEN_CREATED: Final = "GEN_CREATED" -GEN_RUNNING: Final = "GEN_RUNNING" -GEN_SUSPENDED: Final = "GEN_SUSPENDED" -GEN_CLOSED: Final = "GEN_CLOSED" - -def getgeneratorstate( - generator: Generator[Any, Any, Any], -) -> Literal["GEN_CREATED", "GEN_RUNNING", "GEN_SUSPENDED", "GEN_CLOSED"]: ... - -CORO_CREATED: Final = "CORO_CREATED" -CORO_RUNNING: Final = "CORO_RUNNING" -CORO_SUSPENDED: Final = "CORO_SUSPENDED" -CORO_CLOSED: Final = "CORO_CLOSED" - -def getcoroutinestate( - coroutine: Coroutine[Any, Any, Any], -) -> Literal["CORO_CREATED", "CORO_RUNNING", "CORO_SUSPENDED", "CORO_CLOSED"]: ... -def getgeneratorlocals(generator: Generator[Any, Any, Any]) -> dict[str, Any]: ... -def getcoroutinelocals(coroutine: Coroutine[Any, Any, Any]) -> dict[str, Any]: ... - -# Create private type alias to avoid conflict with symbol of same -# name created in Attribute class. -_Object: TypeAlias = object - -class Attribute(NamedTuple): - name: str - kind: Literal["class method", "static method", "property", "method", "data"] - defining_class: type - object: _Object - -def classify_class_attrs(cls: type) -> list[Attribute]: ... - -class ClassFoundException(Exception): ... - -if sys.version_info >= (3, 12): - class BufferFlags(enum.IntFlag): - SIMPLE = 0 - WRITABLE = 1 - FORMAT = 4 - ND = 8 - STRIDES = 24 - C_CONTIGUOUS = 56 - F_CONTIGUOUS = 88 - ANY_CONTIGUOUS = 152 - INDIRECT = 280 - CONTIG = 9 - CONTIG_RO = 8 - STRIDED = 25 - STRIDED_RO = 24 - RECORDS = 29 - RECORDS_RO = 28 - FULL = 285 - FULL_RO = 284 - READ = 256 - WRITE = 512 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/io.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/io.pyi deleted file mode 100644 index 5c26cb245a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/io.pyi +++ /dev/null @@ -1,60 +0,0 @@ -import abc -import sys -from _io import ( - DEFAULT_BUFFER_SIZE as DEFAULT_BUFFER_SIZE, - BlockingIOError as BlockingIOError, - BufferedRandom as BufferedRandom, - BufferedReader as BufferedReader, - BufferedRWPair as BufferedRWPair, - BufferedWriter as BufferedWriter, - BytesIO as BytesIO, - FileIO as FileIO, - IncrementalNewlineDecoder as IncrementalNewlineDecoder, - StringIO as StringIO, - TextIOWrapper as TextIOWrapper, - _BufferedIOBase, - _IOBase, - _RawIOBase, - _TextIOBase, - _WrappedBuffer as _WrappedBuffer, # used elsewhere in typeshed - open as open, - open_code as open_code, -) -from typing import Final - -__all__ = [ - "BlockingIOError", - "open", - "open_code", - "IOBase", - "RawIOBase", - "FileIO", - "BytesIO", - "StringIO", - "BufferedIOBase", - "BufferedReader", - "BufferedWriter", - "BufferedRWPair", - "BufferedRandom", - "TextIOBase", - "TextIOWrapper", - "UnsupportedOperation", - "SEEK_SET", - "SEEK_CUR", - "SEEK_END", -] - -if sys.version_info >= (3, 11): - from _io import text_encoding as text_encoding - - __all__ += ["DEFAULT_BUFFER_SIZE", "IncrementalNewlineDecoder", "text_encoding"] - -SEEK_SET: Final = 0 -SEEK_CUR: Final = 1 -SEEK_END: Final = 2 - -class UnsupportedOperation(OSError, ValueError): ... -class IOBase(_IOBase, metaclass=abc.ABCMeta): ... -class RawIOBase(_RawIOBase, IOBase): ... -class BufferedIOBase(_BufferedIOBase, IOBase): ... -class TextIOBase(_TextIOBase, IOBase): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ipaddress.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ipaddress.pyi deleted file mode 100644 index 6883895fd2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ipaddress.pyi +++ /dev/null @@ -1,232 +0,0 @@ -import sys -from collections.abc import Iterable, Iterator -from typing import Any, Final, Generic, Literal, TypeVar, overload -from typing_extensions import Self, TypeAlias - -# Undocumented length constants -IPV4LENGTH: Final = 32 -IPV6LENGTH: Final = 128 - -_A = TypeVar("_A", IPv4Address, IPv6Address) -_N = TypeVar("_N", IPv4Network, IPv6Network) - -_RawIPAddress: TypeAlias = int | str | bytes | IPv4Address | IPv6Address -_RawNetworkPart: TypeAlias = IPv4Network | IPv6Network | IPv4Interface | IPv6Interface - -def ip_address(address: _RawIPAddress) -> IPv4Address | IPv6Address: ... -def ip_network( - address: _RawIPAddress | _RawNetworkPart | tuple[_RawIPAddress] | tuple[_RawIPAddress, int], strict: bool = True -) -> IPv4Network | IPv6Network: ... -def ip_interface( - address: _RawIPAddress | _RawNetworkPart | tuple[_RawIPAddress] | tuple[_RawIPAddress, int], -) -> IPv4Interface | IPv6Interface: ... - -class _IPAddressBase: - @property - def compressed(self) -> str: ... - @property - def exploded(self) -> str: ... - @property - def reverse_pointer(self) -> str: ... - @property - def version(self) -> int: ... - -class _BaseAddress(_IPAddressBase): - def __add__(self, other: int) -> Self: ... - def __hash__(self) -> int: ... - def __int__(self) -> int: ... - def __sub__(self, other: int) -> Self: ... - def __format__(self, fmt: str) -> str: ... - def __eq__(self, other: object) -> bool: ... - def __lt__(self, other: Self) -> bool: ... - if sys.version_info >= (3, 11): - def __ge__(self, other: Self) -> bool: ... - def __gt__(self, other: Self) -> bool: ... - def __le__(self, other: Self) -> bool: ... - else: - def __ge__(self, other: Self, NotImplemented: Any = ...) -> bool: ... - def __gt__(self, other: Self, NotImplemented: Any = ...) -> bool: ... - def __le__(self, other: Self, NotImplemented: Any = ...) -> bool: ... - -class _BaseNetwork(_IPAddressBase, Generic[_A]): - network_address: _A - netmask: _A - def __contains__(self, other: Any) -> bool: ... - 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: ... - def __gt__(self, other: Self) -> bool: ... - def __le__(self, other: Self) -> bool: ... - else: - def __ge__(self, other: Self, NotImplemented: Any = ...) -> bool: ... - def __gt__(self, other: Self, NotImplemented: Any = ...) -> bool: ... - def __le__(self, other: Self, NotImplemented: Any = ...) -> bool: ... - - def address_exclude(self, other: Self) -> Iterator[Self]: ... - @property - def broadcast_address(self) -> _A: ... - def compare_networks(self, other: Self) -> int: ... - def hosts(self) -> Iterator[_A]: ... - @property - def is_global(self) -> bool: ... - @property - def is_link_local(self) -> bool: ... - @property - def is_loopback(self) -> bool: ... - @property - def is_multicast(self) -> bool: ... - @property - def is_private(self) -> bool: ... - @property - def is_reserved(self) -> bool: ... - @property - def is_unspecified(self) -> bool: ... - @property - def num_addresses(self) -> int: ... - def overlaps(self, other: _BaseNetwork[IPv4Address] | _BaseNetwork[IPv6Address]) -> bool: ... - @property - def prefixlen(self) -> int: ... - def subnet_of(self, other: Self) -> bool: ... - def supernet_of(self, other: Self) -> bool: ... - def subnets(self, prefixlen_diff: int = 1, new_prefix: int | None = None) -> Iterator[Self]: ... - def supernet(self, prefixlen_diff: int = 1, new_prefix: int | None = None) -> Self: ... - @property - def with_hostmask(self) -> str: ... - @property - def with_netmask(self) -> str: ... - @property - def with_prefixlen(self) -> str: ... - @property - def hostmask(self) -> _A: ... - -class _BaseV4: - @property - def version(self) -> Literal[4]: ... - @property - def max_prefixlen(self) -> Literal[32]: ... - -class IPv4Address(_BaseV4, _BaseAddress): - def __init__(self, address: object) -> None: ... - @property - def is_global(self) -> bool: ... - @property - def is_link_local(self) -> bool: ... - @property - def is_loopback(self) -> bool: ... - @property - def is_multicast(self) -> bool: ... - @property - def is_private(self) -> bool: ... - @property - def is_reserved(self) -> bool: ... - @property - def is_unspecified(self) -> bool: ... - @property - def packed(self) -> bytes: ... - if sys.version_info >= (3, 13): - @property - def ipv6_mapped(self) -> IPv6Address: ... - -class IPv4Network(_BaseV4, _BaseNetwork[IPv4Address]): - def __init__(self, address: object, strict: bool = ...) -> None: ... - -class IPv4Interface(IPv4Address): - netmask: IPv4Address - network: IPv4Network - def __eq__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... - @property - def hostmask(self) -> IPv4Address: ... - @property - def ip(self) -> IPv4Address: ... - @property - def with_hostmask(self) -> str: ... - @property - def with_netmask(self) -> str: ... - @property - def with_prefixlen(self) -> str: ... - -class _BaseV6: - @property - def version(self) -> Literal[6]: ... - @property - def max_prefixlen(self) -> Literal[128]: ... - -class IPv6Address(_BaseV6, _BaseAddress): - def __init__(self, address: object) -> None: ... - @property - def is_global(self) -> bool: ... - @property - def is_link_local(self) -> bool: ... - @property - def is_loopback(self) -> bool: ... - @property - def is_multicast(self) -> bool: ... - @property - def is_private(self) -> bool: ... - @property - def is_reserved(self) -> bool: ... - @property - def is_unspecified(self) -> bool: ... - @property - def packed(self) -> bytes: ... - @property - def ipv4_mapped(self) -> IPv4Address | None: ... - @property - def is_site_local(self) -> bool: ... - @property - def sixtofour(self) -> IPv4Address | None: ... - @property - def teredo(self) -> tuple[IPv4Address, IPv4Address] | None: ... - @property - def scope_id(self) -> str | None: ... - def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: ... - -class IPv6Network(_BaseV6, _BaseNetwork[IPv6Address]): - def __init__(self, address: object, strict: bool = ...) -> None: ... - @property - def is_site_local(self) -> bool: ... - -class IPv6Interface(IPv6Address): - netmask: IPv6Address - network: IPv6Network - def __eq__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... - @property - def hostmask(self) -> IPv6Address: ... - @property - def ip(self) -> IPv6Address: ... - @property - def with_hostmask(self) -> str: ... - @property - def with_netmask(self) -> str: ... - @property - def with_prefixlen(self) -> str: ... - -def v4_int_to_packed(address: int) -> bytes: ... -def v6_int_to_packed(address: int) -> bytes: ... - -# Third overload is technically incorrect, but convenient when first and last are return values of ip_address() -@overload -def summarize_address_range(first: IPv4Address, last: IPv4Address) -> Iterator[IPv4Network]: ... -@overload -def summarize_address_range(first: IPv6Address, last: IPv6Address) -> Iterator[IPv6Network]: ... -@overload -def summarize_address_range( - first: IPv4Address | IPv6Address, last: IPv4Address | IPv6Address -) -> Iterator[IPv4Network] | Iterator[IPv6Network]: ... -def collapse_addresses(addresses: Iterable[_N]) -> Iterator[_N]: ... -@overload -def get_mixed_type_key(obj: _A) -> tuple[int, _A]: ... -@overload -def get_mixed_type_key(obj: IPv4Network) -> tuple[int, IPv4Address, IPv4Address]: ... -@overload -def get_mixed_type_key(obj: IPv6Network) -> tuple[int, IPv6Address, IPv6Address]: ... - -class AddressValueError(ValueError): ... -class NetmaskValueError(ValueError): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/itertools.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/itertools.pyi deleted file mode 100644 index d0085dd722..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/itertools.pyi +++ /dev/null @@ -1,333 +0,0 @@ -import sys -from _typeshed import MaybeNone -from collections.abc import Callable, Iterable, Iterator -from types import GenericAlias -from typing import Any, Generic, Literal, SupportsComplex, SupportsFloat, SupportsIndex, SupportsInt, TypeVar, overload -from typing_extensions import Self, TypeAlias - -_T = TypeVar("_T") -_S = TypeVar("_S") -_N = TypeVar("_N", int, float, SupportsFloat, SupportsInt, SupportsIndex, SupportsComplex) -_T_co = TypeVar("_T_co", covariant=True) -_S_co = TypeVar("_S_co", covariant=True) -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") -_T3 = TypeVar("_T3") -_T4 = TypeVar("_T4") -_T5 = TypeVar("_T5") -_T6 = TypeVar("_T6") -_T7 = TypeVar("_T7") -_T8 = TypeVar("_T8") -_T9 = TypeVar("_T9") -_T10 = TypeVar("_T10") - -_Step: TypeAlias = SupportsFloat | SupportsInt | SupportsIndex | SupportsComplex - -_Predicate: TypeAlias = Callable[[_T], object] - -# Technically count can take anything that implements a number protocol and has an add method -# but we can't enforce the add method -class count(Generic[_N]): - @overload - def __new__(cls) -> count[int]: ... - @overload - def __new__(cls, start: _N, step: _Step = ...) -> count[_N]: ... - @overload - def __new__(cls, *, step: _N) -> count[_N]: ... - def __next__(self) -> _N: ... - def __iter__(self) -> Self: ... - -class cycle(Generic[_T]): - def __new__(cls, iterable: Iterable[_T], /) -> Self: ... - def __next__(self) -> _T: ... - def __iter__(self) -> Self: ... - -class repeat(Generic[_T]): - @overload - def __new__(cls, object: _T) -> Self: ... - @overload - def __new__(cls, object: _T, times: int) -> Self: ... - def __next__(self) -> _T: ... - def __iter__(self) -> Self: ... - def __length_hint__(self) -> int: ... - -class accumulate(Generic[_T]): - @overload - def __new__(cls, iterable: Iterable[_T], func: None = None, *, initial: _T | None = ...) -> Self: ... - @overload - def __new__(cls, iterable: Iterable[_S], func: Callable[[_T, _S], _T], *, initial: _T | None = ...) -> Self: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T: ... - -class chain(Generic[_T]): - def __new__(cls, *iterables: Iterable[_T]) -> Self: ... - def __next__(self) -> _T: ... - def __iter__(self) -> Self: ... - @classmethod - # We use type[Any] and not type[_S] to not lose the type inference from __iterable - def from_iterable(cls: type[Any], iterable: Iterable[Iterable[_S]], /) -> chain[_S]: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class compress(Generic[_T]): - def __new__(cls, data: Iterable[_T], selectors: Iterable[Any]) -> Self: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T: ... - -class dropwhile(Generic[_T]): - def __new__(cls, predicate: _Predicate[_T], iterable: Iterable[_T], /) -> Self: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T: ... - -class filterfalse(Generic[_T]): - def __new__(cls, function: _Predicate[_T] | None, iterable: Iterable[_T], /) -> Self: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T: ... - -class groupby(Generic[_T_co, _S_co]): - @overload - def __new__(cls, iterable: Iterable[_T1], key: None = None) -> groupby[_T1, _T1]: ... - @overload - def __new__(cls, iterable: Iterable[_T1], key: Callable[[_T1], _T2]) -> groupby[_T2, _T1]: ... - def __iter__(self) -> Self: ... - def __next__(self) -> tuple[_T_co, Iterator[_S_co]]: ... - -class islice(Generic[_T]): - @overload - def __new__(cls, iterable: Iterable[_T], stop: int | None, /) -> Self: ... - @overload - def __new__(cls, iterable: Iterable[_T], start: int | None, stop: int | None, step: int | None = ..., /) -> Self: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T: ... - -class starmap(Generic[_T_co]): - def __new__(cls, function: Callable[..., _T], iterable: Iterable[Iterable[Any]], /) -> starmap[_T]: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T_co: ... - -class takewhile(Generic[_T]): - def __new__(cls, predicate: _Predicate[_T], iterable: Iterable[_T], /) -> Self: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T: ... - -def tee(iterable: Iterable[_T], n: int = 2, /) -> tuple[Iterator[_T], ...]: ... - -class zip_longest(Generic[_T_co]): - # one iterable (fillvalue doesn't matter) - @overload - def __new__(cls, iter1: Iterable[_T1], /, *, fillvalue: object = ...) -> zip_longest[tuple[_T1]]: ... - # two iterables - @overload - # In the overloads without fillvalue, all of the tuple members could theoretically be None, - # but we return Any instead to avoid false positives for code where we know one of the iterables - # is longer. - def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], /) -> zip_longest[tuple[_T1 | MaybeNone, _T2 | MaybeNone]]: ... - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], /, *, fillvalue: _T - ) -> zip_longest[tuple[_T1 | _T, _T2 | _T]]: ... - # three iterables - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], / - ) -> zip_longest[tuple[_T1 | MaybeNone, _T2 | MaybeNone, _T3 | MaybeNone]]: ... - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /, *, fillvalue: _T - ) -> zip_longest[tuple[_T1 | _T, _T2 | _T, _T3 | _T]]: ... - # four iterables - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], / - ) -> zip_longest[tuple[_T1 | MaybeNone, _T2 | MaybeNone, _T3 | MaybeNone, _T4 | MaybeNone]]: ... - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], /, *, fillvalue: _T - ) -> zip_longest[tuple[_T1 | _T, _T2 | _T, _T3 | _T, _T4 | _T]]: ... - # five iterables - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], / - ) -> zip_longest[tuple[_T1 | MaybeNone, _T2 | MaybeNone, _T3 | MaybeNone, _T4 | MaybeNone, _T5 | MaybeNone]]: ... - @overload - def __new__( - cls, - iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5], - /, - *, - fillvalue: _T, - ) -> zip_longest[tuple[_T1 | _T, _T2 | _T, _T3 | _T, _T4 | _T, _T5 | _T]]: ... - # six or more iterables - @overload - def __new__( - cls, - iter1: Iterable[_T], - iter2: Iterable[_T], - iter3: Iterable[_T], - iter4: Iterable[_T], - iter5: Iterable[_T], - iter6: Iterable[_T], - /, - *iterables: Iterable[_T], - ) -> zip_longest[tuple[_T | MaybeNone, ...]]: ... - @overload - def __new__( - cls, - iter1: Iterable[_T], - iter2: Iterable[_T], - iter3: Iterable[_T], - iter4: Iterable[_T], - iter5: Iterable[_T], - iter6: Iterable[_T], - /, - *iterables: Iterable[_T], - fillvalue: _T, - ) -> zip_longest[tuple[_T, ...]]: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T_co: ... - -class product(Generic[_T_co]): - @overload - def __new__(cls, iter1: Iterable[_T1], /) -> product[tuple[_T1]]: ... - @overload - def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], /) -> product[tuple[_T1, _T2]]: ... - @overload - def __new__(cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], /) -> product[tuple[_T1, _T2, _T3]]: ... - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], / - ) -> product[tuple[_T1, _T2, _T3, _T4]]: ... - @overload - def __new__( - cls, iter1: Iterable[_T1], iter2: Iterable[_T2], iter3: Iterable[_T3], iter4: Iterable[_T4], iter5: Iterable[_T5], / - ) -> product[tuple[_T1, _T2, _T3, _T4, _T5]]: ... - @overload - def __new__( - cls, - iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5], - iter6: Iterable[_T6], - /, - ) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ... - @overload - def __new__( - cls, - iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5], - iter6: Iterable[_T6], - iter7: Iterable[_T7], - /, - ) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6, _T7]]: ... - @overload - def __new__( - cls, - iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5], - iter6: Iterable[_T6], - iter7: Iterable[_T7], - iter8: Iterable[_T8], - /, - ) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8]]: ... - @overload - def __new__( - cls, - iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5], - iter6: Iterable[_T6], - iter7: Iterable[_T7], - iter8: Iterable[_T8], - iter9: Iterable[_T9], - /, - ) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9]]: ... - @overload - def __new__( - cls, - iter1: Iterable[_T1], - iter2: Iterable[_T2], - iter3: Iterable[_T3], - iter4: Iterable[_T4], - iter5: Iterable[_T5], - iter6: Iterable[_T6], - iter7: Iterable[_T7], - iter8: Iterable[_T8], - iter9: Iterable[_T9], - iter10: Iterable[_T10], - /, - ) -> product[tuple[_T1, _T2, _T3, _T4, _T5, _T6, _T7, _T8, _T9, _T10]]: ... - @overload - def __new__(cls, *iterables: Iterable[_T1], repeat: int = 1) -> product[tuple[_T1, ...]]: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T_co: ... - -class permutations(Generic[_T_co]): - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[2]) -> permutations[tuple[_T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[3]) -> permutations[tuple[_T, _T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[4]) -> permutations[tuple[_T, _T, _T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[5]) -> permutations[tuple[_T, _T, _T, _T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: int | None = ...) -> permutations[tuple[_T, ...]]: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T_co: ... - -class combinations(Generic[_T_co]): - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[2]) -> combinations[tuple[_T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[3]) -> combinations[tuple[_T, _T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[4]) -> combinations[tuple[_T, _T, _T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[5]) -> combinations[tuple[_T, _T, _T, _T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: int) -> combinations[tuple[_T, ...]]: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T_co: ... - -class combinations_with_replacement(Generic[_T_co]): - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[2]) -> combinations_with_replacement[tuple[_T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[3]) -> combinations_with_replacement[tuple[_T, _T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[4]) -> combinations_with_replacement[tuple[_T, _T, _T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: Literal[5]) -> combinations_with_replacement[tuple[_T, _T, _T, _T, _T]]: ... - @overload - def __new__(cls, iterable: Iterable[_T], r: int) -> combinations_with_replacement[tuple[_T, ...]]: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T_co: ... - -if sys.version_info >= (3, 10): - class pairwise(Generic[_T_co]): - def __new__(cls, iterable: Iterable[_T], /) -> pairwise[tuple[_T, _T]]: ... - def __iter__(self) -> Self: ... - def __next__(self) -> _T_co: ... - -if sys.version_info >= (3, 12): - class batched(Generic[_T_co]): - if sys.version_info >= (3, 13): - def __new__(cls, iterable: Iterable[_T_co], n: int, *, strict: bool = False) -> Self: ... - else: - def __new__(cls, iterable: Iterable[_T_co], n: int) -> Self: ... - - def __iter__(self) -> Self: ... - def __next__(self) -> tuple[_T_co, ...]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/json/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/json/__init__.pyi deleted file mode 100644 index 63e9718ee1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/json/__init__.pyi +++ /dev/null @@ -1,61 +0,0 @@ -from _typeshed import SupportsRead, SupportsWrite -from collections.abc import Callable -from typing import Any - -from .decoder import JSONDecodeError as JSONDecodeError, JSONDecoder as JSONDecoder -from .encoder import JSONEncoder as JSONEncoder - -__all__ = ["dump", "dumps", "load", "loads", "JSONDecoder", "JSONDecodeError", "JSONEncoder"] - -def dumps( - obj: Any, - *, - skipkeys: bool = False, - ensure_ascii: bool = True, - check_circular: bool = True, - allow_nan: bool = True, - cls: type[JSONEncoder] | None = None, - indent: None | int | str = None, - separators: tuple[str, str] | None = None, - default: Callable[[Any], Any] | None = None, - sort_keys: bool = False, - **kwds: Any, -) -> str: ... -def dump( - obj: Any, - fp: SupportsWrite[str], - *, - skipkeys: bool = False, - ensure_ascii: bool = True, - check_circular: bool = True, - allow_nan: bool = True, - cls: type[JSONEncoder] | None = None, - indent: None | int | str = None, - separators: tuple[str, str] | None = None, - default: Callable[[Any], Any] | None = None, - sort_keys: bool = False, - **kwds: Any, -) -> None: ... -def loads( - s: str | bytes | bytearray, - *, - cls: type[JSONDecoder] | None = None, - object_hook: Callable[[dict[Any, Any]], Any] | None = None, - parse_float: Callable[[str], Any] | None = None, - parse_int: Callable[[str], Any] | None = None, - parse_constant: Callable[[str], Any] | None = None, - object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None, - **kwds: Any, -) -> Any: ... -def load( - fp: SupportsRead[str | bytes], - *, - cls: type[JSONDecoder] | None = None, - object_hook: Callable[[dict[Any, Any]], Any] | None = None, - parse_float: Callable[[str], Any] | None = None, - parse_int: Callable[[str], Any] | None = None, - parse_constant: Callable[[str], Any] | None = None, - object_pairs_hook: Callable[[list[tuple[Any, Any]]], Any] | None = None, - **kwds: Any, -) -> Any: ... -def detect_encoding(b: bytes | bytearray) -> str: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/json/decoder.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/json/decoder.pyi deleted file mode 100644 index 8debfe6cd6..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/json/decoder.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from collections.abc import Callable -from typing import Any - -__all__ = ["JSONDecoder", "JSONDecodeError"] - -class JSONDecodeError(ValueError): - msg: str - doc: str - pos: int - lineno: int - colno: int - def __init__(self, msg: str, doc: str, pos: int) -> None: ... - -class JSONDecoder: - object_hook: Callable[[dict[str, Any]], Any] - parse_float: Callable[[str], Any] - parse_int: Callable[[str], Any] - parse_constant: Callable[[str], Any] - strict: bool - object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] - def __init__( - self, - *, - object_hook: Callable[[dict[str, Any]], Any] | None = None, - parse_float: Callable[[str], Any] | None = None, - parse_int: Callable[[str], Any] | None = None, - parse_constant: Callable[[str], Any] | None = None, - strict: bool = True, - object_pairs_hook: Callable[[list[tuple[str, Any]]], Any] | None = None, - ) -> None: ... - def decode(self, s: str, _w: Callable[..., Any] = ...) -> Any: ... # _w is undocumented - def raw_decode(self, s: str, idx: int = 0) -> tuple[Any, int]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/json/encoder.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/json/encoder.pyi deleted file mode 100644 index 83b78666d4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/json/encoder.pyi +++ /dev/null @@ -1,40 +0,0 @@ -from collections.abc import Callable, Iterator -from re import Pattern -from typing import Any, Final - -ESCAPE: Final[Pattern[str]] # undocumented -ESCAPE_ASCII: Final[Pattern[str]] # undocumented -HAS_UTF8: Final[Pattern[bytes]] # undocumented -ESCAPE_DCT: Final[dict[str, str]] # undocumented -INFINITY: Final[float] # undocumented - -def py_encode_basestring(s: str) -> str: ... # undocumented -def py_encode_basestring_ascii(s: str) -> str: ... # undocumented -def encode_basestring(s: str, /) -> str: ... # undocumented -def encode_basestring_ascii(s: str, /) -> str: ... # undocumented - -class JSONEncoder: - item_separator: str - key_separator: str - - skipkeys: bool - ensure_ascii: bool - check_circular: bool - allow_nan: bool - sort_keys: bool - indent: int | str - def __init__( - self, - *, - skipkeys: bool = False, - ensure_ascii: bool = True, - check_circular: bool = True, - allow_nan: bool = True, - sort_keys: bool = False, - indent: int | str | None = None, - separators: tuple[str, str] | None = None, - default: Callable[..., Any] | None = None, - ) -> None: ... - def default(self, o: Any) -> Any: ... - def encode(self, o: Any) -> str: ... - def iterencode(self, o: Any, _one_shot: bool = False) -> Iterator[str]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/json/scanner.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/json/scanner.pyi deleted file mode 100644 index 68b42e92d2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/json/scanner.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from _json import make_scanner as make_scanner -from re import Pattern -from typing import Final - -__all__ = ["make_scanner"] - -NUMBER_RE: Final[Pattern[str]] # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/json/tool.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/json/tool.pyi deleted file mode 100644 index 7e7363e797..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/json/tool.pyi +++ /dev/null @@ -1 +0,0 @@ -def main() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/keyword.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/keyword.pyi deleted file mode 100644 index 6b8bdad6be..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/keyword.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from collections.abc import Sequence -from typing import Final - -__all__ = ["iskeyword", "issoftkeyword", "kwlist", "softkwlist"] - -def iskeyword(s: str, /) -> bool: ... - -# a list at runtime, but you're not meant to mutate it; -# type it as a sequence -kwlist: Final[Sequence[str]] - -def issoftkeyword(s: str, /) -> bool: ... - -# a list at runtime, but you're not meant to mutate it; -# type it as a sequence -softkwlist: Final[Sequence[str]] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/__init__.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/btm_matcher.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/btm_matcher.pyi deleted file mode 100644 index 4c87b664eb..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/btm_matcher.pyi +++ /dev/null @@ -1,28 +0,0 @@ -from _typeshed import Incomplete, SupportsGetItem -from collections import defaultdict -from collections.abc import Iterable - -from .fixer_base import BaseFix -from .pytree import Leaf, Node - -class BMNode: - count: Incomplete - transition_table: Incomplete - fixers: Incomplete - id: Incomplete - content: str - def __init__(self) -> None: ... - -class BottomMatcher: - match: Incomplete - root: Incomplete - nodes: Incomplete - fixers: Incomplete - logger: Incomplete - def __init__(self) -> None: ... - def add_fixer(self, fixer: BaseFix) -> None: ... - def add(self, pattern: SupportsGetItem[int | slice, Incomplete] | None, start: BMNode) -> list[BMNode]: ... - def run(self, leaves: Iterable[Leaf]) -> defaultdict[BaseFix, list[Node | Leaf]]: ... - def print_ac(self) -> None: ... - -def type_repr(type_num: int) -> str | int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixer_base.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixer_base.pyi deleted file mode 100644 index 06813c9430..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixer_base.pyi +++ /dev/null @@ -1,42 +0,0 @@ -from _typeshed import Incomplete, StrPath -from abc import ABCMeta, abstractmethod -from collections.abc import MutableMapping -from typing import ClassVar, Literal, TypeVar - -from .pytree import Base, Leaf, Node - -_N = TypeVar("_N", bound=Base) - -class BaseFix: - PATTERN: ClassVar[str | None] - pattern: Incomplete | None - pattern_tree: Incomplete | None - options: Incomplete | None - filename: Incomplete | None - numbers: Incomplete - used_names: Incomplete - order: ClassVar[Literal["post", "pre"]] - explicit: ClassVar[bool] - run_order: ClassVar[int] - keep_line_order: ClassVar[bool] - BM_compatible: ClassVar[bool] - syms: Incomplete - log: Incomplete - def __init__(self, options: MutableMapping[str, Incomplete], log: list[str]) -> None: ... - def compile_pattern(self) -> None: ... - def set_filename(self, filename: StrPath) -> None: ... - def match(self, node: _N) -> Literal[False] | dict[str, _N]: ... - @abstractmethod - def transform(self, node: Base, results: dict[str, Base]) -> Node | Leaf | None: ... - def new_name(self, template: str = "xxx_todo_changeme") -> str: ... - first_log: bool - def log_message(self, message: str) -> None: ... - def cannot_convert(self, node: Base, reason: str | None = None) -> None: ... - def warning(self, node: Base, reason: str) -> None: ... - def start_tree(self, tree: Node, filename: StrPath) -> None: ... - def finish_tree(self, tree: Node, filename: StrPath) -> None: ... - -class ConditionalFix(BaseFix, metaclass=ABCMeta): - skip_on: ClassVar[str | None] - def start_tree(self, tree: Node, filename: StrPath, /) -> None: ... - def should_skip(self, node: Base) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/__init__.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi deleted file mode 100644 index e53e3dd864..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixApply(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi deleted file mode 100644 index 1bf7db2f76..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from typing import ClassVar, Final, Literal - -from ..fixer_base import BaseFix - -NAMES: Final[dict[str, str]] - -class FixAsserts(BaseFix): - BM_compatible: ClassVar[Literal[False]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi deleted file mode 100644 index 8ed5ccaa7f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixBasestring(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[Literal["'basestring'"]] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi deleted file mode 100644 index 1efca6228e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixBuffer(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi deleted file mode 100644 index 08c54c3bc3..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar, Literal - -from .. import fixer_base - -iter_exempt: set[str] - -class FixDict(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... - P1: ClassVar[str] - p1: ClassVar[Incomplete] - P2: ClassVar[str] - p2: ClassVar[Incomplete] - def in_special_context(self, node, isiter): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_except.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_except.pyi deleted file mode 100644 index 30930a2c38..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from collections.abc import Generator, Iterable -from typing import ClassVar, Literal, TypeVar - -from .. import fixer_base -from ..pytree import Base - -_N = TypeVar("_N", bound=Base) - -def find_excepts(nodes: Iterable[_N]) -> Generator[tuple[_N, _N], None, None]: ... - -class FixExcept(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi deleted file mode 100644 index 71e2a820a5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixExec(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi deleted file mode 100644 index 8122a6389b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixExecfile(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi deleted file mode 100644 index 7fc910c0a1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from _typeshed import Incomplete, StrPath -from lib2to3 import fixer_base -from typing import ClassVar, Literal - -from ..pytree import Node - -class FixExitfunc(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def __init__(self, *args) -> None: ... - sys_import: Incomplete | None - def start_tree(self, tree: Node, filename: StrPath) -> None: ... - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi deleted file mode 100644 index 638889be8b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixFilter(fixer_base.ConditionalFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - skip_on: ClassVar[Literal["future_builtins.filter"]] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi deleted file mode 100644 index 60487bb1f2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixFuncattrs(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_future.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_future.pyi deleted file mode 100644 index 12ed93f212..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixFuture(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi deleted file mode 100644 index aa3ccf50be..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixGetcwdu(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi deleted file mode 100644 index f6f5a072e2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixHasKey(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi deleted file mode 100644 index 6b2723d09d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from typing import ClassVar, Final, Literal - -from .. import fixer_base - -CMP: Final[str] -TYPE: Final[str] - -class FixIdioms(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[False]] - PATTERN: ClassVar[str] - def match(self, node): ... - def transform(self, node, results): ... - def transform_isinstance(self, node, results): ... - def transform_while(self, node, results) -> None: ... - def transform_sort(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_import.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_import.pyi deleted file mode 100644 index bf4b2d0092..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from _typeshed import StrPath -from collections.abc import Generator -from typing import ClassVar, Literal - -from .. import fixer_base -from ..pytree import Node - -def traverse_imports(names) -> Generator[str, None, None]: ... - -class FixImport(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - skip: bool - def start_tree(self, tree: Node, name: StrPath) -> None: ... - def transform(self, node, results): ... - def probably_a_local_import(self, imp_name): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi deleted file mode 100644 index c747af529f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +++ /dev/null @@ -1,21 +0,0 @@ -from _typeshed import StrPath -from collections.abc import Generator -from typing import ClassVar, Final, Literal - -from .. import fixer_base -from ..pytree import Node - -MAPPING: Final[dict[str, str]] - -def alternates(members): ... -def build_pattern(mapping=...) -> Generator[str, None, None]: ... - -class FixImports(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - mapping = MAPPING - def build_pattern(self): ... - def compile_pattern(self) -> None: ... - def match(self, node): ... - replace: dict[str, str] - def start_tree(self, tree: Node, filename: StrPath) -> None: ... - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi deleted file mode 100644 index 618ecd0424..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import Final - -from . import fix_imports - -MAPPING: Final[dict[str, str]] - -class FixImports2(fix_imports.FixImports): - mapping = MAPPING diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_input.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_input.pyi deleted file mode 100644 index fc1279535b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar, Literal - -from .. import fixer_base - -context: Incomplete - -class FixInput(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi deleted file mode 100644 index 804b7b2517..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixIntern(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - order: ClassVar[Literal["pre"]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi deleted file mode 100644 index 31eefd6253..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixIsinstance(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi deleted file mode 100644 index 229d86ee71..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixItertools(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - it_funcs: str - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi deleted file mode 100644 index 39a4da5068..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from lib2to3 import fixer_base -from typing import ClassVar, Literal - -class FixItertoolsImports(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_long.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_long.pyi deleted file mode 100644 index 9ccf2711d7..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from lib2to3 import fixer_base -from typing import ClassVar, Literal - -class FixLong(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[Literal["'long'"]] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_map.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_map.pyi deleted file mode 100644 index 6e60282cf0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixMap(fixer_base.ConditionalFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - skip_on: ClassVar[Literal["future_builtins.map"]] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi deleted file mode 100644 index 1b1ec82032..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Generator -from typing import ClassVar, Literal - -from .. import fixer_base -from ..pytree import Base - -def has_metaclass(parent): ... -def fixup_parse_tree(cls_node) -> None: ... -def fixup_simple_stmt(parent, i, stmt_node) -> None: ... -def remove_trailing_newline(node) -> None: ... -def find_metas(cls_node) -> Generator[tuple[Base, int, Base], None, None]: ... -def fixup_indent(suite) -> None: ... - -class FixMetaclass(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi deleted file mode 100644 index ca9b71e43f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from typing import ClassVar, Final, Literal - -from .. import fixer_base - -MAP: Final[dict[str, str]] - -class FixMethodattrs(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi deleted file mode 100644 index 6ff1220b04..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixNe(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[False]] - def match(self, node): ... - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_next.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_next.pyi deleted file mode 100644 index b13914ae8c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from _typeshed import StrPath -from typing import ClassVar, Literal - -from .. import fixer_base -from ..pytree import Node - -bind_warning: str - -class FixNext(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - order: ClassVar[Literal["pre"]] - shadowed_next: bool - def start_tree(self, tree: Node, filename: StrPath) -> None: ... - def transform(self, node, results) -> None: ... - -def is_assign_target(node): ... -def find_assign(node): ... -def is_subtree(root, node): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi deleted file mode 100644 index 5c37fc12ef..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixNonzero(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi deleted file mode 100644 index 113145e395..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixNumliterals(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[False]] - def match(self, node): ... - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi deleted file mode 100644 index b9863d3834..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from lib2to3 import fixer_base -from typing import ClassVar, Literal - -def invocation(s): ... - -class FixOperator(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - order: ClassVar[Literal["pre"]] - methods: str - obj: str - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi deleted file mode 100644 index 237df6c5ff..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixParen(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_print.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_print.pyi deleted file mode 100644 index e9564b04ac..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar, Literal - -from .. import fixer_base - -parend_expr: Incomplete - -class FixPrint(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... - def add_kwarg(self, l_nodes, s_kwd, n_expr) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi deleted file mode 100644 index e02c3080f4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixRaise(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi deleted file mode 100644 index d1a0eb0e0a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixRawInput(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi deleted file mode 100644 index f8ad876c21..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from lib2to3 import fixer_base -from typing import ClassVar, Literal - -class FixReduce(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - order: ClassVar[Literal["pre"]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi deleted file mode 100644 index 820075438e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixReload(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - order: ClassVar[Literal["pre"]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi deleted file mode 100644 index 652d8f15ea..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from collections.abc import Generator -from typing import ClassVar, Final, Literal - -from .. import fixer_base - -MAPPING: Final[dict[str, dict[str, str]]] -LOOKUP: Final[dict[tuple[str, str], str]] - -def alternates(members): ... -def build_pattern() -> Generator[str, None, None]: ... - -class FixRenames(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - order: ClassVar[Literal["pre"]] - PATTERN: ClassVar[str] - def match(self, node): ... - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi deleted file mode 100644 index 3b192d396d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixRepr(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi deleted file mode 100644 index 6962ff326f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from lib2to3 import fixer_base -from typing import ClassVar, Literal - -class FixSetLiteral(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi deleted file mode 100644 index ba914bcab5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixStandarderror(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi deleted file mode 100644 index 0fa1a47870..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixSysExc(fixer_base.BaseFix): - exc_info: ClassVar[list[str]] - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi deleted file mode 100644 index 4c99855e5c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixThrow(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi deleted file mode 100644 index bfaa9970c9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +++ /dev/null @@ -1,17 +0,0 @@ -from _typeshed import Incomplete -from typing import ClassVar, Literal - -from .. import fixer_base - -def is_docstring(stmt): ... - -class FixTupleParams(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... - def transform_lambda(self, node, results) -> None: ... - -def simplify_args(node): ... -def find_params(node): ... -def map_to_index(param_list, prefix=..., d: Incomplete | None = ...): ... -def tuple_name(param_list): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_types.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_types.pyi deleted file mode 100644 index e26dbec71a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixTypes(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi deleted file mode 100644 index 85d1315213..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from _typeshed import StrPath -from typing import ClassVar, Literal - -from .. import fixer_base -from ..pytree import Node - -class FixUnicode(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - unicode_literals: bool - def start_tree(self, tree: Node, filename: StrPath) -> None: ... - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi deleted file mode 100644 index abdcc0f629..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from collections.abc import Generator -from typing import Final, Literal - -from .fix_imports import FixImports - -MAPPING: Final[dict[str, list[tuple[Literal["urllib.request", "urllib.parse", "urllib.error"], list[str]]]]] - -def build_pattern() -> Generator[str, None, None]: ... - -class FixUrllib(FixImports): - def build_pattern(self): ... - def transform_import(self, node, results) -> None: ... - def transform_member(self, node, results): ... - def transform_dot(self, node, results) -> None: ... - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi deleted file mode 100644 index 4ce5cb2c4a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base -from ..pytree import Leaf - -class FixWsComma(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[False]] - PATTERN: ClassVar[str] - COMMA: Leaf - COLON: Leaf - SEPS: tuple[Leaf, Leaf] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi deleted file mode 100644 index 71318b7660..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from _typeshed import Incomplete, StrPath -from typing import ClassVar, Literal - -from .. import fixer_base -from ..pytree import Node - -class FixXrange(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - transformed_xranges: set[Incomplete] | None - def start_tree(self, tree: Node, filename: StrPath) -> None: ... - def finish_tree(self, tree: Node, filename: StrPath) -> None: ... - def transform(self, node, results): ... - def transform_xrange(self, node, results) -> None: ... - def transform_range(self, node, results): ... - P1: ClassVar[str] - p1: ClassVar[Incomplete] - P2: ClassVar[str] - p2: ClassVar[Incomplete] - def in_special_context(self, node): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi deleted file mode 100644 index b4794143a0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixXreadlines(fixer_base.BaseFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - def transform(self, node, results) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi deleted file mode 100644 index 805886ee31..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import ClassVar, Literal - -from .. import fixer_base - -class FixZip(fixer_base.ConditionalFix): - BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[str] - skip_on: ClassVar[Literal["future_builtins.zip"]] - def transform(self, node, results): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/main.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/main.pyi deleted file mode 100644 index 5b7fdfca5d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/main.pyi +++ /dev/null @@ -1,42 +0,0 @@ -from _typeshed import FileDescriptorOrPath -from collections.abc import Container, Iterable, Iterator, Mapping, Sequence -from logging import _ExcInfoType -from typing import AnyStr, Literal - -from . import refactor as refactor - -def diff_texts(a: str, b: str, filename: str) -> Iterator[str]: ... - -class StdoutRefactoringTool(refactor.MultiprocessRefactoringTool): - nobackups: bool - show_diffs: bool - def __init__( - self, - fixers: Iterable[str], - options: Mapping[str, object] | None, - explicit: Container[str] | None, - nobackups: bool, - show_diffs: bool, - input_base_dir: str = "", - output_dir: str = "", - append_suffix: str = "", - ) -> None: ... - # Same as super.log_error and Logger.error - def log_error( # type: ignore[override] - self, - msg: str, - *args: Iterable[str], - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - ) -> None: ... - # Same as super.write_file but without default values - def write_file( # type: ignore[override] - self, new_text: str, filename: FileDescriptorOrPath, old_text: str, encoding: str | None - ) -> None: ... - # filename has to be str - def print_output(self, old: str, new: str, filename: str, equal: bool) -> None: ... # type: ignore[override] - -def warn(msg: object) -> None: ... -def main(fixer_pkg: str, args: Sequence[AnyStr] | None = None) -> Literal[0, 1, 2]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/__init__.pyi deleted file mode 100644 index de8a874f43..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from collections.abc import Callable -from typing import Any -from typing_extensions import TypeAlias - -from ..pytree import _RawNode -from .grammar import Grammar - -# This is imported in several lib2to3/pgen2 submodules -_Convert: TypeAlias = Callable[[Grammar, _RawNode], Any] # noqa: Y047 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/driver.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/driver.pyi deleted file mode 100644 index dea13fb9d0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/driver.pyi +++ /dev/null @@ -1,27 +0,0 @@ -from _typeshed import StrPath -from collections.abc import Iterable -from logging import Logger -from typing import IO - -from ..pytree import _NL -from . import _Convert -from .grammar import Grammar - -__all__ = ["Driver", "load_grammar"] - -class Driver: - grammar: Grammar - logger: Logger - convert: _Convert - def __init__(self, grammar: Grammar, convert: _Convert | None = None, logger: Logger | None = None) -> None: ... - def parse_tokens( - self, tokens: Iterable[tuple[int, str, tuple[int, int], tuple[int, int], str]], debug: bool = False - ) -> _NL: ... - def parse_stream_raw(self, stream: IO[str], debug: bool = False) -> _NL: ... - def parse_stream(self, stream: IO[str], debug: bool = False) -> _NL: ... - def parse_file(self, filename: StrPath, encoding: str | None = None, debug: bool = False) -> _NL: ... - def parse_string(self, text: str, debug: bool = False) -> _NL: ... - -def load_grammar( - gt: str = "Grammar.txt", gp: str | None = None, save: bool = True, force: bool = False, logger: Logger | None = None -) -> Grammar: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/grammar.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/grammar.pyi deleted file mode 100644 index bef0a79226..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from _typeshed import StrPath -from typing_extensions import Self, TypeAlias - -_Label: TypeAlias = tuple[int, str | None] -_DFA: TypeAlias = list[list[tuple[int, int]]] -_DFAS: TypeAlias = tuple[_DFA, dict[int, int]] - -class Grammar: - symbol2number: dict[str, int] - number2symbol: dict[int, str] - states: list[_DFA] - dfas: dict[int, _DFAS] - labels: list[_Label] - keywords: dict[str, int] - tokens: dict[int, int] - symbol2label: dict[str, int] - start: int - def dump(self, filename: StrPath) -> None: ... - def load(self, filename: StrPath) -> None: ... - def copy(self) -> Self: ... - def report(self) -> None: ... - -opmap_raw: str -opmap: dict[str, str] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/literals.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/literals.pyi deleted file mode 100644 index c3fabe8a51..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/literals.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from re import Match - -simple_escapes: dict[str, str] - -def escape(m: Match[str]) -> str: ... -def evalString(s: str) -> str: ... -def test() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/parse.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/parse.pyi deleted file mode 100644 index 320c5f018d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/parse.pyi +++ /dev/null @@ -1,30 +0,0 @@ -from _typeshed import Incomplete -from collections.abc import Sequence -from typing_extensions import TypeAlias - -from ..pytree import _NL, _RawNode -from . import _Convert -from .grammar import _DFAS, Grammar - -_Context: TypeAlias = Sequence[Incomplete] - -class ParseError(Exception): - msg: str - type: int - value: str | None - context: _Context - def __init__(self, msg: str, type: int, value: str | None, context: _Context) -> None: ... - -class Parser: - grammar: Grammar - convert: _Convert - stack: list[tuple[_DFAS, int, _RawNode]] - rootnode: _NL | None - used_names: set[str] - def __init__(self, grammar: Grammar, convert: _Convert | None = None) -> None: ... - def setup(self, start: int | None = None) -> None: ... - def addtoken(self, type: int, value: str | None, context: _Context) -> bool: ... - def classify(self, type: int, value: str | None, context: _Context) -> int: ... - def shift(self, type: int, value: str | None, newstate: int, context: _Context) -> None: ... - def push(self, type: int, newdfa: _DFAS, newstate: int, context: _Context) -> None: ... - def pop(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/pgen.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/pgen.pyi deleted file mode 100644 index 5776d100d1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +++ /dev/null @@ -1,51 +0,0 @@ -from _typeshed import Incomplete, StrPath -from collections.abc import Iterable, Iterator -from typing import IO, ClassVar, NoReturn, overload - -from . import grammar -from .tokenize import _TokenInfo - -class PgenGrammar(grammar.Grammar): ... - -class ParserGenerator: - filename: StrPath - stream: IO[str] - generator: Iterator[_TokenInfo] - first: dict[str, dict[str, int]] - def __init__(self, filename: StrPath, stream: IO[str] | None = None) -> None: ... - def make_grammar(self) -> PgenGrammar: ... - def make_first(self, c: PgenGrammar, name: str) -> dict[int, int]: ... - def make_label(self, c: PgenGrammar, label: str) -> int: ... - def addfirstsets(self) -> None: ... - def calcfirst(self, name: str) -> None: ... - def parse(self) -> tuple[dict[str, list[DFAState]], str]: ... - def make_dfa(self, start: NFAState, finish: NFAState) -> list[DFAState]: ... - def dump_nfa(self, name: str, start: NFAState, finish: NFAState) -> list[DFAState]: ... - def dump_dfa(self, name: str, dfa: Iterable[DFAState]) -> None: ... - def simplify_dfa(self, dfa: list[DFAState]) -> None: ... - def parse_rhs(self) -> tuple[NFAState, NFAState]: ... - def parse_alt(self) -> tuple[NFAState, NFAState]: ... - def parse_item(self) -> tuple[NFAState, NFAState]: ... - def parse_atom(self) -> tuple[NFAState, NFAState]: ... - def expect(self, type: int, value: str | None = None) -> str: ... - def gettoken(self) -> None: ... - @overload - def raise_error(self, msg: object) -> NoReturn: ... - @overload - def raise_error(self, msg: str, *args: object) -> NoReturn: ... - -class NFAState: - arcs: list[tuple[str | None, NFAState]] - def addarc(self, next: NFAState, label: str | None = None) -> None: ... - -class DFAState: - nfaset: dict[NFAState, Incomplete] - isfinal: bool - arcs: dict[str, DFAState] - def __init__(self, nfaset: dict[NFAState, Incomplete], final: NFAState) -> None: ... - def addarc(self, next: DFAState, label: str) -> None: ... - def unifystate(self, old: DFAState, new: DFAState) -> None: ... - def __eq__(self, other: DFAState) -> bool: ... # type: ignore[override] - __hash__: ClassVar[None] # type: ignore[assignment] - -def generate_grammar(filename: StrPath = "Grammar.txt") -> PgenGrammar: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/token.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/token.pyi deleted file mode 100644 index 6898517ace..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/token.pyi +++ /dev/null @@ -1,69 +0,0 @@ -from typing import Final - -ENDMARKER: Final[int] -NAME: Final[int] -NUMBER: Final[int] -STRING: Final[int] -NEWLINE: Final[int] -INDENT: Final[int] -DEDENT: Final[int] -LPAR: Final[int] -RPAR: Final[int] -LSQB: Final[int] -RSQB: Final[int] -COLON: Final[int] -COMMA: Final[int] -SEMI: Final[int] -PLUS: Final[int] -MINUS: Final[int] -STAR: Final[int] -SLASH: Final[int] -VBAR: Final[int] -AMPER: Final[int] -LESS: Final[int] -GREATER: Final[int] -EQUAL: Final[int] -DOT: Final[int] -PERCENT: Final[int] -BACKQUOTE: Final[int] -LBRACE: Final[int] -RBRACE: Final[int] -EQEQUAL: Final[int] -NOTEQUAL: Final[int] -LESSEQUAL: Final[int] -GREATEREQUAL: Final[int] -TILDE: Final[int] -CIRCUMFLEX: Final[int] -LEFTSHIFT: Final[int] -RIGHTSHIFT: Final[int] -DOUBLESTAR: Final[int] -PLUSEQUAL: Final[int] -MINEQUAL: Final[int] -STAREQUAL: Final[int] -SLASHEQUAL: Final[int] -PERCENTEQUAL: Final[int] -AMPEREQUAL: Final[int] -VBAREQUAL: Final[int] -CIRCUMFLEXEQUAL: Final[int] -LEFTSHIFTEQUAL: Final[int] -RIGHTSHIFTEQUAL: Final[int] -DOUBLESTAREQUAL: Final[int] -DOUBLESLASH: Final[int] -DOUBLESLASHEQUAL: Final[int] -OP: Final[int] -COMMENT: Final[int] -NL: Final[int] -RARROW: Final[int] -AT: Final[int] -ATEQUAL: Final[int] -AWAIT: Final[int] -ASYNC: Final[int] -ERRORTOKEN: Final[int] -COLONEQUAL: Final[int] -N_TOKENS: Final[int] -NT_OFFSET: Final[int] -tok_name: dict[int, str] - -def ISTERMINAL(x: int) -> bool: ... -def ISNONTERMINAL(x: int) -> bool: ... -def ISEOF(x: int) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi deleted file mode 100644 index af54de1b51..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +++ /dev/null @@ -1,96 +0,0 @@ -from collections.abc import Callable, Iterable, Iterator -from typing_extensions import TypeAlias - -from .token import * - -__all__ = [ - "AMPER", - "AMPEREQUAL", - "ASYNC", - "AT", - "ATEQUAL", - "AWAIT", - "BACKQUOTE", - "CIRCUMFLEX", - "CIRCUMFLEXEQUAL", - "COLON", - "COMMA", - "COMMENT", - "DEDENT", - "DOT", - "DOUBLESLASH", - "DOUBLESLASHEQUAL", - "DOUBLESTAR", - "DOUBLESTAREQUAL", - "ENDMARKER", - "EQEQUAL", - "EQUAL", - "ERRORTOKEN", - "GREATER", - "GREATEREQUAL", - "INDENT", - "ISEOF", - "ISNONTERMINAL", - "ISTERMINAL", - "LBRACE", - "LEFTSHIFT", - "LEFTSHIFTEQUAL", - "LESS", - "LESSEQUAL", - "LPAR", - "LSQB", - "MINEQUAL", - "MINUS", - "NAME", - "NEWLINE", - "NL", - "NOTEQUAL", - "NT_OFFSET", - "NUMBER", - "N_TOKENS", - "OP", - "PERCENT", - "PERCENTEQUAL", - "PLUS", - "PLUSEQUAL", - "RARROW", - "RBRACE", - "RIGHTSHIFT", - "RIGHTSHIFTEQUAL", - "RPAR", - "RSQB", - "SEMI", - "SLASH", - "SLASHEQUAL", - "STAR", - "STAREQUAL", - "STRING", - "TILDE", - "VBAR", - "VBAREQUAL", - "tok_name", - "tokenize", - "generate_tokens", - "untokenize", - "COLONEQUAL", -] - -_Coord: TypeAlias = tuple[int, int] -_TokenEater: TypeAlias = Callable[[int, str, _Coord, _Coord, str], object] -_TokenInfo: TypeAlias = tuple[int, str, _Coord, _Coord, str] - -class TokenError(Exception): ... -class StopTokenizing(Exception): ... - -def tokenize(readline: Callable[[], str], tokeneater: _TokenEater = ...) -> None: ... - -class Untokenizer: - tokens: list[str] - prev_row: int - prev_col: int - def add_whitespace(self, start: _Coord) -> None: ... - def untokenize(self, iterable: Iterable[_TokenInfo]) -> str: ... - def compat(self, token: tuple[int, str], iterable: Iterable[_TokenInfo]) -> None: ... - -def untokenize(iterable: Iterable[_TokenInfo]) -> str: ... -def generate_tokens(readline: Callable[[], str]) -> Iterator[_TokenInfo]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pygram.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pygram.pyi deleted file mode 100644 index 86c74b5488..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pygram.pyi +++ /dev/null @@ -1,114 +0,0 @@ -from .pgen2.grammar import Grammar - -class Symbols: - def __init__(self, grammar: Grammar) -> None: ... - -class python_symbols(Symbols): - and_expr: int - and_test: int - annassign: int - arglist: int - argument: int - arith_expr: int - assert_stmt: int - async_funcdef: int - async_stmt: int - atom: int - augassign: int - break_stmt: int - classdef: int - comp_for: int - comp_if: int - comp_iter: int - comp_op: int - comparison: int - compound_stmt: int - continue_stmt: int - decorated: int - decorator: int - decorators: int - del_stmt: int - dictsetmaker: int - dotted_as_name: int - dotted_as_names: int - dotted_name: int - encoding_decl: int - eval_input: int - except_clause: int - exec_stmt: int - expr: int - expr_stmt: int - exprlist: int - factor: int - file_input: int - flow_stmt: int - for_stmt: int - funcdef: int - global_stmt: int - if_stmt: int - import_as_name: int - import_as_names: int - import_from: int - import_name: int - import_stmt: int - lambdef: int - listmaker: int - not_test: int - old_lambdef: int - old_test: int - or_test: int - parameters: int - pass_stmt: int - power: int - print_stmt: int - raise_stmt: int - return_stmt: int - shift_expr: int - simple_stmt: int - single_input: int - sliceop: int - small_stmt: int - star_expr: int - stmt: int - subscript: int - subscriptlist: int - suite: int - term: int - test: int - testlist: int - testlist1: int - testlist_gexp: int - testlist_safe: int - testlist_star_expr: int - tfpdef: int - tfplist: int - tname: int - trailer: int - try_stmt: int - typedargslist: int - varargslist: int - vfpdef: int - vfplist: int - vname: int - while_stmt: int - with_item: int - with_stmt: int - with_var: int - xor_expr: int - yield_arg: int - yield_expr: int - yield_stmt: int - -class pattern_symbols(Symbols): - Alternative: int - Alternatives: int - Details: int - Matcher: int - NegatedUnit: int - Repeater: int - Unit: int - -python_grammar: Grammar -python_grammar_no_print_statement: Grammar -python_grammar_no_print_and_exec_statement: Grammar -pattern_grammar: Grammar diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pytree.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pytree.pyi deleted file mode 100644 index 51bdbc75e1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/pytree.pyi +++ /dev/null @@ -1,118 +0,0 @@ -from _typeshed import Incomplete, SupportsGetItem, SupportsLenAndGetItem, Unused -from abc import abstractmethod -from collections.abc import Iterable, Iterator, MutableSequence -from typing import ClassVar, Final -from typing_extensions import Self, TypeAlias - -from .fixer_base import BaseFix -from .pgen2.grammar import Grammar - -_NL: TypeAlias = Node | Leaf -_Context: TypeAlias = tuple[str, int, int] -_Results: TypeAlias = dict[str, _NL] -_RawNode: TypeAlias = tuple[int, str, _Context, list[_NL] | None] - -HUGE: Final = 0x7FFFFFFF - -def type_repr(type_num: int) -> str | int: ... - -class Base: - type: int - parent: Node | None - prefix: str - children: list[_NL] - was_changed: bool - was_checked: bool - def __eq__(self, other: object) -> bool: ... - __hash__: ClassVar[None] # type: ignore[assignment] - @abstractmethod - def _eq(self, other: Base) -> bool: ... - @abstractmethod - def clone(self) -> Self: ... - @abstractmethod - def post_order(self) -> Iterator[Self]: ... - @abstractmethod - def pre_order(self) -> Iterator[Self]: ... - def replace(self, new: _NL | list[_NL]) -> None: ... - def get_lineno(self) -> int: ... - def changed(self) -> None: ... - def remove(self) -> int | None: ... - @property - def next_sibling(self) -> _NL | None: ... - @property - def prev_sibling(self) -> _NL | None: ... - def leaves(self) -> Iterator[Leaf]: ... - def depth(self) -> int: ... - def get_suffix(self) -> str: ... - -class Node(Base): - fixers_applied: MutableSequence[BaseFix] | None - # Is Unbound until set in refactor.RefactoringTool - future_features: frozenset[Incomplete] - # Is Unbound until set in pgen2.parse.Parser.pop - used_names: set[str] - def __init__( - self, - type: int, - children: Iterable[_NL], - context: Unused = None, - prefix: str | None = None, - fixers_applied: MutableSequence[BaseFix] | None = None, - ) -> None: ... - def _eq(self, other: Base) -> bool: ... - def clone(self) -> Node: ... - def post_order(self) -> Iterator[Self]: ... - def pre_order(self) -> Iterator[Self]: ... - def set_child(self, i: int, child: _NL) -> None: ... - def insert_child(self, i: int, child: _NL) -> None: ... - def append_child(self, child: _NL) -> None: ... - def __unicode__(self) -> str: ... - -class Leaf(Base): - lineno: int - column: int - value: str - fixers_applied: MutableSequence[BaseFix] - def __init__( - self, - type: int, - value: str, - context: _Context | None = None, - prefix: str | None = None, - fixers_applied: MutableSequence[BaseFix] = [], - ) -> None: ... - def _eq(self, other: Base) -> bool: ... - def clone(self) -> Leaf: ... - def post_order(self) -> Iterator[Self]: ... - def pre_order(self) -> Iterator[Self]: ... - def __unicode__(self) -> str: ... - -def convert(gr: Grammar, raw_node: _RawNode) -> _NL: ... - -class BasePattern: - type: int - content: str | None - name: str | None - def optimize(self) -> BasePattern: ... # sic, subclasses are free to optimize themselves into different patterns - def match(self, node: _NL, results: _Results | None = None) -> bool: ... - def match_seq(self, nodes: SupportsLenAndGetItem[_NL], results: _Results | None = None) -> bool: ... - def generate_matches(self, nodes: SupportsGetItem[int, _NL]) -> Iterator[tuple[int, _Results]]: ... - -class LeafPattern(BasePattern): - def __init__(self, type: int | None = None, content: str | None = None, name: str | None = None) -> None: ... - -class NodePattern(BasePattern): - wildcards: bool - def __init__(self, type: int | None = None, content: str | None = None, name: str | None = None) -> None: ... - -class WildcardPattern(BasePattern): - min: int - max: int - def __init__(self, content: str | None = None, min: int = 0, max: int = 0x7FFFFFFF, name: str | None = None) -> None: ... - -class NegatedPattern(BasePattern): - def __init__(self, content: str | None = None) -> None: ... - -def generate_matches( - patterns: SupportsGetItem[int | slice, BasePattern] | None, nodes: SupportsGetItem[int | slice, _NL] -) -> Iterator[tuple[int, _Results]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/refactor.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/refactor.pyi deleted file mode 100644 index a7f3825406..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lib2to3/refactor.pyi +++ /dev/null @@ -1,82 +0,0 @@ -from _typeshed import FileDescriptorOrPath, StrPath, SupportsGetItem -from collections.abc import Container, Generator, Iterable, Mapping -from logging import Logger, _ExcInfoType -from multiprocessing import JoinableQueue -from multiprocessing.synchronize import Lock -from typing import Any, ClassVar, Final, NoReturn, overload - -from .btm_matcher import BottomMatcher -from .fixer_base import BaseFix -from .pgen2.driver import Driver -from .pgen2.grammar import Grammar -from .pytree import Node - -def get_all_fix_names(fixer_pkg: str, remove_prefix: bool = True) -> list[str]: ... -def get_fixers_from_package(pkg_name: str) -> list[str]: ... - -class FixerError(Exception): ... - -class RefactoringTool: - CLASS_PREFIX: ClassVar[str] - FILE_PREFIX: ClassVar[str] - fixers: Iterable[str] - explicit: Container[str] - options: dict[str, Any] - grammar: Grammar - write_unchanged_files: bool - errors: list[tuple[str, Iterable[str], dict[str, _ExcInfoType]]] - logger: Logger - fixer_log: list[str] - wrote: bool - driver: Driver - pre_order: list[BaseFix] - post_order: list[BaseFix] - files: list[StrPath] - BM: BottomMatcher - bmi_pre_order: list[BaseFix] - bmi_post_order: list[BaseFix] - def __init__( - self, fixer_names: Iterable[str], options: Mapping[str, object] | None = None, explicit: Container[str] | None = None - ) -> None: ... - def get_fixers(self) -> tuple[list[BaseFix], list[BaseFix]]: ... - def log_error(self, msg: str, *args: Iterable[str], **kwargs: _ExcInfoType) -> NoReturn: ... - @overload - def log_message(self, msg: object) -> None: ... - @overload - def log_message(self, msg: str, *args: object) -> None: ... - @overload - def log_debug(self, msg: object) -> None: ... - @overload - def log_debug(self, msg: str, *args: object) -> None: ... - def print_output(self, old_text: str, new_text: str, filename: StrPath, equal: bool) -> None: ... - def refactor(self, items: Iterable[str], write: bool = False, doctests_only: bool = False) -> None: ... - def refactor_dir(self, dir_name: str, write: bool = False, doctests_only: bool = False) -> None: ... - def _read_python_source(self, filename: FileDescriptorOrPath) -> tuple[str, str]: ... - def refactor_file(self, filename: StrPath, write: bool = False, doctests_only: bool = False) -> None: ... - def refactor_string(self, data: str, name: str) -> Node | None: ... - def refactor_stdin(self, doctests_only: bool = False) -> None: ... - def refactor_tree(self, tree: Node, name: str) -> bool: ... - def traverse_by(self, fixers: SupportsGetItem[int, Iterable[BaseFix]] | None, traversal: Iterable[Node]) -> None: ... - def processed_file( - self, new_text: str, filename: StrPath, old_text: str | None = None, write: bool = False, encoding: str | None = None - ) -> None: ... - def write_file(self, new_text: str, filename: FileDescriptorOrPath, old_text: str, encoding: str | None = None) -> None: ... - PS1: Final = ">>> " - PS2: Final = "... " - def refactor_docstring(self, input: str, filename: StrPath) -> str: ... - def refactor_doctest(self, block: list[str], lineno: int, indent: int, filename: StrPath) -> list[str]: ... - def summarize(self) -> None: ... - def parse_block(self, block: Iterable[str], lineno: int, indent: int) -> Node: ... - def wrap_toks( - self, block: Iterable[str], lineno: int, indent: int - ) -> Generator[tuple[int, str, tuple[int, int], tuple[int, int], str], None, None]: ... - def gen_lines(self, block: Iterable[str], indent: int) -> Generator[str, None, None]: ... - -class MultiprocessingUnsupported(Exception): ... - -class MultiprocessRefactoringTool(RefactoringTool): - queue: JoinableQueue[None | tuple[Iterable[str], bool | int]] | None - output_lock: Lock | None - def refactor( - self, items: Iterable[str], write: bool = False, doctests_only: bool = False, num_processes: int = 1 - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/linecache.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/linecache.pyi deleted file mode 100644 index 5379a21e7d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/linecache.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from collections.abc import Callable -from typing import Any -from typing_extensions import TypeAlias - -__all__ = ["getline", "clearcache", "checkcache", "lazycache"] - -_ModuleGlobals: TypeAlias = dict[str, Any] -_ModuleMetadata: TypeAlias = tuple[int, float | None, list[str], str] - -_SourceLoader: TypeAlias = tuple[Callable[[], str | None]] - -cache: dict[str, _SourceLoader | _ModuleMetadata] # undocumented - -def getline(filename: str, lineno: int, module_globals: _ModuleGlobals | None = None) -> str: ... -def clearcache() -> None: ... -def getlines(filename: str, module_globals: _ModuleGlobals | None = None) -> list[str]: ... -def checkcache(filename: str | None = None) -> None: ... -def updatecache(filename: str, module_globals: _ModuleGlobals | None = None) -> list[str]: ... -def lazycache(filename: str, module_globals: _ModuleGlobals) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/locale.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/locale.pyi deleted file mode 100644 index 58de654495..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/locale.pyi +++ /dev/null @@ -1,156 +0,0 @@ -import sys -from _locale import ( - CHAR_MAX as CHAR_MAX, - LC_ALL as LC_ALL, - LC_COLLATE as LC_COLLATE, - LC_CTYPE as LC_CTYPE, - LC_MONETARY as LC_MONETARY, - LC_NUMERIC as LC_NUMERIC, - LC_TIME as LC_TIME, - localeconv as localeconv, - strcoll as strcoll, - strxfrm as strxfrm, -) - -# This module defines a function "str()", which is why "str" can't be used -# as a type annotation or type alias. -from builtins import str as _str -from collections.abc import Callable, Iterable -from decimal import Decimal -from typing import Any - -if sys.version_info >= (3, 11): - from _locale import getencoding as getencoding - -# Some parts of the `_locale` module are platform-specific: -if sys.platform != "win32": - from _locale import ( - ABDAY_1 as ABDAY_1, - ABDAY_2 as ABDAY_2, - ABDAY_3 as ABDAY_3, - ABDAY_4 as ABDAY_4, - ABDAY_5 as ABDAY_5, - ABDAY_6 as ABDAY_6, - ABDAY_7 as ABDAY_7, - ABMON_1 as ABMON_1, - ABMON_2 as ABMON_2, - ABMON_3 as ABMON_3, - ABMON_4 as ABMON_4, - ABMON_5 as ABMON_5, - ABMON_6 as ABMON_6, - ABMON_7 as ABMON_7, - ABMON_8 as ABMON_8, - ABMON_9 as ABMON_9, - ABMON_10 as ABMON_10, - ABMON_11 as ABMON_11, - ABMON_12 as ABMON_12, - ALT_DIGITS as ALT_DIGITS, - AM_STR as AM_STR, - CODESET as CODESET, - CRNCYSTR as CRNCYSTR, - D_FMT as D_FMT, - D_T_FMT as D_T_FMT, - DAY_1 as DAY_1, - DAY_2 as DAY_2, - DAY_3 as DAY_3, - DAY_4 as DAY_4, - DAY_5 as DAY_5, - DAY_6 as DAY_6, - DAY_7 as DAY_7, - ERA as ERA, - ERA_D_FMT as ERA_D_FMT, - ERA_D_T_FMT as ERA_D_T_FMT, - ERA_T_FMT as ERA_T_FMT, - LC_MESSAGES as LC_MESSAGES, - MON_1 as MON_1, - MON_2 as MON_2, - MON_3 as MON_3, - MON_4 as MON_4, - MON_5 as MON_5, - MON_6 as MON_6, - MON_7 as MON_7, - MON_8 as MON_8, - MON_9 as MON_9, - MON_10 as MON_10, - MON_11 as MON_11, - MON_12 as MON_12, - NOEXPR as NOEXPR, - PM_STR as PM_STR, - RADIXCHAR as RADIXCHAR, - T_FMT as T_FMT, - T_FMT_AMPM as T_FMT_AMPM, - THOUSEP as THOUSEP, - YESEXPR as YESEXPR, - bind_textdomain_codeset as bind_textdomain_codeset, - bindtextdomain as bindtextdomain, - dcgettext as dcgettext, - dgettext as dgettext, - gettext as gettext, - nl_langinfo as nl_langinfo, - textdomain as textdomain, - ) - -__all__ = [ - "getlocale", - "getdefaultlocale", - "getpreferredencoding", - "Error", - "setlocale", - "localeconv", - "strcoll", - "strxfrm", - "str", - "atof", - "atoi", - "format_string", - "currency", - "normalize", - "LC_CTYPE", - "LC_COLLATE", - "LC_TIME", - "LC_MONETARY", - "LC_NUMERIC", - "LC_ALL", - "CHAR_MAX", -] - -if sys.version_info >= (3, 11): - __all__ += ["getencoding"] - -if sys.version_info < (3, 12): - __all__ += ["format"] - -if sys.version_info < (3, 13): - __all__ += ["resetlocale"] - -if sys.platform != "win32": - __all__ += ["LC_MESSAGES"] - -class Error(Exception): ... - -def getdefaultlocale( - envvars: tuple[_str, ...] = ("LC_ALL", "LC_CTYPE", "LANG", "LANGUAGE") -) -> tuple[_str | None, _str | None]: ... -def getlocale(category: int = ...) -> tuple[_str | None, _str | None]: ... -def setlocale(category: int, locale: _str | Iterable[_str | None] | None = None) -> _str: ... -def getpreferredencoding(do_setlocale: bool = True) -> _str: ... -def normalize(localename: _str) -> _str: ... - -if sys.version_info < (3, 13): - def resetlocale(category: int = ...) -> None: ... - -if sys.version_info < (3, 12): - def format( - percent: _str, value: float | Decimal, grouping: bool = False, monetary: bool = False, *additional: Any - ) -> _str: ... - -def format_string(f: _str, val: Any, grouping: bool = False, monetary: bool = False) -> _str: ... -def currency(val: float | Decimal, symbol: bool = True, grouping: bool = False, international: bool = False) -> _str: ... -def delocalize(string: _str) -> _str: ... -def atof(string: _str, func: Callable[[_str], float] = ...) -> float: ... -def atoi(string: _str) -> int: ... -def str(val: float) -> _str: ... - -locale_alias: dict[_str, _str] # undocumented -locale_encoding_alias: dict[_str, _str] # undocumented -windows_locale: dict[int, _str] # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/logging/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/logging/__init__.pyi deleted file mode 100644 index e555f74a81..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/logging/__init__.pyi +++ /dev/null @@ -1,657 +0,0 @@ -import sys -import threading -from _typeshed import StrPath, SupportsWrite -from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence -from io import TextIOWrapper -from re import Pattern -from string import Template -from time import struct_time -from types import FrameType, GenericAlias, TracebackType -from typing import Any, ClassVar, Final, Generic, Literal, Protocol, TextIO, TypeVar, overload -from typing_extensions import Self, TypeAlias, deprecated - -__all__ = [ - "BASIC_FORMAT", - "BufferingFormatter", - "CRITICAL", - "DEBUG", - "ERROR", - "FATAL", - "FileHandler", - "Filter", - "Formatter", - "Handler", - "INFO", - "LogRecord", - "Logger", - "LoggerAdapter", - "NOTSET", - "NullHandler", - "StreamHandler", - "WARN", - "WARNING", - "addLevelName", - "basicConfig", - "captureWarnings", - "critical", - "debug", - "disable", - "error", - "exception", - "fatal", - "getLevelName", - "getLogger", - "getLoggerClass", - "info", - "log", - "makeLogRecord", - "setLoggerClass", - "shutdown", - "warning", - "getLogRecordFactory", - "setLogRecordFactory", - "lastResort", - "raiseExceptions", - "warn", -] - -if sys.version_info >= (3, 11): - __all__ += ["getLevelNamesMapping"] -if sys.version_info >= (3, 12): - __all__ += ["getHandlerByName", "getHandlerNames"] - -_SysExcInfoType: TypeAlias = tuple[type[BaseException], BaseException, TracebackType | None] | tuple[None, None, None] -_ExcInfoType: TypeAlias = None | bool | _SysExcInfoType | BaseException -_ArgsType: TypeAlias = tuple[object, ...] | Mapping[str, object] -_Level: TypeAlias = int | str -_FormatStyle: TypeAlias = Literal["%", "{", "$"] - -if sys.version_info >= (3, 12): - class _SupportsFilter(Protocol): - def filter(self, record: LogRecord, /) -> bool | LogRecord: ... - - _FilterType: TypeAlias = Filter | Callable[[LogRecord], bool | LogRecord] | _SupportsFilter -else: - class _SupportsFilter(Protocol): - def filter(self, record: LogRecord, /) -> bool: ... - - _FilterType: TypeAlias = Filter | Callable[[LogRecord], bool] | _SupportsFilter - -raiseExceptions: bool -logThreads: bool -logMultiprocessing: bool -logProcesses: bool -_srcfile: str | None - -def currentframe() -> FrameType: ... - -_levelToName: dict[int, str] -_nameToLevel: dict[str, int] - -class Filterer: - filters: list[_FilterType] - def addFilter(self, filter: _FilterType) -> None: ... - def removeFilter(self, filter: _FilterType) -> None: ... - if sys.version_info >= (3, 12): - def filter(self, record: LogRecord) -> bool | LogRecord: ... - else: - def filter(self, record: LogRecord) -> bool: ... - -class Manager: # undocumented - root: RootLogger - disable: int - emittedNoHandlerWarning: bool - loggerDict: dict[str, Logger | PlaceHolder] - loggerClass: type[Logger] | None - logRecordFactory: Callable[..., LogRecord] | None - def __init__(self, rootnode: RootLogger) -> None: ... - def getLogger(self, name: str) -> Logger: ... - def setLoggerClass(self, klass: type[Logger]) -> None: ... - def setLogRecordFactory(self, factory: Callable[..., LogRecord]) -> None: ... - -class Logger(Filterer): - name: str # undocumented - level: int # undocumented - parent: Logger | None # undocumented - propagate: bool - handlers: list[Handler] # undocumented - disabled: bool # undocumented - root: ClassVar[RootLogger] # undocumented - manager: Manager # undocumented - def __init__(self, name: str, level: _Level = 0) -> None: ... - def setLevel(self, level: _Level) -> None: ... - def isEnabledFor(self, level: int) -> bool: ... - def getEffectiveLevel(self) -> int: ... - def getChild(self, suffix: str) -> Self: ... # see python/typing#980 - if sys.version_info >= (3, 12): - def getChildren(self) -> set[Logger]: ... - - def debug( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - ) -> None: ... - def info( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - ) -> None: ... - def warning( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - ) -> None: ... - @deprecated("Deprecated; use warning() instead.") - def warn( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - ) -> None: ... - def error( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - ) -> None: ... - def exception( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = True, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - ) -> None: ... - def critical( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - ) -> None: ... - def log( - self, - level: int, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - ) -> None: ... - def _log( - self, - level: int, - msg: object, - args: _ArgsType, - exc_info: _ExcInfoType | None = None, - extra: Mapping[str, object] | None = None, - stack_info: bool = False, - stacklevel: int = 1, - ) -> None: ... # undocumented - fatal = critical - def addHandler(self, hdlr: Handler) -> None: ... - def removeHandler(self, hdlr: Handler) -> None: ... - def findCaller(self, stack_info: bool = False, stacklevel: int = 1) -> tuple[str, int, str, str | None]: ... - def handle(self, record: LogRecord) -> None: ... - def makeRecord( - self, - name: str, - level: int, - fn: str, - lno: int, - msg: object, - args: _ArgsType, - exc_info: _SysExcInfoType | None, - func: str | None = None, - extra: Mapping[str, object] | None = None, - sinfo: str | None = None, - ) -> LogRecord: ... - def hasHandlers(self) -> bool: ... - def callHandlers(self, record: LogRecord) -> None: ... # undocumented - -CRITICAL: Final = 50 -FATAL: Final = CRITICAL -ERROR: Final = 40 -WARNING: Final = 30 -WARN: Final = WARNING -INFO: Final = 20 -DEBUG: Final = 10 -NOTSET: Final = 0 - -class Handler(Filterer): - level: int # undocumented - formatter: Formatter | None # undocumented - lock: threading.Lock | None # undocumented - name: str | None # undocumented - def __init__(self, level: _Level = 0) -> None: ... - def get_name(self) -> str: ... # undocumented - def set_name(self, name: str) -> None: ... # undocumented - def createLock(self) -> None: ... - def acquire(self) -> None: ... - def release(self) -> None: ... - def setLevel(self, level: _Level) -> None: ... - def setFormatter(self, fmt: Formatter | None) -> None: ... - def flush(self) -> None: ... - def close(self) -> None: ... - def handle(self, record: LogRecord) -> bool: ... - def handleError(self, record: LogRecord) -> None: ... - def format(self, record: LogRecord) -> str: ... - def emit(self, record: LogRecord) -> None: ... - -if sys.version_info >= (3, 12): - def getHandlerByName(name: str) -> Handler | None: ... - def getHandlerNames() -> frozenset[str]: ... - -class Formatter: - converter: Callable[[float | None], struct_time] - _fmt: str | None # undocumented - datefmt: str | None # undocumented - _style: PercentStyle # undocumented - default_time_format: str - default_msec_format: str | None - - if sys.version_info >= (3, 10): - def __init__( - self, - fmt: str | None = None, - datefmt: str | None = None, - style: _FormatStyle = "%", - validate: bool = True, - *, - defaults: Mapping[str, Any] | None = None, - ) -> None: ... - else: - def __init__( - self, fmt: str | None = None, datefmt: str | None = None, style: _FormatStyle = "%", validate: bool = True - ) -> None: ... - - def format(self, record: LogRecord) -> str: ... - def formatTime(self, record: LogRecord, datefmt: str | None = None) -> str: ... - def formatException(self, ei: _SysExcInfoType) -> str: ... - def formatMessage(self, record: LogRecord) -> str: ... # undocumented - def formatStack(self, stack_info: str) -> str: ... - def usesTime(self) -> bool: ... # undocumented - -class BufferingFormatter: - linefmt: Formatter - def __init__(self, linefmt: Formatter | None = None) -> None: ... - def formatHeader(self, records: Sequence[LogRecord]) -> str: ... - def formatFooter(self, records: Sequence[LogRecord]) -> str: ... - def format(self, records: Sequence[LogRecord]) -> str: ... - -class Filter: - name: str # undocumented - nlen: int # undocumented - def __init__(self, name: str = "") -> None: ... - if sys.version_info >= (3, 12): - def filter(self, record: LogRecord) -> bool | LogRecord: ... - else: - def filter(self, record: LogRecord) -> bool: ... - -class LogRecord: - # args can be set to None by logging.handlers.QueueHandler - # (see https://bugs.python.org/issue44473) - args: _ArgsType | None - asctime: str - created: float - exc_info: _SysExcInfoType | None - exc_text: str | None - filename: str - funcName: str - levelname: str - levelno: int - lineno: int - module: str - msecs: float - # Only created when logging.Formatter.format is called. See #6132. - message: str - msg: str | Any # The runtime accepts any object, but will be a str in 99% of cases - name: str - pathname: str - process: int | None - processName: str | None - relativeCreated: float - stack_info: str | None - thread: int | None - threadName: str | None - if sys.version_info >= (3, 12): - taskName: str | None - - def __init__( - self, - name: str, - level: int, - pathname: str, - lineno: int, - msg: object, - args: _ArgsType | None, - exc_info: _SysExcInfoType | None, - func: str | None = None, - sinfo: str | None = None, - ) -> None: ... - def getMessage(self) -> str: ... - # Allows setting contextual information on LogRecord objects as per the docs, see #7833 - def __setattr__(self, name: str, value: Any, /) -> None: ... - -_L = TypeVar("_L", bound=Logger | LoggerAdapter[Any]) - -class LoggerAdapter(Generic[_L]): - logger: _L - manager: Manager # undocumented - - if sys.version_info >= (3, 13): - def __init__(self, logger: _L, extra: Mapping[str, object] | None = None, merge_extra: bool = False) -> None: ... - elif sys.version_info >= (3, 10): - def __init__(self, logger: _L, extra: Mapping[str, object] | None = None) -> None: ... - else: - def __init__(self, logger: _L, extra: Mapping[str, object]) -> None: ... - - if sys.version_info >= (3, 10): - extra: Mapping[str, object] | None - else: - extra: Mapping[str, object] - - def process(self, msg: Any, kwargs: MutableMapping[str, Any]) -> tuple[Any, MutableMapping[str, Any]]: ... - def debug( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - **kwargs: object, - ) -> None: ... - def info( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - **kwargs: object, - ) -> None: ... - def warning( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - **kwargs: object, - ) -> None: ... - @deprecated("Deprecated; use warning() instead.") - def warn( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - **kwargs: object, - ) -> None: ... - def error( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - **kwargs: object, - ) -> None: ... - def exception( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = True, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - **kwargs: object, - ) -> None: ... - def critical( - self, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - **kwargs: object, - ) -> None: ... - def log( - self, - level: int, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, - **kwargs: object, - ) -> None: ... - def isEnabledFor(self, level: int) -> bool: ... - def getEffectiveLevel(self) -> int: ... - def setLevel(self, level: _Level) -> None: ... - def hasHandlers(self) -> bool: ... - if sys.version_info >= (3, 11): - def _log( - self, - level: int, - msg: object, - args: _ArgsType, - *, - exc_info: _ExcInfoType | None = None, - extra: Mapping[str, object] | None = None, - stack_info: bool = False, - ) -> None: ... # undocumented - else: - def _log( - self, - level: int, - msg: object, - args: _ArgsType, - exc_info: _ExcInfoType | None = None, - extra: Mapping[str, object] | None = None, - stack_info: bool = False, - ) -> None: ... # undocumented - - @property - def name(self) -> str: ... # undocumented - if sys.version_info >= (3, 11): - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -def getLogger(name: str | None = None) -> Logger: ... -def getLoggerClass() -> type[Logger]: ... -def getLogRecordFactory() -> Callable[..., LogRecord]: ... -def debug( - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, -) -> None: ... -def info( - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, -) -> None: ... -def warning( - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, -) -> None: ... -@deprecated("Deprecated; use warning() instead.") -def warn( - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, -) -> None: ... -def error( - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, -) -> None: ... -def critical( - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, -) -> None: ... -def exception( - msg: object, - *args: object, - exc_info: _ExcInfoType = True, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, -) -> None: ... -def log( - level: int, - msg: object, - *args: object, - exc_info: _ExcInfoType = None, - stack_info: bool = False, - stacklevel: int = 1, - extra: Mapping[str, object] | None = None, -) -> None: ... - -fatal = critical - -def disable(level: int = 50) -> None: ... -def addLevelName(level: int, levelName: str) -> None: ... -@overload -def getLevelName(level: int) -> str: ... -@overload -@deprecated("The str -> int case is considered a mistake.") -def getLevelName(level: str) -> Any: ... - -if sys.version_info >= (3, 11): - def getLevelNamesMapping() -> dict[str, int]: ... - -def makeLogRecord(dict: Mapping[str, object]) -> LogRecord: ... -def basicConfig( - *, - filename: StrPath | None = ..., - filemode: str = ..., - format: str = ..., - datefmt: str | None = ..., - style: _FormatStyle = ..., - level: _Level | None = ..., - stream: SupportsWrite[str] | None = ..., - handlers: Iterable[Handler] | None = ..., - force: bool | None = ..., - encoding: str | None = ..., - errors: str | None = ..., -) -> None: ... -def shutdown(handlerList: Sequence[Any] = ...) -> None: ... # handlerList is undocumented -def setLoggerClass(klass: type[Logger]) -> None: ... -def captureWarnings(capture: bool) -> None: ... -def setLogRecordFactory(factory: Callable[..., LogRecord]) -> None: ... - -lastResort: Handler | None - -_StreamT = TypeVar("_StreamT", bound=SupportsWrite[str]) - -class StreamHandler(Handler, Generic[_StreamT]): - stream: _StreamT # undocumented - terminator: str - @overload - def __init__(self: StreamHandler[TextIO], stream: None = None) -> None: ... - @overload - def __init__(self: StreamHandler[_StreamT], stream: _StreamT) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 - def setStream(self, stream: _StreamT) -> _StreamT | None: ... - if sys.version_info >= (3, 11): - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class FileHandler(StreamHandler[TextIOWrapper]): - baseFilename: str # undocumented - mode: str # undocumented - encoding: str | None # undocumented - delay: bool # undocumented - errors: str | None # undocumented - def __init__( - self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None - ) -> None: ... - def _open(self) -> TextIOWrapper: ... # undocumented - -class NullHandler(Handler): ... - -class PlaceHolder: # undocumented - loggerMap: dict[Logger, None] - def __init__(self, alogger: Logger) -> None: ... - def append(self, alogger: Logger) -> None: ... - -# Below aren't in module docs but still visible - -class RootLogger(Logger): - def __init__(self, level: int) -> None: ... - -root: RootLogger - -class PercentStyle: # undocumented - default_format: str - asctime_format: str - asctime_search: str - validation_pattern: Pattern[str] - _fmt: str - if sys.version_info >= (3, 10): - def __init__(self, fmt: str, *, defaults: Mapping[str, Any] | None = None) -> None: ... - else: - def __init__(self, fmt: str) -> None: ... - - def usesTime(self) -> bool: ... - def validate(self) -> None: ... - def format(self, record: Any) -> str: ... - -class StrFormatStyle(PercentStyle): # undocumented - fmt_spec: Pattern[str] - field_spec: Pattern[str] - -class StringTemplateStyle(PercentStyle): # undocumented - _tpl: Template - -_STYLES: Final[dict[str, tuple[PercentStyle, str]]] - -BASIC_FORMAT: Final[str] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/logging/config.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/logging/config.pyi deleted file mode 100644 index 000ba1ebb0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/logging/config.pyi +++ /dev/null @@ -1,139 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from collections.abc import Callable, Hashable, Iterable, Mapping, Sequence -from configparser import RawConfigParser -from re import Pattern -from threading import Thread -from typing import IO, Any, Final, Literal, SupportsIndex, TypedDict, overload, type_check_only -from typing_extensions import Required, TypeAlias - -from . import Filter, Filterer, Formatter, Handler, Logger, _FilterType, _FormatStyle, _Level - -DEFAULT_LOGGING_CONFIG_PORT: int -RESET_ERROR: Final[int] # undocumented -IDENTIFIER: Final[Pattern[str]] # undocumented - -if sys.version_info >= (3, 11): - @type_check_only - class _RootLoggerConfiguration(TypedDict, total=False): - level: _Level - filters: Sequence[str | _FilterType] - handlers: Sequence[str] - -else: - @type_check_only - class _RootLoggerConfiguration(TypedDict, total=False): - level: _Level - filters: Sequence[str] - handlers: Sequence[str] - -@type_check_only -class _LoggerConfiguration(_RootLoggerConfiguration, TypedDict, total=False): - propagate: bool - -_FormatterConfigurationTypedDict = TypedDict( - "_FormatterConfigurationTypedDict", {"class": str, "format": str, "datefmt": str, "style": _FormatStyle}, total=False -) - -@type_check_only -class _FilterConfigurationTypedDict(TypedDict): - name: str - -# Formatter and filter configs can specify custom factories via the special `()` key. -# If that is the case, the dictionary can contain any additional keys -# https://docs.python.org/3/library/logging.config.html#user-defined-objects -_FormatterConfiguration: TypeAlias = _FormatterConfigurationTypedDict | dict[str, Any] -_FilterConfiguration: TypeAlias = _FilterConfigurationTypedDict | dict[str, Any] -# Handler config can have additional keys even when not providing a custom factory so we just use `dict`. -_HandlerConfiguration: TypeAlias = dict[str, Any] - -@type_check_only -class _DictConfigArgs(TypedDict, total=False): - version: Required[Literal[1]] - formatters: dict[str, _FormatterConfiguration] - filters: dict[str, _FilterConfiguration] - handlers: dict[str, _HandlerConfiguration] - loggers: dict[str, _LoggerConfiguration] - root: _RootLoggerConfiguration - incremental: bool - disable_existing_loggers: bool - -# Accept dict[str, Any] to avoid false positives if called with a dict -# type, since dict types are not compatible with TypedDicts. -# -# Also accept a TypedDict type, to allow callers to use TypedDict -# types, and for somewhat stricter type checking of dict literals. -def dictConfig(config: _DictConfigArgs | dict[str, Any]) -> None: ... - -if sys.version_info >= (3, 10): - def fileConfig( - fname: StrOrBytesPath | IO[str] | RawConfigParser, - defaults: Mapping[str, str] | None = None, - disable_existing_loggers: bool = True, - encoding: str | None = None, - ) -> None: ... - -else: - def fileConfig( - fname: StrOrBytesPath | IO[str] | RawConfigParser, - defaults: Mapping[str, str] | None = None, - disable_existing_loggers: bool = True, - ) -> None: ... - -def valid_ident(s: str) -> Literal[True]: ... # undocumented -def listen(port: int = 9030, verify: Callable[[bytes], bytes | None] | None = None) -> Thread: ... -def stopListening() -> None: ... - -class ConvertingMixin: # undocumented - def convert_with_key(self, key: Any, value: Any, replace: bool = True) -> Any: ... - def convert(self, value: Any) -> Any: ... - -class ConvertingDict(dict[Hashable, Any], ConvertingMixin): # undocumented - def __getitem__(self, key: Hashable) -> Any: ... - def get(self, key: Hashable, default: Any = None) -> Any: ... - def pop(self, key: Hashable, default: Any = None) -> Any: ... - -class ConvertingList(list[Any], ConvertingMixin): # undocumented - @overload - def __getitem__(self, key: SupportsIndex) -> Any: ... - @overload - def __getitem__(self, key: slice) -> Any: ... - def pop(self, idx: SupportsIndex = -1) -> Any: ... - -class ConvertingTuple(tuple[Any, ...], ConvertingMixin): # undocumented - @overload - def __getitem__(self, key: SupportsIndex) -> Any: ... - @overload - def __getitem__(self, key: slice) -> Any: ... - -class BaseConfigurator: # undocumented - CONVERT_PATTERN: Pattern[str] - WORD_PATTERN: Pattern[str] - DOT_PATTERN: Pattern[str] - INDEX_PATTERN: Pattern[str] - DIGIT_PATTERN: Pattern[str] - value_converters: dict[str, str] - importer: Callable[..., Any] - - def __init__(self, config: _DictConfigArgs | dict[str, Any]) -> None: ... - def resolve(self, s: str) -> Any: ... - def ext_convert(self, value: str) -> Any: ... - def cfg_convert(self, value: str) -> Any: ... - def convert(self, value: Any) -> Any: ... - def configure_custom(self, config: dict[str, Any]) -> Any: ... - def as_tuple(self, value: list[Any] | tuple[Any, ...]) -> tuple[Any, ...]: ... - -class DictConfigurator(BaseConfigurator): - def configure(self) -> None: ... # undocumented - def configure_formatter(self, config: _FormatterConfiguration) -> Formatter | Any: ... # undocumented - def configure_filter(self, config: _FilterConfiguration) -> Filter | Any: ... # undocumented - def add_filters(self, filterer: Filterer, filters: Iterable[_FilterType]) -> None: ... # undocumented - def configure_handler(self, config: _HandlerConfiguration) -> Handler | Any: ... # undocumented - def add_handlers(self, logger: Logger, handlers: Iterable[str]) -> None: ... # undocumented - def common_logger_config( - self, logger: Logger, config: _LoggerConfiguration, incremental: bool = False - ) -> None: ... # undocumented - def configure_logger(self, name: str, config: _LoggerConfiguration, incremental: bool = False) -> None: ... # undocumented - def configure_root(self, config: _LoggerConfiguration, incremental: bool = False) -> None: ... # undocumented - -dictConfigClass = DictConfigurator diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/logging/handlers.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/logging/handlers.pyi deleted file mode 100644 index 2c7ec05afe..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/logging/handlers.pyi +++ /dev/null @@ -1,239 +0,0 @@ -import datetime -import http.client -import ssl -import sys -from _typeshed import ReadableBuffer, StrPath -from collections.abc import Callable -from logging import FileHandler, Handler, LogRecord -from re import Pattern -from socket import SocketKind, socket -from threading import Thread -from typing import Any, ClassVar, Final, Protocol, TypeVar - -_T = TypeVar("_T") - -DEFAULT_TCP_LOGGING_PORT: Final[int] -DEFAULT_UDP_LOGGING_PORT: Final[int] -DEFAULT_HTTP_LOGGING_PORT: Final[int] -DEFAULT_SOAP_LOGGING_PORT: Final[int] -SYSLOG_UDP_PORT: Final[int] -SYSLOG_TCP_PORT: Final[int] - -class WatchedFileHandler(FileHandler): - dev: int # undocumented - ino: int # undocumented - def __init__( - self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None - ) -> None: ... - def _statstream(self) -> None: ... # undocumented - def reopenIfNeeded(self) -> None: ... - -class BaseRotatingHandler(FileHandler): - namer: Callable[[str], str] | None - rotator: Callable[[str, str], None] | None - def __init__( - self, filename: StrPath, mode: str, encoding: str | None = None, delay: bool = False, errors: str | None = None - ) -> None: ... - def rotation_filename(self, default_name: str) -> str: ... - def rotate(self, source: str, dest: str) -> None: ... - -class RotatingFileHandler(BaseRotatingHandler): - maxBytes: int # undocumented - backupCount: int # undocumented - def __init__( - self, - filename: StrPath, - mode: str = "a", - maxBytes: int = 0, - backupCount: int = 0, - encoding: str | None = None, - delay: bool = False, - errors: str | None = None, - ) -> None: ... - def doRollover(self) -> None: ... - def shouldRollover(self, record: LogRecord) -> int: ... # undocumented - -class TimedRotatingFileHandler(BaseRotatingHandler): - when: str # undocumented - backupCount: int # undocumented - utc: bool # undocumented - atTime: datetime.time | None # undocumented - interval: int # undocumented - suffix: str # undocumented - dayOfWeek: int # undocumented - rolloverAt: int # undocumented - extMatch: Pattern[str] # undocumented - def __init__( - self, - filename: StrPath, - when: str = "h", - interval: int = 1, - backupCount: int = 0, - encoding: str | None = None, - delay: bool = False, - utc: bool = False, - atTime: datetime.time | None = None, - errors: str | None = None, - ) -> None: ... - def doRollover(self) -> None: ... - def shouldRollover(self, record: LogRecord) -> int: ... # undocumented - def computeRollover(self, currentTime: int) -> int: ... # undocumented - def getFilesToDelete(self) -> list[str]: ... # undocumented - -class SocketHandler(Handler): - host: str # undocumented - port: int | None # undocumented - address: tuple[str, int] | str # undocumented - sock: socket | None # undocumented - closeOnError: bool # undocumented - retryTime: float | None # undocumented - retryStart: float # undocumented - retryFactor: float # undocumented - retryMax: float # undocumented - def __init__(self, host: str, port: int | None) -> None: ... - def makeSocket(self, timeout: float = 1) -> socket: ... # timeout is undocumented - def makePickle(self, record: LogRecord) -> bytes: ... - def send(self, s: ReadableBuffer) -> None: ... - def createSocket(self) -> None: ... - -class DatagramHandler(SocketHandler): - def makeSocket(self) -> socket: ... # type: ignore[override] - -class SysLogHandler(Handler): - LOG_EMERG: int - LOG_ALERT: int - LOG_CRIT: int - LOG_ERR: int - LOG_WARNING: int - LOG_NOTICE: int - LOG_INFO: int - LOG_DEBUG: int - - LOG_KERN: int - LOG_USER: int - LOG_MAIL: int - LOG_DAEMON: int - LOG_AUTH: int - LOG_SYSLOG: int - LOG_LPR: int - LOG_NEWS: int - LOG_UUCP: int - LOG_CRON: int - LOG_AUTHPRIV: int - LOG_FTP: int - LOG_NTP: int - LOG_SECURITY: int - LOG_CONSOLE: int - LOG_SOLCRON: int - LOG_LOCAL0: int - LOG_LOCAL1: int - LOG_LOCAL2: int - LOG_LOCAL3: int - LOG_LOCAL4: int - LOG_LOCAL5: int - LOG_LOCAL6: int - LOG_LOCAL7: int - address: tuple[str, int] | str # undocumented - unixsocket: bool # undocumented - socktype: SocketKind # undocumented - ident: str # undocumented - append_nul: bool # 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: tuple[str, int] | str = ("localhost", 514), facility: str | int = 1, socktype: SocketKind | None = None - ) -> None: ... - if sys.version_info >= (3, 11): - def createSocket(self) -> None: ... - - def encodePriority(self, facility: int | str, priority: int | str) -> int: ... - def mapPriority(self, levelName: str) -> str: ... - -class NTEventLogHandler(Handler): - def __init__(self, appname: str, dllname: str | None = None, logtype: str = "Application") -> None: ... - def getEventCategory(self, record: LogRecord) -> int: ... - # TODO: correct return value? - def getEventType(self, record: LogRecord) -> int: ... - def getMessageID(self, record: LogRecord) -> int: ... - -class SMTPHandler(Handler): - mailhost: str # undocumented - mailport: int | None # undocumented - username: str | None # undocumented - # password only exists as an attribute if passed credentials is a tuple or list - password: str # undocumented - fromaddr: str # undocumented - toaddrs: list[str] # undocumented - subject: str # undocumented - secure: tuple[()] | tuple[str] | tuple[str, str] | None # undocumented - timeout: float # undocumented - def __init__( - self, - mailhost: str | tuple[str, int], - fromaddr: str, - toaddrs: str | list[str], - subject: str, - credentials: tuple[str, str] | None = None, - secure: tuple[()] | tuple[str] | tuple[str, str] | None = None, - timeout: float = 5.0, - ) -> None: ... - def getSubject(self, record: LogRecord) -> str: ... - -class BufferingHandler(Handler): - capacity: int # undocumented - buffer: list[LogRecord] # undocumented - def __init__(self, capacity: int) -> None: ... - def shouldFlush(self, record: LogRecord) -> bool: ... - -class MemoryHandler(BufferingHandler): - flushLevel: int # undocumented - target: Handler | None # undocumented - flushOnClose: bool # undocumented - def __init__(self, capacity: int, flushLevel: int = 40, target: Handler | None = None, flushOnClose: bool = True) -> None: ... - def setTarget(self, target: Handler | None) -> None: ... - -class HTTPHandler(Handler): - host: str # undocumented - url: str # undocumented - method: str # undocumented - secure: bool # undocumented - credentials: tuple[str, str] | None # undocumented - context: ssl.SSLContext | None # undocumented - def __init__( - self, - host: str, - url: str, - method: str = "GET", - secure: bool = False, - credentials: tuple[str, str] | None = None, - context: ssl.SSLContext | None = None, - ) -> None: ... - def mapLogRecord(self, record: LogRecord) -> dict[str, Any]: ... - def getConnection(self, host: str, secure: bool) -> http.client.HTTPConnection: ... # undocumented - -class _QueueLike(Protocol[_T]): - def get(self) -> _T: ... - def put_nowait(self, item: _T, /) -> None: ... - -class QueueHandler(Handler): - queue: _QueueLike[Any] - def __init__(self, queue: _QueueLike[Any]) -> None: ... - def prepare(self, record: LogRecord) -> Any: ... - def enqueue(self, record: LogRecord) -> None: ... - if sys.version_info >= (3, 12): - listener: QueueListener | None - -class QueueListener: - handlers: tuple[Handler, ...] # undocumented - respect_handler_level: bool # undocumented - queue: _QueueLike[Any] # undocumented - _thread: Thread | None # undocumented - def __init__(self, queue: _QueueLike[Any], *handlers: Handler, respect_handler_level: bool = False) -> None: ... - def dequeue(self, block: bool) -> LogRecord: ... - def prepare(self, record: LogRecord) -> Any: ... - def start(self) -> None: ... - def stop(self) -> None: ... - def enqueue_sentinel(self) -> None: ... - def handle(self, record: LogRecord) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/lzma.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/lzma.pyi deleted file mode 100644 index 2f0279f598..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/lzma.pyi +++ /dev/null @@ -1,174 +0,0 @@ -from _compression import BaseStream -from _lzma import ( - CHECK_CRC32 as CHECK_CRC32, - CHECK_CRC64 as CHECK_CRC64, - CHECK_ID_MAX as CHECK_ID_MAX, - CHECK_NONE as CHECK_NONE, - CHECK_SHA256 as CHECK_SHA256, - CHECK_UNKNOWN as CHECK_UNKNOWN, - FILTER_ARM as FILTER_ARM, - FILTER_ARMTHUMB as FILTER_ARMTHUMB, - FILTER_DELTA as FILTER_DELTA, - FILTER_IA64 as FILTER_IA64, - FILTER_LZMA1 as FILTER_LZMA1, - FILTER_LZMA2 as FILTER_LZMA2, - FILTER_POWERPC as FILTER_POWERPC, - FILTER_SPARC as FILTER_SPARC, - FILTER_X86 as FILTER_X86, - FORMAT_ALONE as FORMAT_ALONE, - FORMAT_AUTO as FORMAT_AUTO, - FORMAT_RAW as FORMAT_RAW, - FORMAT_XZ as FORMAT_XZ, - MF_BT2 as MF_BT2, - MF_BT3 as MF_BT3, - MF_BT4 as MF_BT4, - MF_HC3 as MF_HC3, - MF_HC4 as MF_HC4, - MODE_FAST as MODE_FAST, - MODE_NORMAL as MODE_NORMAL, - PRESET_DEFAULT as PRESET_DEFAULT, - PRESET_EXTREME as PRESET_EXTREME, - LZMACompressor as LZMACompressor, - LZMADecompressor as LZMADecompressor, - LZMAError as LZMAError, - _FilterChain, - is_check_supported as is_check_supported, -) -from _typeshed import ReadableBuffer, StrOrBytesPath -from typing import IO, Literal, TextIO, overload -from typing_extensions import Self, TypeAlias - -__all__ = [ - "CHECK_NONE", - "CHECK_CRC32", - "CHECK_CRC64", - "CHECK_SHA256", - "CHECK_ID_MAX", - "CHECK_UNKNOWN", - "FILTER_LZMA1", - "FILTER_LZMA2", - "FILTER_DELTA", - "FILTER_X86", - "FILTER_IA64", - "FILTER_ARM", - "FILTER_ARMTHUMB", - "FILTER_POWERPC", - "FILTER_SPARC", - "FORMAT_AUTO", - "FORMAT_XZ", - "FORMAT_ALONE", - "FORMAT_RAW", - "MF_HC3", - "MF_HC4", - "MF_BT2", - "MF_BT3", - "MF_BT4", - "MODE_FAST", - "MODE_NORMAL", - "PRESET_DEFAULT", - "PRESET_EXTREME", - "LZMACompressor", - "LZMADecompressor", - "LZMAFile", - "LZMAError", - "open", - "compress", - "decompress", - "is_check_supported", -] - -_OpenBinaryWritingMode: TypeAlias = Literal["w", "wb", "x", "xb", "a", "ab"] -_OpenTextWritingMode: TypeAlias = Literal["wt", "xt", "at"] - -_PathOrFile: TypeAlias = StrOrBytesPath | IO[bytes] - -class LZMAFile(BaseStream, IO[bytes]): # type: ignore[misc] # incompatible definitions of writelines in the base classes - def __init__( - self, - filename: _PathOrFile | None = None, - mode: str = "r", - *, - format: int | None = None, - check: int = -1, - preset: int | None = None, - filters: _FilterChain | None = None, - ) -> None: ... - def __enter__(self) -> Self: ... - def peek(self, size: int = -1) -> bytes: ... - def read(self, size: int | None = -1) -> bytes: ... - def read1(self, size: int = -1) -> bytes: ... - def readline(self, size: int | None = -1) -> bytes: ... - def write(self, data: ReadableBuffer) -> int: ... - def seek(self, offset: int, whence: int = 0) -> int: ... - -@overload -def open( - filename: _PathOrFile, - mode: Literal["r", "rb"] = "rb", - *, - format: int | None = None, - check: Literal[-1] = -1, - preset: None = None, - filters: _FilterChain | None = None, - encoding: None = None, - errors: None = None, - newline: None = None, -) -> LZMAFile: ... -@overload -def open( - filename: _PathOrFile, - mode: _OpenBinaryWritingMode, - *, - format: int | None = None, - check: int = -1, - preset: int | None = None, - filters: _FilterChain | None = None, - encoding: None = None, - errors: None = None, - newline: None = None, -) -> LZMAFile: ... -@overload -def open( - filename: StrOrBytesPath, - mode: Literal["rt"], - *, - format: int | None = None, - check: Literal[-1] = -1, - preset: None = None, - filters: _FilterChain | None = None, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, -) -> TextIO: ... -@overload -def open( - filename: StrOrBytesPath, - mode: _OpenTextWritingMode, - *, - format: int | None = None, - check: int = -1, - preset: int | None = None, - filters: _FilterChain | None = None, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, -) -> TextIO: ... -@overload -def open( - filename: _PathOrFile, - mode: str, - *, - format: int | None = None, - check: int = -1, - preset: int | None = None, - filters: _FilterChain | None = None, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, -) -> LZMAFile | TextIO: ... -def compress( - data: ReadableBuffer, format: int = 1, check: int = -1, preset: int | None = None, filters: _FilterChain | None = None -) -> bytes: ... -def decompress( - data: ReadableBuffer, format: int = 0, memlimit: int | None = None, filters: _FilterChain | None = None -) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/mailbox.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/mailbox.pyi deleted file mode 100644 index dc2fbd593d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/mailbox.pyi +++ /dev/null @@ -1,259 +0,0 @@ -import email.message -import io -import sys -from _typeshed import StrPath, SupportsNoArgReadline, SupportsRead -from abc import ABCMeta, abstractmethod -from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence -from types import GenericAlias, TracebackType -from typing import IO, Any, AnyStr, Generic, Literal, Protocol, TypeVar, overload -from typing_extensions import Self, TypeAlias - -__all__ = [ - "Mailbox", - "Maildir", - "mbox", - "MH", - "Babyl", - "MMDF", - "Message", - "MaildirMessage", - "mboxMessage", - "MHMessage", - "BabylMessage", - "MMDFMessage", - "Error", - "NoSuchMailboxError", - "NotEmptyError", - "ExternalClashError", - "FormatError", -] - -_T = TypeVar("_T") -_MessageT = TypeVar("_MessageT", bound=Message) - -class _SupportsReadAndReadline(SupportsRead[bytes], SupportsNoArgReadline[bytes], Protocol): ... - -_MessageData: TypeAlias = email.message.Message | bytes | str | io.StringIO | _SupportsReadAndReadline - -class _HasIteritems(Protocol): - def iteritems(self) -> Iterator[tuple[str, _MessageData]]: ... - -class _HasItems(Protocol): - def items(self) -> Iterator[tuple[str, _MessageData]]: ... - -linesep: bytes - -class Mailbox(Generic[_MessageT]): - _path: str # undocumented - _factory: Callable[[IO[Any]], _MessageT] | None # undocumented - @overload - def __init__(self, path: StrPath, factory: Callable[[IO[Any]], _MessageT], create: bool = True) -> None: ... - @overload - def __init__(self, path: StrPath, factory: None = None, create: bool = True) -> None: ... - @abstractmethod - def add(self, message: _MessageData) -> str: ... - @abstractmethod - def remove(self, key: str) -> None: ... - def __delitem__(self, key: str) -> None: ... - def discard(self, key: str) -> None: ... - @abstractmethod - def __setitem__(self, key: str, message: _MessageData) -> None: ... - @overload - def get(self, key: str, default: None = None) -> _MessageT | None: ... - @overload - def get(self, key: str, default: _T) -> _MessageT | _T: ... - def __getitem__(self, key: str) -> _MessageT: ... - @abstractmethod - def get_message(self, key: str) -> _MessageT: ... - def get_string(self, key: str) -> str: ... - @abstractmethod - def get_bytes(self, key: str) -> bytes: ... - # As '_ProxyFile' doesn't implement the full IO spec, and BytesIO is incompatible with it, get_file return is Any here - @abstractmethod - def get_file(self, key: str) -> Any: ... - @abstractmethod - def iterkeys(self) -> Iterator[str]: ... - def keys(self) -> list[str]: ... - def itervalues(self) -> Iterator[_MessageT]: ... - def __iter__(self) -> Iterator[_MessageT]: ... - def values(self) -> list[_MessageT]: ... - def iteritems(self) -> Iterator[tuple[str, _MessageT]]: ... - def items(self) -> list[tuple[str, _MessageT]]: ... - @abstractmethod - def __contains__(self, key: str) -> bool: ... - @abstractmethod - def __len__(self) -> int: ... - def clear(self) -> None: ... - @overload - def pop(self, key: str, default: None = None) -> _MessageT | None: ... - @overload - def pop(self, key: str, default: _T) -> _MessageT | _T: ... - def popitem(self) -> tuple[str, _MessageT]: ... - def update(self, arg: _HasIteritems | _HasItems | Iterable[tuple[str, _MessageData]] | None = None) -> None: ... - @abstractmethod - def flush(self) -> None: ... - @abstractmethod - def lock(self) -> None: ... - @abstractmethod - def unlock(self) -> None: ... - @abstractmethod - def close(self) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class Maildir(Mailbox[MaildirMessage]): - colon: str - def __init__( - self, dirname: StrPath, factory: Callable[[IO[Any]], MaildirMessage] | None = None, create: bool = True - ) -> None: ... - def add(self, message: _MessageData) -> str: ... - def remove(self, key: str) -> None: ... - def __setitem__(self, key: str, message: _MessageData) -> None: ... - def get_message(self, key: str) -> MaildirMessage: ... - def get_bytes(self, key: str) -> bytes: ... - def get_file(self, key: str) -> _ProxyFile[bytes]: ... - if sys.version_info >= (3, 13): - def get_info(self, key: str) -> str: ... - def set_info(self, key: str, info: str) -> None: ... - def get_flags(self, key: str) -> str: ... - def set_flags(self, key: str, flags: str) -> None: ... - def add_flag(self, key: str, flag: str) -> None: ... - def remove_flag(self, key: str, flag: str) -> None: ... - - def iterkeys(self) -> Iterator[str]: ... - def __contains__(self, key: str) -> bool: ... - def __len__(self) -> int: ... - def flush(self) -> None: ... - def lock(self) -> None: ... - def unlock(self) -> None: ... - def close(self) -> None: ... - def list_folders(self) -> list[str]: ... - def get_folder(self, folder: str) -> Maildir: ... - def add_folder(self, folder: str) -> Maildir: ... - def remove_folder(self, folder: str) -> None: ... - def clean(self) -> None: ... - def next(self) -> str | None: ... - -class _singlefileMailbox(Mailbox[_MessageT], metaclass=ABCMeta): - def add(self, message: _MessageData) -> str: ... - def remove(self, key: str) -> None: ... - def __setitem__(self, key: str, message: _MessageData) -> None: ... - def iterkeys(self) -> Iterator[str]: ... - def __contains__(self, key: str) -> bool: ... - def __len__(self) -> int: ... - def lock(self) -> None: ... - def unlock(self) -> None: ... - def flush(self) -> None: ... - def close(self) -> None: ... - -class _mboxMMDF(_singlefileMailbox[_MessageT]): - def get_message(self, key: str) -> _MessageT: ... - def get_file(self, key: str, from_: bool = False) -> _PartialFile[bytes]: ... - def get_bytes(self, key: str, from_: bool = False) -> bytes: ... - def get_string(self, key: str, from_: bool = False) -> str: ... - -class mbox(_mboxMMDF[mboxMessage]): - def __init__(self, path: StrPath, factory: Callable[[IO[Any]], mboxMessage] | None = None, create: bool = True) -> None: ... - -class MMDF(_mboxMMDF[MMDFMessage]): - def __init__(self, path: StrPath, factory: Callable[[IO[Any]], MMDFMessage] | None = None, create: bool = True) -> None: ... - -class MH(Mailbox[MHMessage]): - def __init__(self, path: StrPath, factory: Callable[[IO[Any]], MHMessage] | None = None, create: bool = True) -> None: ... - def add(self, message: _MessageData) -> str: ... - def remove(self, key: str) -> None: ... - def __setitem__(self, key: str, message: _MessageData) -> None: ... - def get_message(self, key: str) -> MHMessage: ... - def get_bytes(self, key: str) -> bytes: ... - def get_file(self, key: str) -> _ProxyFile[bytes]: ... - def iterkeys(self) -> Iterator[str]: ... - def __contains__(self, key: str) -> bool: ... - def __len__(self) -> int: ... - def flush(self) -> None: ... - def lock(self) -> None: ... - def unlock(self) -> None: ... - def close(self) -> None: ... - def list_folders(self) -> list[str]: ... - def get_folder(self, folder: StrPath) -> MH: ... - def add_folder(self, folder: StrPath) -> MH: ... - def remove_folder(self, folder: StrPath) -> None: ... - def get_sequences(self) -> dict[str, list[int]]: ... - def set_sequences(self, sequences: Mapping[str, Sequence[int]]) -> None: ... - def pack(self) -> None: ... - -class Babyl(_singlefileMailbox[BabylMessage]): - def __init__(self, path: StrPath, factory: Callable[[IO[Any]], BabylMessage] | None = None, create: bool = True) -> None: ... - def get_message(self, key: str) -> BabylMessage: ... - def get_bytes(self, key: str) -> bytes: ... - def get_file(self, key: str) -> IO[bytes]: ... - def get_labels(self) -> list[str]: ... - -class Message(email.message.Message): - def __init__(self, message: _MessageData | None = None) -> None: ... - -class MaildirMessage(Message): - def get_subdir(self) -> str: ... - def set_subdir(self, subdir: Literal["new", "cur"]) -> None: ... - def get_flags(self) -> str: ... - def set_flags(self, flags: Iterable[str]) -> None: ... - def add_flag(self, flag: str) -> None: ... - def remove_flag(self, flag: str) -> None: ... - def get_date(self) -> int: ... - def set_date(self, date: float) -> None: ... - def get_info(self) -> str: ... - def set_info(self, info: str) -> None: ... - -class _mboxMMDFMessage(Message): - def get_from(self) -> str: ... - def set_from(self, from_: str, time_: bool | tuple[int, int, int, int, int, int, int, int, int] | None = None) -> None: ... - def get_flags(self) -> str: ... - def set_flags(self, flags: Iterable[str]) -> None: ... - def add_flag(self, flag: str) -> None: ... - def remove_flag(self, flag: str) -> None: ... - -class mboxMessage(_mboxMMDFMessage): ... - -class MHMessage(Message): - def get_sequences(self) -> list[str]: ... - def set_sequences(self, sequences: Iterable[str]) -> None: ... - def add_sequence(self, sequence: str) -> None: ... - def remove_sequence(self, sequence: str) -> None: ... - -class BabylMessage(Message): - def get_labels(self) -> list[str]: ... - def set_labels(self, labels: Iterable[str]) -> None: ... - def add_label(self, label: str) -> None: ... - def remove_label(self, label: str) -> None: ... - def get_visible(self) -> Message: ... - def set_visible(self, visible: _MessageData) -> None: ... - def update_visible(self) -> None: ... - -class MMDFMessage(_mboxMMDFMessage): ... - -class _ProxyFile(Generic[AnyStr]): - def __init__(self, f: IO[AnyStr], pos: int | None = None) -> None: ... - def read(self, size: int | None = None) -> AnyStr: ... - def read1(self, size: int | None = None) -> AnyStr: ... - def readline(self, size: int | None = None) -> AnyStr: ... - def readlines(self, sizehint: int | None = None) -> list[AnyStr]: ... - def __iter__(self) -> Iterator[AnyStr]: ... - def tell(self) -> int: ... - def seek(self, offset: int, whence: int = 0) -> None: ... - def close(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, exc_type: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None) -> None: ... - def readable(self) -> bool: ... - def writable(self) -> bool: ... - def seekable(self) -> bool: ... - def flush(self) -> None: ... - @property - def closed(self) -> bool: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class _PartialFile(_ProxyFile[AnyStr]): - def __init__(self, f: IO[AnyStr], start: int | None = None, stop: int | None = None) -> None: ... - -class Error(Exception): ... -class NoSuchMailboxError(Error): ... -class NotEmptyError(Error): ... -class ExternalClashError(Error): ... -class FormatError(Error): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/mailcap.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/mailcap.pyi deleted file mode 100644 index ce549e01f5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/mailcap.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from collections.abc import Mapping, Sequence -from typing_extensions import TypeAlias - -_Cap: TypeAlias = dict[str, str | int] - -__all__ = ["getcaps", "findmatch"] - -def findmatch( - caps: Mapping[str, list[_Cap]], MIMEtype: str, key: str = "view", filename: str = "/dev/null", plist: Sequence[str] = [] -) -> tuple[str | None, _Cap | None]: ... -def getcaps() -> dict[str, list[_Cap]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/marshal.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/marshal.pyi deleted file mode 100644 index 6ab202637d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/marshal.pyi +++ /dev/null @@ -1,41 +0,0 @@ -import builtins -import sys -import types -from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite -from typing import Any -from typing_extensions import TypeAlias - -version: int - -_Marshallable: TypeAlias = ( - # handled in w_object() in marshal.c - None - | type[StopIteration] - | builtins.ellipsis - | bool - # handled in w_complex_object() in marshal.c - | int - | float - | complex - | bytes - | str - | tuple[_Marshallable, ...] - | list[Any] - | dict[Any, Any] - | set[Any] - | frozenset[_Marshallable] - | types.CodeType - | ReadableBuffer -) - -if sys.version_info >= (3, 13): - def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 4, /, *, allow_code: bool = True) -> None: ... - def load(file: SupportsRead[bytes], /, *, allow_code: bool = True) -> Any: ... - def dumps(value: _Marshallable, version: int = 4, /, *, allow_code: bool = True) -> bytes: ... - def loads(bytes: ReadableBuffer, /, *, allow_code: bool = True) -> Any: ... - -else: - def dump(value: _Marshallable, file: SupportsWrite[bytes], version: int = 4, /) -> None: ... - def load(file: SupportsRead[bytes], /) -> Any: ... - def dumps(value: _Marshallable, version: int = 4, /) -> bytes: ... - def loads(bytes: ReadableBuffer, /) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/math.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/math.pyi deleted file mode 100644 index 9e77f0cd7e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/math.pyi +++ /dev/null @@ -1,137 +0,0 @@ -import sys -from _typeshed import SupportsMul, SupportsRMul -from collections.abc import Iterable -from typing import Any, Final, Literal, Protocol, SupportsFloat, SupportsIndex, TypeVar, overload -from typing_extensions import TypeAlias - -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True) - -_SupportsFloatOrIndex: TypeAlias = SupportsFloat | SupportsIndex - -e: Final[float] -pi: Final[float] -inf: Final[float] -nan: Final[float] -tau: Final[float] - -def acos(x: _SupportsFloatOrIndex, /) -> float: ... -def acosh(x: _SupportsFloatOrIndex, /) -> float: ... -def asin(x: _SupportsFloatOrIndex, /) -> float: ... -def asinh(x: _SupportsFloatOrIndex, /) -> float: ... -def atan(x: _SupportsFloatOrIndex, /) -> float: ... -def atan2(y: _SupportsFloatOrIndex, x: _SupportsFloatOrIndex, /) -> float: ... -def atanh(x: _SupportsFloatOrIndex, /) -> float: ... - -if sys.version_info >= (3, 11): - def cbrt(x: _SupportsFloatOrIndex, /) -> float: ... - -class _SupportsCeil(Protocol[_T_co]): - def __ceil__(self) -> _T_co: ... - -@overload -def ceil(x: _SupportsCeil[_T], /) -> _T: ... -@overload -def ceil(x: _SupportsFloatOrIndex, /) -> int: ... -def comb(n: SupportsIndex, k: SupportsIndex, /) -> int: ... -def copysign(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ... -def cos(x: _SupportsFloatOrIndex, /) -> float: ... -def cosh(x: _SupportsFloatOrIndex, /) -> float: ... -def degrees(x: _SupportsFloatOrIndex, /) -> float: ... -def dist(p: Iterable[_SupportsFloatOrIndex], q: Iterable[_SupportsFloatOrIndex], /) -> float: ... -def erf(x: _SupportsFloatOrIndex, /) -> float: ... -def erfc(x: _SupportsFloatOrIndex, /) -> float: ... -def exp(x: _SupportsFloatOrIndex, /) -> float: ... - -if sys.version_info >= (3, 11): - def exp2(x: _SupportsFloatOrIndex, /) -> float: ... - -def expm1(x: _SupportsFloatOrIndex, /) -> float: ... -def fabs(x: _SupportsFloatOrIndex, /) -> float: ... -def factorial(x: SupportsIndex, /) -> int: ... - -class _SupportsFloor(Protocol[_T_co]): - def __floor__(self) -> _T_co: ... - -@overload -def floor(x: _SupportsFloor[_T], /) -> _T: ... -@overload -def floor(x: _SupportsFloatOrIndex, /) -> int: ... -def fmod(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ... -def frexp(x: _SupportsFloatOrIndex, /) -> tuple[float, int]: ... -def fsum(seq: Iterable[_SupportsFloatOrIndex], /) -> float: ... -def gamma(x: _SupportsFloatOrIndex, /) -> float: ... -def gcd(*integers: SupportsIndex) -> int: ... -def hypot(*coordinates: _SupportsFloatOrIndex) -> float: ... -def isclose( - a: _SupportsFloatOrIndex, - b: _SupportsFloatOrIndex, - *, - rel_tol: _SupportsFloatOrIndex = 1e-09, - abs_tol: _SupportsFloatOrIndex = 0.0, -) -> bool: ... -def isinf(x: _SupportsFloatOrIndex, /) -> bool: ... -def isfinite(x: _SupportsFloatOrIndex, /) -> bool: ... -def isnan(x: _SupportsFloatOrIndex, /) -> bool: ... -def isqrt(n: SupportsIndex, /) -> int: ... -def lcm(*integers: SupportsIndex) -> int: ... -def ldexp(x: _SupportsFloatOrIndex, i: int, /) -> float: ... -def lgamma(x: _SupportsFloatOrIndex, /) -> float: ... -def log(x: _SupportsFloatOrIndex, base: _SupportsFloatOrIndex = ...) -> float: ... -def log10(x: _SupportsFloatOrIndex, /) -> float: ... -def log1p(x: _SupportsFloatOrIndex, /) -> float: ... -def log2(x: _SupportsFloatOrIndex, /) -> float: ... -def modf(x: _SupportsFloatOrIndex, /) -> tuple[float, float]: ... - -if sys.version_info >= (3, 12): - def nextafter(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /, *, steps: SupportsIndex | None = None) -> float: ... - -else: - def nextafter(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ... - -def perm(n: SupportsIndex, k: SupportsIndex | None = None, /) -> int: ... -def pow(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ... - -_PositiveInteger: TypeAlias = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25] -_NegativeInteger: TypeAlias = Literal[-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -17, -18, -19, -20] -_LiteralInteger = _PositiveInteger | _NegativeInteger | Literal[0] # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed - -_MultiplicableT1 = TypeVar("_MultiplicableT1", bound=SupportsMul[Any, Any]) -_MultiplicableT2 = TypeVar("_MultiplicableT2", bound=SupportsMul[Any, Any]) - -class _SupportsProdWithNoDefaultGiven(SupportsMul[Any, Any], SupportsRMul[int, Any], Protocol): ... - -_SupportsProdNoDefaultT = TypeVar("_SupportsProdNoDefaultT", bound=_SupportsProdWithNoDefaultGiven) - -# This stub is based on the type stub for `builtins.sum`. -# Like `builtins.sum`, it cannot be precisely represented in a type stub -# without introducing many false positives. -# For more details on its limitations and false positives, see #13572. -# Instead, just like `builtins.sum`, we explicitly handle several useful cases. -@overload -def prod(iterable: Iterable[bool | _LiteralInteger], /, *, start: int = 1) -> int: ... # type: ignore[overload-overlap] -@overload -def prod(iterable: Iterable[_SupportsProdNoDefaultT], /) -> _SupportsProdNoDefaultT | Literal[1]: ... -@overload -def prod(iterable: Iterable[_MultiplicableT1], /, *, start: _MultiplicableT2) -> _MultiplicableT1 | _MultiplicableT2: ... -def radians(x: _SupportsFloatOrIndex, /) -> float: ... -def remainder(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, /) -> float: ... -def sin(x: _SupportsFloatOrIndex, /) -> float: ... -def sinh(x: _SupportsFloatOrIndex, /) -> float: ... - -if sys.version_info >= (3, 12): - def sumprod(p: Iterable[float], q: Iterable[float], /) -> float: ... - -def sqrt(x: _SupportsFloatOrIndex, /) -> float: ... -def tan(x: _SupportsFloatOrIndex, /) -> float: ... -def tanh(x: _SupportsFloatOrIndex, /) -> float: ... - -# Is different from `_typeshed.SupportsTrunc`, which is not generic -class _SupportsTrunc(Protocol[_T_co]): - def __trunc__(self) -> _T_co: ... - -def trunc(x: _SupportsTrunc[_T], /) -> _T: ... -def ulp(x: _SupportsFloatOrIndex, /) -> float: ... - -if sys.version_info >= (3, 13): - def fma(x: _SupportsFloatOrIndex, y: _SupportsFloatOrIndex, z: _SupportsFloatOrIndex, /) -> float: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/mimetypes.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/mimetypes.pyi deleted file mode 100644 index 9914a34a2d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/mimetypes.pyi +++ /dev/null @@ -1,56 +0,0 @@ -import sys -from _typeshed import StrPath -from collections.abc import Sequence -from typing import IO - -__all__ = [ - "knownfiles", - "inited", - "MimeTypes", - "guess_type", - "guess_all_extensions", - "guess_extension", - "add_type", - "init", - "read_mime_types", - "suffix_map", - "encodings_map", - "types_map", - "common_types", -] - -if sys.version_info >= (3, 13): - __all__ += ["guess_file_type"] - -def guess_type(url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... -def guess_all_extensions(type: str, strict: bool = True) -> list[str]: ... -def guess_extension(type: str, strict: bool = True) -> str | None: ... -def init(files: Sequence[str] | None = None) -> None: ... -def read_mime_types(file: str) -> dict[str, str] | None: ... -def add_type(type: str, ext: str, strict: bool = True) -> None: ... - -if sys.version_info >= (3, 13): - def guess_file_type(path: StrPath, *, strict: bool = True) -> tuple[str | None, str | None]: ... - -inited: bool -knownfiles: list[str] -suffix_map: dict[str, str] -encodings_map: dict[str, str] -types_map: dict[str, str] -common_types: dict[str, str] - -class MimeTypes: - suffix_map: dict[str, str] - encodings_map: dict[str, str] - types_map: tuple[dict[str, str], dict[str, str]] - types_map_inv: tuple[dict[str, str], dict[str, str]] - def __init__(self, filenames: tuple[str, ...] = (), strict: bool = True) -> None: ... - def add_type(self, type: str, ext: str, strict: bool = True) -> None: ... - def guess_extension(self, type: str, strict: bool = True) -> str | None: ... - def guess_type(self, url: StrPath, strict: bool = True) -> tuple[str | None, str | None]: ... - def guess_all_extensions(self, type: str, strict: bool = True) -> list[str]: ... - def read(self, filename: str, strict: bool = True) -> None: ... - def readfp(self, fp: IO[str], strict: bool = True) -> None: ... - def read_windows_registry(self, strict: bool = True) -> None: ... - if sys.version_info >= (3, 13): - def guess_file_type(self, path: StrPath, *, strict: bool = True) -> tuple[str | None, str | None]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/mmap.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/mmap.pyi deleted file mode 100644 index c9b8358cde..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/mmap.pyi +++ /dev/null @@ -1,146 +0,0 @@ -import sys -from _typeshed import ReadableBuffer, Unused -from collections.abc import Iterator -from typing import Final, Literal, NoReturn, overload -from typing_extensions import Self - -ACCESS_DEFAULT: int -ACCESS_READ: int -ACCESS_WRITE: int -ACCESS_COPY: int - -ALLOCATIONGRANULARITY: int - -if sys.platform == "linux": - MAP_DENYWRITE: int - MAP_EXECUTABLE: int - if sys.version_info >= (3, 10): - MAP_POPULATE: int -if sys.version_info >= (3, 11) and sys.platform != "win32" and sys.platform != "darwin": - MAP_STACK: int - -if sys.platform != "win32": - MAP_ANON: int - MAP_ANONYMOUS: int - MAP_PRIVATE: int - MAP_SHARED: int - PROT_EXEC: int - PROT_READ: int - PROT_WRITE: int - -PAGESIZE: int - -class mmap: - if sys.platform == "win32": - def __init__(self, fileno: int, length: int, tagname: str | None = ..., access: int = ..., offset: int = ...) -> None: ... - else: - if sys.version_info >= (3, 13): - def __new__( - cls, - fileno: int, - length: int, - flags: int = ..., - prot: int = ..., - access: int = ..., - offset: int = ..., - *, - trackfd: bool = True, - ) -> Self: ... - else: - def __new__( - cls, fileno: int, length: int, flags: int = ..., prot: int = ..., access: int = ..., offset: int = ... - ) -> Self: ... - - def close(self) -> None: ... - def flush(self, offset: int = ..., size: int = ...) -> None: ... - def move(self, dest: int, src: int, count: int) -> None: ... - def read_byte(self) -> int: ... - def readline(self) -> bytes: ... - def resize(self, newsize: int) -> None: ... - def seek(self, pos: int, whence: int = ...) -> None: ... - def size(self) -> int: ... - def tell(self) -> int: ... - def write_byte(self, byte: int) -> None: ... - def __len__(self) -> int: ... - closed: bool - if sys.platform != "win32": - def madvise(self, option: int, start: int = ..., length: int = ...) -> None: ... - - def find(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ... - def rfind(self, sub: ReadableBuffer, start: int = ..., stop: int = ...) -> int: ... - def read(self, n: int | None = ...) -> bytes: ... - def write(self, bytes: ReadableBuffer) -> int: ... - @overload - def __getitem__(self, key: int, /) -> int: ... - @overload - def __getitem__(self, key: slice, /) -> bytes: ... - def __delitem__(self, key: int | slice, /) -> NoReturn: ... - @overload - def __setitem__(self, key: int, value: int, /) -> None: ... - @overload - def __setitem__(self, key: slice, value: ReadableBuffer, /) -> None: ... - # Doesn't actually exist, but the object actually supports "in" because it has __getitem__, - # so we claim that there is also a __contains__ to help type checkers. - def __contains__(self, o: object, /) -> bool: ... - # Doesn't actually exist, but the object is actually iterable because it has __getitem__ and __len__, - # so we claim that there is also an __iter__ to help type checkers. - def __iter__(self) -> Iterator[int]: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - def __buffer__(self, flags: int, /) -> memoryview: ... - def __release_buffer__(self, buffer: memoryview, /) -> None: ... - if sys.version_info >= (3, 13): - def seekable(self) -> Literal[True]: ... - -if sys.platform != "win32": - MADV_NORMAL: int - MADV_RANDOM: int - MADV_SEQUENTIAL: int - MADV_WILLNEED: int - MADV_DONTNEED: int - MADV_FREE: int - -if sys.platform == "linux": - MADV_REMOVE: int - MADV_DONTFORK: int - MADV_DOFORK: int - MADV_HWPOISON: int - MADV_MERGEABLE: int - MADV_UNMERGEABLE: int - # Seems like this constant is not defined in glibc. - # See https://github.com/python/typeshed/pull/5360 for details - # MADV_SOFT_OFFLINE: int - MADV_HUGEPAGE: int - MADV_NOHUGEPAGE: int - MADV_DONTDUMP: int - MADV_DODUMP: int - -# This Values are defined for FreeBSD but type checkers do not support conditions for these -if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win32": - MADV_NOSYNC: int - MADV_AUTOSYNC: int - MADV_NOCORE: int - MADV_CORE: int - MADV_PROTECT: int - -if sys.version_info >= (3, 10) and sys.platform == "darwin": - MADV_FREE_REUSABLE: int - MADV_FREE_REUSE: int - -if sys.version_info >= (3, 13) and sys.platform != "win32": - MAP_32BIT: Final = 32768 - -if sys.version_info >= (3, 13) and sys.platform == "darwin": - MAP_NORESERVE: Final = 64 - MAP_NOEXTEND: Final = 256 - MAP_HASSEMAPHORE: Final = 512 - MAP_NOCACHE: Final = 1024 - MAP_JIT: Final = 2048 - MAP_RESILIENT_CODESIGN: Final = 8192 - MAP_RESILIENT_MEDIA: Final = 16384 - MAP_TRANSLATED_ALLOW_EXECUTE: Final = 131072 - MAP_UNIX03: Final = 262144 - MAP_TPRO: Final = 524288 - -if sys.version_info >= (3, 13) and sys.platform == "linux": - MAP_NORESERVE: Final = 16384 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/modulefinder.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/modulefinder.pyi deleted file mode 100644 index 6db665a18e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/modulefinder.pyi +++ /dev/null @@ -1,68 +0,0 @@ -import sys -from collections.abc import Container, Iterable, Iterator, Sequence -from types import CodeType -from typing import IO, Any, Final - -if sys.version_info < (3, 11): - LOAD_CONST: Final[int] # undocumented - IMPORT_NAME: Final[int] # undocumented - STORE_NAME: Final[int] # undocumented - STORE_GLOBAL: Final[int] # undocumented - STORE_OPS: Final[tuple[int, int]] # undocumented - EXTENDED_ARG: Final[int] # undocumented - -packagePathMap: dict[str, list[str]] # undocumented - -def AddPackagePath(packagename: str, path: str) -> None: ... - -replacePackageMap: dict[str, str] # undocumented - -def ReplacePackage(oldname: str, newname: str) -> None: ... - -class Module: # undocumented - def __init__(self, name: str, file: str | None = None, path: str | None = None) -> None: ... - -class ModuleFinder: - modules: dict[str, Module] - path: list[str] # undocumented - badmodules: dict[str, dict[str, int]] # undocumented - debug: int # undocumented - indent: int # undocumented - excludes: Container[str] # undocumented - replace_paths: Sequence[tuple[str, str]] # undocumented - - def __init__( - self, - path: list[str] | None = None, - debug: int = 0, - excludes: Container[str] | None = None, - replace_paths: Sequence[tuple[str, str]] | None = None, - ) -> None: ... - def msg(self, level: int, str: str, *args: Any) -> None: ... # undocumented - def msgin(self, *args: Any) -> None: ... # undocumented - def msgout(self, *args: Any) -> None: ... # undocumented - def run_script(self, pathname: str) -> None: ... - def load_file(self, pathname: str) -> None: ... # undocumented - def import_hook( - self, name: str, caller: Module | None = None, fromlist: list[str] | None = None, level: int = -1 - ) -> Module | None: ... # undocumented - def determine_parent(self, caller: Module | None, level: int = -1) -> Module | None: ... # undocumented - def find_head_package(self, parent: Module, name: str) -> tuple[Module, str]: ... # undocumented - def load_tail(self, q: Module, tail: str) -> Module: ... # undocumented - def ensure_fromlist(self, m: Module, fromlist: Iterable[str], recursive: int = 0) -> None: ... # undocumented - def find_all_submodules(self, m: Module) -> Iterable[str]: ... # undocumented - def import_module(self, partname: str, fqname: str, parent: Module) -> Module | None: ... # undocumented - def load_module(self, fqname: str, fp: IO[str], pathname: str, file_info: tuple[str, str, str]) -> Module: ... # undocumented - def scan_opcodes(self, co: CodeType) -> Iterator[tuple[str, tuple[Any, ...]]]: ... # undocumented - def scan_code(self, co: CodeType, m: Module) -> None: ... # undocumented - def load_package(self, fqname: str, pathname: str) -> Module: ... # undocumented - def add_module(self, fqname: str) -> Module: ... # undocumented - def find_module( - self, name: str, path: str | None, parent: Module | None = None - ) -> tuple[IO[Any] | None, str | None, tuple[str, str, int]]: ... # undocumented - def report(self) -> None: ... - def any_missing(self) -> list[str]: ... # undocumented - def any_missing_maybe(self) -> tuple[list[str], list[str]]: ... # undocumented - def replace_paths_in_code(self, co: CodeType) -> CodeType: ... # undocumented - -def test() -> ModuleFinder | None: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/__init__.pyi deleted file mode 100644 index 3e43cbc44f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/__init__.pyi +++ /dev/null @@ -1,177 +0,0 @@ -import sys -from collections.abc import Container, Iterable, Sequence -from types import ModuleType -from typing import Any, Literal - -if sys.platform == "win32": - from _msi import * - from _msi import _Database - - AMD64: bool - Win64: bool - - datasizemask: Literal[0x00FF] - type_valid: Literal[0x0100] - type_localizable: Literal[0x0200] - typemask: Literal[0x0C00] - type_long: Literal[0x0000] - type_short: Literal[0x0400] - type_string: Literal[0x0C00] - type_binary: Literal[0x0800] - type_nullable: Literal[0x1000] - type_key: Literal[0x2000] - knownbits: Literal[0x3FFF] - - class Table: - name: str - fields: list[tuple[int, str, int]] - def __init__(self, name: str) -> None: ... - def add_field(self, index: int, name: str, type: int) -> None: ... - def sql(self) -> str: ... - def create(self, db: _Database) -> None: ... - - class _Unspecified: ... - - def change_sequence( - seq: Sequence[tuple[str, str | None, int]], - action: str, - seqno: int | type[_Unspecified] = ..., - cond: str | type[_Unspecified] = ..., - ) -> None: ... - def add_data(db: _Database, table: str, values: Iterable[tuple[Any, ...]]) -> None: ... - def add_stream(db: _Database, name: str, path: str) -> None: ... - def init_database( - name: str, schema: ModuleType, ProductName: str, ProductCode: str, ProductVersion: str, Manufacturer: str - ) -> _Database: ... - def add_tables(db: _Database, module: ModuleType) -> None: ... - def make_id(str: str) -> str: ... - def gen_uuid() -> str: ... - - class CAB: - name: str - files: list[tuple[str, str]] - filenames: set[str] - index: int - def __init__(self, name: str) -> None: ... - def gen_id(self, file: str) -> str: ... - def append(self, full: str, file: str, logical: str) -> tuple[int, str]: ... - def commit(self, db: _Database) -> None: ... - - _directories: set[str] - - class Directory: - db: _Database - cab: CAB - basedir: str - physical: str - logical: str - component: str | None - short_names: set[str] - ids: set[str] - keyfiles: dict[str, str] - componentflags: int | None - absolute: str - def __init__( - self, - db: _Database, - cab: CAB, - basedir: str, - physical: str, - _logical: str, - default: str, - componentflags: int | None = None, - ) -> None: ... - def start_component( - self, - component: str | None = None, - feature: Feature | None = None, - flags: int | None = None, - keyfile: str | None = None, - uuid: str | None = None, - ) -> None: ... - def make_short(self, file: str) -> str: ... - def add_file(self, file: str, src: str | None = None, version: str | None = None, language: str | None = None) -> str: ... - def glob(self, pattern: str, exclude: Container[str] | None = None) -> list[str]: ... - def remove_pyc(self) -> None: ... - - class Binary: - name: str - def __init__(self, fname: str) -> None: ... - - class Feature: - id: str - def __init__( - self, - db: _Database, - id: str, - title: str, - desc: str, - display: int, - level: int = 1, - parent: Feature | None = None, - directory: str | None = None, - attributes: int = 0, - ) -> None: ... - def set_current(self) -> None: ... - - class Control: - dlg: Dialog - name: str - def __init__(self, dlg: Dialog, name: str) -> None: ... - def event(self, event: str, argument: str, condition: str = "1", ordering: int | None = None) -> None: ... - def mapping(self, event: str, attribute: str) -> None: ... - def condition(self, action: str, condition: str) -> None: ... - - class RadioButtonGroup(Control): - property: str - index: int - def __init__(self, dlg: Dialog, name: str, property: str) -> None: ... - def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = None) -> None: ... - - class Dialog: - db: _Database - name: str - x: int - y: int - w: int - h: int - def __init__( - self, - db: _Database, - name: str, - x: int, - y: int, - w: int, - h: int, - attr: int, - title: str, - first: str, - default: str, - cancel: str, - ) -> None: ... - def control( - self, - name: str, - type: str, - x: int, - y: int, - w: int, - h: int, - attr: int, - prop: str | None, - text: str | None, - next: str | None, - help: str | None, - ) -> Control: ... - def text(self, name: str, x: int, y: int, w: int, h: int, attr: int, text: str | None) -> Control: ... - def bitmap(self, name: str, x: int, y: int, w: int, h: int, text: str | None) -> Control: ... - def line(self, name: str, x: int, y: int, w: int, h: int) -> Control: ... - def pushbutton( - self, name: str, x: int, y: int, w: int, h: int, attr: int, text: str | None, next: str | None - ) -> Control: ... - def radiogroup( - self, name: str, x: int, y: int, w: int, h: int, attr: int, prop: str | None, text: str | None, next: str | None - ) -> RadioButtonGroup: ... - def checkbox( - self, name: str, x: int, y: int, w: int, h: int, attr: int, prop: str | None, text: str | None, next: str | None - ) -> Control: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/schema.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/schema.pyi deleted file mode 100644 index 4ad9a1783f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/schema.pyi +++ /dev/null @@ -1,94 +0,0 @@ -import sys - -if sys.platform == "win32": - from . import Table - - _Validation: Table - ActionText: Table - AdminExecuteSequence: Table - Condition: Table - AdminUISequence: Table - AdvtExecuteSequence: Table - AdvtUISequence: Table - AppId: Table - AppSearch: Table - Property: Table - BBControl: Table - Billboard: Table - Feature: Table - Binary: Table - BindImage: Table - File: Table - CCPSearch: Table - CheckBox: Table - Class: Table - Component: Table - Icon: Table - ProgId: Table - ComboBox: Table - CompLocator: Table - Complus: Table - Directory: Table - Control: Table - Dialog: Table - ControlCondition: Table - ControlEvent: Table - CreateFolder: Table - CustomAction: Table - DrLocator: Table - DuplicateFile: Table - Environment: Table - Error: Table - EventMapping: Table - Extension: Table - MIME: Table - FeatureComponents: Table - FileSFPCatalog: Table - SFPCatalog: Table - Font: Table - IniFile: Table - IniLocator: Table - InstallExecuteSequence: Table - InstallUISequence: Table - IsolatedComponent: Table - LaunchCondition: Table - ListBox: Table - ListView: Table - LockPermissions: Table - Media: Table - MoveFile: Table - MsiAssembly: Table - MsiAssemblyName: Table - MsiDigitalCertificate: Table - MsiDigitalSignature: Table - MsiFileHash: Table - MsiPatchHeaders: Table - ODBCAttribute: Table - ODBCDriver: Table - ODBCDataSource: Table - ODBCSourceAttribute: Table - ODBCTranslator: Table - Patch: Table - PatchPackage: Table - PublishComponent: Table - RadioButton: Table - Registry: Table - RegLocator: Table - RemoveFile: Table - RemoveIniFile: Table - RemoveRegistry: Table - ReserveCost: Table - SelfReg: Table - ServiceControl: Table - ServiceInstall: Table - Shortcut: Table - Signature: Table - TextStyle: Table - TypeLib: Table - UIText: Table - Upgrade: Table - Verb: Table - - tables: list[Table] - - _Validation_records: list[tuple[str, str, str, int | None, int | None, str | None, int | None, str | None, str | None, str]] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/sequence.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/sequence.pyi deleted file mode 100644 index b8af09f46e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/sequence.pyi +++ /dev/null @@ -1,13 +0,0 @@ -import sys -from typing_extensions import TypeAlias - -if sys.platform == "win32": - _SequenceType: TypeAlias = list[tuple[str, str | None, int]] - - AdminExecuteSequence: _SequenceType - AdminUISequence: _SequenceType - AdvtExecuteSequence: _SequenceType - InstallExecuteSequence: _SequenceType - InstallUISequence: _SequenceType - - tables: list[str] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/text.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/text.pyi deleted file mode 100644 index 441c843ca6..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/msilib/text.pyi +++ /dev/null @@ -1,7 +0,0 @@ -import sys - -if sys.platform == "win32": - ActionText: list[tuple[str, str, str | None]] - UIText: list[tuple[str, str | None]] - dirname: str - tables: list[str] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/msvcrt.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/msvcrt.pyi deleted file mode 100644 index 403a5d9335..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/msvcrt.pyi +++ /dev/null @@ -1,32 +0,0 @@ -import sys -from typing import Final - -# This module is only available on Windows -if sys.platform == "win32": - CRT_ASSEMBLY_VERSION: Final[str] - LK_UNLCK: Final = 0 - LK_LOCK: Final = 1 - LK_NBLCK: Final = 2 - LK_RLCK: Final = 3 - LK_NBRLCK: Final = 4 - SEM_FAILCRITICALERRORS: int - SEM_NOALIGNMENTFAULTEXCEPT: int - SEM_NOGPFAULTERRORBOX: int - SEM_NOOPENFILEERRORBOX: int - def locking(fd: int, mode: int, nbytes: int, /) -> None: ... - def setmode(fd: int, mode: int, /) -> int: ... - def open_osfhandle(handle: int, flags: int, /) -> int: ... - def get_osfhandle(fd: int, /) -> int: ... - def kbhit() -> bool: ... - def getch() -> bytes: ... - def getwch() -> str: ... - def getche() -> bytes: ... - def getwche() -> str: ... - def putch(char: bytes | bytearray, /) -> None: ... - def putwch(unicode_char: str, /) -> None: ... - def ungetch(char: bytes | bytearray, /) -> None: ... - def ungetwch(unicode_char: str, /) -> None: ... - def heapmin() -> None: ... - def SetErrorMode(mode: int, /) -> int: ... - if sys.version_info >= (3, 10): - def GetErrorMode() -> int: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/__init__.pyi deleted file mode 100644 index 2bd6e2883d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/__init__.pyi +++ /dev/null @@ -1,90 +0,0 @@ -from multiprocessing import context, reduction as reducer -from multiprocessing.context import ( - AuthenticationError as AuthenticationError, - BufferTooShort as BufferTooShort, - Process as Process, - ProcessError as ProcessError, - TimeoutError as TimeoutError, -) -from multiprocessing.process import ( - active_children as active_children, - current_process as current_process, - parent_process as parent_process, -) - -# These are technically functions that return instances of these Queue classes. -# The stub here doesn't reflect reality exactly -- -# while e.g. `multiprocessing.queues.Queue` is a class, -# `multiprocessing.Queue` is actually a function at runtime. -# Avoid using `multiprocessing.Queue` as a type annotation; -# use imports from multiprocessing.queues instead. -# See #4266 and #8450 for discussion. -from multiprocessing.queues import JoinableQueue as JoinableQueue, Queue as Queue, SimpleQueue as SimpleQueue -from multiprocessing.spawn import freeze_support as freeze_support - -__all__ = [ - "Array", - "AuthenticationError", - "Barrier", - "BoundedSemaphore", - "BufferTooShort", - "Condition", - "Event", - "JoinableQueue", - "Lock", - "Manager", - "Pipe", - "Pool", - "Process", - "ProcessError", - "Queue", - "RLock", - "RawArray", - "RawValue", - "Semaphore", - "SimpleQueue", - "TimeoutError", - "Value", - "active_children", - "allow_connection_pickling", - "cpu_count", - "current_process", - "freeze_support", - "get_all_start_methods", - "get_context", - "get_logger", - "get_start_method", - "log_to_stderr", - "parent_process", - "reducer", - "set_executable", - "set_forkserver_preload", - "set_start_method", -] - -# These functions (really bound methods) -# are all autogenerated at runtime here: https://github.com/python/cpython/blob/600c65c094b0b48704d8ec2416930648052ba715/Lib/multiprocessing/__init__.py#L23 -RawValue = context._default_context.RawValue -RawArray = context._default_context.RawArray -Value = context._default_context.Value -Array = context._default_context.Array -Barrier = context._default_context.Barrier -BoundedSemaphore = context._default_context.BoundedSemaphore -Condition = context._default_context.Condition -Event = context._default_context.Event -Lock = context._default_context.Lock -RLock = context._default_context.RLock -Semaphore = context._default_context.Semaphore -Pipe = context._default_context.Pipe -Pool = context._default_context.Pool -allow_connection_pickling = context._default_context.allow_connection_pickling -cpu_count = context._default_context.cpu_count -get_logger = context._default_context.get_logger -log_to_stderr = context._default_context.log_to_stderr -Manager = context._default_context.Manager -set_executable = context._default_context.set_executable -set_forkserver_preload = context._default_context.set_forkserver_preload -get_all_start_methods = context._default_context.get_all_start_methods -get_start_method = context._default_context.get_start_method -set_start_method = context._default_context.set_start_method -get_context = context._default_context.get_context diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/connection.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/connection.pyi deleted file mode 100644 index cd4fa102c0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/connection.pyi +++ /dev/null @@ -1,83 +0,0 @@ -import socket -import sys -from _typeshed import Incomplete, ReadableBuffer -from collections.abc import Iterable -from types import TracebackType -from typing import Any, Generic, SupportsIndex, TypeVar -from typing_extensions import Self, TypeAlias - -__all__ = ["Client", "Listener", "Pipe", "wait"] - -# https://docs.python.org/3/library/multiprocessing.html#address-formats -_Address: TypeAlias = str | tuple[str, int] - -# Defaulting to Any to avoid forcing generics on a lot of pre-existing code -_SendT_contra = TypeVar("_SendT_contra", contravariant=True, default=Any) -_RecvT_co = TypeVar("_RecvT_co", covariant=True, default=Any) - -class _ConnectionBase(Generic[_SendT_contra, _RecvT_co]): - def __init__(self, handle: SupportsIndex, readable: bool = True, writable: bool = True) -> None: ... - @property - def closed(self) -> bool: ... # undocumented - @property - def readable(self) -> bool: ... # undocumented - @property - def writable(self) -> bool: ... # undocumented - def fileno(self) -> int: ... - def close(self) -> None: ... - def send_bytes(self, buf: ReadableBuffer, offset: int = 0, size: int | None = None) -> None: ... - def send(self, obj: _SendT_contra) -> None: ... - def recv_bytes(self, maxlength: int | None = None) -> bytes: ... - def recv_bytes_into(self, buf: Any, offset: int = 0) -> int: ... - def recv(self) -> _RecvT_co: ... - def poll(self, timeout: float | None = 0.0) -> bool: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - def __del__(self) -> None: ... - -class Connection(_ConnectionBase[_SendT_contra, _RecvT_co]): ... - -if sys.platform == "win32": - class PipeConnection(_ConnectionBase[_SendT_contra, _RecvT_co]): ... - -class Listener: - def __init__( - self, address: _Address | None = None, family: str | None = None, backlog: int = 1, authkey: bytes | None = None - ) -> None: ... - def accept(self) -> Connection[Incomplete, Incomplete]: ... - def close(self) -> None: ... - @property - def address(self) -> _Address: ... - @property - def last_accepted(self) -> _Address | None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - -# Any: send and recv methods unused -if sys.version_info >= (3, 12): - def deliver_challenge(connection: Connection[Any, Any], authkey: bytes, digest_name: str = "sha256") -> None: ... - -else: - def deliver_challenge(connection: Connection[Any, Any], authkey: bytes) -> None: ... - -def answer_challenge(connection: Connection[Any, Any], authkey: bytes) -> None: ... -def wait( - object_list: Iterable[Connection[_SendT_contra, _RecvT_co] | socket.socket | int], timeout: float | None = None -) -> list[Connection[_SendT_contra, _RecvT_co] | socket.socket | int]: ... -def Client(address: _Address, family: str | None = None, authkey: bytes | None = None) -> Connection[Any, Any]: ... - -# N.B. Keep this in sync with multiprocessing.context.BaseContext.Pipe. -# _ConnectionBase is the common base class of Connection and PipeConnection -# and can be used in cross-platform code. -# -# The two connections should have the same generic types but inverted (Connection[_T1, _T2], Connection[_T2, _T1]). -# However, TypeVars scoped entirely within a return annotation is unspecified in the spec. -if sys.platform != "win32": - def Pipe(duplex: bool = True) -> tuple[Connection[Any, Any], Connection[Any, Any]]: ... - -else: - def Pipe(duplex: bool = True) -> tuple[PipeConnection[Any, Any], PipeConnection[Any, Any]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/context.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/context.pyi deleted file mode 100644 index 03d1d2e5c2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/context.pyi +++ /dev/null @@ -1,206 +0,0 @@ -import ctypes -import sys -from _ctypes import _CData -from collections.abc import Callable, Iterable, Sequence -from ctypes import _SimpleCData, c_char -from logging import Logger, _Level as _LoggingLevel -from multiprocessing import popen_fork, popen_forkserver, popen_spawn_posix, popen_spawn_win32, queues, synchronize -from multiprocessing.managers import SyncManager -from multiprocessing.pool import Pool as _Pool -from multiprocessing.process import BaseProcess -from multiprocessing.sharedctypes import Synchronized, SynchronizedArray, SynchronizedString -from typing import Any, ClassVar, Literal, TypeVar, overload -from typing_extensions import TypeAlias - -if sys.platform != "win32": - from multiprocessing.connection import Connection -else: - from multiprocessing.connection import PipeConnection - -__all__ = () - -_LockLike: TypeAlias = synchronize.Lock | synchronize.RLock -_T = TypeVar("_T") -_CT = TypeVar("_CT", bound=_CData) - -class ProcessError(Exception): ... -class BufferTooShort(ProcessError): ... -class TimeoutError(ProcessError): ... -class AuthenticationError(ProcessError): ... - -class BaseContext: - ProcessError: ClassVar[type[ProcessError]] - BufferTooShort: ClassVar[type[BufferTooShort]] - TimeoutError: ClassVar[type[TimeoutError]] - AuthenticationError: ClassVar[type[AuthenticationError]] - - # N.B. The methods below are applied at runtime to generate - # multiprocessing.*, so the signatures should be identical (modulo self). - @staticmethod - def current_process() -> BaseProcess: ... - @staticmethod - def parent_process() -> BaseProcess | None: ... - @staticmethod - def active_children() -> list[BaseProcess]: ... - def cpu_count(self) -> int: ... - def Manager(self) -> SyncManager: ... - - # N.B. Keep this in sync with multiprocessing.connection.Pipe. - # _ConnectionBase is the common base class of Connection and PipeConnection - # and can be used in cross-platform code. - # - # The two connections should have the same generic types but inverted (Connection[_T1, _T2], Connection[_T2, _T1]). - # However, TypeVars scoped entirely within a return annotation is unspecified in the spec. - if sys.platform != "win32": - def Pipe(self, duplex: bool = True) -> tuple[Connection[Any, Any], Connection[Any, Any]]: ... - else: - def Pipe(self, duplex: bool = True) -> tuple[PipeConnection[Any, Any], PipeConnection[Any, Any]]: ... - - def Barrier( - self, parties: int, action: Callable[..., object] | None = None, timeout: float | None = None - ) -> synchronize.Barrier: ... - def BoundedSemaphore(self, value: int = 1) -> synchronize.BoundedSemaphore: ... - def Condition(self, lock: _LockLike | None = None) -> synchronize.Condition: ... - def Event(self) -> synchronize.Event: ... - def Lock(self) -> synchronize.Lock: ... - def RLock(self) -> synchronize.RLock: ... - def Semaphore(self, value: int = 1) -> synchronize.Semaphore: ... - def Queue(self, maxsize: int = 0) -> queues.Queue[Any]: ... - def JoinableQueue(self, maxsize: int = 0) -> queues.JoinableQueue[Any]: ... - def SimpleQueue(self) -> queues.SimpleQueue[Any]: ... - def Pool( - self, - processes: int | None = None, - initializer: Callable[..., object] | None = None, - initargs: Iterable[Any] = (), - maxtasksperchild: int | None = None, - ) -> _Pool: ... - @overload - def RawValue(self, typecode_or_type: type[_CT], *args: Any) -> _CT: ... - @overload - def RawValue(self, typecode_or_type: str, *args: Any) -> Any: ... - @overload - def RawArray(self, typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any]) -> ctypes.Array[_CT]: ... - @overload - def RawArray(self, typecode_or_type: str, size_or_initializer: int | Sequence[Any]) -> Any: ... - @overload - def Value( - self, typecode_or_type: type[_SimpleCData[_T]], *args: Any, lock: Literal[True] | _LockLike = True - ) -> Synchronized[_T]: ... - @overload - def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[False]) -> Synchronized[_CT]: ... - @overload - def Value(self, typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = True) -> Synchronized[_CT]: ... - @overload - def Value(self, typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = True) -> Synchronized[Any]: ... - @overload - def Value(self, typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True) -> Any: ... - @overload - def Array( - self, typecode_or_type: type[_SimpleCData[_T]], size_or_initializer: int | Sequence[Any], *, lock: Literal[False] - ) -> SynchronizedArray[_T]: ... - @overload - def Array( - self, typecode_or_type: type[c_char], size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True - ) -> SynchronizedString: ... - @overload - def Array( - self, - typecode_or_type: type[_SimpleCData[_T]], - size_or_initializer: int | Sequence[Any], - *, - lock: Literal[True] | _LockLike = True, - ) -> SynchronizedArray[_T]: ... - @overload - def Array( - self, typecode_or_type: str, size_or_initializer: int | Sequence[Any], *, lock: Literal[True] | _LockLike = True - ) -> SynchronizedArray[Any]: ... - @overload - def Array( - self, typecode_or_type: str | type[_CData], size_or_initializer: int | Sequence[Any], *, lock: bool | _LockLike = True - ) -> Any: ... - def freeze_support(self) -> None: ... - def get_logger(self) -> Logger: ... - def log_to_stderr(self, level: _LoggingLevel | None = None) -> Logger: ... - def allow_connection_pickling(self) -> None: ... - def set_executable(self, executable: str) -> None: ... - def set_forkserver_preload(self, module_names: list[str]) -> None: ... - if sys.platform != "win32": - @overload - def get_context(self, method: None = None) -> DefaultContext: ... - @overload - def get_context(self, method: Literal["spawn"]) -> SpawnContext: ... - @overload - def get_context(self, method: Literal["fork"]) -> ForkContext: ... - @overload - def get_context(self, method: Literal["forkserver"]) -> ForkServerContext: ... - @overload - def get_context(self, method: str) -> BaseContext: ... - else: - @overload - def get_context(self, method: None = None) -> DefaultContext: ... - @overload - def get_context(self, method: Literal["spawn"]) -> SpawnContext: ... - @overload - def get_context(self, method: str) -> BaseContext: ... - - @overload - def get_start_method(self, allow_none: Literal[False] = False) -> str: ... - @overload - def get_start_method(self, allow_none: bool) -> str | None: ... - def set_start_method(self, method: str | None, force: bool = False) -> None: ... - @property - def reducer(self) -> str: ... - @reducer.setter - def reducer(self, reduction: str) -> None: ... - def _check_available(self) -> None: ... - -class Process(BaseProcess): - _start_method: str | None - @staticmethod - def _Popen(process_obj: BaseProcess) -> DefaultContext: ... - -class DefaultContext(BaseContext): - Process: ClassVar[type[Process]] - def __init__(self, context: BaseContext) -> None: ... - def get_start_method(self, allow_none: bool = False) -> str: ... - def get_all_start_methods(self) -> list[str]: ... - -_default_context: DefaultContext - -class SpawnProcess(BaseProcess): - _start_method: str - if sys.platform != "win32": - @staticmethod - def _Popen(process_obj: BaseProcess) -> popen_spawn_posix.Popen: ... - else: - @staticmethod - def _Popen(process_obj: BaseProcess) -> popen_spawn_win32.Popen: ... - -class SpawnContext(BaseContext): - _name: str - Process: ClassVar[type[SpawnProcess]] - -if sys.platform != "win32": - class ForkProcess(BaseProcess): - _start_method: str - @staticmethod - def _Popen(process_obj: BaseProcess) -> popen_fork.Popen: ... - - class ForkServerProcess(BaseProcess): - _start_method: str - @staticmethod - def _Popen(process_obj: BaseProcess) -> popen_forkserver.Popen: ... - - class ForkContext(BaseContext): - _name: str - Process: ClassVar[type[ForkProcess]] - - class ForkServerContext(BaseContext): - _name: str - Process: ClassVar[type[ForkServerProcess]] - -def _force_start_method(method: str) -> None: ... -def get_spawning_popen() -> Any | None: ... -def set_spawning_popen(popen: Any) -> None: ... -def assert_spawning(obj: Any) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/dummy/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/dummy/__init__.pyi deleted file mode 100644 index 3cbeeb0577..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +++ /dev/null @@ -1,77 +0,0 @@ -import array -import threading -import weakref -from collections.abc import Callable, Iterable, Mapping, Sequence -from queue import Queue as Queue -from threading import ( - Barrier as Barrier, - BoundedSemaphore as BoundedSemaphore, - Condition as Condition, - Event as Event, - Lock as Lock, - RLock as RLock, - Semaphore as Semaphore, -) -from typing import Any, Literal - -from .connection import Pipe as Pipe - -__all__ = [ - "Process", - "current_process", - "active_children", - "freeze_support", - "Lock", - "RLock", - "Semaphore", - "BoundedSemaphore", - "Condition", - "Event", - "Barrier", - "Queue", - "Manager", - "Pipe", - "Pool", - "JoinableQueue", -] - -JoinableQueue = Queue - -class DummyProcess(threading.Thread): - _children: weakref.WeakKeyDictionary[Any, Any] - _parent: threading.Thread - _pid: None - _start_called: int - @property - def exitcode(self) -> Literal[0] | None: ... - def __init__( - self, - group: Any = None, - target: Callable[..., object] | None = None, - name: str | None = None, - args: Iterable[Any] = (), - kwargs: Mapping[str, Any] = {}, - ) -> None: ... - -Process = DummyProcess - -class Namespace: - def __init__(self, **kwds: Any) -> None: ... - def __getattr__(self, name: str, /) -> Any: ... - def __setattr__(self, name: str, value: Any, /) -> None: ... - -class Value: - _typecode: Any - _value: Any - value: Any - def __init__(self, typecode: Any, value: Any, lock: Any = True) -> None: ... - -def Array(typecode: Any, sequence: Sequence[Any], lock: Any = True) -> array.array[Any]: ... -def Manager() -> Any: ... -def Pool(processes: int | None = None, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ()) -> Any: ... -def active_children() -> list[Any]: ... - -current_process = threading.current_thread - -def freeze_support() -> None: ... -def shutdown() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/dummy/connection.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/dummy/connection.pyi deleted file mode 100644 index d7e9821294..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/dummy/connection.pyi +++ /dev/null @@ -1,39 +0,0 @@ -from multiprocessing.connection import _Address -from queue import Queue -from types import TracebackType -from typing import Any -from typing_extensions import Self - -__all__ = ["Client", "Listener", "Pipe"] - -families: list[None] - -class Connection: - _in: Any - _out: Any - recv: Any - recv_bytes: Any - send: Any - send_bytes: Any - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - def __init__(self, _in: Any, _out: Any) -> None: ... - def close(self) -> None: ... - def poll(self, timeout: float = 0.0) -> bool: ... - -class Listener: - _backlog_queue: Queue[Any] | None - @property - def address(self) -> Queue[Any] | None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - def __init__(self, address: _Address | None = None, family: int | None = None, backlog: int = 1) -> None: ... - def accept(self) -> Connection: ... - def close(self) -> None: ... - -def Client(address: _Address) -> Connection: ... -def Pipe(duplex: bool = True) -> tuple[Connection, Connection]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/forkserver.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/forkserver.pyi deleted file mode 100644 index 31b9828563..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/forkserver.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from _typeshed import FileDescriptorLike, Unused -from collections.abc import Sequence -from struct import Struct -from typing import Any, Final - -__all__ = ["ensure_running", "get_inherited_fds", "connect_to_new_process", "set_forkserver_preload"] - -MAXFDS_TO_SEND: Final = 256 -SIGNED_STRUCT: Final[Struct] - -class ForkServer: - def set_forkserver_preload(self, modules_names: list[str]) -> None: ... - def get_inherited_fds(self) -> list[int] | None: ... - def connect_to_new_process(self, fds: Sequence[int]) -> tuple[int, int]: ... - def ensure_running(self) -> None: ... - -def main( - listener_fd: int | None, - alive_r: FileDescriptorLike, - preload: Sequence[str], - main_path: str | None = None, - sys_path: Unused = None, -) -> None: ... -def read_signed(fd: int) -> Any: ... -def write_signed(fd: int, n: int) -> None: ... - -_forkserver: ForkServer -ensure_running = _forkserver.ensure_running -get_inherited_fds = _forkserver.get_inherited_fds -connect_to_new_process = _forkserver.connect_to_new_process -set_forkserver_preload = _forkserver.set_forkserver_preload diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/heap.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/heap.pyi deleted file mode 100644 index b5e2ced5e8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/heap.pyi +++ /dev/null @@ -1,36 +0,0 @@ -import sys -from _typeshed import Incomplete -from collections.abc import Callable -from mmap import mmap -from typing import Protocol -from typing_extensions import TypeAlias - -__all__ = ["BufferWrapper"] - -class Arena: - size: int - buffer: mmap - if sys.platform == "win32": - name: str - def __init__(self, size: int) -> None: ... - else: - fd: int - def __init__(self, size: int, fd: int = -1) -> None: ... - -_Block: TypeAlias = tuple[Arena, int, int] - -if sys.platform != "win32": - class _SupportsDetach(Protocol): - def detach(self) -> int: ... - - def reduce_arena(a: Arena) -> tuple[Callable[[int, _SupportsDetach], Arena], tuple[int, Incomplete]]: ... - def rebuild_arena(size: int, dupfd: _SupportsDetach) -> Arena: ... - -class Heap: - def __init__(self, size: int = ...) -> None: ... - def free(self, block: _Block) -> None: ... - def malloc(self, size: int) -> _Block: ... - -class BufferWrapper: - def __init__(self, size: int) -> None: ... - def create_memoryview(self) -> memoryview: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/managers.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/managers.pyi deleted file mode 100644 index 50e4f1c1fe..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/managers.pyi +++ /dev/null @@ -1,288 +0,0 @@ -import queue -import sys -import threading -from _typeshed import SupportsKeysAndGetItem, SupportsRichComparison, SupportsRichComparisonT -from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping, MutableSequence, Sequence -from types import GenericAlias, TracebackType -from typing import Any, AnyStr, ClassVar, Generic, SupportsIndex, TypeVar, overload -from typing_extensions import Self, TypeAlias - -from . import pool -from .connection import Connection, _Address -from .context import BaseContext -from .shared_memory import _SLT, ShareableList as _ShareableList, SharedMemory as _SharedMemory -from .util import Finalize as _Finalize - -__all__ = ["BaseManager", "SyncManager", "BaseProxy", "Token", "SharedMemoryManager"] - -_T = TypeVar("_T") -_KT = TypeVar("_KT") -_VT = TypeVar("_VT") - -class Namespace: - def __init__(self, **kwds: Any) -> None: ... - def __getattr__(self, name: str, /) -> Any: ... - def __setattr__(self, name: str, value: Any, /) -> None: ... - -_Namespace: TypeAlias = Namespace - -class Token: - typeid: str | bytes | None - address: _Address | None - id: str | bytes | int | None - def __init__(self, typeid: bytes | str | None, address: _Address | None, id: str | bytes | int | None) -> None: ... - def __getstate__(self) -> tuple[str | bytes | None, tuple[str | bytes, int], str | bytes | int | None]: ... - def __setstate__(self, state: tuple[str | bytes | None, tuple[str | bytes, int], str | bytes | int | None]) -> None: ... - -class BaseProxy: - _address_to_local: dict[_Address, Any] - _mutex: Any - def __init__( - self, - token: Any, - serializer: str, - manager: Any = None, - authkey: AnyStr | None = None, - exposed: Any = None, - incref: bool = True, - manager_owned: bool = False, - ) -> None: ... - def __deepcopy__(self, memo: Any | None) -> Any: ... - def _callmethod(self, methodname: str, args: tuple[Any, ...] = (), kwds: dict[Any, Any] = {}) -> None: ... - def _getvalue(self) -> Any: ... - def __reduce__(self) -> tuple[Any, tuple[Any, Any, str, dict[Any, Any]]]: ... - -class ValueProxy(BaseProxy, Generic[_T]): - def get(self) -> _T: ... - def set(self, value: _T) -> None: ... - value: _T - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -if sys.version_info >= (3, 13): - class _BaseDictProxy(BaseProxy, MutableMapping[_KT, _VT]): - __builtins__: ClassVar[dict[str, Any]] - def __len__(self) -> int: ... - def __getitem__(self, key: _KT, /) -> _VT: ... - def __setitem__(self, key: _KT, value: _VT, /) -> None: ... - def __delitem__(self, key: _KT, /) -> None: ... - def __iter__(self) -> Iterator[_KT]: ... - def copy(self) -> dict[_KT, _VT]: ... - @overload # type: ignore[override] - def get(self, key: _KT, /) -> _VT | None: ... - @overload - def get(self, key: _KT, default: _VT, /) -> _VT: ... - @overload - def get(self, key: _KT, default: _T, /) -> _VT | _T: ... - @overload - def pop(self, key: _KT, /) -> _VT: ... - @overload - def pop(self, key: _KT, default: _VT, /) -> _VT: ... - @overload - def pop(self, key: _KT, default: _T, /) -> _VT | _T: ... - def keys(self) -> list[_KT]: ... # type: ignore[override] - def items(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override] - def values(self) -> list[_VT]: ... # type: ignore[override] - - class DictProxy(_BaseDictProxy[_KT, _VT]): - def __class_getitem__(cls, args: Any, /) -> GenericAlias: ... - -else: - class DictProxy(BaseProxy, MutableMapping[_KT, _VT]): - __builtins__: ClassVar[dict[str, Any]] - def __len__(self) -> int: ... - def __getitem__(self, key: _KT, /) -> _VT: ... - def __setitem__(self, key: _KT, value: _VT, /) -> None: ... - def __delitem__(self, key: _KT, /) -> None: ... - def __iter__(self) -> Iterator[_KT]: ... - def copy(self) -> dict[_KT, _VT]: ... - @overload # type: ignore[override] - def get(self, key: _KT, /) -> _VT | None: ... - @overload - def get(self, key: _KT, default: _VT, /) -> _VT: ... - @overload - def get(self, key: _KT, default: _T, /) -> _VT | _T: ... - @overload - def pop(self, key: _KT, /) -> _VT: ... - @overload - def pop(self, key: _KT, default: _VT, /) -> _VT: ... - @overload - def pop(self, key: _KT, default: _T, /) -> _VT | _T: ... - def keys(self) -> list[_KT]: ... # type: ignore[override] - def items(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override] - def values(self) -> list[_VT]: ... # type: ignore[override] - -class BaseListProxy(BaseProxy, MutableSequence[_T]): - __builtins__: ClassVar[dict[str, Any]] - def __len__(self) -> int: ... - def __add__(self, x: list[_T], /) -> list[_T]: ... - def __delitem__(self, i: SupportsIndex | slice, /) -> None: ... - @overload - def __getitem__(self, i: SupportsIndex, /) -> _T: ... - @overload - def __getitem__(self, s: slice, /) -> list[_T]: ... - @overload - def __setitem__(self, i: SupportsIndex, o: _T, /) -> None: ... - @overload - def __setitem__(self, s: slice, o: Iterable[_T], /) -> None: ... - def __mul__(self, n: SupportsIndex, /) -> list[_T]: ... - def __rmul__(self, n: SupportsIndex, /) -> list[_T]: ... - def __imul__(self, value: SupportsIndex, /) -> Self: ... - def __reversed__(self) -> Iterator[_T]: ... - def append(self, object: _T, /) -> None: ... - def extend(self, iterable: Iterable[_T], /) -> None: ... - def pop(self, index: SupportsIndex = ..., /) -> _T: ... - def index(self, value: _T, start: SupportsIndex = ..., stop: SupportsIndex = ..., /) -> int: ... - def count(self, value: _T, /) -> int: ... - def insert(self, index: SupportsIndex, object: _T, /) -> None: ... - def remove(self, value: _T, /) -> None: ... - # Use BaseListProxy[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison] - # to work around invariance - @overload - def sort(self: BaseListProxy[SupportsRichComparisonT], *, key: None = None, reverse: bool = ...) -> None: ... - @overload - def sort(self, *, key: Callable[[_T], SupportsRichComparison], reverse: bool = ...) -> None: ... - -class ListProxy(BaseListProxy[_T]): - def __iadd__(self, value: Iterable[_T], /) -> Self: ... # type: ignore[override] - def __imul__(self, value: SupportsIndex, /) -> Self: ... # type: ignore[override] - if sys.version_info >= (3, 13): - def __class_getitem__(cls, args: Any, /) -> Any: ... - -# Send is (kind, result) -# Receive is (id, methodname, args, kwds) -_ServerConnection: TypeAlias = Connection[tuple[str, Any], tuple[str, str, Iterable[Any], Mapping[str, Any]]] - -# Returned by BaseManager.get_server() -class Server: - address: _Address | None - id_to_obj: dict[str, tuple[Any, set[str], dict[str, str]]] - fallback_mapping: dict[str, Callable[[_ServerConnection, str, Any], Any]] - public: list[str] - # Registry values are (callable, exposed, method_to_typeid, proxytype) - def __init__( - self, - registry: dict[str, tuple[Callable[..., Any], Iterable[str], dict[str, str], Any]], - address: _Address | None, - authkey: bytes, - serializer: str, - ) -> None: ... - def serve_forever(self) -> None: ... - def accepter(self) -> None: ... - if sys.version_info >= (3, 10): - def handle_request(self, conn: _ServerConnection) -> None: ... - else: - def handle_request(self, c: _ServerConnection) -> None: ... - - def serve_client(self, conn: _ServerConnection) -> None: ... - def fallback_getvalue(self, conn: _ServerConnection, ident: str, obj: _T) -> _T: ... - def fallback_str(self, conn: _ServerConnection, ident: str, obj: Any) -> str: ... - def fallback_repr(self, conn: _ServerConnection, ident: str, obj: Any) -> str: ... - def dummy(self, c: _ServerConnection) -> None: ... - def debug_info(self, c: _ServerConnection) -> str: ... - def number_of_objects(self, c: _ServerConnection) -> int: ... - def shutdown(self, c: _ServerConnection) -> None: ... - def create(self, c: _ServerConnection, typeid: str, /, *args: Any, **kwds: Any) -> tuple[str, tuple[str, ...]]: ... - def get_methods(self, c: _ServerConnection, token: Token) -> set[str]: ... - def accept_connection(self, c: _ServerConnection, name: str) -> None: ... - def incref(self, c: _ServerConnection, ident: str) -> None: ... - def decref(self, c: _ServerConnection, ident: str) -> None: ... - -class BaseManager: - if sys.version_info >= (3, 11): - def __init__( - self, - address: _Address | None = None, - authkey: bytes | None = None, - serializer: str = "pickle", - ctx: BaseContext | None = None, - *, - shutdown_timeout: float = 1.0, - ) -> None: ... - else: - def __init__( - self, - address: _Address | None = None, - authkey: bytes | None = None, - serializer: str = "pickle", - ctx: BaseContext | None = None, - ) -> None: ... - - def get_server(self) -> Server: ... - def connect(self) -> None: ... - def start(self, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = ()) -> None: ... - shutdown: _Finalize # only available after start() was called - def join(self, timeout: float | None = None) -> None: ... # undocumented - @property - def address(self) -> _Address | None: ... - @classmethod - def register( - cls, - typeid: str, - callable: Callable[..., object] | None = None, - proxytype: Any = None, - exposed: Sequence[str] | None = None, - method_to_typeid: Mapping[str, str] | None = None, - create_method: bool = True, - ) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - -class SyncManager(BaseManager): - def Barrier( - self, parties: int, action: Callable[[], None] | None = None, timeout: float | None = None - ) -> threading.Barrier: ... - def BoundedSemaphore(self, value: int = 1) -> threading.BoundedSemaphore: ... - def Condition(self, lock: threading.Lock | threading._RLock | None = None) -> threading.Condition: ... - def Event(self) -> threading.Event: ... - def Lock(self) -> threading.Lock: ... - def Namespace(self) -> _Namespace: ... - def Pool( - self, - processes: int | None = None, - initializer: Callable[..., object] | None = None, - initargs: Iterable[Any] = (), - maxtasksperchild: int | None = None, - context: Any | None = None, - ) -> pool.Pool: ... - def Queue(self, maxsize: int = ...) -> queue.Queue[Any]: ... - def JoinableQueue(self, maxsize: int = ...) -> queue.Queue[Any]: ... - def RLock(self) -> threading.RLock: ... - def Semaphore(self, value: int = 1) -> threading.Semaphore: ... - def Array(self, typecode: Any, sequence: Sequence[_T]) -> Sequence[_T]: ... - def Value(self, typecode: Any, value: _T) -> ValueProxy[_T]: ... - # Overloads are copied from builtins.dict.__init__ - @overload - def dict(self) -> DictProxy[Any, Any]: ... - @overload - def dict(self, **kwargs: _VT) -> DictProxy[str, _VT]: ... - @overload - def dict(self, map: SupportsKeysAndGetItem[_KT, _VT], /) -> DictProxy[_KT, _VT]: ... - @overload - def dict(self, map: SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT) -> DictProxy[str, _VT]: ... - @overload - def dict(self, iterable: Iterable[tuple[_KT, _VT]], /) -> DictProxy[_KT, _VT]: ... - @overload - def dict(self, iterable: Iterable[tuple[str, _VT]], /, **kwargs: _VT) -> DictProxy[str, _VT]: ... - @overload - def dict(self, iterable: Iterable[list[str]], /) -> DictProxy[str, str]: ... - @overload - def dict(self, iterable: Iterable[list[bytes]], /) -> DictProxy[bytes, bytes]: ... - @overload - def list(self, sequence: Sequence[_T], /) -> ListProxy[_T]: ... - @overload - def list(self) -> ListProxy[Any]: ... - -class RemoteError(Exception): ... - -class SharedMemoryServer(Server): - def track_segment(self, c: _ServerConnection, segment_name: str) -> None: ... - def release_segment(self, c: _ServerConnection, segment_name: str) -> None: ... - def list_segments(self, c: _ServerConnection) -> list[str]: ... - -class SharedMemoryManager(BaseManager): - def get_server(self) -> SharedMemoryServer: ... - def SharedMemory(self, size: int) -> _SharedMemory: ... - def ShareableList(self, sequence: Iterable[_SLT] | None) -> _ShareableList[_SLT]: ... - def __del__(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/pool.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/pool.pyi deleted file mode 100644 index b79f9e7735..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/pool.pyi +++ /dev/null @@ -1,101 +0,0 @@ -from collections.abc import Callable, Iterable, Mapping -from multiprocessing.context import DefaultContext, Process -from types import GenericAlias, TracebackType -from typing import Any, Final, Generic, TypeVar -from typing_extensions import Self - -__all__ = ["Pool", "ThreadPool"] - -_S = TypeVar("_S") -_T = TypeVar("_T") - -class ApplyResult(Generic[_T]): - def __init__( - self, pool: Pool, callback: Callable[[_T], object] | None, error_callback: Callable[[BaseException], object] | None - ) -> None: ... - def get(self, timeout: float | None = None) -> _T: ... - def wait(self, timeout: float | None = None) -> None: ... - def ready(self) -> bool: ... - def successful(self) -> bool: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -# alias created during issue #17805 -AsyncResult = ApplyResult - -class MapResult(ApplyResult[list[_T]]): - def __init__( - self, - pool: Pool, - chunksize: int, - length: int, - callback: Callable[[list[_T]], object] | None, - error_callback: Callable[[BaseException], object] | None, - ) -> None: ... - -class IMapIterator(Generic[_T]): - def __init__(self, pool: Pool) -> None: ... - def __iter__(self) -> Self: ... - def next(self, timeout: float | None = None) -> _T: ... - def __next__(self, timeout: float | None = None) -> _T: ... - -class IMapUnorderedIterator(IMapIterator[_T]): ... - -class Pool: - def __init__( - self, - processes: int | None = None, - initializer: Callable[..., object] | None = None, - initargs: Iterable[Any] = (), - maxtasksperchild: int | None = None, - context: Any | None = None, - ) -> None: ... - @staticmethod - def Process(ctx: DefaultContext, *args: Any, **kwds: Any) -> Process: ... - def apply(self, func: Callable[..., _T], args: Iterable[Any] = (), kwds: Mapping[str, Any] = {}) -> _T: ... - def apply_async( - self, - func: Callable[..., _T], - args: Iterable[Any] = (), - kwds: Mapping[str, Any] = {}, - callback: Callable[[_T], object] | None = None, - error_callback: Callable[[BaseException], object] | None = None, - ) -> AsyncResult[_T]: ... - def map(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = None) -> list[_T]: ... - def map_async( - self, - func: Callable[[_S], _T], - iterable: Iterable[_S], - chunksize: int | None = None, - callback: Callable[[list[_T]], object] | None = None, - error_callback: Callable[[BaseException], object] | None = None, - ) -> MapResult[_T]: ... - def imap(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = 1) -> IMapIterator[_T]: ... - def imap_unordered(self, func: Callable[[_S], _T], iterable: Iterable[_S], chunksize: int | None = 1) -> IMapIterator[_T]: ... - def starmap(self, func: Callable[..., _T], iterable: Iterable[Iterable[Any]], chunksize: int | None = None) -> list[_T]: ... - def starmap_async( - self, - func: Callable[..., _T], - iterable: Iterable[Iterable[Any]], - chunksize: int | None = None, - callback: Callable[[list[_T]], object] | None = None, - error_callback: Callable[[BaseException], object] | None = None, - ) -> AsyncResult[list[_T]]: ... - def close(self) -> None: ... - def terminate(self) -> None: ... - def join(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - def __del__(self) -> None: ... - -class ThreadPool(Pool): - def __init__( - self, processes: int | None = None, initializer: Callable[..., object] | None = None, initargs: Iterable[Any] = () - ) -> None: ... - -# undocumented -INIT: Final = "INIT" -RUN: Final = "RUN" -CLOSE: Final = "CLOSE" -TERMINATE: Final = "TERMINATE" diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_fork.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_fork.pyi deleted file mode 100644 index 4fcbfd99a8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_fork.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import sys -from typing import ClassVar - -from .process import BaseProcess -from .util import Finalize - -if sys.platform != "win32": - __all__ = ["Popen"] - - class Popen: - finalizer: Finalize | None - method: ClassVar[str] - pid: int - returncode: int | None - sentinel: int # doesn't exist if os.fork in _launch returns 0 - - def __init__(self, process_obj: BaseProcess) -> None: ... - def duplicate_for_child(self, fd: int) -> int: ... - def poll(self, flag: int = 1) -> int | None: ... - def wait(self, timeout: float | None = None) -> int | None: ... - def terminate(self) -> None: ... - def kill(self) -> None: ... - def close(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_forkserver.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_forkserver.pyi deleted file mode 100644 index f7d53bbb3e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +++ /dev/null @@ -1,16 +0,0 @@ -import sys -from typing import ClassVar - -from . import popen_fork -from .util import Finalize - -if sys.platform != "win32": - __all__ = ["Popen"] - - class _DupFd: - def __init__(self, ind: int) -> None: ... - def detach(self) -> int: ... - - class Popen(popen_fork.Popen): - DupFd: ClassVar[type[_DupFd]] - finalizer: Finalize diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi deleted file mode 100644 index 7e81d39600..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +++ /dev/null @@ -1,20 +0,0 @@ -import sys -from typing import ClassVar - -from . import popen_fork -from .util import Finalize - -if sys.platform != "win32": - __all__ = ["Popen"] - - class _DupFd: - fd: int - - def __init__(self, fd: int) -> None: ... - def detach(self) -> int: ... - - class Popen(popen_fork.Popen): - DupFd: ClassVar[type[_DupFd]] - finalizer: Finalize - pid: int # may not exist if _launch raises in second try / except - sentinel: int # may not exist if _launch raises in second try / except diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi deleted file mode 100644 index 481b9eec5a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +++ /dev/null @@ -1,30 +0,0 @@ -import sys -from multiprocessing.process import BaseProcess -from typing import ClassVar, Final - -from .util import Finalize - -if sys.platform == "win32": - __all__ = ["Popen"] - - TERMINATE: Final[int] - WINEXE: Final[bool] - WINSERVICE: Final[bool] - WINENV: Final[bool] - - class Popen: - finalizer: Finalize - method: ClassVar[str] - pid: int - returncode: int | None - sentinel: int - - def __init__(self, process_obj: BaseProcess) -> None: ... - def duplicate_for_child(self, handle: int) -> int: ... - def wait(self, timeout: float | None = None) -> int | None: ... - def poll(self) -> int | None: ... - def terminate(self) -> None: ... - - kill = terminate - - def close(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/process.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/process.pyi deleted file mode 100644 index 4d129b27b0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/process.pyi +++ /dev/null @@ -1,39 +0,0 @@ -from collections.abc import Callable, Iterable, Mapping -from typing import Any - -__all__ = ["BaseProcess", "current_process", "active_children", "parent_process"] - -class BaseProcess: - name: str - daemon: bool - authkey: bytes - _identity: tuple[int, ...] # undocumented - def __init__( - self, - group: None = None, - target: Callable[..., object] | None = None, - name: str | None = None, - args: Iterable[Any] = (), - kwargs: Mapping[str, Any] = {}, - *, - daemon: bool | None = None, - ) -> None: ... - def run(self) -> None: ... - def start(self) -> None: ... - def terminate(self) -> None: ... - def kill(self) -> None: ... - def close(self) -> None: ... - def join(self, timeout: float | None = None) -> None: ... - def is_alive(self) -> bool: ... - @property - def exitcode(self) -> int | None: ... - @property - def ident(self) -> int | None: ... - @property - def pid(self) -> int | None: ... - @property - def sentinel(self) -> int: ... - -def current_process() -> BaseProcess: ... -def active_children() -> list[BaseProcess]: ... -def parent_process() -> BaseProcess | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/queues.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/queues.pyi deleted file mode 100644 index a6b00d744c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/queues.pyi +++ /dev/null @@ -1,36 +0,0 @@ -import sys -from types import GenericAlias -from typing import Any, Generic, TypeVar - -__all__ = ["Queue", "SimpleQueue", "JoinableQueue"] - -_T = TypeVar("_T") - -class Queue(Generic[_T]): - # FIXME: `ctx` is a circular dependency and it's not actually optional. - # It's marked as such to be able to use the generic Queue in __init__.pyi. - def __init__(self, maxsize: int = 0, *, ctx: Any = ...) -> None: ... - def put(self, obj: _T, block: bool = True, timeout: float | None = None) -> None: ... - def get(self, block: bool = True, timeout: float | None = None) -> _T: ... - def qsize(self) -> int: ... - def empty(self) -> bool: ... - def full(self) -> bool: ... - def get_nowait(self) -> _T: ... - def put_nowait(self, obj: _T) -> None: ... - def close(self) -> None: ... - def join_thread(self) -> None: ... - def cancel_join_thread(self) -> None: ... - if sys.version_info >= (3, 12): - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class JoinableQueue(Queue[_T]): - def task_done(self) -> None: ... - def join(self) -> None: ... - -class SimpleQueue(Generic[_T]): - def __init__(self, *, ctx: Any = ...) -> None: ... - def close(self) -> None: ... - def empty(self) -> bool: ... - def get(self) -> _T: ... - def put(self, obj: _T) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/reduction.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/reduction.pyi deleted file mode 100644 index 942e92ce53..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/reduction.pyi +++ /dev/null @@ -1,87 +0,0 @@ -import pickle -import sys -from _pickle import _ReducedType -from _typeshed import HasFileno, SupportsWrite, Unused -from abc import ABCMeta -from builtins import type as Type # alias to avoid name clash -from collections.abc import Callable -from copyreg import _DispatchTableType -from multiprocessing import connection -from socket import socket -from typing import Any, Final - -if sys.platform == "win32": - __all__ = ["send_handle", "recv_handle", "ForkingPickler", "register", "dump", "DupHandle", "duplicate", "steal_handle"] -else: - __all__ = ["send_handle", "recv_handle", "ForkingPickler", "register", "dump", "DupFd", "sendfds", "recvfds"] - -HAVE_SEND_HANDLE: Final[bool] - -class ForkingPickler(pickle.Pickler): - dispatch_table: _DispatchTableType - def __init__(self, file: SupportsWrite[bytes], protocol: int | None = ...) -> None: ... - @classmethod - def register(cls, type: Type, reduce: Callable[[Any], _ReducedType]) -> None: ... - @classmethod - def dumps(cls, obj: Any, protocol: int | None = None) -> memoryview: ... - loads = pickle.loads - -register = ForkingPickler.register - -def dump(obj: Any, file: SupportsWrite[bytes], protocol: int | None = None) -> None: ... - -if sys.platform == "win32": - def duplicate( - handle: int, target_process: int | None = None, inheritable: bool = False, *, source_process: int | None = None - ) -> int: ... - def steal_handle(source_pid: int, handle: int) -> int: ... - def send_handle(conn: connection.PipeConnection[DupHandle, Any], handle: int, destination_pid: int) -> None: ... - def recv_handle(conn: connection.PipeConnection[Any, DupHandle]) -> int: ... - - class DupHandle: - def __init__(self, handle: int, access: int, pid: int | None = None) -> None: ... - def detach(self) -> int: ... - -else: - ACKNOWLEDGE: Final[bool] - - def recvfds(sock: socket, size: int) -> list[int]: ... - def send_handle(conn: HasFileno, handle: int, destination_pid: Unused) -> None: ... - def recv_handle(conn: HasFileno) -> int: ... - def sendfds(sock: socket, fds: list[int]) -> None: ... - def DupFd(fd: int) -> Any: ... # Return type is really hard to get right - -# These aliases are to work around pyright complaints. -# Pyright doesn't like it when a class object is defined as an alias -# of a global object with the same name. -_ForkingPickler = ForkingPickler -_register = register -_dump = dump -_send_handle = send_handle -_recv_handle = recv_handle - -if sys.platform == "win32": - _steal_handle = steal_handle - _duplicate = duplicate - _DupHandle = DupHandle -else: - _sendfds = sendfds - _recvfds = recvfds - _DupFd = DupFd - -class AbstractReducer(metaclass=ABCMeta): - ForkingPickler = _ForkingPickler - register = _register - dump = _dump - send_handle = _send_handle - recv_handle = _recv_handle - if sys.platform == "win32": - steal_handle = _steal_handle - duplicate = _duplicate - DupHandle = _DupHandle - else: - sendfds = _sendfds - recvfds = _recvfds - DupFd = _DupFd - - def __init__(self, *args: Unused) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/resource_sharer.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/resource_sharer.pyi deleted file mode 100644 index 5fee7cf31e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/resource_sharer.pyi +++ /dev/null @@ -1,20 +0,0 @@ -import sys -from socket import socket - -__all__ = ["stop"] - -if sys.platform == "win32": - __all__ += ["DupSocket"] - - class DupSocket: - def __init__(self, sock: socket) -> None: ... - def detach(self) -> socket: ... - -else: - __all__ += ["DupFd"] - - class DupFd: - def __init__(self, fd: int) -> None: ... - def detach(self) -> int: ... - -def stop(timeout: float | None = None) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/resource_tracker.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/resource_tracker.pyi deleted file mode 100644 index cb2f27a628..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/resource_tracker.pyi +++ /dev/null @@ -1,21 +0,0 @@ -import sys -from _typeshed import FileDescriptorOrPath -from collections.abc import Sized - -__all__ = ["ensure_running", "register", "unregister"] - -class ResourceTracker: - def getfd(self) -> int | None: ... - def ensure_running(self) -> None: ... - def register(self, name: Sized, rtype: str) -> None: ... - def unregister(self, name: Sized, rtype: str) -> None: ... - if sys.version_info >= (3, 12): - def __del__(self) -> None: ... - -_resource_tracker: ResourceTracker -ensure_running = _resource_tracker.ensure_running -register = _resource_tracker.register -unregister = _resource_tracker.unregister -getfd = _resource_tracker.getfd - -def main(fd: FileDescriptorOrPath) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/shared_memory.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/shared_memory.pyi deleted file mode 100644 index 1a12812c27..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/shared_memory.pyi +++ /dev/null @@ -1,41 +0,0 @@ -import sys -from collections.abc import Iterable -from types import GenericAlias -from typing import Any, Generic, TypeVar, overload -from typing_extensions import Self - -__all__ = ["SharedMemory", "ShareableList"] - -_SLT = TypeVar("_SLT", int, float, bool, str, bytes, None) - -class SharedMemory: - if sys.version_info >= (3, 13): - def __init__(self, name: str | None = None, create: bool = False, size: int = 0, *, track: bool = True) -> None: ... - else: - def __init__(self, name: str | None = None, create: bool = False, size: int = 0) -> None: ... - - @property - def buf(self) -> memoryview: ... - @property - def name(self) -> str: ... - @property - def size(self) -> int: ... - def close(self) -> None: ... - def unlink(self) -> None: ... - def __del__(self) -> None: ... - -class ShareableList(Generic[_SLT]): - shm: SharedMemory - @overload - def __init__(self, sequence: None = None, *, name: str | None = None) -> None: ... - @overload - def __init__(self, sequence: Iterable[_SLT], *, name: str | None = None) -> None: ... - def __getitem__(self, position: int) -> _SLT: ... - def __setitem__(self, position: int, value: _SLT) -> None: ... - def __reduce__(self) -> tuple[Self, tuple[_SLT, ...]]: ... - def __len__(self) -> int: ... - @property - def format(self) -> str: ... - def count(self, value: _SLT) -> int: ... - def index(self, value: _SLT) -> int: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/sharedctypes.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/sharedctypes.pyi deleted file mode 100644 index 5283445d85..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/sharedctypes.pyi +++ /dev/null @@ -1,129 +0,0 @@ -import ctypes -from _ctypes import _CData -from collections.abc import Callable, Iterable, Sequence -from ctypes import _SimpleCData, c_char -from multiprocessing.context import BaseContext -from multiprocessing.synchronize import _LockLike -from types import TracebackType -from typing import Any, Generic, Literal, Protocol, TypeVar, overload - -__all__ = ["RawValue", "RawArray", "Value", "Array", "copy", "synchronized"] - -_T = TypeVar("_T") -_CT = TypeVar("_CT", bound=_CData) - -@overload -def RawValue(typecode_or_type: type[_CT], *args: Any) -> _CT: ... -@overload -def RawValue(typecode_or_type: str, *args: Any) -> Any: ... -@overload -def RawArray(typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any]) -> ctypes.Array[_CT]: ... -@overload -def RawArray(typecode_or_type: str, size_or_initializer: int | Sequence[Any]) -> Any: ... -@overload -def Value(typecode_or_type: type[_CT], *args: Any, lock: Literal[False], ctx: BaseContext | None = None) -> _CT: ... -@overload -def Value( - typecode_or_type: type[_CT], *args: Any, lock: Literal[True] | _LockLike = True, ctx: BaseContext | None = None -) -> SynchronizedBase[_CT]: ... -@overload -def Value( - typecode_or_type: str, *args: Any, lock: Literal[True] | _LockLike = True, ctx: BaseContext | None = None -) -> SynchronizedBase[Any]: ... -@overload -def Value( - typecode_or_type: str | type[_CData], *args: Any, lock: bool | _LockLike = True, ctx: BaseContext | None = None -) -> Any: ... -@overload -def Array( - typecode_or_type: type[_CT], size_or_initializer: int | Sequence[Any], *, lock: Literal[False], ctx: BaseContext | None = None -) -> _CT: ... -@overload -def Array( - typecode_or_type: type[c_char], - size_or_initializer: int | Sequence[Any], - *, - lock: Literal[True] | _LockLike = True, - ctx: BaseContext | None = None, -) -> SynchronizedString: ... -@overload -def Array( - typecode_or_type: type[_SimpleCData[_T]], - size_or_initializer: int | Sequence[Any], - *, - lock: Literal[True] | _LockLike = True, - ctx: BaseContext | None = None, -) -> SynchronizedArray[_T]: ... -@overload -def Array( - typecode_or_type: str, - size_or_initializer: int | Sequence[Any], - *, - lock: Literal[True] | _LockLike = True, - ctx: BaseContext | None = None, -) -> SynchronizedArray[Any]: ... -@overload -def Array( - typecode_or_type: str | type[_CData], - size_or_initializer: int | Sequence[Any], - *, - lock: bool | _LockLike = True, - ctx: BaseContext | None = None, -) -> Any: ... -def copy(obj: _CT) -> _CT: ... -@overload -def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = None, ctx: Any | None = None) -> Synchronized[_T]: ... -@overload -def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ... -@overload -def synchronized( - obj: ctypes.Array[_SimpleCData[_T]], lock: _LockLike | None = None, ctx: Any | None = None -) -> SynchronizedArray[_T]: ... -@overload -def synchronized(obj: _CT, lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedBase[_CT]: ... - -class _AcquireFunc(Protocol): - def __call__(self, block: bool = ..., timeout: float | None = ..., /) -> bool: ... - -class SynchronizedBase(Generic[_CT]): - acquire: _AcquireFunc - release: Callable[[], None] - def __init__(self, obj: Any, lock: _LockLike | None = None, ctx: Any | None = None) -> None: ... - def __reduce__(self) -> tuple[Callable[[Any, _LockLike], SynchronizedBase[Any]], tuple[Any, _LockLike]]: ... - def get_obj(self) -> _CT: ... - def get_lock(self) -> _LockLike: ... - def __enter__(self) -> bool: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, / - ) -> None: ... - -class Synchronized(SynchronizedBase[_SimpleCData[_T]], Generic[_T]): - value: _T - -class SynchronizedArray(SynchronizedBase[ctypes.Array[_SimpleCData[_T]]], Generic[_T]): - def __len__(self) -> int: ... - @overload - def __getitem__(self, i: slice) -> list[_T]: ... - @overload - def __getitem__(self, i: int) -> _T: ... - @overload - def __setitem__(self, i: slice, value: Iterable[_T]) -> None: ... - @overload - def __setitem__(self, i: int, value: _T) -> None: ... - def __getslice__(self, start: int, stop: int) -> list[_T]: ... - def __setslice__(self, start: int, stop: int, values: Iterable[_T]) -> None: ... - -class SynchronizedString(SynchronizedArray[bytes]): - @overload # type: ignore[override] - def __getitem__(self, i: slice) -> bytes: ... - @overload - def __getitem__(self, i: int) -> bytes: ... - @overload # type: ignore[override] - def __setitem__(self, i: slice, value: bytes) -> None: ... - @overload - def __setitem__(self, i: int, value: bytes) -> None: ... - def __getslice__(self, start: int, stop: int) -> bytes: ... # type: ignore[override] - def __setslice__(self, start: int, stop: int, values: bytes) -> None: ... # type: ignore[override] - - value: bytes - raw: bytes diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/spawn.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/spawn.pyi deleted file mode 100644 index 4a97532228..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/spawn.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from collections.abc import Mapping, Sequence -from types import ModuleType -from typing import Any, Final - -__all__ = [ - "_main", - "freeze_support", - "set_executable", - "get_executable", - "get_preparation_data", - "get_command_line", - "import_main_path", -] - -WINEXE: Final[bool] -WINSERVICE: Final[bool] - -def set_executable(exe: str) -> None: ... -def get_executable() -> str: ... -def is_forking(argv: Sequence[str]) -> bool: ... -def freeze_support() -> None: ... -def get_command_line(**kwds: Any) -> list[str]: ... -def spawn_main(pipe_handle: int, parent_pid: int | None = None, tracker_fd: int | None = None) -> None: ... - -# undocumented -def _main(fd: int, parent_sentinel: int) -> int: ... -def get_preparation_data(name: str) -> dict[str, Any]: ... - -old_main_modules: list[ModuleType] - -def prepare(data: Mapping[str, Any]) -> None: ... -def import_main_path(main_path: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/synchronize.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/synchronize.pyi deleted file mode 100644 index a0d97baa06..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/synchronize.pyi +++ /dev/null @@ -1,60 +0,0 @@ -import threading -from collections.abc import Callable -from multiprocessing.context import BaseContext -from types import TracebackType -from typing_extensions import TypeAlias - -__all__ = ["Lock", "RLock", "Semaphore", "BoundedSemaphore", "Condition", "Event"] - -_LockLike: TypeAlias = Lock | RLock - -class Barrier(threading.Barrier): - def __init__( - self, parties: int, action: Callable[[], object] | None = None, timeout: float | None = None, *, ctx: BaseContext - ) -> None: ... - -class Condition: - def __init__(self, lock: _LockLike | None = None, *, ctx: BaseContext) -> None: ... - def notify(self, n: int = 1) -> None: ... - def notify_all(self) -> None: ... - def wait(self, timeout: float | None = None) -> bool: ... - def wait_for(self, predicate: Callable[[], bool], timeout: float | None = None) -> bool: ... - def __enter__(self) -> bool: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, / - ) -> None: ... - # These methods are copied from the lock passed to the constructor, or an - # instance of ctx.RLock() if lock was None. - def acquire(self, block: bool = True, timeout: float | None = None) -> bool: ... - def release(self) -> None: ... - -class Event: - def __init__(self, *, ctx: BaseContext) -> None: ... - def is_set(self) -> bool: ... - def set(self) -> None: ... - def clear(self) -> None: ... - def wait(self, timeout: float | None = None) -> bool: ... - -# Not part of public API -class SemLock: - def __init__(self, kind: int, value: int, maxvalue: int, *, ctx: BaseContext | None) -> None: ... - def __enter__(self) -> bool: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, / - ) -> None: ... - # These methods are copied from the wrapped _multiprocessing.SemLock object - def acquire(self, block: bool = True, timeout: float | None = None) -> bool: ... - def release(self) -> None: ... - -class Lock(SemLock): - def __init__(self, *, ctx: BaseContext) -> None: ... - -class RLock(SemLock): - def __init__(self, *, ctx: BaseContext) -> None: ... - -class Semaphore(SemLock): - def __init__(self, value: int = 1, *, ctx: BaseContext) -> None: ... - def get_value(self) -> int: ... - -class BoundedSemaphore(Semaphore): - def __init__(self, value: int = 1, *, ctx: BaseContext) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/util.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/util.pyi deleted file mode 100644 index d5b6384afd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/multiprocessing/util.pyi +++ /dev/null @@ -1,98 +0,0 @@ -import threading -from _typeshed import ConvertibleToInt, Incomplete, Unused -from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence -from logging import Logger, _Level as _LoggingLevel -from typing import Any, Final, Generic, TypeVar, overload - -__all__ = [ - "sub_debug", - "debug", - "info", - "sub_warning", - "get_logger", - "log_to_stderr", - "get_temp_dir", - "register_after_fork", - "is_exiting", - "Finalize", - "ForkAwareThreadLock", - "ForkAwareLocal", - "close_all_fds_except", - "SUBDEBUG", - "SUBWARNING", -] - -_T = TypeVar("_T") -_R_co = TypeVar("_R_co", default=Any, covariant=True) - -NOTSET: Final[int] -SUBDEBUG: Final[int] -DEBUG: Final[int] -INFO: Final[int] -SUBWARNING: Final[int] - -LOGGER_NAME: Final[str] -DEFAULT_LOGGING_FORMAT: Final[str] - -def sub_debug(msg: object, *args: object) -> None: ... -def debug(msg: object, *args: object) -> None: ... -def info(msg: object, *args: object) -> None: ... -def sub_warning(msg: object, *args: object) -> None: ... -def get_logger() -> Logger: ... -def log_to_stderr(level: _LoggingLevel | None = None) -> Logger: ... -def is_abstract_socket_namespace(address: str | bytes | None) -> bool: ... - -abstract_sockets_supported: bool - -def get_temp_dir() -> str: ... -def register_after_fork(obj: _T, func: Callable[[_T], object]) -> None: ... - -class Finalize(Generic[_R_co]): - # "args" and "kwargs" are passed as arguments to "callback". - @overload - def __init__( - self, - obj: None, - callback: Callable[..., _R_co], - *, - args: Sequence[Any] = (), - kwargs: Mapping[str, Any] | None = None, - exitpriority: int, - ) -> None: ... - @overload - def __init__( - self, obj: None, callback: Callable[..., _R_co], args: Sequence[Any], kwargs: Mapping[str, Any] | None, exitpriority: int - ) -> None: ... - @overload - def __init__( - self, - obj: Any, - callback: Callable[..., _R_co], - args: Sequence[Any] = (), - kwargs: Mapping[str, Any] | None = None, - exitpriority: int | None = None, - ) -> None: ... - def __call__( - self, - wr: Unused = None, - _finalizer_registry: MutableMapping[Incomplete, Incomplete] = {}, - sub_debug: Callable[..., object] = ..., - getpid: Callable[[], int] = ..., - ) -> _R_co: ... - def cancel(self) -> None: ... - def still_active(self) -> bool: ... - -def is_exiting() -> bool: ... - -class ForkAwareThreadLock: - acquire: Callable[[bool, float], bool] - release: Callable[[], None] - def __enter__(self) -> bool: ... - def __exit__(self, *args: Unused) -> None: ... - -class ForkAwareLocal(threading.local): ... - -MAXFD: Final[int] - -def close_all_fds_except(fds: Iterable[int]) -> None: ... -def spawnv_passfds(path: bytes, args: Sequence[ConvertibleToInt], passfds: Sequence[int]) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/netrc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/netrc.pyi deleted file mode 100644 index 480f55a46d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/netrc.pyi +++ /dev/null @@ -1,23 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from typing_extensions import TypeAlias - -__all__ = ["netrc", "NetrcParseError"] - -class NetrcParseError(Exception): - filename: str | None - lineno: int | None - msg: str - def __init__(self, msg: str, filename: StrOrBytesPath | None = None, lineno: int | None = None) -> None: ... - -# (login, account, password) tuple -if sys.version_info >= (3, 11): - _NetrcTuple: TypeAlias = tuple[str, str, str] -else: - _NetrcTuple: TypeAlias = tuple[str, str | None, str | None] - -class netrc: - hosts: dict[str, _NetrcTuple] - macros: dict[str, list[str]] - def __init__(self, file: StrOrBytesPath | None = None) -> None: ... - def authenticators(self, host: str) -> _NetrcTuple | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/nis.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/nis.pyi deleted file mode 100644 index 10eef2336a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/nis.pyi +++ /dev/null @@ -1,9 +0,0 @@ -import sys - -if sys.platform != "win32": - def cat(map: str, domain: str = ...) -> dict[str, str]: ... - def get_default_domain() -> str: ... - def maps(domain: str = ...) -> list[str]: ... - def match(key: str, map: str, domain: str = ...) -> str: ... - - class error(Exception): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/nntplib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/nntplib.pyi deleted file mode 100644 index 1fb1e79f69..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/nntplib.pyi +++ /dev/null @@ -1,120 +0,0 @@ -import datetime -import socket -import ssl -from _typeshed import Unused -from builtins import list as _list # conflicts with a method named "list" -from collections.abc import Iterable -from typing import IO, Any, Final, NamedTuple -from typing_extensions import Self, TypeAlias - -__all__ = [ - "NNTP", - "NNTPError", - "NNTPReplyError", - "NNTPTemporaryError", - "NNTPPermanentError", - "NNTPProtocolError", - "NNTPDataError", - "decode_header", - "NNTP_SSL", -] - -_File: TypeAlias = IO[bytes] | bytes | str | None - -class NNTPError(Exception): - response: str - -class NNTPReplyError(NNTPError): ... -class NNTPTemporaryError(NNTPError): ... -class NNTPPermanentError(NNTPError): ... -class NNTPProtocolError(NNTPError): ... -class NNTPDataError(NNTPError): ... - -NNTP_PORT: Final = 119 -NNTP_SSL_PORT: Final = 563 - -class GroupInfo(NamedTuple): - group: str - last: str - first: str - flag: str - -class ArticleInfo(NamedTuple): - number: int - message_id: str - lines: list[bytes] - -def decode_header(header_str: str) -> str: ... - -class NNTP: - encoding: str - errors: str - - host: str - port: int - sock: socket.socket - file: IO[bytes] - debugging: int - welcome: str - readermode_afterauth: bool - tls_on: bool - authenticated: bool - nntp_implementation: str - nntp_version: int - def __init__( - self, - host: str, - port: int = 119, - user: str | None = None, - password: str | None = None, - readermode: bool | None = None, - usenetrc: bool = False, - timeout: float = ..., - ) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - def getwelcome(self) -> str: ... - def getcapabilities(self) -> dict[str, _list[str]]: ... - def set_debuglevel(self, level: int) -> None: ... - def debug(self, level: int) -> None: ... - def capabilities(self) -> tuple[str, dict[str, _list[str]]]: ... - def newgroups(self, date: datetime.date | datetime.datetime, *, file: _File = None) -> tuple[str, _list[str]]: ... - def newnews(self, group: str, date: datetime.date | datetime.datetime, *, file: _File = None) -> tuple[str, _list[str]]: ... - def list(self, group_pattern: str | None = None, *, file: _File = None) -> tuple[str, _list[str]]: ... - def description(self, group: str) -> str: ... - def descriptions(self, group_pattern: str) -> tuple[str, dict[str, str]]: ... - def group(self, name: str) -> tuple[str, int, int, int, str]: ... - def help(self, *, file: _File = None) -> tuple[str, _list[str]]: ... - def stat(self, message_spec: Any = None) -> tuple[str, int, str]: ... - def next(self) -> tuple[str, int, str]: ... - def last(self) -> tuple[str, int, str]: ... - def head(self, message_spec: Any = None, *, file: _File = None) -> tuple[str, ArticleInfo]: ... - def body(self, message_spec: Any = None, *, file: _File = None) -> tuple[str, ArticleInfo]: ... - def article(self, message_spec: Any = None, *, file: _File = None) -> tuple[str, ArticleInfo]: ... - def slave(self) -> str: ... - def xhdr(self, hdr: str, str: Any, *, file: _File = None) -> tuple[str, _list[str]]: ... - def xover(self, start: int, end: int, *, file: _File = None) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ... - def over( - self, message_spec: None | str | _list[Any] | tuple[Any, ...], *, file: _File = None - ) -> tuple[str, _list[tuple[int, dict[str, str]]]]: ... - def date(self) -> tuple[str, datetime.datetime]: ... - def post(self, data: bytes | Iterable[bytes]) -> str: ... - def ihave(self, message_id: Any, data: bytes | Iterable[bytes]) -> str: ... - def quit(self) -> str: ... - def login(self, user: str | None = None, password: str | None = None, usenetrc: bool = True) -> None: ... - def starttls(self, context: ssl.SSLContext | None = None) -> None: ... - -class NNTP_SSL(NNTP): - ssl_context: ssl.SSLContext | None - sock: ssl.SSLSocket - def __init__( - self, - host: str, - port: int = 563, - user: str | None = None, - password: str | None = None, - ssl_context: ssl.SSLContext | None = None, - readermode: bool | None = None, - usenetrc: bool = False, - timeout: float = ..., - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/nt.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/nt.pyi deleted file mode 100644 index 3ed8f8af37..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/nt.pyi +++ /dev/null @@ -1,113 +0,0 @@ -import sys - -if sys.platform == "win32": - # Actually defined here and re-exported from os at runtime, - # but this leads to less code duplication - from os import ( - F_OK as F_OK, - O_APPEND as O_APPEND, - O_BINARY as O_BINARY, - O_CREAT as O_CREAT, - O_EXCL as O_EXCL, - O_NOINHERIT as O_NOINHERIT, - O_RANDOM as O_RANDOM, - O_RDONLY as O_RDONLY, - O_RDWR as O_RDWR, - O_SEQUENTIAL as O_SEQUENTIAL, - O_SHORT_LIVED as O_SHORT_LIVED, - O_TEMPORARY as O_TEMPORARY, - O_TEXT as O_TEXT, - O_TRUNC as O_TRUNC, - O_WRONLY as O_WRONLY, - P_DETACH as P_DETACH, - P_NOWAIT as P_NOWAIT, - P_NOWAITO as P_NOWAITO, - P_OVERLAY as P_OVERLAY, - P_WAIT as P_WAIT, - R_OK as R_OK, - TMP_MAX as TMP_MAX, - W_OK as W_OK, - X_OK as X_OK, - DirEntry as DirEntry, - abort as abort, - access as access, - chdir as chdir, - chmod as chmod, - close as close, - closerange as closerange, - cpu_count as cpu_count, - device_encoding as device_encoding, - dup as dup, - dup2 as dup2, - error as error, - execv as execv, - execve as execve, - fspath as fspath, - fstat as fstat, - fsync as fsync, - ftruncate as ftruncate, - get_handle_inheritable as get_handle_inheritable, - get_inheritable as get_inheritable, - get_terminal_size as get_terminal_size, - getcwd as getcwd, - getcwdb as getcwdb, - getlogin as getlogin, - getpid as getpid, - getppid as getppid, - isatty as isatty, - kill as kill, - link as link, - listdir as listdir, - lseek as lseek, - lstat as lstat, - mkdir as mkdir, - open as open, - pipe as pipe, - putenv as putenv, - read as read, - readlink as readlink, - remove as remove, - rename as rename, - replace as replace, - rmdir as rmdir, - scandir as scandir, - set_handle_inheritable as set_handle_inheritable, - set_inheritable as set_inheritable, - spawnv as spawnv, - spawnve as spawnve, - startfile as startfile, - stat as stat, - stat_result as stat_result, - statvfs_result as statvfs_result, - strerror as strerror, - symlink as symlink, - system as system, - terminal_size as terminal_size, - times as times, - times_result as times_result, - truncate as truncate, - umask as umask, - uname_result as uname_result, - unlink as unlink, - unsetenv as unsetenv, - urandom as urandom, - utime as utime, - waitpid as waitpid, - waitstatus_to_exitcode as waitstatus_to_exitcode, - write as write, - ) - - if sys.version_info >= (3, 11): - from os import EX_OK as EX_OK - if sys.version_info >= (3, 12): - from os import ( - get_blocking as get_blocking, - listdrives as listdrives, - listmounts as listmounts, - listvolumes as listvolumes, - set_blocking as set_blocking, - ) - if sys.version_info >= (3, 13): - from os import fchmod as fchmod, lchmod as lchmod - - environ: dict[str, str] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ntpath.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ntpath.pyi deleted file mode 100644 index ebe305ef70..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ntpath.pyi +++ /dev/null @@ -1,126 +0,0 @@ -import sys -from _typeshed import BytesPath, StrOrBytesPath, StrPath -from genericpath import ( - commonprefix as commonprefix, - exists as exists, - getatime as getatime, - getctime as getctime, - getmtime as getmtime, - getsize as getsize, - isdir as isdir, - isfile as isfile, - samefile as samefile, - sameopenfile as sameopenfile, - samestat as samestat, -) -from os import PathLike - -# Re-export common definitions from posixpath to reduce duplication -from posixpath import ( - abspath as abspath, - basename as basename, - commonpath as commonpath, - curdir as curdir, - defpath as defpath, - devnull as devnull, - dirname as dirname, - expanduser as expanduser, - expandvars as expandvars, - extsep as extsep, - isabs as isabs, - islink as islink, - ismount as ismount, - lexists as lexists, - normcase as normcase, - normpath as normpath, - pardir as pardir, - pathsep as pathsep, - relpath as relpath, - sep as sep, - split as split, - splitdrive as splitdrive, - splitext as splitext, - supports_unicode_filenames as supports_unicode_filenames, -) -from typing import AnyStr, overload -from typing_extensions import LiteralString - -if sys.version_info >= (3, 12): - from posixpath import isjunction as isjunction, splitroot as splitroot -if sys.version_info >= (3, 13): - from genericpath import isdevdrive as isdevdrive - -__all__ = [ - "normcase", - "isabs", - "join", - "splitdrive", - "split", - "splitext", - "basename", - "dirname", - "commonprefix", - "getsize", - "getmtime", - "getatime", - "getctime", - "islink", - "exists", - "lexists", - "isdir", - "isfile", - "ismount", - "expanduser", - "expandvars", - "normpath", - "abspath", - "curdir", - "pardir", - "sep", - "pathsep", - "defpath", - "altsep", - "extsep", - "devnull", - "realpath", - "supports_unicode_filenames", - "relpath", - "samefile", - "sameopenfile", - "samestat", - "commonpath", -] -if sys.version_info >= (3, 12): - __all__ += ["isjunction", "splitroot"] -if sys.version_info >= (3, 13): - __all__ += ["isdevdrive", "isreserved"] - -altsep: LiteralString - -# First parameter is not actually pos-only, -# but must be defined as pos-only in the stub or cross-platform code doesn't type-check, -# as the parameter name is different in posixpath.join() -@overload -def join(path: LiteralString, /, *paths: LiteralString) -> LiteralString: ... -@overload -def join(path: StrPath, /, *paths: StrPath) -> str: ... -@overload -def join(path: BytesPath, /, *paths: BytesPath) -> bytes: ... - -if sys.platform == "win32": - if sys.version_info >= (3, 10): - @overload - def realpath(path: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ... - @overload - def realpath(path: AnyStr, *, strict: bool = False) -> AnyStr: ... - else: - @overload - def realpath(path: PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(path: AnyStr) -> AnyStr: ... - -else: - realpath = abspath - -if sys.version_info >= (3, 13): - def isreserved(path: StrOrBytesPath) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/nturl2path.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/nturl2path.pyi deleted file mode 100644 index b8ad8d6821..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/nturl2path.pyi +++ /dev/null @@ -1,2 +0,0 @@ -def url2pathname(url: str) -> str: ... -def pathname2url(p: str) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/numbers.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/numbers.pyi deleted file mode 100644 index f2bca4e58b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/numbers.pyi +++ /dev/null @@ -1,210 +0,0 @@ -# Note: these stubs are incomplete. The more complex type -# signatures are currently omitted. -# -# Use _ComplexLike, _RealLike and _IntegralLike for return types in this module -# rather than `numbers.Complex`, `numbers.Real` and `numbers.Integral`, -# to avoid an excessive number of `type: ignore`s in subclasses of these ABCs -# (since type checkers don't see `complex` as a subtype of `numbers.Complex`, -# nor `float` as a subtype of `numbers.Real`, etc.) - -from _typeshed import Incomplete -from abc import ABCMeta, abstractmethod -from typing import ClassVar, Literal, Protocol, overload - -__all__ = ["Number", "Complex", "Real", "Rational", "Integral"] - -############################ -# Protocols for return types -############################ - -# `_ComplexLike` is a structural-typing approximation -# of the `Complex` ABC, which is not (and cannot be) a protocol -# -# NOTE: We can't include `__complex__` here, -# as we want `int` to be seen as a subtype of `_ComplexLike`, -# and `int.__complex__` does not exist :( -class _ComplexLike(Protocol): - def __neg__(self) -> _ComplexLike: ... - def __pos__(self) -> _ComplexLike: ... - def __abs__(self) -> _RealLike: ... - -# _RealLike is a structural-typing approximation -# of the `Real` ABC, which is not (and cannot be) a protocol -class _RealLike(_ComplexLike, Protocol): - def __trunc__(self) -> _IntegralLike: ... - def __floor__(self) -> _IntegralLike: ... - def __ceil__(self) -> _IntegralLike: ... - def __float__(self) -> float: ... - # Overridden from `_ComplexLike` - # for a more precise return type: - def __neg__(self) -> _RealLike: ... - def __pos__(self) -> _RealLike: ... - -# _IntegralLike is a structural-typing approximation -# of the `Integral` ABC, which is not (and cannot be) a protocol -class _IntegralLike(_RealLike, Protocol): - def __invert__(self) -> _IntegralLike: ... - def __int__(self) -> int: ... - def __index__(self) -> int: ... - # Overridden from `_ComplexLike` - # for a more precise return type: - def __abs__(self) -> _IntegralLike: ... - # Overridden from `RealLike` - # for a more precise return type: - def __neg__(self) -> _IntegralLike: ... - def __pos__(self) -> _IntegralLike: ... - -################# -# Module "proper" -################# - -class Number(metaclass=ABCMeta): - @abstractmethod - def __hash__(self) -> int: ... - -# See comment at the top of the file -# for why some of these return types are purposefully vague -class Complex(Number, _ComplexLike): - @abstractmethod - def __complex__(self) -> complex: ... - def __bool__(self) -> bool: ... - @property - @abstractmethod - def real(self) -> _RealLike: ... - @property - @abstractmethod - def imag(self) -> _RealLike: ... - @abstractmethod - def __add__(self, other) -> _ComplexLike: ... - @abstractmethod - def __radd__(self, other) -> _ComplexLike: ... - @abstractmethod - def __neg__(self) -> _ComplexLike: ... - @abstractmethod - def __pos__(self) -> _ComplexLike: ... - def __sub__(self, other) -> _ComplexLike: ... - def __rsub__(self, other) -> _ComplexLike: ... - @abstractmethod - def __mul__(self, other) -> _ComplexLike: ... - @abstractmethod - def __rmul__(self, other) -> _ComplexLike: ... - @abstractmethod - def __truediv__(self, other) -> _ComplexLike: ... - @abstractmethod - def __rtruediv__(self, other) -> _ComplexLike: ... - @abstractmethod - def __pow__(self, exponent) -> _ComplexLike: ... - @abstractmethod - def __rpow__(self, base) -> _ComplexLike: ... - @abstractmethod - def __abs__(self) -> _RealLike: ... - @abstractmethod - def conjugate(self) -> _ComplexLike: ... - @abstractmethod - def __eq__(self, other: object) -> bool: ... - __hash__: ClassVar[None] # type: ignore[assignment] - -# See comment at the top of the file -# for why some of these return types are purposefully vague -class Real(Complex, _RealLike): - @abstractmethod - def __float__(self) -> float: ... - @abstractmethod - def __trunc__(self) -> _IntegralLike: ... - @abstractmethod - def __floor__(self) -> _IntegralLike: ... - @abstractmethod - def __ceil__(self) -> _IntegralLike: ... - @abstractmethod - @overload - def __round__(self, ndigits: None = None) -> _IntegralLike: ... - @abstractmethod - @overload - def __round__(self, ndigits: int) -> _RealLike: ... - def __divmod__(self, other) -> tuple[_RealLike, _RealLike]: ... - def __rdivmod__(self, other) -> tuple[_RealLike, _RealLike]: ... - @abstractmethod - def __floordiv__(self, other) -> _RealLike: ... - @abstractmethod - def __rfloordiv__(self, other) -> _RealLike: ... - @abstractmethod - def __mod__(self, other) -> _RealLike: ... - @abstractmethod - def __rmod__(self, other) -> _RealLike: ... - @abstractmethod - def __lt__(self, other) -> bool: ... - @abstractmethod - def __le__(self, other) -> bool: ... - def __complex__(self) -> complex: ... - @property - def real(self) -> _RealLike: ... - @property - def imag(self) -> Literal[0]: ... - def conjugate(self) -> _RealLike: ... - # Not actually overridden at runtime, - # but we override these in the stub to give them more precise return types: - @abstractmethod - def __pos__(self) -> _RealLike: ... - @abstractmethod - def __neg__(self) -> _RealLike: ... - -# See comment at the top of the file -# for why some of these return types are purposefully vague -class Rational(Real): - @property - @abstractmethod - def numerator(self) -> _IntegralLike: ... - @property - @abstractmethod - def denominator(self) -> _IntegralLike: ... - def __float__(self) -> float: ... - -# See comment at the top of the file -# for why some of these return types are purposefully vague -class Integral(Rational, _IntegralLike): - @abstractmethod - def __int__(self) -> int: ... - def __index__(self) -> int: ... - @abstractmethod - def __pow__(self, exponent, modulus: Incomplete | None = None) -> _IntegralLike: ... - @abstractmethod - def __lshift__(self, other) -> _IntegralLike: ... - @abstractmethod - def __rlshift__(self, other) -> _IntegralLike: ... - @abstractmethod - def __rshift__(self, other) -> _IntegralLike: ... - @abstractmethod - def __rrshift__(self, other) -> _IntegralLike: ... - @abstractmethod - def __and__(self, other) -> _IntegralLike: ... - @abstractmethod - def __rand__(self, other) -> _IntegralLike: ... - @abstractmethod - def __xor__(self, other) -> _IntegralLike: ... - @abstractmethod - def __rxor__(self, other) -> _IntegralLike: ... - @abstractmethod - def __or__(self, other) -> _IntegralLike: ... - @abstractmethod - def __ror__(self, other) -> _IntegralLike: ... - @abstractmethod - def __invert__(self) -> _IntegralLike: ... - def __float__(self) -> float: ... - @property - def numerator(self) -> _IntegralLike: ... - @property - def denominator(self) -> Literal[1]: ... - # Not actually overridden at runtime, - # but we override these in the stub to give them more precise return types: - @abstractmethod - def __pos__(self) -> _IntegralLike: ... - @abstractmethod - def __neg__(self) -> _IntegralLike: ... - @abstractmethod - def __abs__(self) -> _IntegralLike: ... - @abstractmethod - @overload - def __round__(self, ndigits: None = None) -> _IntegralLike: ... - @abstractmethod - @overload - def __round__(self, ndigits: int) -> _IntegralLike: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/opcode.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/opcode.pyi deleted file mode 100644 index a5a3a79c32..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/opcode.pyi +++ /dev/null @@ -1,47 +0,0 @@ -import sys -from typing import Literal - -__all__ = [ - "cmp_op", - "hasconst", - "hasname", - "hasjrel", - "hasjabs", - "haslocal", - "hascompare", - "hasfree", - "opname", - "opmap", - "HAVE_ARGUMENT", - "EXTENDED_ARG", - "stack_effect", -] -if sys.version_info >= (3, 12): - __all__ += ["hasarg", "hasexc"] -else: - __all__ += ["hasnargs"] -if sys.version_info >= (3, 13): - __all__ += ["hasjump"] - -cmp_op: tuple[Literal["<"], Literal["<="], Literal["=="], Literal["!="], Literal[">"], Literal[">="]] -hasconst: list[int] -hasname: list[int] -hasjrel: list[int] -hasjabs: list[int] -haslocal: list[int] -hascompare: list[int] -hasfree: list[int] -if sys.version_info >= (3, 12): - hasarg: list[int] - hasexc: list[int] -else: - hasnargs: list[int] -if sys.version_info >= (3, 13): - hasjump: list[int] -opname: list[str] - -opmap: dict[str, int] -HAVE_ARGUMENT: int -EXTENDED_ARG: int - -def stack_effect(opcode: int, oparg: int | None = None, /, *, jump: bool | None = None) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/operator.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/operator.pyi deleted file mode 100644 index bc2b5e0266..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/operator.pyi +++ /dev/null @@ -1,215 +0,0 @@ -import sys -from _operator import ( - abs as abs, - add as add, - and_ as and_, - concat as concat, - contains as contains, - countOf as countOf, - delitem as delitem, - eq as eq, - floordiv as floordiv, - ge as ge, - getitem as getitem, - gt as gt, - iadd as iadd, - iand as iand, - iconcat as iconcat, - ifloordiv as ifloordiv, - ilshift as ilshift, - imatmul as imatmul, - imod as imod, - imul as imul, - index as index, - indexOf as indexOf, - inv as inv, - invert as invert, - ior as ior, - ipow as ipow, - irshift as irshift, - is_ as is_, - is_not as is_not, - isub as isub, - itruediv as itruediv, - ixor as ixor, - le as le, - length_hint as length_hint, - lshift as lshift, - lt as lt, - matmul as matmul, - mod as mod, - mul as mul, - ne as ne, - neg as neg, - not_ as not_, - or_ as or_, - pos as pos, - pow as pow, - rshift as rshift, - setitem as setitem, - sub as sub, - truediv as truediv, - truth as truth, - xor as xor, -) -from _typeshed import SupportsGetItem -from typing import Any, Generic, TypeVar, final, overload -from typing_extensions import Self, TypeVarTuple, Unpack - -_T = TypeVar("_T") -_T_co = TypeVar("_T_co", covariant=True) -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") -_Ts = TypeVarTuple("_Ts") - -__all__ = [ - "abs", - "add", - "and_", - "attrgetter", - "concat", - "contains", - "countOf", - "delitem", - "eq", - "floordiv", - "ge", - "getitem", - "gt", - "iadd", - "iand", - "iconcat", - "ifloordiv", - "ilshift", - "imatmul", - "imod", - "imul", - "index", - "indexOf", - "inv", - "invert", - "ior", - "ipow", - "irshift", - "is_", - "is_not", - "isub", - "itemgetter", - "itruediv", - "ixor", - "le", - "length_hint", - "lshift", - "lt", - "matmul", - "methodcaller", - "mod", - "mul", - "ne", - "neg", - "not_", - "or_", - "pos", - "pow", - "rshift", - "setitem", - "sub", - "truediv", - "truth", - "xor", -] - -if sys.version_info >= (3, 11): - from _operator import call as call - - __all__ += ["call"] - -if sys.version_info >= (3, 14): - from _operator import is_none as is_none, is_not_none as is_not_none - - __all__ += ["is_none", "is_not_none"] - -__lt__ = lt -__le__ = le -__eq__ = eq -__ne__ = ne -__ge__ = ge -__gt__ = gt -__not__ = not_ -__abs__ = abs -__add__ = add -__and__ = and_ -__floordiv__ = floordiv -__index__ = index -__inv__ = inv -__invert__ = invert -__lshift__ = lshift -__mod__ = mod -__mul__ = mul -__matmul__ = matmul -__neg__ = neg -__or__ = or_ -__pos__ = pos -__pow__ = pow -__rshift__ = rshift -__sub__ = sub -__truediv__ = truediv -__xor__ = xor -__concat__ = concat -__contains__ = contains -__delitem__ = delitem -__getitem__ = getitem -__setitem__ = setitem -__iadd__ = iadd -__iand__ = iand -__iconcat__ = iconcat -__ifloordiv__ = ifloordiv -__ilshift__ = ilshift -__imod__ = imod -__imul__ = imul -__imatmul__ = imatmul -__ior__ = ior -__ipow__ = ipow -__irshift__ = irshift -__isub__ = isub -__itruediv__ = itruediv -__ixor__ = ixor -if sys.version_info >= (3, 11): - __call__ = call - -# At runtime, these classes are implemented in C as part of the _operator module -# However, they consider themselves to live in the operator module, so we'll put -# them here. -@final -class attrgetter(Generic[_T_co]): - @overload - def __new__(cls, attr: str, /) -> attrgetter[Any]: ... - @overload - def __new__(cls, attr: str, attr2: str, /) -> attrgetter[tuple[Any, Any]]: ... - @overload - def __new__(cls, attr: str, attr2: str, attr3: str, /) -> attrgetter[tuple[Any, Any, Any]]: ... - @overload - def __new__(cls, attr: str, attr2: str, attr3: str, attr4: str, /) -> attrgetter[tuple[Any, Any, Any, Any]]: ... - @overload - def __new__(cls, attr: str, /, *attrs: str) -> attrgetter[tuple[Any, ...]]: ... - def __call__(self, obj: Any, /) -> _T_co: ... - -@final -class itemgetter(Generic[_T_co]): - @overload - def __new__(cls, item: _T, /) -> itemgetter[_T]: ... - @overload - def __new__(cls, item1: _T1, item2: _T2, /, *items: Unpack[_Ts]) -> itemgetter[tuple[_T1, _T2, Unpack[_Ts]]]: ... - # __key: _KT_contra in SupportsGetItem seems to be causing variance issues, ie: - # TypeVar "_KT_contra@SupportsGetItem" is contravariant - # "tuple[int, int]" is incompatible with protocol "SupportsIndex" - # preventing [_T_co, ...] instead of [Any, ...] - # - # A suspected mypy issue prevents using [..., _T] instead of [..., Any] here. - # https://github.com/python/mypy/issues/14032 - def __call__(self, obj: SupportsGetItem[Any, Any]) -> Any: ... - -@final -class methodcaller: - def __new__(cls, name: str, /, *args: Any, **kwargs: Any) -> Self: ... - def __call__(self, obj: Any) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/optparse.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/optparse.pyi deleted file mode 100644 index 8b7fcd82e5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/optparse.pyi +++ /dev/null @@ -1,309 +0,0 @@ -import builtins -from _typeshed import MaybeNone, SupportsWrite -from abc import abstractmethod -from collections.abc import Callable, Iterable, Mapping, Sequence -from typing import Any, ClassVar, Final, Literal, NoReturn, overload -from typing_extensions import Self - -__all__ = [ - "Option", - "make_option", - "SUPPRESS_HELP", - "SUPPRESS_USAGE", - "Values", - "OptionContainer", - "OptionGroup", - "OptionParser", - "HelpFormatter", - "IndentedHelpFormatter", - "TitledHelpFormatter", - "OptParseError", - "OptionError", - "OptionConflictError", - "OptionValueError", - "BadOptionError", - "check_choice", -] -# pytype is not happy with `NO_DEFAULT: Final = ("NO", "DEFAULT")` -NO_DEFAULT: Final[tuple[Literal["NO"], Literal["DEFAULT"]]] -SUPPRESS_HELP: Final = "SUPPRESSHELP" -SUPPRESS_USAGE: Final = "SUPPRESSUSAGE" - -# Can return complex, float, or int depending on the option's type -def check_builtin(option: Option, opt: str, value: str) -> complex: ... -def check_choice(option: Option, opt: str, value: str) -> str: ... - -class OptParseError(Exception): - msg: str - def __init__(self, msg: str) -> None: ... - -class BadOptionError(OptParseError): - opt_str: str - def __init__(self, opt_str: str) -> None: ... - -class AmbiguousOptionError(BadOptionError): - possibilities: Iterable[str] - def __init__(self, opt_str: str, possibilities: Sequence[str]) -> None: ... - -class OptionError(OptParseError): - option_id: str - def __init__(self, msg: str, option: Option) -> None: ... - -class OptionConflictError(OptionError): ... -class OptionValueError(OptParseError): ... - -class HelpFormatter: - NO_DEFAULT_VALUE: str - _long_opt_fmt: str - _short_opt_fmt: str - current_indent: int - default_tag: str - help_position: int - help_width: int | MaybeNone # initialized as None and computed later as int when storing option strings - indent_increment: int - level: int - max_help_position: int - option_strings: dict[Option, str] - parser: OptionParser - short_first: bool | Literal[0, 1] - width: int - def __init__( - self, indent_increment: int, max_help_position: int, width: int | None, short_first: bool | Literal[0, 1] - ) -> None: ... - def dedent(self) -> None: ... - def expand_default(self, option: Option) -> str: ... - def format_description(self, description: str | None) -> str: ... - def format_epilog(self, epilog: str | None) -> str: ... - @abstractmethod - def format_heading(self, heading: str) -> str: ... - def format_option(self, option: Option) -> str: ... - def format_option_strings(self, option: Option) -> str: ... - @abstractmethod - def format_usage(self, usage: str) -> str: ... - def indent(self) -> None: ... - def set_long_opt_delimiter(self, delim: str) -> None: ... - def set_parser(self, parser: OptionParser) -> None: ... - def set_short_opt_delimiter(self, delim: str) -> None: ... - def store_option_strings(self, parser: OptionParser) -> None: ... - -class IndentedHelpFormatter(HelpFormatter): - def __init__( - self, - indent_increment: int = 2, - max_help_position: int = 24, - width: int | None = None, - short_first: bool | Literal[0, 1] = 1, - ) -> None: ... - def format_heading(self, heading: str) -> str: ... - def format_usage(self, usage: str) -> str: ... - -class TitledHelpFormatter(HelpFormatter): - def __init__( - self, - indent_increment: int = 0, - max_help_position: int = 24, - width: int | None = None, - short_first: bool | Literal[0, 1] = 0, - ) -> None: ... - def format_heading(self, heading: str) -> str: ... - def format_usage(self, usage: str) -> str: ... - -class Option: - ACTIONS: tuple[str, ...] - ALWAYS_TYPED_ACTIONS: tuple[str, ...] - ATTRS: list[str] - CHECK_METHODS: list[Callable[[Self], object]] | None - CONST_ACTIONS: tuple[str, ...] - STORE_ACTIONS: tuple[str, ...] - TYPED_ACTIONS: tuple[str, ...] - TYPES: tuple[str, ...] - TYPE_CHECKER: dict[str, Callable[[Option, str, str], object]] - _long_opts: list[str] - _short_opts: list[str] - action: str - type: str | None - dest: str | None - default: Any # default can be "any" type - nargs: int - const: Any | None # const can be "any" type - choices: list[str] | tuple[str, ...] | None - # Callback args and kwargs cannot be expressed in Python's type system. - # Revisit if ParamSpec is ever changed to work with packed args/kwargs. - callback: Callable[..., object] | None - callback_args: tuple[Any, ...] | None - callback_kwargs: dict[str, Any] | None - help: str | None - metavar: str | None - def __init__( - self, - *opts: str | None, - # The following keywords are handled by the _set_attrs method. All default to - # `None` except for `default`, which defaults to `NO_DEFAULT`. - action: str | None = None, - type: str | builtins.type | None = None, - dest: str | None = None, - default: Any = ..., # = NO_DEFAULT - nargs: int | None = None, - const: Any | None = None, - choices: list[str] | tuple[str, ...] | None = None, - callback: Callable[..., object] | None = None, - callback_args: tuple[Any, ...] | None = None, - callback_kwargs: dict[str, Any] | None = None, - help: str | None = None, - metavar: str | None = None, - ) -> None: ... - def _check_action(self) -> None: ... - def _check_callback(self) -> None: ... - def _check_choice(self) -> None: ... - def _check_const(self) -> None: ... - def _check_dest(self) -> None: ... - def _check_nargs(self) -> None: ... - def _check_opt_strings(self, opts: Iterable[str | None]) -> list[str]: ... - def _check_type(self) -> None: ... - def _set_attrs(self, attrs: dict[str, Any]) -> None: ... # accepted attrs depend on the ATTRS attribute - def _set_opt_strings(self, opts: Iterable[str]) -> None: ... - def check_value(self, opt: str, value: str) -> Any: ... # return type cannot be known statically - def convert_value(self, opt: str, value: str | tuple[str, ...] | None) -> Any: ... # return type cannot be known statically - def get_opt_string(self) -> str: ... - def process(self, opt: str, value: str | tuple[str, ...] | None, values: Values, parser: OptionParser) -> int: ... - # value of take_action can be "any" type - def take_action(self, action: str, dest: str, opt: str, value: Any, values: Values, parser: OptionParser) -> int: ... - def takes_value(self) -> bool: ... - -make_option = Option - -class OptionContainer: - _long_opt: dict[str, Option] - _short_opt: dict[str, Option] - conflict_handler: str - defaults: dict[str, Any] # default values can be "any" type - description: str | None - option_class: type[Option] - def __init__( - self, option_class: type[Option], conflict_handler: Literal["error", "resolve"], description: str | None - ) -> None: ... - def _check_conflict(self, option: Option) -> None: ... - def _create_option_mappings(self) -> None: ... - def _share_option_mappings(self, parser: OptionParser) -> None: ... - @overload - def add_option(self, opt: Option, /) -> Option: ... - @overload - def add_option( - self, - opt_str: str, - /, - *opts: str | None, - action: str | None = None, - type: str | builtins.type | None = None, - dest: str | None = None, - default: Any = ..., # = NO_DEFAULT - nargs: int | None = None, - const: Any | None = None, - choices: list[str] | tuple[str, ...] | None = None, - callback: Callable[..., object] | None = None, - callback_args: tuple[Any, ...] | None = None, - callback_kwargs: dict[str, Any] | None = None, - help: str | None = None, - metavar: str | None = None, - **kwargs, # Allow arbitrary keyword arguments for user defined option_class - ) -> Option: ... - def add_options(self, option_list: Iterable[Option]) -> None: ... - def destroy(self) -> None: ... - def format_option_help(self, formatter: HelpFormatter) -> str: ... - def format_description(self, formatter: HelpFormatter) -> str: ... - def format_help(self, formatter: HelpFormatter) -> str: ... - def get_description(self) -> str | None: ... - def get_option(self, opt_str: str) -> Option | None: ... - def has_option(self, opt_str: str) -> bool: ... - def remove_option(self, opt_str: str) -> None: ... - def set_conflict_handler(self, handler: Literal["error", "resolve"]) -> None: ... - def set_description(self, description: str | None) -> None: ... - -class OptionGroup(OptionContainer): - option_list: list[Option] - parser: OptionParser - title: str - def __init__(self, parser: OptionParser, title: str, description: str | None = None) -> None: ... - def _create_option_list(self) -> None: ... - def set_title(self, title: str) -> None: ... - -class Values: - def __init__(self, defaults: Mapping[str, object] | None = None) -> None: ... - def _update(self, dict: Mapping[str, object], mode: Literal["careful", "loose"]) -> None: ... - def _update_careful(self, dict: Mapping[str, object]) -> None: ... - def _update_loose(self, dict: Mapping[str, object]) -> None: ... - def ensure_value(self, attr: str, value: object) -> Any: ... # return type cannot be known statically - def read_file(self, filename: str, mode: Literal["careful", "loose"] = "careful") -> None: ... - def read_module(self, modname: str, mode: Literal["careful", "loose"] = "careful") -> None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - # __getattr__ doesn't exist, but anything passed as a default to __init__ - # is set on the instance. - def __getattr__(self, name: str) -> Any: ... - # TODO: mypy infers -> object for __getattr__ if __setattr__ has `value: object` - def __setattr__(self, name: str, value: Any, /) -> None: ... - def __eq__(self, other: object) -> bool: ... - -class OptionParser(OptionContainer): - allow_interspersed_args: bool - epilog: str | None - formatter: HelpFormatter - largs: list[str] | None - option_groups: list[OptionGroup] - option_list: list[Option] - process_default_values: bool - prog: str | None - rargs: list[str] | None - standard_option_list: list[Option] - usage: str | None - values: Values | None - version: str - def __init__( - self, - usage: str | None = None, - option_list: Iterable[Option] | None = None, - option_class: type[Option] = ..., - version: str | None = None, - conflict_handler: str = "error", - description: str | None = None, - formatter: HelpFormatter | None = None, - add_help_option: bool = True, - prog: str | None = None, - epilog: str | None = None, - ) -> None: ... - def _add_help_option(self) -> None: ... - def _add_version_option(self) -> None: ... - def _create_option_list(self) -> None: ... - def _get_all_options(self) -> list[Option]: ... - def _get_args(self, args: list[str] | None) -> list[str]: ... - def _init_parsing_state(self) -> None: ... - def _match_long_opt(self, opt: str) -> str: ... - def _populate_option_list(self, option_list: Iterable[Option] | None, add_help: bool = True) -> None: ... - def _process_args(self, largs: list[str], rargs: list[str], values: Values) -> None: ... - def _process_long_opt(self, rargs: list[str], values: Values) -> None: ... - def _process_short_opts(self, rargs: list[str], values: Values) -> None: ... - @overload - def add_option_group(self, opt_group: OptionGroup, /) -> OptionGroup: ... - @overload - def add_option_group(self, title: str, /, description: str | None = None) -> OptionGroup: ... - def check_values(self, values: Values, args: list[str]) -> tuple[Values, list[str]]: ... - def disable_interspersed_args(self) -> None: ... - def enable_interspersed_args(self) -> None: ... - def error(self, msg: str) -> NoReturn: ... - def exit(self, status: int = 0, msg: str | None = None) -> NoReturn: ... - def expand_prog_name(self, s: str) -> str: ... - def format_epilog(self, formatter: HelpFormatter) -> str: ... - def format_help(self, formatter: HelpFormatter | None = None) -> str: ... - def format_option_help(self, formatter: HelpFormatter | None = None) -> str: ... - def get_default_values(self) -> Values: ... - def get_option_group(self, opt_str: str) -> OptionGroup | None: ... - def get_prog_name(self) -> str: ... - def get_usage(self) -> str: ... - def get_version(self) -> str: ... - def parse_args(self, args: list[str] | None = None, values: Values | None = None) -> tuple[Values, list[str]]: ... - def print_usage(self, file: SupportsWrite[str] | None = None) -> None: ... - def print_help(self, file: SupportsWrite[str] | None = None) -> None: ... - def print_version(self, file: SupportsWrite[str] | None = None) -> None: ... - def set_default(self, dest: str, value: Any) -> None: ... # default value can be "any" type - def set_defaults(self, **kwargs: Any) -> None: ... # default values can be "any" type - def set_process_default_values(self, process: bool) -> None: ... - def set_usage(self, usage: str | None) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/os/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/os/__init__.pyi deleted file mode 100644 index d0ef614abb..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/os/__init__.pyi +++ /dev/null @@ -1,1653 +0,0 @@ -import sys -from _typeshed import ( - AnyStr_co, - BytesPath, - FileDescriptor, - FileDescriptorLike, - FileDescriptorOrPath, - GenericPath, - OpenBinaryMode, - OpenBinaryModeReading, - OpenBinaryModeUpdating, - OpenBinaryModeWriting, - OpenTextMode, - ReadableBuffer, - StrOrBytesPath, - StrPath, - SupportsLenAndGetItem, - Unused, - WriteableBuffer, - structseq, -) -from abc import ABC, abstractmethod -from builtins import OSError -from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping, Sequence -from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper -from subprocess import Popen -from types import GenericAlias, TracebackType -from typing import ( - IO, - Any, - AnyStr, - BinaryIO, - Final, - Generic, - Literal, - NoReturn, - Protocol, - TypeVar, - final, - overload, - runtime_checkable, -) -from typing_extensions import Self, TypeAlias, Unpack, deprecated - -from . import path as _path - -__all__ = [ - "F_OK", - "O_APPEND", - "O_CREAT", - "O_EXCL", - "O_RDONLY", - "O_RDWR", - "O_TRUNC", - "O_WRONLY", - "P_NOWAIT", - "P_NOWAITO", - "P_WAIT", - "R_OK", - "SEEK_CUR", - "SEEK_END", - "SEEK_SET", - "TMP_MAX", - "W_OK", - "X_OK", - "DirEntry", - "_exit", - "abort", - "access", - "altsep", - "chdir", - "chmod", - "close", - "closerange", - "cpu_count", - "curdir", - "defpath", - "device_encoding", - "devnull", - "dup", - "dup2", - "environ", - "error", - "execl", - "execle", - "execlp", - "execlpe", - "execv", - "execve", - "execvp", - "execvpe", - "extsep", - "fdopen", - "fsdecode", - "fsencode", - "fspath", - "fstat", - "fsync", - "ftruncate", - "get_exec_path", - "get_inheritable", - "get_terminal_size", - "getcwd", - "getcwdb", - "getenv", - "getlogin", - "getpid", - "getppid", - "isatty", - "kill", - "linesep", - "link", - "listdir", - "lseek", - "lstat", - "makedirs", - "mkdir", - "name", - "open", - "pardir", - "path", - "pathsep", - "pipe", - "popen", - "putenv", - "read", - "readlink", - "remove", - "removedirs", - "rename", - "renames", - "replace", - "rmdir", - "scandir", - "sep", - "set_inheritable", - "spawnl", - "spawnle", - "spawnv", - "spawnve", - "stat", - "stat_result", - "statvfs_result", - "strerror", - "supports_bytes_environ", - "symlink", - "system", - "terminal_size", - "times", - "times_result", - "truncate", - "umask", - "uname_result", - "unlink", - "unsetenv", - "urandom", - "utime", - "waitpid", - "waitstatus_to_exitcode", - "walk", - "write", -] -if sys.platform == "darwin" and sys.version_info >= (3, 12): - __all__ += ["PRIO_DARWIN_BG", "PRIO_DARWIN_NONUI", "PRIO_DARWIN_PROCESS", "PRIO_DARWIN_THREAD"] -if sys.platform == "darwin" and sys.version_info >= (3, 10): - __all__ += ["O_EVTONLY", "O_NOFOLLOW_ANY", "O_SYMLINK"] -if sys.platform == "linux": - __all__ += [ - "GRND_NONBLOCK", - "GRND_RANDOM", - "MFD_ALLOW_SEALING", - "MFD_CLOEXEC", - "MFD_HUGETLB", - "MFD_HUGE_16GB", - "MFD_HUGE_16MB", - "MFD_HUGE_1GB", - "MFD_HUGE_1MB", - "MFD_HUGE_256MB", - "MFD_HUGE_2GB", - "MFD_HUGE_2MB", - "MFD_HUGE_32MB", - "MFD_HUGE_512KB", - "MFD_HUGE_512MB", - "MFD_HUGE_64KB", - "MFD_HUGE_8MB", - "MFD_HUGE_MASK", - "MFD_HUGE_SHIFT", - "O_DIRECT", - "O_LARGEFILE", - "O_NOATIME", - "O_PATH", - "O_RSYNC", - "O_TMPFILE", - "P_PIDFD", - "RTLD_DEEPBIND", - "SCHED_BATCH", - "SCHED_IDLE", - "SCHED_RESET_ON_FORK", - "XATTR_CREATE", - "XATTR_REPLACE", - "XATTR_SIZE_MAX", - "copy_file_range", - "getrandom", - "getxattr", - "listxattr", - "memfd_create", - "pidfd_open", - "removexattr", - "setxattr", - ] -if sys.platform == "linux" and sys.version_info >= (3, 13): - __all__ += [ - "POSIX_SPAWN_CLOSEFROM", - "TFD_CLOEXEC", - "TFD_NONBLOCK", - "TFD_TIMER_ABSTIME", - "TFD_TIMER_CANCEL_ON_SET", - "timerfd_create", - "timerfd_gettime", - "timerfd_gettime_ns", - "timerfd_settime", - "timerfd_settime_ns", - ] -if sys.platform == "linux" and sys.version_info >= (3, 12): - __all__ += [ - "CLONE_FILES", - "CLONE_FS", - "CLONE_NEWCGROUP", - "CLONE_NEWIPC", - "CLONE_NEWNET", - "CLONE_NEWNS", - "CLONE_NEWPID", - "CLONE_NEWTIME", - "CLONE_NEWUSER", - "CLONE_NEWUTS", - "CLONE_SIGHAND", - "CLONE_SYSVSEM", - "CLONE_THREAD", - "CLONE_VM", - "setns", - "unshare", - "PIDFD_NONBLOCK", - ] -if sys.platform == "linux" and sys.version_info >= (3, 10): - __all__ += [ - "EFD_CLOEXEC", - "EFD_NONBLOCK", - "EFD_SEMAPHORE", - "RWF_APPEND", - "SPLICE_F_MORE", - "SPLICE_F_MOVE", - "SPLICE_F_NONBLOCK", - "eventfd", - "eventfd_read", - "eventfd_write", - "splice", - ] -if sys.platform == "win32": - __all__ += [ - "O_BINARY", - "O_NOINHERIT", - "O_RANDOM", - "O_SEQUENTIAL", - "O_SHORT_LIVED", - "O_TEMPORARY", - "O_TEXT", - "P_DETACH", - "P_OVERLAY", - "get_handle_inheritable", - "set_handle_inheritable", - "startfile", - ] -if sys.platform == "win32" and sys.version_info >= (3, 12): - __all__ += ["listdrives", "listmounts", "listvolumes"] -if sys.platform != "win32": - __all__ += [ - "CLD_CONTINUED", - "CLD_DUMPED", - "CLD_EXITED", - "CLD_KILLED", - "CLD_STOPPED", - "CLD_TRAPPED", - "EX_CANTCREAT", - "EX_CONFIG", - "EX_DATAERR", - "EX_IOERR", - "EX_NOHOST", - "EX_NOINPUT", - "EX_NOPERM", - "EX_NOUSER", - "EX_OSERR", - "EX_OSFILE", - "EX_PROTOCOL", - "EX_SOFTWARE", - "EX_TEMPFAIL", - "EX_UNAVAILABLE", - "EX_USAGE", - "F_LOCK", - "F_TEST", - "F_TLOCK", - "F_ULOCK", - "NGROUPS_MAX", - "O_ACCMODE", - "O_ASYNC", - "O_CLOEXEC", - "O_DIRECTORY", - "O_DSYNC", - "O_NDELAY", - "O_NOCTTY", - "O_NOFOLLOW", - "O_NONBLOCK", - "O_SYNC", - "POSIX_SPAWN_CLOSE", - "POSIX_SPAWN_DUP2", - "POSIX_SPAWN_OPEN", - "PRIO_PGRP", - "PRIO_PROCESS", - "PRIO_USER", - "P_ALL", - "P_PGID", - "P_PID", - "RTLD_GLOBAL", - "RTLD_LAZY", - "RTLD_LOCAL", - "RTLD_NODELETE", - "RTLD_NOLOAD", - "RTLD_NOW", - "SCHED_FIFO", - "SCHED_OTHER", - "SCHED_RR", - "SEEK_DATA", - "SEEK_HOLE", - "ST_NOSUID", - "ST_RDONLY", - "WCONTINUED", - "WCOREDUMP", - "WEXITED", - "WEXITSTATUS", - "WIFCONTINUED", - "WIFEXITED", - "WIFSIGNALED", - "WIFSTOPPED", - "WNOHANG", - "WNOWAIT", - "WSTOPPED", - "WSTOPSIG", - "WTERMSIG", - "WUNTRACED", - "chown", - "chroot", - "confstr", - "confstr_names", - "ctermid", - "environb", - "fchdir", - "fchown", - "fork", - "forkpty", - "fpathconf", - "fstatvfs", - "fwalk", - "getegid", - "getenvb", - "geteuid", - "getgid", - "getgrouplist", - "getgroups", - "getloadavg", - "getpgid", - "getpgrp", - "getpriority", - "getsid", - "getuid", - "initgroups", - "killpg", - "lchown", - "lockf", - "major", - "makedev", - "minor", - "mkfifo", - "mknod", - "nice", - "openpty", - "pathconf", - "pathconf_names", - "posix_spawn", - "posix_spawnp", - "pread", - "preadv", - "pwrite", - "pwritev", - "readv", - "register_at_fork", - "sched_get_priority_max", - "sched_get_priority_min", - "sched_yield", - "sendfile", - "setegid", - "seteuid", - "setgid", - "setgroups", - "setpgid", - "setpgrp", - "setpriority", - "setregid", - "setreuid", - "setsid", - "setuid", - "spawnlp", - "spawnlpe", - "spawnvp", - "spawnvpe", - "statvfs", - "sync", - "sysconf", - "sysconf_names", - "tcgetpgrp", - "tcsetpgrp", - "ttyname", - "uname", - "wait", - "wait3", - "wait4", - "writev", - ] -if sys.platform != "win32" and sys.version_info >= (3, 13): - __all__ += ["grantpt", "posix_openpt", "ptsname", "unlockpt"] -if sys.platform != "win32" and sys.version_info >= (3, 11): - __all__ += ["login_tty"] -if sys.platform != "win32" and sys.version_info >= (3, 10): - __all__ += ["O_FSYNC"] -if sys.platform != "darwin" and sys.platform != "win32": - __all__ += [ - "POSIX_FADV_DONTNEED", - "POSIX_FADV_NOREUSE", - "POSIX_FADV_NORMAL", - "POSIX_FADV_RANDOM", - "POSIX_FADV_SEQUENTIAL", - "POSIX_FADV_WILLNEED", - "RWF_DSYNC", - "RWF_HIPRI", - "RWF_NOWAIT", - "RWF_SYNC", - "ST_APPEND", - "ST_MANDLOCK", - "ST_NOATIME", - "ST_NODEV", - "ST_NODIRATIME", - "ST_NOEXEC", - "ST_RELATIME", - "ST_SYNCHRONOUS", - "ST_WRITE", - "fdatasync", - "getresgid", - "getresuid", - "pipe2", - "posix_fadvise", - "posix_fallocate", - "sched_getaffinity", - "sched_getparam", - "sched_getscheduler", - "sched_param", - "sched_rr_get_interval", - "sched_setaffinity", - "sched_setparam", - "sched_setscheduler", - "setresgid", - "setresuid", - ] -if sys.platform != "linux" and sys.platform != "win32": - __all__ += ["O_EXLOCK", "O_SHLOCK", "chflags", "lchflags"] -if sys.platform != "linux" and sys.platform != "win32" and sys.version_info >= (3, 13): - __all__ += ["O_EXEC", "O_SEARCH"] -if sys.platform != "darwin" or sys.version_info >= (3, 13): - if sys.platform != "win32": - __all__ += ["waitid", "waitid_result"] -if sys.platform != "win32" or sys.version_info >= (3, 13): - __all__ += ["fchmod"] - if sys.platform != "linux": - __all__ += ["lchmod"] -if sys.platform != "win32" or sys.version_info >= (3, 12): - __all__ += ["get_blocking", "set_blocking"] -if sys.platform != "win32" or sys.version_info >= (3, 11): - __all__ += ["EX_OK"] - -# This unnecessary alias is to work around various errors -path = _path - -_T = TypeVar("_T") -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") - -# ----- os variables ----- - -error = OSError - -supports_bytes_environ: bool - -supports_dir_fd: set[Callable[..., Any]] -supports_fd: set[Callable[..., Any]] -supports_effective_ids: set[Callable[..., Any]] -supports_follow_symlinks: set[Callable[..., Any]] - -if sys.platform != "win32": - # Unix only - PRIO_PROCESS: int - PRIO_PGRP: int - PRIO_USER: int - - F_LOCK: int - F_TLOCK: int - F_ULOCK: int - F_TEST: int - - if sys.platform != "darwin": - POSIX_FADV_NORMAL: int - POSIX_FADV_SEQUENTIAL: int - POSIX_FADV_RANDOM: int - POSIX_FADV_NOREUSE: int - POSIX_FADV_WILLNEED: int - POSIX_FADV_DONTNEED: int - - if sys.platform != "linux" and sys.platform != "darwin": - # In the os-module docs, these are marked as being available - # on "Unix, not Emscripten, not WASI." - # However, in the source code, a comment indicates they're "FreeBSD constants". - # sys.platform could have one of many values on a FreeBSD Python build, - # so the sys-module docs recommend doing `if sys.platform.startswith('freebsd')` - # to detect FreeBSD builds. Unfortunately that would be too dynamic - # for type checkers, however. - SF_NODISKIO: int - SF_MNOWAIT: int - SF_SYNC: int - - if sys.version_info >= (3, 11): - SF_NOCACHE: int - - if sys.platform == "linux": - XATTR_SIZE_MAX: int - XATTR_CREATE: int - XATTR_REPLACE: int - - P_PID: int - P_PGID: int - P_ALL: int - - if sys.platform == "linux": - P_PIDFD: int - - WEXITED: int - WSTOPPED: int - WNOWAIT: int - - CLD_EXITED: int - CLD_DUMPED: int - CLD_TRAPPED: int - CLD_CONTINUED: int - CLD_KILLED: int - CLD_STOPPED: int - - SCHED_OTHER: int - SCHED_FIFO: int - SCHED_RR: int - if sys.platform != "darwin" and sys.platform != "linux": - SCHED_SPORADIC: int - -if sys.platform == "linux": - SCHED_BATCH: int - SCHED_IDLE: int - SCHED_RESET_ON_FORK: int - -if sys.platform != "win32": - RTLD_LAZY: int - RTLD_NOW: int - RTLD_GLOBAL: int - RTLD_LOCAL: int - RTLD_NODELETE: int - RTLD_NOLOAD: int - -if sys.platform == "linux": - RTLD_DEEPBIND: int - GRND_NONBLOCK: int - GRND_RANDOM: int - -if sys.platform == "darwin" and sys.version_info >= (3, 12): - PRIO_DARWIN_BG: int - PRIO_DARWIN_NONUI: int - PRIO_DARWIN_PROCESS: int - PRIO_DARWIN_THREAD: int - -SEEK_SET: int -SEEK_CUR: int -SEEK_END: int -if sys.platform != "win32": - SEEK_DATA: int - SEEK_HOLE: int - -O_RDONLY: int -O_WRONLY: int -O_RDWR: int -O_APPEND: int -O_CREAT: int -O_EXCL: int -O_TRUNC: int -if sys.platform == "win32": - O_BINARY: int - O_NOINHERIT: int - O_SHORT_LIVED: int - O_TEMPORARY: int - O_RANDOM: int - O_SEQUENTIAL: int - O_TEXT: int - -if sys.platform != "win32": - O_DSYNC: int - O_SYNC: int - O_NDELAY: int - O_NONBLOCK: int - O_NOCTTY: int - O_CLOEXEC: int - O_ASYNC: int # Gnu extension if in C library - O_DIRECTORY: int # Gnu extension if in C library - O_NOFOLLOW: int # Gnu extension if in C library - O_ACCMODE: int # TODO: when does this exist? - -if sys.platform == "linux": - O_RSYNC: int - O_DIRECT: int # Gnu extension if in C library - O_NOATIME: int # Gnu extension if in C library - O_PATH: int # Gnu extension if in C library - O_TMPFILE: int # Gnu extension if in C library - O_LARGEFILE: int # Gnu extension if in C library - -if sys.platform != "linux" and sys.platform != "win32": - O_SHLOCK: int - O_EXLOCK: int - -if sys.platform == "darwin" and sys.version_info >= (3, 10): - O_EVTONLY: int - O_NOFOLLOW_ANY: int - O_SYMLINK: int - -if sys.platform != "win32" and sys.version_info >= (3, 10): - O_FSYNC: int - -if sys.platform != "linux" and sys.platform != "win32" and sys.version_info >= (3, 13): - O_EXEC: int - O_SEARCH: int - -if sys.platform != "win32" and sys.platform != "darwin": - # posix, but apparently missing on macos - ST_APPEND: int - ST_MANDLOCK: int - ST_NOATIME: int - ST_NODEV: int - ST_NODIRATIME: int - ST_NOEXEC: int - ST_RELATIME: int - ST_SYNCHRONOUS: int - ST_WRITE: int - -if sys.platform != "win32": - NGROUPS_MAX: int - ST_NOSUID: int - ST_RDONLY: int - -curdir: str -pardir: str -sep: str -if sys.platform == "win32": - altsep: str -else: - altsep: str | None -extsep: str -pathsep: str -defpath: str -linesep: str -devnull: str -name: str - -F_OK: int -R_OK: int -W_OK: int -X_OK: int - -_EnvironCodeFunc: TypeAlias = Callable[[AnyStr], AnyStr] - -class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]): - encodekey: _EnvironCodeFunc[AnyStr] - decodekey: _EnvironCodeFunc[AnyStr] - encodevalue: _EnvironCodeFunc[AnyStr] - decodevalue: _EnvironCodeFunc[AnyStr] - def __init__( - self, - data: MutableMapping[AnyStr, AnyStr], - encodekey: _EnvironCodeFunc[AnyStr], - decodekey: _EnvironCodeFunc[AnyStr], - encodevalue: _EnvironCodeFunc[AnyStr], - decodevalue: _EnvironCodeFunc[AnyStr], - ) -> None: ... - def setdefault(self, key: AnyStr, value: AnyStr) -> AnyStr: ... - def copy(self) -> dict[AnyStr, AnyStr]: ... - def __delitem__(self, key: AnyStr) -> None: ... - def __getitem__(self, key: AnyStr) -> AnyStr: ... - def __setitem__(self, key: AnyStr, value: AnyStr) -> None: ... - def __iter__(self) -> Iterator[AnyStr]: ... - def __len__(self) -> int: ... - def __or__(self, other: Mapping[_T1, _T2]) -> dict[AnyStr | _T1, AnyStr | _T2]: ... - def __ror__(self, other: Mapping[_T1, _T2]) -> dict[AnyStr | _T1, AnyStr | _T2]: ... - # We use @overload instead of a Union for reasons similar to those given for - # overloading MutableMapping.update in stdlib/typing.pyi - # The type: ignore is needed due to incompatible __or__/__ior__ signatures - @overload # type: ignore[misc] - def __ior__(self, other: Mapping[AnyStr, AnyStr]) -> Self: ... - @overload - def __ior__(self, other: Iterable[tuple[AnyStr, AnyStr]]) -> Self: ... - -environ: _Environ[str] -if sys.platform != "win32": - environb: _Environ[bytes] - -if sys.version_info >= (3, 11) or sys.platform != "win32": - EX_OK: int - -if sys.platform != "win32": - confstr_names: dict[str, int] - pathconf_names: dict[str, int] - sysconf_names: dict[str, int] - - EX_USAGE: int - EX_DATAERR: int - EX_NOINPUT: int - EX_NOUSER: int - EX_NOHOST: int - EX_UNAVAILABLE: int - EX_SOFTWARE: int - EX_OSERR: int - EX_OSFILE: int - EX_CANTCREAT: int - EX_IOERR: int - EX_TEMPFAIL: int - EX_PROTOCOL: int - EX_NOPERM: int - EX_CONFIG: int - -# Exists on some Unix platforms, e.g. Solaris. -if sys.platform != "win32" and sys.platform != "darwin" and sys.platform != "linux": - EX_NOTFOUND: int - -P_NOWAIT: int -P_NOWAITO: int -P_WAIT: int -if sys.platform == "win32": - P_DETACH: int - P_OVERLAY: int - -# wait()/waitpid() options -if sys.platform != "win32": - WNOHANG: int # Unix only - WCONTINUED: int # some Unix systems - WUNTRACED: int # Unix only - -TMP_MAX: int # Undocumented, but used by tempfile - -# ----- os classes (structures) ----- -@final -class stat_result(structseq[float], tuple[int, int, int, int, int, int, int, float, float, float]): - # The constructor of this class takes an iterable of variable length (though it must be at least 10). - # - # However, this class behaves like a tuple of 10 elements, - # no matter how long the iterable supplied to the constructor is. - # https://github.com/python/typeshed/pull/6560#discussion_r767162532 - # - # The 10 elements always present are st_mode, st_ino, st_dev, st_nlink, - # st_uid, st_gid, st_size, st_atime, st_mtime, st_ctime. - # - # More items may be added at the end by some implementations. - if sys.version_info >= (3, 10): - __match_args__: Final = ("st_mode", "st_ino", "st_dev", "st_nlink", "st_uid", "st_gid", "st_size") - - @property - def st_mode(self) -> int: ... # protection bits, - @property - def st_ino(self) -> int: ... # inode number, - @property - def st_dev(self) -> int: ... # device, - @property - def st_nlink(self) -> int: ... # number of hard links, - @property - def st_uid(self) -> int: ... # user id of owner, - @property - def st_gid(self) -> int: ... # group id of owner, - @property - def st_size(self) -> int: ... # size of file, in bytes, - @property - def st_atime(self) -> float: ... # time of most recent access, - @property - def st_mtime(self) -> float: ... # time of most recent content modification, - # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) - if sys.version_info >= (3, 12) and sys.platform == "win32": - @property - @deprecated( - """\ -Use st_birthtime instead to retrieve the file creation time. \ -In the future, this property will contain the last metadata change time.""" - ) - def st_ctime(self) -> float: ... - else: - @property - def st_ctime(self) -> float: ... - - @property - def st_atime_ns(self) -> int: ... # time of most recent access, in nanoseconds - @property - def st_mtime_ns(self) -> int: ... # time of most recent content modification in nanoseconds - # platform dependent (time of most recent metadata change on Unix, or the time of creation on Windows) in nanoseconds - @property - def st_ctime_ns(self) -> int: ... - if sys.platform == "win32": - @property - def st_file_attributes(self) -> int: ... - @property - def st_reparse_tag(self) -> int: ... - if sys.version_info >= (3, 12): - @property - def st_birthtime(self) -> float: ... # time of file creation in seconds - @property - def st_birthtime_ns(self) -> int: ... # time of file creation in nanoseconds - else: - @property - def st_blocks(self) -> int: ... # number of blocks allocated for file - @property - def st_blksize(self) -> int: ... # filesystem blocksize - @property - def st_rdev(self) -> int: ... # type of device if an inode device - if sys.platform != "linux": - # These properties are available on MacOS, but not Ubuntu. - # On other Unix systems (such as FreeBSD), the following attributes may be - # available (but may be only filled out if root tries to use them): - @property - def st_gen(self) -> int: ... # file generation number - @property - def st_birthtime(self) -> float: ... # time of file creation in seconds - if sys.platform == "darwin": - @property - def st_flags(self) -> int: ... # user defined flags for file - # Attributes documented as sometimes appearing, but deliberately omitted from the stub: `st_creator`, `st_rsize`, `st_type`. - # See https://github.com/python/typeshed/pull/6560#issuecomment-991253327 - -# mypy and pyright object to this being both ABC and Protocol. -# At runtime it inherits from ABC and is not a Protocol, but it will be -# on the allowlist for use as a Protocol starting in 3.14. -@runtime_checkable -class PathLike(ABC, Protocol[AnyStr_co]): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - @abstractmethod - def __fspath__(self) -> AnyStr_co: ... - -@overload -def listdir(path: StrPath | None = None) -> list[str]: ... -@overload -def listdir(path: BytesPath) -> list[bytes]: ... -@overload -def listdir(path: int) -> list[str]: ... -@final -class DirEntry(Generic[AnyStr]): - # This is what the scandir iterator yields - # The constructor is hidden - - @property - def name(self) -> AnyStr: ... - @property - def path(self) -> AnyStr: ... - def inode(self) -> int: ... - def is_dir(self, *, follow_symlinks: bool = True) -> bool: ... - def is_file(self, *, follow_symlinks: bool = True) -> bool: ... - def is_symlink(self) -> bool: ... - def stat(self, *, follow_symlinks: bool = True) -> stat_result: ... - def __fspath__(self) -> AnyStr: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - if sys.version_info >= (3, 12): - def is_junction(self) -> bool: ... - -@final -class statvfs_result(structseq[int], tuple[int, int, int, int, int, int, int, int, int, int, int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ( - "f_bsize", - "f_frsize", - "f_blocks", - "f_bfree", - "f_bavail", - "f_files", - "f_ffree", - "f_favail", - "f_flag", - "f_namemax", - ) - - @property - def f_bsize(self) -> int: ... - @property - def f_frsize(self) -> int: ... - @property - def f_blocks(self) -> int: ... - @property - def f_bfree(self) -> int: ... - @property - def f_bavail(self) -> int: ... - @property - def f_files(self) -> int: ... - @property - def f_ffree(self) -> int: ... - @property - def f_favail(self) -> int: ... - @property - def f_flag(self) -> int: ... - @property - def f_namemax(self) -> int: ... - @property - def f_fsid(self) -> int: ... - -# ----- os function stubs ----- -def fsencode(filename: StrOrBytesPath) -> bytes: ... -def fsdecode(filename: StrOrBytesPath) -> str: ... -@overload -def fspath(path: str) -> str: ... -@overload -def fspath(path: bytes) -> bytes: ... -@overload -def fspath(path: PathLike[AnyStr]) -> AnyStr: ... -def get_exec_path(env: Mapping[str, str] | None = None) -> list[str]: ... -def getlogin() -> str: ... -def getpid() -> int: ... -def getppid() -> int: ... -def strerror(code: int, /) -> str: ... -def umask(mask: int, /) -> int: ... -@final -class uname_result(structseq[str], tuple[str, str, str, str, str]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("sysname", "nodename", "release", "version", "machine") - - @property - def sysname(self) -> str: ... - @property - def nodename(self) -> str: ... - @property - def release(self) -> str: ... - @property - def version(self) -> str: ... - @property - def machine(self) -> str: ... - -if sys.platform != "win32": - def ctermid() -> str: ... - def getegid() -> int: ... - def geteuid() -> int: ... - def getgid() -> int: ... - def getgrouplist(user: str, group: int, /) -> list[int]: ... - def getgroups() -> list[int]: ... # Unix only, behaves differently on Mac - def initgroups(username: str, gid: int, /) -> None: ... - def getpgid(pid: int) -> int: ... - def getpgrp() -> int: ... - def getpriority(which: int, who: int) -> int: ... - def setpriority(which: int, who: int, priority: int) -> None: ... - if sys.platform != "darwin": - def getresuid() -> tuple[int, int, int]: ... - def getresgid() -> tuple[int, int, int]: ... - - def getuid() -> int: ... - def setegid(egid: int, /) -> None: ... - def seteuid(euid: int, /) -> None: ... - def setgid(gid: int, /) -> None: ... - def setgroups(groups: Sequence[int], /) -> None: ... - def setpgrp() -> None: ... - def setpgid(pid: int, pgrp: int, /) -> None: ... - def setregid(rgid: int, egid: int, /) -> None: ... - if sys.platform != "darwin": - def setresgid(rgid: int, egid: int, sgid: int, /) -> None: ... - def setresuid(ruid: int, euid: int, suid: int, /) -> None: ... - - def setreuid(ruid: int, euid: int, /) -> None: ... - def getsid(pid: int, /) -> int: ... - def setsid() -> None: ... - def setuid(uid: int, /) -> None: ... - def uname() -> uname_result: ... - -@overload -def getenv(key: str) -> str | None: ... -@overload -def getenv(key: str, default: _T) -> str | _T: ... - -if sys.platform != "win32": - @overload - def getenvb(key: bytes) -> bytes | None: ... - @overload - def getenvb(key: bytes, default: _T) -> bytes | _T: ... - def putenv(name: StrOrBytesPath, value: StrOrBytesPath, /) -> None: ... - def unsetenv(name: StrOrBytesPath, /) -> None: ... - -else: - def putenv(name: str, value: str, /) -> None: ... - def unsetenv(name: str, /) -> None: ... - -_Opener: TypeAlias = Callable[[str, int], int] - -@overload -def fdopen( - fd: int, - mode: OpenTextMode = "r", - buffering: int = -1, - encoding: str | None = None, - errors: str | None = ..., - newline: str | None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., -) -> TextIOWrapper: ... -@overload -def fdopen( - fd: int, - mode: OpenBinaryMode, - buffering: Literal[0], - encoding: None = None, - errors: None = None, - newline: None = None, - closefd: bool = ..., - opener: _Opener | None = ..., -) -> FileIO: ... -@overload -def fdopen( - fd: int, - mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - closefd: bool = ..., - opener: _Opener | None = ..., -) -> BufferedRandom: ... -@overload -def fdopen( - fd: int, - mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - closefd: bool = ..., - opener: _Opener | None = ..., -) -> BufferedWriter: ... -@overload -def fdopen( - fd: int, - mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - closefd: bool = ..., - opener: _Opener | None = ..., -) -> BufferedReader: ... -@overload -def fdopen( - fd: int, - mode: OpenBinaryMode, - buffering: int = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - closefd: bool = ..., - opener: _Opener | None = ..., -) -> BinaryIO: ... -@overload -def fdopen( - fd: int, - mode: str, - buffering: int = -1, - encoding: str | None = None, - errors: str | None = ..., - newline: str | None = ..., - closefd: bool = ..., - opener: _Opener | None = ..., -) -> IO[Any]: ... -def close(fd: int) -> None: ... -def closerange(fd_low: int, fd_high: int, /) -> None: ... -def device_encoding(fd: int) -> str | None: ... -def dup(fd: int, /) -> int: ... -def dup2(fd: int, fd2: int, inheritable: bool = True) -> int: ... -def fstat(fd: int) -> stat_result: ... -def ftruncate(fd: int, length: int, /) -> None: ... -def fsync(fd: FileDescriptorLike) -> None: ... -def isatty(fd: int, /) -> bool: ... - -if sys.platform != "win32" and sys.version_info >= (3, 11): - def login_tty(fd: int, /) -> None: ... - -if sys.version_info >= (3, 11): - def lseek(fd: int, position: int, whence: int, /) -> int: ... - -else: - def lseek(fd: int, position: int, how: int, /) -> int: ... - -def open(path: StrOrBytesPath, flags: int, mode: int = 0o777, *, dir_fd: int | None = None) -> int: ... -def pipe() -> tuple[int, int]: ... -def read(fd: int, length: int, /) -> bytes: ... - -if sys.version_info >= (3, 12) or sys.platform != "win32": - def get_blocking(fd: int, /) -> bool: ... - def set_blocking(fd: int, blocking: bool, /) -> None: ... - -if sys.platform != "win32": - def fchown(fd: int, uid: int, gid: int) -> None: ... - def fpathconf(fd: int, name: str | int, /) -> int: ... - def fstatvfs(fd: int, /) -> statvfs_result: ... - def lockf(fd: int, command: int, length: int, /) -> None: ... - def openpty() -> tuple[int, int]: ... # some flavors of Unix - if sys.platform != "darwin": - def fdatasync(fd: FileDescriptorLike) -> None: ... - def pipe2(flags: int, /) -> tuple[int, int]: ... # some flavors of Unix - def posix_fallocate(fd: int, offset: int, length: int, /) -> None: ... - def posix_fadvise(fd: int, offset: int, length: int, advice: int, /) -> None: ... - - def pread(fd: int, length: int, offset: int, /) -> bytes: ... - def pwrite(fd: int, buffer: ReadableBuffer, offset: int, /) -> int: ... - # In CI, stubtest sometimes reports that these are available on MacOS, sometimes not - def preadv(fd: int, buffers: SupportsLenAndGetItem[WriteableBuffer], offset: int, flags: int = 0, /) -> int: ... - def pwritev(fd: int, buffers: SupportsLenAndGetItem[ReadableBuffer], offset: int, flags: int = 0, /) -> int: ... - if sys.platform != "darwin": - if sys.version_info >= (3, 10): - RWF_APPEND: int # docs say available on 3.7+, stubtest says otherwise - RWF_DSYNC: int - RWF_SYNC: int - RWF_HIPRI: int - RWF_NOWAIT: int - - if sys.platform == "linux": - def sendfile(out_fd: FileDescriptor, in_fd: FileDescriptor, offset: int | None, count: int) -> int: ... - else: - def sendfile( - out_fd: FileDescriptor, - in_fd: FileDescriptor, - offset: int, - count: int, - headers: Sequence[ReadableBuffer] = ..., - trailers: Sequence[ReadableBuffer] = ..., - flags: int = 0, - ) -> int: ... # FreeBSD and Mac OS X only - - def readv(fd: int, buffers: SupportsLenAndGetItem[WriteableBuffer], /) -> int: ... - def writev(fd: int, buffers: SupportsLenAndGetItem[ReadableBuffer], /) -> int: ... - -@final -class terminal_size(structseq[int], tuple[int, int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("columns", "lines") - - @property - def columns(self) -> int: ... - @property - def lines(self) -> int: ... - -def get_terminal_size(fd: int = ..., /) -> terminal_size: ... -def get_inheritable(fd: int, /) -> bool: ... -def set_inheritable(fd: int, inheritable: bool, /) -> None: ... - -if sys.platform == "win32": - def get_handle_inheritable(handle: int, /) -> bool: ... - def set_handle_inheritable(handle: int, inheritable: bool, /) -> None: ... - -if sys.platform != "win32": - # Unix only - def tcgetpgrp(fd: int, /) -> int: ... - def tcsetpgrp(fd: int, pgid: int, /) -> None: ... - def ttyname(fd: int, /) -> str: ... - -def write(fd: int, data: ReadableBuffer, /) -> int: ... -def access( - path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, effective_ids: bool = False, follow_symlinks: bool = True -) -> bool: ... -def chdir(path: FileDescriptorOrPath) -> None: ... - -if sys.platform != "win32": - def fchdir(fd: FileDescriptorLike) -> None: ... - -def getcwd() -> str: ... -def getcwdb() -> bytes: ... -def chmod(path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, follow_symlinks: bool = ...) -> None: ... - -if sys.platform != "win32" and sys.platform != "linux": - def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = True) -> None: ... # some flavors of Unix - def lchflags(path: StrOrBytesPath, flags: int) -> None: ... - -if sys.platform != "win32": - def chroot(path: StrOrBytesPath) -> None: ... - def chown( - path: FileDescriptorOrPath, uid: int, gid: int, *, dir_fd: int | None = None, follow_symlinks: bool = True - ) -> None: ... - def lchown(path: StrOrBytesPath, uid: int, gid: int) -> None: ... - -def link( - src: StrOrBytesPath, - dst: StrOrBytesPath, - *, - src_dir_fd: int | None = None, - dst_dir_fd: int | None = None, - follow_symlinks: bool = True, -) -> None: ... -def lstat(path: StrOrBytesPath, *, dir_fd: int | None = None) -> stat_result: ... -def mkdir(path: StrOrBytesPath, mode: int = 0o777, *, dir_fd: int | None = None) -> None: ... - -if sys.platform != "win32": - def mkfifo(path: StrOrBytesPath, mode: int = 0o666, *, dir_fd: int | None = None) -> None: ... # Unix only - -def makedirs(name: StrOrBytesPath, mode: int = 0o777, exist_ok: bool = False) -> None: ... - -if sys.platform != "win32": - def mknod(path: StrOrBytesPath, mode: int = 0o600, device: int = 0, *, dir_fd: int | None = None) -> None: ... - def major(device: int, /) -> int: ... - def minor(device: int, /) -> int: ... - def makedev(major: int, minor: int, /) -> int: ... - def pathconf(path: FileDescriptorOrPath, name: str | int) -> int: ... # Unix only - -def readlink(path: GenericPath[AnyStr], *, dir_fd: int | None = None) -> AnyStr: ... -def remove(path: StrOrBytesPath, *, dir_fd: int | None = None) -> None: ... -def removedirs(name: StrOrBytesPath) -> None: ... -def rename(src: StrOrBytesPath, dst: StrOrBytesPath, *, src_dir_fd: int | None = None, dst_dir_fd: int | None = None) -> None: ... -def renames(old: StrOrBytesPath, new: StrOrBytesPath) -> None: ... -def replace( - src: StrOrBytesPath, dst: StrOrBytesPath, *, src_dir_fd: int | None = None, dst_dir_fd: int | None = None -) -> None: ... -def rmdir(path: StrOrBytesPath, *, dir_fd: int | None = None) -> None: ... -@final -class _ScandirIterator(Generic[AnyStr]): - def __del__(self) -> None: ... - def __iter__(self) -> Self: ... - def __next__(self) -> DirEntry[AnyStr]: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - def close(self) -> None: ... - -@overload -def scandir(path: None = None) -> _ScandirIterator[str]: ... -@overload -def scandir(path: int) -> _ScandirIterator[str]: ... -@overload -def scandir(path: GenericPath[AnyStr]) -> _ScandirIterator[AnyStr]: ... -def stat(path: FileDescriptorOrPath, *, dir_fd: int | None = None, follow_symlinks: bool = True) -> stat_result: ... - -if sys.platform != "win32": - def statvfs(path: FileDescriptorOrPath) -> statvfs_result: ... # Unix only - -def symlink( - src: StrOrBytesPath, dst: StrOrBytesPath, target_is_directory: bool = False, *, dir_fd: int | None = None -) -> None: ... - -if sys.platform != "win32": - def sync() -> None: ... # Unix only - -def truncate(path: FileDescriptorOrPath, length: int) -> None: ... # Unix only up to version 3.4 -def unlink(path: StrOrBytesPath, *, dir_fd: int | None = None) -> None: ... -def utime( - path: FileDescriptorOrPath, - times: tuple[int, int] | tuple[float, float] | None = None, - *, - ns: tuple[int, int] = ..., - dir_fd: int | None = None, - follow_symlinks: bool = True, -) -> None: ... - -_OnError: TypeAlias = Callable[[OSError], object] - -def walk( - top: GenericPath[AnyStr], topdown: bool = True, onerror: _OnError | None = None, followlinks: bool = False -) -> Iterator[tuple[AnyStr, list[AnyStr], list[AnyStr]]]: ... - -if sys.platform != "win32": - @overload - def fwalk( - top: StrPath = ".", - topdown: bool = True, - onerror: _OnError | None = None, - *, - follow_symlinks: bool = False, - dir_fd: int | None = None, - ) -> Iterator[tuple[str, list[str], list[str], int]]: ... - @overload - def fwalk( - top: BytesPath, - topdown: bool = True, - onerror: _OnError | None = None, - *, - follow_symlinks: bool = False, - dir_fd: int | None = None, - ) -> Iterator[tuple[bytes, list[bytes], list[bytes], int]]: ... - if sys.platform == "linux": - def getxattr(path: FileDescriptorOrPath, attribute: StrOrBytesPath, *, follow_symlinks: bool = True) -> bytes: ... - def listxattr(path: FileDescriptorOrPath | None = None, *, follow_symlinks: bool = True) -> list[str]: ... - def removexattr(path: FileDescriptorOrPath, attribute: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... - def setxattr( - path: FileDescriptorOrPath, - attribute: StrOrBytesPath, - value: ReadableBuffer, - flags: int = 0, - *, - follow_symlinks: bool = True, - ) -> None: ... - -def abort() -> NoReturn: ... - -# These are defined as execl(file, *args) but the first *arg is mandatory. -def execl(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> NoReturn: ... -def execlp(file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]]]]) -> NoReturn: ... - -# These are: execle(file, *args, env) but env is pulled from the last element of the args. -def execle( - file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]], _ExecEnv]] -) -> NoReturn: ... -def execlpe( - file: StrOrBytesPath, *args: Unpack[tuple[StrOrBytesPath, Unpack[tuple[StrOrBytesPath, ...]], _ExecEnv]] -) -> NoReturn: ... - -# The docs say `args: tuple or list of strings` -# The implementation enforces tuple or list so we can't use Sequence. -# Not separating out PathLike[str] and PathLike[bytes] here because it doesn't make much difference -# in practice, and doing so would explode the number of combinations in this already long union. -# All these combinations are necessary due to list being invariant. -_ExecVArgs: TypeAlias = ( - tuple[StrOrBytesPath, ...] - | list[bytes] - | list[str] - | list[PathLike[Any]] - | list[bytes | str] - | list[bytes | PathLike[Any]] - | list[str | PathLike[Any]] - | list[bytes | str | PathLike[Any]] -) -# Depending on the OS, the keys and values are passed either to -# PyUnicode_FSDecoder (which accepts str | ReadableBuffer) or to -# PyUnicode_FSConverter (which accepts StrOrBytesPath). For simplicity, -# we limit to str | bytes. -_ExecEnv: TypeAlias = Mapping[bytes, bytes | str] | Mapping[str, bytes | str] - -def execv(path: StrOrBytesPath, argv: _ExecVArgs, /) -> NoReturn: ... -def execve(path: FileDescriptorOrPath, argv: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... -def execvp(file: StrOrBytesPath, args: _ExecVArgs) -> NoReturn: ... -def execvpe(file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> NoReturn: ... -def _exit(status: int) -> NoReturn: ... -def kill(pid: int, signal: int, /) -> None: ... - -if sys.platform != "win32": - # Unix only - def fork() -> int: ... - def forkpty() -> tuple[int, int]: ... # some flavors of Unix - def killpg(pgid: int, signal: int, /) -> None: ... - def nice(increment: int, /) -> int: ... - if sys.platform != "darwin" and sys.platform != "linux": - def plock(op: int, /) -> None: ... - -class _wrap_close: - def __init__(self, stream: TextIOWrapper, proc: Popen[str]) -> None: ... - def close(self) -> int | None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - def __iter__(self) -> Iterator[str]: ... - # Methods below here don't exist directly on the _wrap_close object, but - # are copied from the wrapped TextIOWrapper object via __getattr__. - # The full set of TextIOWrapper methods are technically available this way, - # but undocumented. Only a subset are currently included here. - def read(self, size: int | None = -1, /) -> str: ... - def readable(self) -> bool: ... - def readline(self, size: int = -1, /) -> str: ... - def readlines(self, hint: int = -1, /) -> list[str]: ... - def writable(self) -> bool: ... - def write(self, s: str, /) -> int: ... - def writelines(self, lines: Iterable[str], /) -> None: ... - -def popen(cmd: str, mode: str = "r", buffering: int = -1) -> _wrap_close: ... -def spawnl(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ... -def spawnle(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: Any) -> int: ... # Imprecise sig - -if sys.platform != "win32": - def spawnv(mode: int, file: StrOrBytesPath, args: _ExecVArgs) -> int: ... - def spawnve(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ... - -else: - def spawnv(mode: int, path: StrOrBytesPath, argv: _ExecVArgs, /) -> int: ... - def spawnve(mode: int, path: StrOrBytesPath, argv: _ExecVArgs, env: _ExecEnv, /) -> int: ... - -def system(command: StrOrBytesPath) -> int: ... -@final -class times_result(structseq[float], tuple[float, float, float, float, float]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("user", "system", "children_user", "children_system", "elapsed") - - @property - def user(self) -> float: ... - @property - def system(self) -> float: ... - @property - def children_user(self) -> float: ... - @property - def children_system(self) -> float: ... - @property - def elapsed(self) -> float: ... - -def times() -> times_result: ... -def waitpid(pid: int, options: int, /) -> tuple[int, int]: ... - -if sys.platform == "win32": - if sys.version_info >= (3, 10): - def startfile( - filepath: StrOrBytesPath, - operation: str = ..., - arguments: str = "", - cwd: StrOrBytesPath | None = None, - show_cmd: int = 1, - ) -> None: ... - else: - def startfile(filepath: StrOrBytesPath, operation: str = ...) -> None: ... - -else: - def spawnlp(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ... - def spawnlpe(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: Any) -> int: ... # Imprecise signature - def spawnvp(mode: int, file: StrOrBytesPath, args: _ExecVArgs) -> int: ... - def spawnvpe(mode: int, file: StrOrBytesPath, args: _ExecVArgs, env: _ExecEnv) -> int: ... - def wait() -> tuple[int, int]: ... # Unix only - # Added to MacOS in 3.13 - if sys.platform != "darwin" or sys.version_info >= (3, 13): - @final - class waitid_result(structseq[int], tuple[int, int, int, int, int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("si_pid", "si_uid", "si_signo", "si_status", "si_code") - - @property - def si_pid(self) -> int: ... - @property - def si_uid(self) -> int: ... - @property - def si_signo(self) -> int: ... - @property - def si_status(self) -> int: ... - @property - def si_code(self) -> int: ... - - def waitid(idtype: int, ident: int, options: int, /) -> waitid_result | None: ... - - from resource import struct_rusage - - def wait3(options: int) -> tuple[int, int, struct_rusage]: ... - def wait4(pid: int, options: int) -> tuple[int, int, struct_rusage]: ... - def WCOREDUMP(status: int, /) -> bool: ... - def WIFCONTINUED(status: int) -> bool: ... - def WIFSTOPPED(status: int) -> bool: ... - def WIFSIGNALED(status: int) -> bool: ... - def WIFEXITED(status: int) -> bool: ... - def WEXITSTATUS(status: int) -> int: ... - def WSTOPSIG(status: int) -> int: ... - def WTERMSIG(status: int) -> int: ... - def posix_spawn( - path: StrOrBytesPath, - argv: _ExecVArgs, - env: _ExecEnv, - /, - *, - file_actions: Sequence[tuple[Any, ...]] | None = ..., - setpgroup: int | None = ..., - resetids: bool = ..., - setsid: bool = ..., - setsigmask: Iterable[int] = ..., - setsigdef: Iterable[int] = ..., - scheduler: tuple[Any, sched_param] | None = ..., - ) -> int: ... - def posix_spawnp( - path: StrOrBytesPath, - argv: _ExecVArgs, - env: _ExecEnv, - /, - *, - file_actions: Sequence[tuple[Any, ...]] | None = ..., - setpgroup: int | None = ..., - resetids: bool = ..., - setsid: bool = ..., - setsigmask: Iterable[int] = ..., - setsigdef: Iterable[int] = ..., - scheduler: tuple[Any, sched_param] | None = ..., - ) -> int: ... - POSIX_SPAWN_OPEN: int - POSIX_SPAWN_CLOSE: int - POSIX_SPAWN_DUP2: int - -if sys.platform != "win32": - @final - class sched_param(structseq[int], tuple[int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("sched_priority",) - - def __new__(cls, sched_priority: int) -> Self: ... - @property - def sched_priority(self) -> int: ... - - def sched_get_priority_min(policy: int) -> int: ... # some flavors of Unix - def sched_get_priority_max(policy: int) -> int: ... # some flavors of Unix - def sched_yield() -> None: ... # some flavors of Unix - if sys.platform != "darwin": - def sched_setscheduler(pid: int, policy: int, param: sched_param, /) -> None: ... # some flavors of Unix - def sched_getscheduler(pid: int, /) -> int: ... # some flavors of Unix - def sched_rr_get_interval(pid: int, /) -> float: ... # some flavors of Unix - def sched_setparam(pid: int, param: sched_param, /) -> None: ... # some flavors of Unix - def sched_getparam(pid: int, /) -> sched_param: ... # some flavors of Unix - def sched_setaffinity(pid: int, mask: Iterable[int], /) -> None: ... # some flavors of Unix - def sched_getaffinity(pid: int, /) -> set[int]: ... # some flavors of Unix - -def cpu_count() -> int | None: ... - -if sys.version_info >= (3, 13): - # Documented to return `int | None`, but falls back to `len(sched_getaffinity(0))` when - # available. See https://github.com/python/cpython/blob/417c130/Lib/os.py#L1175-L1186. - if sys.platform != "win32" and sys.platform != "darwin": - def process_cpu_count() -> int: ... - else: - def process_cpu_count() -> int | None: ... - -if sys.platform != "win32": - # Unix only - def confstr(name: str | int, /) -> str | None: ... - def getloadavg() -> tuple[float, float, float]: ... - def sysconf(name: str | int, /) -> int: ... - -if sys.platform == "linux": - def getrandom(size: int, flags: int = 0) -> bytes: ... - -def urandom(size: int, /) -> bytes: ... - -if sys.platform != "win32": - def register_at_fork( - *, - before: Callable[..., Any] | None = ..., - after_in_parent: Callable[..., Any] | None = ..., - after_in_child: Callable[..., Any] | None = ..., - ) -> None: ... - -if sys.platform == "win32": - class _AddedDllDirectory: - path: str | None - def __init__(self, path: str | None, cookie: _T, remove_dll_directory: Callable[[_T], object]) -> None: ... - def close(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - - def add_dll_directory(path: str) -> _AddedDllDirectory: ... - -if sys.platform == "linux": - MFD_CLOEXEC: int - MFD_ALLOW_SEALING: int - MFD_HUGETLB: int - MFD_HUGE_SHIFT: int - MFD_HUGE_MASK: int - MFD_HUGE_64KB: int - MFD_HUGE_512KB: int - MFD_HUGE_1MB: int - MFD_HUGE_2MB: int - MFD_HUGE_8MB: int - MFD_HUGE_16MB: int - MFD_HUGE_32MB: int - MFD_HUGE_256MB: int - MFD_HUGE_512MB: int - MFD_HUGE_1GB: int - MFD_HUGE_2GB: int - MFD_HUGE_16GB: int - def memfd_create(name: str, flags: int = ...) -> int: ... - def copy_file_range(src: int, dst: int, count: int, offset_src: int | None = ..., offset_dst: int | None = ...) -> int: ... - -def waitstatus_to_exitcode(status: int) -> int: ... - -if sys.platform == "linux": - def pidfd_open(pid: int, flags: int = ...) -> int: ... - -if sys.version_info >= (3, 12) and sys.platform == "linux": - PIDFD_NONBLOCK: Final = 2048 - -if sys.version_info >= (3, 12) and sys.platform == "win32": - def listdrives() -> list[str]: ... - def listmounts(volume: str) -> list[str]: ... - def listvolumes() -> list[str]: ... - -if sys.version_info >= (3, 10) and sys.platform == "linux": - EFD_CLOEXEC: int - EFD_NONBLOCK: int - EFD_SEMAPHORE: int - SPLICE_F_MORE: int - SPLICE_F_MOVE: int - SPLICE_F_NONBLOCK: int - def eventfd(initval: int, flags: int = 524288) -> FileDescriptor: ... - def eventfd_read(fd: FileDescriptor) -> int: ... - def eventfd_write(fd: FileDescriptor, value: int) -> None: ... - def splice( - src: FileDescriptor, - dst: FileDescriptor, - count: int, - offset_src: int | None = ..., - offset_dst: int | None = ..., - flags: int = 0, - ) -> int: ... - -if sys.version_info >= (3, 12) and sys.platform == "linux": - CLONE_FILES: int - CLONE_FS: int - CLONE_NEWCGROUP: int # Linux 4.6+ - CLONE_NEWIPC: int # Linux 2.6.19+ - CLONE_NEWNET: int # Linux 2.6.24+ - CLONE_NEWNS: int - CLONE_NEWPID: int # Linux 3.8+ - CLONE_NEWTIME: int # Linux 5.6+ - CLONE_NEWUSER: int # Linux 3.8+ - CLONE_NEWUTS: int # Linux 2.6.19+ - CLONE_SIGHAND: int - CLONE_SYSVSEM: int # Linux 2.6.26+ - CLONE_THREAD: int - CLONE_VM: int - def unshare(flags: int) -> None: ... - def setns(fd: FileDescriptorLike, nstype: int = 0) -> None: ... - -if sys.version_info >= (3, 13) and sys.platform != "win32": - def posix_openpt(oflag: int, /) -> int: ... - def grantpt(fd: FileDescriptorLike, /) -> None: ... - def unlockpt(fd: FileDescriptorLike, /) -> None: ... - def ptsname(fd: FileDescriptorLike, /) -> str: ... - -if sys.version_info >= (3, 13) and sys.platform == "linux": - TFD_TIMER_ABSTIME: Final = 1 - TFD_TIMER_CANCEL_ON_SET: Final = 2 - TFD_NONBLOCK: Final[int] - TFD_CLOEXEC: Final[int] - POSIX_SPAWN_CLOSEFROM: Final[int] - - def timerfd_create(clockid: int, /, *, flags: int = 0) -> int: ... - def timerfd_settime( - fd: FileDescriptor, /, *, flags: int = 0, initial: float = 0.0, interval: float = 0.0 - ) -> tuple[float, float]: ... - def timerfd_settime_ns(fd: FileDescriptor, /, *, flags: int = 0, initial: int = 0, interval: int = 0) -> tuple[int, int]: ... - def timerfd_gettime(fd: FileDescriptor, /) -> tuple[float, float]: ... - def timerfd_gettime_ns(fd: FileDescriptor, /) -> tuple[int, int]: ... - -if sys.version_info >= (3, 13) or sys.platform != "win32": - # Added to Windows in 3.13. - def fchmod(fd: int, mode: int) -> None: ... - -if sys.platform != "linux": - if sys.version_info >= (3, 13) or sys.platform != "win32": - # Added to Windows in 3.13. - def lchmod(path: StrOrBytesPath, mode: int) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/os/path.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/os/path.pyi deleted file mode 100644 index dc688a9f87..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/os/path.pyi +++ /dev/null @@ -1,8 +0,0 @@ -import sys - -if sys.platform == "win32": - from ntpath import * - from ntpath import __all__ as __all__ -else: - from posixpath import * - from posixpath import __all__ as __all__ diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ossaudiodev.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ossaudiodev.pyi deleted file mode 100644 index b9ee3edab0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ossaudiodev.pyi +++ /dev/null @@ -1,131 +0,0 @@ -import sys -from typing import Any, Literal, overload - -if sys.platform != "win32" and sys.platform != "darwin": - AFMT_AC3: int - AFMT_A_LAW: int - AFMT_IMA_ADPCM: int - AFMT_MPEG: int - AFMT_MU_LAW: int - AFMT_QUERY: int - AFMT_S16_BE: int - AFMT_S16_LE: int - AFMT_S16_NE: int - AFMT_S8: int - AFMT_U16_BE: int - AFMT_U16_LE: int - AFMT_U8: int - SNDCTL_COPR_HALT: int - SNDCTL_COPR_LOAD: int - SNDCTL_COPR_RCODE: int - SNDCTL_COPR_RCVMSG: int - SNDCTL_COPR_RDATA: int - SNDCTL_COPR_RESET: int - SNDCTL_COPR_RUN: int - SNDCTL_COPR_SENDMSG: int - SNDCTL_COPR_WCODE: int - SNDCTL_COPR_WDATA: int - SNDCTL_DSP_BIND_CHANNEL: int - SNDCTL_DSP_CHANNELS: int - SNDCTL_DSP_GETBLKSIZE: int - SNDCTL_DSP_GETCAPS: int - SNDCTL_DSP_GETCHANNELMASK: int - SNDCTL_DSP_GETFMTS: int - SNDCTL_DSP_GETIPTR: int - SNDCTL_DSP_GETISPACE: int - SNDCTL_DSP_GETODELAY: int - SNDCTL_DSP_GETOPTR: int - SNDCTL_DSP_GETOSPACE: int - SNDCTL_DSP_GETSPDIF: int - SNDCTL_DSP_GETTRIGGER: int - SNDCTL_DSP_MAPINBUF: int - SNDCTL_DSP_MAPOUTBUF: int - SNDCTL_DSP_NONBLOCK: int - SNDCTL_DSP_POST: int - SNDCTL_DSP_PROFILE: int - SNDCTL_DSP_RESET: int - SNDCTL_DSP_SAMPLESIZE: int - SNDCTL_DSP_SETDUPLEX: int - SNDCTL_DSP_SETFMT: int - SNDCTL_DSP_SETFRAGMENT: int - SNDCTL_DSP_SETSPDIF: int - SNDCTL_DSP_SETSYNCRO: int - SNDCTL_DSP_SETTRIGGER: int - SNDCTL_DSP_SPEED: int - SNDCTL_DSP_STEREO: int - SNDCTL_DSP_SUBDIVIDE: int - SNDCTL_DSP_SYNC: int - SNDCTL_FM_4OP_ENABLE: int - SNDCTL_FM_LOAD_INSTR: int - SNDCTL_MIDI_INFO: int - SNDCTL_MIDI_MPUCMD: int - SNDCTL_MIDI_MPUMODE: int - SNDCTL_MIDI_PRETIME: int - SNDCTL_SEQ_CTRLRATE: int - SNDCTL_SEQ_GETINCOUNT: int - SNDCTL_SEQ_GETOUTCOUNT: int - SNDCTL_SEQ_GETTIME: int - SNDCTL_SEQ_NRMIDIS: int - SNDCTL_SEQ_NRSYNTHS: int - SNDCTL_SEQ_OUTOFBAND: int - SNDCTL_SEQ_PANIC: int - SNDCTL_SEQ_PERCMODE: int - SNDCTL_SEQ_RESET: int - SNDCTL_SEQ_RESETSAMPLES: int - SNDCTL_SEQ_SYNC: int - SNDCTL_SEQ_TESTMIDI: int - SNDCTL_SEQ_THRESHOLD: int - SNDCTL_SYNTH_CONTROL: int - SNDCTL_SYNTH_ID: int - SNDCTL_SYNTH_INFO: int - SNDCTL_SYNTH_MEMAVL: int - SNDCTL_SYNTH_REMOVESAMPLE: int - SNDCTL_TMR_CONTINUE: int - SNDCTL_TMR_METRONOME: int - SNDCTL_TMR_SELECT: int - SNDCTL_TMR_SOURCE: int - SNDCTL_TMR_START: int - SNDCTL_TMR_STOP: int - SNDCTL_TMR_TEMPO: int - SNDCTL_TMR_TIMEBASE: int - SOUND_MIXER_ALTPCM: int - SOUND_MIXER_BASS: int - SOUND_MIXER_CD: int - SOUND_MIXER_DIGITAL1: int - SOUND_MIXER_DIGITAL2: int - SOUND_MIXER_DIGITAL3: int - SOUND_MIXER_IGAIN: int - SOUND_MIXER_IMIX: int - SOUND_MIXER_LINE: int - SOUND_MIXER_LINE1: int - SOUND_MIXER_LINE2: int - SOUND_MIXER_LINE3: int - SOUND_MIXER_MIC: int - SOUND_MIXER_MONITOR: int - SOUND_MIXER_NRDEVICES: int - SOUND_MIXER_OGAIN: int - SOUND_MIXER_PCM: int - SOUND_MIXER_PHONEIN: int - SOUND_MIXER_PHONEOUT: int - SOUND_MIXER_RADIO: int - SOUND_MIXER_RECLEV: int - SOUND_MIXER_SPEAKER: int - SOUND_MIXER_SYNTH: int - SOUND_MIXER_TREBLE: int - SOUND_MIXER_VIDEO: int - SOUND_MIXER_VOLUME: int - - control_labels: list[str] - control_names: list[str] - - # TODO: oss_audio_device return type - @overload - def open(mode: Literal["r", "w", "rw"]) -> Any: ... - @overload - def open(device: str, mode: Literal["r", "w", "rw"]) -> Any: ... - - # TODO: oss_mixer_device return type - def openmixer(device: str = ...) -> Any: ... - - class OSSAudioError(Exception): ... - error = OSSAudioError diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/parser.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/parser.pyi deleted file mode 100644 index 26140c7624..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/parser.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from _typeshed import StrOrBytesPath -from collections.abc import Sequence -from types import CodeType -from typing import Any, ClassVar, final - -def expr(source: str) -> STType: ... -def suite(source: str) -> STType: ... -def sequence2st(sequence: Sequence[Any]) -> STType: ... -def tuple2st(sequence: Sequence[Any]) -> STType: ... -def st2list(st: STType, line_info: bool = ..., col_info: bool = ...) -> list[Any]: ... -def st2tuple(st: STType, line_info: bool = ..., col_info: bool = ...) -> tuple[Any, ...]: ... -def compilest(st: STType, filename: StrOrBytesPath = ...) -> CodeType: ... -def isexpr(st: STType) -> bool: ... -def issuite(st: STType) -> bool: ... - -class ParserError(Exception): ... - -@final -class STType: - __hash__: ClassVar[None] # type: ignore[assignment] - def compile(self, filename: StrOrBytesPath = ...) -> CodeType: ... - def isexpr(self) -> bool: ... - def issuite(self) -> bool: ... - def tolist(self, line_info: bool = ..., col_info: bool = ...) -> list[Any]: ... - def totuple(self, line_info: bool = ..., col_info: bool = ...) -> tuple[Any, ...]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pathlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pathlib.pyi deleted file mode 100644 index 1e4d97770b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pathlib.pyi +++ /dev/null @@ -1,296 +0,0 @@ -import sys -import types -from _typeshed import ( - OpenBinaryMode, - OpenBinaryModeReading, - OpenBinaryModeUpdating, - OpenBinaryModeWriting, - OpenTextMode, - ReadableBuffer, - StrOrBytesPath, - StrPath, - Unused, -) -from collections.abc import Callable, Generator, Iterator, Sequence -from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper -from os import PathLike, stat_result -from types import GenericAlias, TracebackType -from typing import IO, Any, BinaryIO, ClassVar, Literal, overload -from typing_extensions import Never, Self, deprecated - -__all__ = ["PurePath", "PurePosixPath", "PureWindowsPath", "Path", "PosixPath", "WindowsPath"] - -if sys.version_info >= (3, 13): - __all__ += ["UnsupportedOperation"] - -class PurePath(PathLike[str]): - if sys.version_info >= (3, 13): - parser: ClassVar[types.ModuleType] - def full_match(self, pattern: StrPath, *, case_sensitive: bool | None = None) -> bool: ... - - @property - def parts(self) -> tuple[str, ...]: ... - @property - def drive(self) -> str: ... - @property - def root(self) -> str: ... - @property - def anchor(self) -> str: ... - @property - def name(self) -> str: ... - @property - def suffix(self) -> str: ... - @property - def suffixes(self) -> list[str]: ... - @property - def stem(self) -> str: ... - if sys.version_info >= (3, 12): - def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... - def __init__(self, *args: StrPath) -> None: ... # pyright: ignore[reportInconsistentConstructor] - else: - def __new__(cls, *args: StrPath) -> Self: ... - - def __hash__(self) -> int: ... - def __fspath__(self) -> str: ... - def __lt__(self, other: PurePath) -> bool: ... - def __le__(self, other: PurePath) -> bool: ... - def __gt__(self, other: PurePath) -> bool: ... - def __ge__(self, other: PurePath) -> bool: ... - def __truediv__(self, key: StrPath) -> Self: ... - def __rtruediv__(self, key: StrPath) -> Self: ... - def __bytes__(self) -> bytes: ... - def as_posix(self) -> str: ... - def as_uri(self) -> str: ... - def is_absolute(self) -> bool: ... - def is_reserved(self) -> bool: ... - if sys.version_info >= (3, 12): - def is_relative_to(self, other: StrPath, /, *_deprecated: StrPath) -> bool: ... - else: - def is_relative_to(self, *other: StrPath) -> bool: ... - - if sys.version_info >= (3, 12): - def match(self, path_pattern: str, *, case_sensitive: bool | None = None) -> bool: ... - else: - def match(self, path_pattern: str) -> bool: ... - - if sys.version_info >= (3, 12): - def relative_to(self, other: StrPath, /, *_deprecated: StrPath, walk_up: bool = False) -> Self: ... - else: - def relative_to(self, *other: StrPath) -> Self: ... - - def with_name(self, name: str) -> Self: ... - def with_stem(self, stem: str) -> Self: ... - def with_suffix(self, suffix: str) -> Self: ... - def joinpath(self, *other: StrPath) -> Self: ... - @property - def parents(self) -> Sequence[Self]: ... - @property - def parent(self) -> Self: ... - if sys.version_info < (3, 11): - def __class_getitem__(cls, type: Any) -> GenericAlias: ... - - if sys.version_info >= (3, 12): - def with_segments(self, *args: StrPath) -> Self: ... - -class PurePosixPath(PurePath): ... -class PureWindowsPath(PurePath): ... - -class Path(PurePath): - if sys.version_info >= (3, 12): - def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... # pyright: ignore[reportInconsistentConstructor] - else: - def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ... - - @classmethod - def cwd(cls) -> Self: ... - if sys.version_info >= (3, 10): - def stat(self, *, follow_symlinks: bool = True) -> stat_result: ... - def chmod(self, mode: int, *, follow_symlinks: bool = True) -> None: ... - else: - def stat(self) -> stat_result: ... - def chmod(self, mode: int) -> None: ... - - if sys.version_info >= (3, 13): - @classmethod - def from_uri(cls, uri: str) -> Self: ... - def is_dir(self, *, follow_symlinks: bool = True) -> bool: ... - def is_file(self, *, follow_symlinks: bool = True) -> bool: ... - def read_text(self, encoding: str | None = None, errors: str | None = None, newline: str | None = None) -> str: ... - else: - def __enter__(self) -> Self: ... - def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... - def is_dir(self) -> bool: ... - def is_file(self) -> bool: ... - def read_text(self, encoding: str | None = None, errors: str | None = None) -> str: ... - - if sys.version_info >= (3, 13): - def glob(self, pattern: str, *, case_sensitive: bool | None = None, recurse_symlinks: bool = False) -> Iterator[Self]: ... - def rglob( - self, pattern: str, *, case_sensitive: bool | None = None, recurse_symlinks: bool = False - ) -> Iterator[Self]: ... - elif sys.version_info >= (3, 12): - def glob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self, None, None]: ... - def rglob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self, None, None]: ... - else: - def glob(self, pattern: str) -> Generator[Self, None, None]: ... - def rglob(self, pattern: str) -> Generator[Self, None, None]: ... - - if sys.version_info >= (3, 12): - def exists(self, *, follow_symlinks: bool = True) -> bool: ... - else: - def exists(self) -> bool: ... - - def is_symlink(self) -> bool: ... - def is_socket(self) -> bool: ... - def is_fifo(self) -> bool: ... - def is_block_device(self) -> bool: ... - def is_char_device(self) -> bool: ... - if sys.version_info >= (3, 12): - def is_junction(self) -> bool: ... - - def iterdir(self) -> Generator[Self, None, None]: ... - def lchmod(self, mode: int) -> None: ... - def lstat(self) -> stat_result: ... - def mkdir(self, mode: int = 0o777, parents: bool = False, exist_ok: bool = False) -> None: ... - - if sys.version_info >= (3, 14): - def copy(self, target: StrPath, *, follow_symlinks: bool = True, preserve_metadata: bool = False) -> None: ... - def copytree( - self, - target: StrPath, - *, - follow_symlinks: bool = True, - preserve_metadata: bool = False, - dirs_exist_ok: bool = False, - ignore: Callable[[Self], bool] | None = None, - on_error: Callable[[OSError], object] | None = None, - ) -> None: ... - - # Adapted from builtins.open - # Text mode: always returns a TextIOWrapper - # The Traversable .open in stdlib/importlib/abc.pyi should be kept in sync with this. - @overload - def open( - self, - mode: OpenTextMode = "r", - buffering: int = -1, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - ) -> TextIOWrapper: ... - # Unbuffered binary mode: returns a FileIO - @overload - def open( - self, mode: OpenBinaryMode, buffering: Literal[0], encoding: None = None, errors: None = None, newline: None = None - ) -> FileIO: ... - # Buffering is on: return BufferedRandom, BufferedReader, or BufferedWriter - @overload - def open( - self, - mode: OpenBinaryModeUpdating, - buffering: Literal[-1, 1] = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - ) -> BufferedRandom: ... - @overload - def open( - self, - mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - ) -> BufferedWriter: ... - @overload - def open( - self, - mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = -1, - encoding: None = None, - errors: None = None, - newline: None = None, - ) -> BufferedReader: ... - # Buffering cannot be determined: fall back to BinaryIO - @overload - def open( - self, mode: OpenBinaryMode, buffering: int = -1, encoding: None = None, errors: None = None, newline: None = None - ) -> BinaryIO: ... - # Fallback if mode is not specified - @overload - def open( - self, mode: str, buffering: int = -1, encoding: str | None = None, errors: str | None = None, newline: str | None = None - ) -> IO[Any]: ... - - # These methods do "exist" on Windows on <3.13, but they always raise NotImplementedError. - if sys.platform == "win32": - if sys.version_info < (3, 13): - def owner(self: Never) -> str: ... # type: ignore[misc] - def group(self: Never) -> str: ... # type: ignore[misc] - else: - if sys.version_info >= (3, 13): - def owner(self, *, follow_symlinks: bool = True) -> str: ... - def group(self, *, follow_symlinks: bool = True) -> str: ... - else: - def owner(self) -> str: ... - def group(self) -> str: ... - - # This method does "exist" on Windows on <3.12, but always raises NotImplementedError - # On py312+, it works properly on Windows, as with all other platforms - if sys.platform == "win32" and sys.version_info < (3, 12): - def is_mount(self: Never) -> bool: ... # type: ignore[misc] - else: - def is_mount(self) -> bool: ... - - def readlink(self) -> Self: ... - - if sys.version_info >= (3, 10): - def rename(self, target: StrPath) -> Self: ... - def replace(self, target: StrPath) -> Self: ... - else: - def rename(self, target: str | PurePath) -> Self: ... - def replace(self, target: str | PurePath) -> Self: ... - - def resolve(self, strict: bool = False) -> Self: ... - def rmdir(self) -> None: ... - if sys.version_info >= (3, 14): - def delete(self, ignore_errors: bool = False, on_error: Callable[[OSError], object] | None = None) -> None: ... - - def symlink_to(self, target: StrOrBytesPath, target_is_directory: bool = False) -> None: ... - if sys.version_info >= (3, 10): - def hardlink_to(self, target: StrOrBytesPath) -> None: ... - - def touch(self, mode: int = 0o666, exist_ok: bool = True) -> None: ... - def unlink(self, missing_ok: bool = False) -> None: ... - @classmethod - def home(cls) -> Self: ... - def absolute(self) -> Self: ... - def expanduser(self) -> Self: ... - def read_bytes(self) -> bytes: ... - def samefile(self, other_path: StrPath) -> bool: ... - def write_bytes(self, data: ReadableBuffer) -> int: ... - if sys.version_info >= (3, 10): - def write_text( - self, data: str, encoding: str | None = None, errors: str | None = None, newline: str | None = None - ) -> int: ... - else: - def write_text(self, data: str, encoding: str | None = None, errors: str | None = None) -> int: ... - if sys.version_info < (3, 12): - if sys.version_info >= (3, 10): - @deprecated("Deprecated as of Python 3.10 and removed in Python 3.12. Use hardlink_to() instead.") - def link_to(self, target: StrOrBytesPath) -> None: ... - else: - def link_to(self, target: StrOrBytesPath) -> None: ... - if sys.version_info >= (3, 12): - def walk( - self, top_down: bool = ..., on_error: Callable[[OSError], object] | None = ..., follow_symlinks: bool = ... - ) -> Iterator[tuple[Self, list[str], list[str]]]: ... - - if sys.version_info >= (3, 14): - def rmtree(self, ignore_errors: bool = False, on_error: Callable[[OSError], object] | None = None) -> None: ... - -class PosixPath(Path, PurePosixPath): ... -class WindowsPath(Path, PureWindowsPath): ... - -if sys.version_info >= (3, 13): - class UnsupportedOperation(NotImplementedError): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pdb.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pdb.pyi deleted file mode 100644 index 61e8b7176e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pdb.pyi +++ /dev/null @@ -1,206 +0,0 @@ -import signal -import sys -from bdb import Bdb -from cmd import Cmd -from collections.abc import Callable, Iterable, Mapping, Sequence -from inspect import _SourceObjectType -from types import CodeType, FrameType, TracebackType -from typing import IO, Any, ClassVar, Final, TypeVar -from typing_extensions import ParamSpec, Self - -__all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace", "post_mortem", "help"] - -_T = TypeVar("_T") -_P = ParamSpec("_P") - -line_prefix: str # undocumented - -class Restart(Exception): ... - -def run(statement: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> None: ... -def runeval(expression: str, globals: dict[str, Any] | None = None, locals: Mapping[str, Any] | None = None) -> Any: ... -def runctx(statement: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> None: ... -def runcall(func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ... -def set_trace(*, header: str | None = None) -> None: ... -def post_mortem(t: TracebackType | None = None) -> None: ... -def pm() -> None: ... - -class Pdb(Bdb, Cmd): - # Everything here is undocumented, except for __init__ - - commands_resuming: ClassVar[list[str]] - - if sys.version_info >= (3, 13): - MAX_CHAINED_EXCEPTION_DEPTH: Final = 999 - - aliases: dict[str, str] - mainpyfile: str - _wait_for_mainpyfile: bool - rcLines: list[str] - commands: dict[int, list[str]] - commands_doprompt: dict[int, bool] - commands_silent: dict[int, bool] - commands_defining: bool - commands_bnum: int | None - lineno: int | None - stack: list[tuple[FrameType, int]] - curindex: int - curframe: FrameType | None - curframe_locals: Mapping[str, Any] - def __init__( - self, - completekey: str = "tab", - stdin: IO[str] | None = None, - stdout: IO[str] | None = None, - skip: Iterable[str] | None = None, - nosigint: bool = False, - readrc: bool = True, - ) -> None: ... - def forget(self) -> None: ... - def setup(self, f: FrameType | None, tb: TracebackType | None) -> None: ... - if sys.version_info < (3, 11): - def execRcLines(self) -> None: ... - - if sys.version_info >= (3, 13): - user_opcode = Bdb.user_line - - def bp_commands(self, frame: FrameType) -> bool: ... - - if sys.version_info >= (3, 13): - def interaction(self, frame: FrameType | None, tb_or_exc: TracebackType | BaseException | None) -> None: ... - else: - def interaction(self, frame: FrameType | None, traceback: TracebackType | None) -> None: ... - - def displayhook(self, obj: object) -> None: ... - def handle_command_def(self, line: str) -> bool: ... - def defaultFile(self) -> str: ... - def lineinfo(self, identifier: str) -> tuple[None, None, None] | tuple[str, str, int]: ... - def checkline(self, filename: str, lineno: int) -> int: ... - def _getval(self, arg: str) -> object: ... - def print_stack_trace(self) -> None: ... - def print_stack_entry(self, frame_lineno: tuple[FrameType, int], prompt_prefix: str = "\n-> ") -> None: ... - def lookupmodule(self, filename: str) -> str | None: ... - if sys.version_info < (3, 11): - def _runscript(self, filename: str) -> None: ... - - if sys.version_info >= (3, 13): - def completedefault(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... - - def do_commands(self, arg: str) -> bool | None: ... - def do_break(self, arg: str, temporary: bool = ...) -> bool | None: ... - def do_tbreak(self, arg: str) -> bool | None: ... - def do_enable(self, arg: str) -> bool | None: ... - def do_disable(self, arg: str) -> bool | None: ... - def do_condition(self, arg: str) -> bool | None: ... - def do_ignore(self, arg: str) -> bool | None: ... - def do_clear(self, arg: str) -> bool | None: ... - def do_where(self, arg: str) -> bool | None: ... - if sys.version_info >= (3, 13): - def do_exceptions(self, arg: str) -> bool | None: ... - - def do_up(self, arg: str) -> bool | None: ... - def do_down(self, arg: str) -> bool | None: ... - def do_until(self, arg: str) -> bool | None: ... - def do_step(self, arg: str) -> bool | None: ... - def do_next(self, arg: str) -> bool | None: ... - def do_run(self, arg: str) -> bool | None: ... - def do_return(self, arg: str) -> bool | None: ... - def do_continue(self, arg: str) -> bool | None: ... - def do_jump(self, arg: str) -> bool | None: ... - def do_debug(self, arg: str) -> bool | None: ... - def do_quit(self, arg: str) -> bool | None: ... - def do_EOF(self, arg: str) -> bool | None: ... - def do_args(self, arg: str) -> bool | None: ... - def do_retval(self, arg: str) -> bool | None: ... - def do_p(self, arg: str) -> bool | None: ... - def do_pp(self, arg: str) -> bool | None: ... - def do_list(self, arg: str) -> bool | None: ... - def do_whatis(self, arg: str) -> bool | None: ... - def do_alias(self, arg: str) -> bool | None: ... - def do_unalias(self, arg: str) -> bool | None: ... - def do_help(self, arg: str) -> bool | None: ... - do_b = do_break - do_cl = do_clear - do_w = do_where - do_bt = do_where - do_u = do_up - do_d = do_down - do_unt = do_until - do_s = do_step - do_n = do_next - do_restart = do_run - do_r = do_return - do_c = do_continue - do_cont = do_continue - do_j = do_jump - do_q = do_quit - do_exit = do_quit - do_a = do_args - do_rv = do_retval - do_l = do_list - do_h = do_help - def help_exec(self) -> None: ... - def help_pdb(self) -> None: ... - def sigint_handler(self, signum: signal.Signals, frame: FrameType) -> None: ... - if sys.version_info >= (3, 13): - def message(self, msg: str, end: str = "\n") -> None: ... - else: - def message(self, msg: str) -> None: ... - - def error(self, msg: str) -> None: ... - if sys.version_info >= (3, 13): - def completenames(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... # type: ignore[override] - if sys.version_info >= (3, 12): - def set_convenience_variable(self, frame: FrameType, name: str, value: Any) -> None: ... - - def _select_frame(self, number: int) -> None: ... - def _getval_except(self, arg: str, frame: FrameType | None = None) -> object: ... - def _print_lines( - self, lines: Sequence[str], start: int, breaks: Sequence[int] = (), frame: FrameType | None = None - ) -> None: ... - def _cmdloop(self) -> None: ... - def do_display(self, arg: str) -> bool | None: ... - def do_interact(self, arg: str) -> bool | None: ... - def do_longlist(self, arg: str) -> bool | None: ... - def do_source(self, arg: str) -> bool | None: ... - def do_undisplay(self, arg: str) -> bool | None: ... - do_ll = do_longlist - def _complete_location(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... - def _complete_bpnumber(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... - def _complete_expression(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... - def complete_undisplay(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... - def complete_unalias(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... - complete_commands = _complete_bpnumber - complete_break = _complete_location - complete_b = _complete_location - complete_tbreak = _complete_location - complete_enable = _complete_bpnumber - complete_disable = _complete_bpnumber - complete_condition = _complete_bpnumber - complete_ignore = _complete_bpnumber - complete_clear = _complete_location - complete_cl = _complete_location - complete_debug = _complete_expression - complete_print = _complete_expression - complete_p = _complete_expression - complete_pp = _complete_expression - complete_source = _complete_expression - complete_whatis = _complete_expression - complete_display = _complete_expression - - if sys.version_info < (3, 11): - def _runmodule(self, module_name: str) -> None: ... - -# undocumented - -def find_function(funcname: str, filename: str) -> tuple[str, str, int] | None: ... -def main() -> None: ... -def help() -> None: ... - -if sys.version_info < (3, 10): - def getsourcelines(obj: _SourceObjectType) -> tuple[list[str], int]: ... - -def lasti2lineno(code: CodeType, lasti: int) -> int: ... - -class _rstr(str): - def __repr__(self) -> Self: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pickle.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pickle.pyi deleted file mode 100644 index 2d80d61645..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pickle.pyi +++ /dev/null @@ -1,233 +0,0 @@ -from _pickle import ( - PickleError as PickleError, - Pickler as Pickler, - PicklingError as PicklingError, - Unpickler as Unpickler, - UnpicklingError as UnpicklingError, - _BufferCallback, - _ReadableFileobj, - _ReducedType, - dump as dump, - dumps as dumps, - load as load, - loads as loads, -) -from _typeshed import ReadableBuffer, SupportsWrite -from collections.abc import Callable, Iterable, Mapping -from typing import Any, ClassVar, SupportsBytes, SupportsIndex, final -from typing_extensions import Self - -__all__ = [ - "PickleBuffer", - "PickleError", - "PicklingError", - "UnpicklingError", - "Pickler", - "Unpickler", - "dump", - "dumps", - "load", - "loads", - "ADDITEMS", - "APPEND", - "APPENDS", - "BINBYTES", - "BINBYTES8", - "BINFLOAT", - "BINGET", - "BININT", - "BININT1", - "BININT2", - "BINPERSID", - "BINPUT", - "BINSTRING", - "BINUNICODE", - "BINUNICODE8", - "BUILD", - "BYTEARRAY8", - "DEFAULT_PROTOCOL", - "DICT", - "DUP", - "EMPTY_DICT", - "EMPTY_LIST", - "EMPTY_SET", - "EMPTY_TUPLE", - "EXT1", - "EXT2", - "EXT4", - "FALSE", - "FLOAT", - "FRAME", - "FROZENSET", - "GET", - "GLOBAL", - "HIGHEST_PROTOCOL", - "INST", - "INT", - "LIST", - "LONG", - "LONG1", - "LONG4", - "LONG_BINGET", - "LONG_BINPUT", - "MARK", - "MEMOIZE", - "NEWFALSE", - "NEWOBJ", - "NEWOBJ_EX", - "NEWTRUE", - "NEXT_BUFFER", - "NONE", - "OBJ", - "PERSID", - "POP", - "POP_MARK", - "PROTO", - "PUT", - "READONLY_BUFFER", - "REDUCE", - "SETITEM", - "SETITEMS", - "SHORT_BINBYTES", - "SHORT_BINSTRING", - "SHORT_BINUNICODE", - "STACK_GLOBAL", - "STOP", - "STRING", - "TRUE", - "TUPLE", - "TUPLE1", - "TUPLE2", - "TUPLE3", - "UNICODE", -] - -HIGHEST_PROTOCOL: int -DEFAULT_PROTOCOL: int - -bytes_types: tuple[type[Any], ...] # undocumented - -@final -class PickleBuffer: - def __new__(cls, buffer: ReadableBuffer) -> Self: ... - def raw(self) -> memoryview: ... - def release(self) -> None: ... - def __buffer__(self, flags: int, /) -> memoryview: ... - def __release_buffer__(self, buffer: memoryview, /) -> None: ... - -MARK: bytes -STOP: bytes -POP: bytes -POP_MARK: bytes -DUP: bytes -FLOAT: bytes -INT: bytes -BININT: bytes -BININT1: bytes -LONG: bytes -BININT2: bytes -NONE: bytes -PERSID: bytes -BINPERSID: bytes -REDUCE: bytes -STRING: bytes -BINSTRING: bytes -SHORT_BINSTRING: bytes -UNICODE: bytes -BINUNICODE: bytes -APPEND: bytes -BUILD: bytes -GLOBAL: bytes -DICT: bytes -EMPTY_DICT: bytes -APPENDS: bytes -GET: bytes -BINGET: bytes -INST: bytes -LONG_BINGET: bytes -LIST: bytes -EMPTY_LIST: bytes -OBJ: bytes -PUT: bytes -BINPUT: bytes -LONG_BINPUT: bytes -SETITEM: bytes -TUPLE: bytes -EMPTY_TUPLE: bytes -SETITEMS: bytes -BINFLOAT: bytes - -TRUE: bytes -FALSE: bytes - -# protocol 2 -PROTO: bytes -NEWOBJ: bytes -EXT1: bytes -EXT2: bytes -EXT4: bytes -TUPLE1: bytes -TUPLE2: bytes -TUPLE3: bytes -NEWTRUE: bytes -NEWFALSE: bytes -LONG1: bytes -LONG4: bytes - -# protocol 3 -BINBYTES: bytes -SHORT_BINBYTES: bytes - -# protocol 4 -SHORT_BINUNICODE: bytes -BINUNICODE8: bytes -BINBYTES8: bytes -EMPTY_SET: bytes -ADDITEMS: bytes -FROZENSET: bytes -NEWOBJ_EX: bytes -STACK_GLOBAL: bytes -MEMOIZE: bytes -FRAME: bytes - -# protocol 5 -BYTEARRAY8: bytes -NEXT_BUFFER: bytes -READONLY_BUFFER: bytes - -def encode_long(x: int) -> bytes: ... # undocumented -def decode_long(data: Iterable[SupportsIndex] | SupportsBytes | ReadableBuffer) -> int: ... # undocumented - -# undocumented pure-Python implementations -class _Pickler: - fast: bool - dispatch_table: Mapping[type, Callable[[Any], _ReducedType]] - bin: bool # undocumented - dispatch: ClassVar[dict[type, Callable[[Unpickler, Any], None]]] # undocumented, _Pickler only - reducer_override: Callable[[Any], Any] - def __init__( - self, - file: SupportsWrite[bytes], - protocol: int | None = None, - *, - fix_imports: bool = True, - buffer_callback: _BufferCallback = None, - ) -> None: ... - def dump(self, obj: Any) -> None: ... - def clear_memo(self) -> None: ... - def persistent_id(self, obj: Any) -> Any: ... - -class _Unpickler: - dispatch: ClassVar[dict[int, Callable[[Unpickler], None]]] # undocumented, _Unpickler only - def __init__( - self, - file: _ReadableFileobj, - *, - fix_imports: bool = True, - encoding: str = "ASCII", - errors: str = "strict", - buffers: Iterable[Any] | None = None, - ) -> None: ... - def load(self) -> Any: ... - def find_class(self, module: str, name: str) -> Any: ... - def persistent_load(self, pid: Any) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pickletools.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pickletools.pyi deleted file mode 100644 index cdade08d39..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pickletools.pyi +++ /dev/null @@ -1,174 +0,0 @@ -import sys -from collections.abc import Callable, Iterator, MutableMapping -from typing import IO, Any -from typing_extensions import TypeAlias - -__all__ = ["dis", "genops", "optimize"] - -_Reader: TypeAlias = Callable[[IO[bytes]], Any] -bytes_types: tuple[type[Any], ...] - -UP_TO_NEWLINE: int -TAKEN_FROM_ARGUMENT1: int -TAKEN_FROM_ARGUMENT4: int -TAKEN_FROM_ARGUMENT4U: int -TAKEN_FROM_ARGUMENT8U: int - -class ArgumentDescriptor: - name: str - n: int - reader: _Reader - doc: str - def __init__(self, name: str, n: int, reader: _Reader, doc: str) -> None: ... - -def read_uint1(f: IO[bytes]) -> int: ... - -uint1: ArgumentDescriptor - -def read_uint2(f: IO[bytes]) -> int: ... - -uint2: ArgumentDescriptor - -def read_int4(f: IO[bytes]) -> int: ... - -int4: ArgumentDescriptor - -def read_uint4(f: IO[bytes]) -> int: ... - -uint4: ArgumentDescriptor - -def read_uint8(f: IO[bytes]) -> int: ... - -uint8: ArgumentDescriptor - -if sys.version_info >= (3, 12): - def read_stringnl( - f: IO[bytes], decode: bool = True, stripquotes: bool = True, *, encoding: str = "latin-1" - ) -> bytes | str: ... - -else: - def read_stringnl(f: IO[bytes], decode: bool = True, stripquotes: bool = True) -> bytes | str: ... - -stringnl: ArgumentDescriptor - -def read_stringnl_noescape(f: IO[bytes]) -> str: ... - -stringnl_noescape: ArgumentDescriptor - -def read_stringnl_noescape_pair(f: IO[bytes]) -> str: ... - -stringnl_noescape_pair: ArgumentDescriptor - -def read_string1(f: IO[bytes]) -> str: ... - -string1: ArgumentDescriptor - -def read_string4(f: IO[bytes]) -> str: ... - -string4: ArgumentDescriptor - -def read_bytes1(f: IO[bytes]) -> bytes: ... - -bytes1: ArgumentDescriptor - -def read_bytes4(f: IO[bytes]) -> bytes: ... - -bytes4: ArgumentDescriptor - -def read_bytes8(f: IO[bytes]) -> bytes: ... - -bytes8: ArgumentDescriptor - -def read_unicodestringnl(f: IO[bytes]) -> str: ... - -unicodestringnl: ArgumentDescriptor - -def read_unicodestring1(f: IO[bytes]) -> str: ... - -unicodestring1: ArgumentDescriptor - -def read_unicodestring4(f: IO[bytes]) -> str: ... - -unicodestring4: ArgumentDescriptor - -def read_unicodestring8(f: IO[bytes]) -> str: ... - -unicodestring8: ArgumentDescriptor - -def read_decimalnl_short(f: IO[bytes]) -> int: ... -def read_decimalnl_long(f: IO[bytes]) -> int: ... - -decimalnl_short: ArgumentDescriptor -decimalnl_long: ArgumentDescriptor - -def read_floatnl(f: IO[bytes]) -> float: ... - -floatnl: ArgumentDescriptor - -def read_float8(f: IO[bytes]) -> float: ... - -float8: ArgumentDescriptor - -def read_long1(f: IO[bytes]) -> int: ... - -long1: ArgumentDescriptor - -def read_long4(f: IO[bytes]) -> int: ... - -long4: ArgumentDescriptor - -class StackObject: - name: str - obtype: type[Any] | tuple[type[Any], ...] - doc: str - def __init__(self, name: str, obtype: type[Any] | tuple[type[Any], ...], doc: str) -> None: ... - -pyint: StackObject -pylong: StackObject -pyinteger_or_bool: StackObject -pybool: StackObject -pyfloat: StackObject -pybytes_or_str: StackObject -pystring: StackObject -pybytes: StackObject -pyunicode: StackObject -pynone: StackObject -pytuple: StackObject -pylist: StackObject -pydict: StackObject -pyset: StackObject -pyfrozenset: StackObject -anyobject: StackObject -markobject: StackObject -stackslice: StackObject - -class OpcodeInfo: - name: str - code: str - arg: ArgumentDescriptor | None - stack_before: list[StackObject] - stack_after: list[StackObject] - proto: int - doc: str - def __init__( - self, - name: str, - code: str, - arg: ArgumentDescriptor | None, - stack_before: list[StackObject], - stack_after: list[StackObject], - proto: int, - doc: str, - ) -> None: ... - -opcodes: list[OpcodeInfo] - -def genops(pickle: bytes | bytearray | IO[bytes]) -> Iterator[tuple[OpcodeInfo, Any | None, int | None]]: ... -def optimize(p: bytes | bytearray | IO[bytes]) -> bytes: ... -def dis( - pickle: bytes | bytearray | IO[bytes], - out: IO[str] | None = None, - memo: MutableMapping[int, Any] | None = None, - indentlevel: int = 4, - annotate: int = 0, -) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pipes.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pipes.pyi deleted file mode 100644 index fe680bfddf..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pipes.pyi +++ /dev/null @@ -1,16 +0,0 @@ -import os - -__all__ = ["Template"] - -class Template: - def reset(self) -> None: ... - def clone(self) -> Template: ... - def debug(self, flag: bool) -> None: ... - def append(self, cmd: str, kind: str) -> None: ... - def prepend(self, cmd: str, kind: str) -> None: ... - def open(self, file: str, rw: str) -> os._wrap_close: ... - def copy(self, infile: str, outfile: str) -> int: ... - -# Not documented, but widely used. -# Documented as shlex.quote since 3.3. -def quote(s: str) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pkgutil.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pkgutil.pyi deleted file mode 100644 index d60e9bad53..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pkgutil.pyi +++ /dev/null @@ -1,51 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath, SupportsRead -from _typeshed.importlib import LoaderProtocol, MetaPathFinderProtocol, PathEntryFinderProtocol -from collections.abc import Callable, Iterable, Iterator -from typing import IO, Any, NamedTuple, TypeVar -from typing_extensions import deprecated - -__all__ = [ - "get_importer", - "iter_importers", - "get_loader", - "find_loader", - "walk_packages", - "iter_modules", - "get_data", - "read_code", - "extend_path", - "ModuleInfo", -] -if sys.version_info < (3, 12): - __all__ += ["ImpImporter", "ImpLoader"] - -_PathT = TypeVar("_PathT", bound=Iterable[str]) - -class ModuleInfo(NamedTuple): - module_finder: MetaPathFinderProtocol | PathEntryFinderProtocol - name: str - ispkg: bool - -def extend_path(path: _PathT, name: str) -> _PathT: ... - -if sys.version_info < (3, 12): - class ImpImporter: - def __init__(self, path: StrOrBytesPath | None = None) -> None: ... - - class ImpLoader: - def __init__(self, fullname: str, file: IO[str], filename: StrOrBytesPath, etc: tuple[str, str, int]) -> None: ... - -@deprecated("Use importlib.util.find_spec() instead. Will be removed in Python 3.14.") -def find_loader(fullname: str) -> LoaderProtocol | None: ... -def get_importer(path_item: StrOrBytesPath) -> PathEntryFinderProtocol | None: ... -@deprecated("Use importlib.util.find_spec() instead. Will be removed in Python 3.14.") -def get_loader(module_or_name: str) -> LoaderProtocol | None: ... -def iter_importers(fullname: str = "") -> Iterator[MetaPathFinderProtocol | PathEntryFinderProtocol]: ... -def iter_modules(path: Iterable[StrOrBytesPath] | None = None, prefix: str = "") -> Iterator[ModuleInfo]: ... -def read_code(stream: SupportsRead[bytes]) -> Any: ... # undocumented -def walk_packages( - path: Iterable[StrOrBytesPath] | None = None, prefix: str = "", onerror: Callable[[str], object] | None = None -) -> Iterator[ModuleInfo]: ... -def get_data(package: str, resource: str) -> bytes | None: ... -def resolve_name(name: str) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/platform.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/platform.pyi deleted file mode 100644 index 19fac26134..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/platform.pyi +++ /dev/null @@ -1,84 +0,0 @@ -import sys -from typing import NamedTuple, type_check_only -from typing_extensions import Self - -def libc_ver(executable: str | None = None, lib: str = "", version: str = "", chunksize: int = 16384) -> tuple[str, str]: ... -def win32_ver(release: str = "", version: str = "", csd: str = "", ptype: str = "") -> tuple[str, str, str, str]: ... -def win32_edition() -> str: ... -def win32_is_iot() -> bool: ... -def mac_ver( - release: str = "", versioninfo: tuple[str, str, str] = ("", "", ""), machine: str = "" -) -> tuple[str, tuple[str, str, str], str]: ... -def java_ver( - release: str = "", vendor: str = "", vminfo: tuple[str, str, str] = ("", "", ""), osinfo: tuple[str, str, str] = ("", "", "") -) -> tuple[str, str, tuple[str, str, str], tuple[str, str, str]]: ... -def system_alias(system: str, release: str, version: str) -> tuple[str, str, str]: ... -def architecture(executable: str = sys.executable, bits: str = "", linkage: str = "") -> tuple[str, str]: ... - -# This class is not exposed. It calls itself platform.uname_result_base. -# At runtime it only has 5 fields. -@type_check_only -class _uname_result_base(NamedTuple): - system: str - node: str - release: str - version: str - machine: str - # This base class doesn't have this field at runtime, but claiming it - # does is the least bad way to handle the situation. Nobody really - # sees this class anyway. See #13068 - processor: str - -# uname_result emulates a 6-field named tuple, but the processor field -# is lazily evaluated rather than being passed in to the constructor. -class uname_result(_uname_result_base): - if sys.version_info >= (3, 10): - __match_args__ = ("system", "node", "release", "version", "machine") # pyright: ignore[reportAssignmentType] - - def __new__(_cls, system: str, node: str, release: str, version: str, machine: str) -> Self: ... - @property - def processor(self) -> str: ... - -def uname() -> uname_result: ... -def system() -> str: ... -def node() -> str: ... -def release() -> str: ... -def version() -> str: ... -def machine() -> str: ... -def processor() -> str: ... -def python_implementation() -> str: ... -def python_version() -> str: ... -def python_version_tuple() -> tuple[str, str, str]: ... -def python_branch() -> str: ... -def python_revision() -> str: ... -def python_build() -> tuple[str, str]: ... -def python_compiler() -> str: ... -def platform(aliased: bool = ..., terse: bool = ...) -> str: ... - -if sys.version_info >= (3, 10): - def freedesktop_os_release() -> dict[str, str]: ... - -if sys.version_info >= (3, 13): - class AndroidVer(NamedTuple): - release: str - api_level: int - manufacturer: str - model: str - device: str - is_emulator: bool - - class IOSVersionInfo(NamedTuple): - system: str - release: str - model: str - is_simulator: bool - - def android_ver( - release: str = "", - api_level: int = 0, - manufacturer: str = "", - model: str = "", - device: str = "", - is_emulator: bool = False, - ) -> AndroidVer: ... - def ios_ver(system: str = "", release: str = "", model: str = "", is_simulator: bool = False) -> IOSVersionInfo: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/plistlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/plistlib.pyi deleted file mode 100644 index 8b39b4217e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/plistlib.pyi +++ /dev/null @@ -1,84 +0,0 @@ -import sys -from _typeshed import ReadableBuffer -from collections.abc import Mapping, MutableMapping -from datetime import datetime -from enum import Enum -from typing import IO, Any -from typing_extensions import Self - -__all__ = ["InvalidFileException", "FMT_XML", "FMT_BINARY", "load", "dump", "loads", "dumps", "UID"] - -class PlistFormat(Enum): - FMT_XML = 1 - FMT_BINARY = 2 - -FMT_XML = PlistFormat.FMT_XML -FMT_BINARY = PlistFormat.FMT_BINARY -if sys.version_info >= (3, 13): - def load( - fp: IO[bytes], - *, - fmt: PlistFormat | None = None, - dict_type: type[MutableMapping[str, Any]] = ..., - aware_datetime: bool = False, - ) -> Any: ... - def loads( - value: ReadableBuffer | str, - *, - fmt: PlistFormat | None = None, - dict_type: type[MutableMapping[str, Any]] = ..., - aware_datetime: bool = False, - ) -> Any: ... - -else: - def load(fp: IO[bytes], *, fmt: PlistFormat | None = None, dict_type: type[MutableMapping[str, Any]] = ...) -> Any: ... - def loads( - value: ReadableBuffer, *, fmt: PlistFormat | None = None, dict_type: type[MutableMapping[str, Any]] = ... - ) -> Any: ... - -if sys.version_info >= (3, 13): - def dump( - value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime, - fp: IO[bytes], - *, - fmt: PlistFormat = ..., - sort_keys: bool = True, - skipkeys: bool = False, - aware_datetime: bool = False, - ) -> None: ... - def dumps( - value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime, - *, - fmt: PlistFormat = ..., - skipkeys: bool = False, - sort_keys: bool = True, - aware_datetime: bool = False, - ) -> bytes: ... - -else: - def dump( - value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime, - fp: IO[bytes], - *, - fmt: PlistFormat = ..., - sort_keys: bool = True, - skipkeys: bool = False, - ) -> None: ... - def dumps( - value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime, - *, - fmt: PlistFormat = ..., - skipkeys: bool = False, - sort_keys: bool = True, - ) -> bytes: ... - -class UID: - data: int - def __init__(self, data: int) -> None: ... - def __index__(self) -> int: ... - def __reduce__(self) -> tuple[type[Self], tuple[int]]: ... - def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: ... - -class InvalidFileException(ValueError): - def __init__(self, message: str = "Invalid file") -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/poplib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/poplib.pyi deleted file mode 100644 index a1e41be86a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/poplib.pyi +++ /dev/null @@ -1,72 +0,0 @@ -import socket -import ssl -import sys -from builtins import list as _list # conflicts with a method named "list" -from re import Pattern -from typing import Any, BinaryIO, Final, NoReturn, overload -from typing_extensions import TypeAlias - -__all__ = ["POP3", "error_proto", "POP3_SSL"] - -_LongResp: TypeAlias = tuple[bytes, list[bytes], int] - -class error_proto(Exception): ... - -POP3_PORT: Final = 110 -POP3_SSL_PORT: Final = 995 -CR: Final = b"\r" -LF: Final = b"\n" -CRLF: Final = b"\r\n" -HAVE_SSL: bool - -class POP3: - encoding: str - host: str - port: int - sock: socket.socket - file: BinaryIO - welcome: bytes - def __init__(self, host: str, port: int = 110, timeout: float = ...) -> None: ... - def getwelcome(self) -> bytes: ... - def set_debuglevel(self, level: int) -> None: ... - def user(self, user: str) -> bytes: ... - def pass_(self, pswd: str) -> bytes: ... - def stat(self) -> tuple[int, int]: ... - def list(self, which: Any | None = None) -> _LongResp: ... - def retr(self, which: Any) -> _LongResp: ... - def dele(self, which: Any) -> bytes: ... - def noop(self) -> bytes: ... - def rset(self) -> bytes: ... - def quit(self) -> bytes: ... - def close(self) -> None: ... - def rpop(self, user: str) -> bytes: ... - timestamp: Pattern[str] - def apop(self, user: str, password: str) -> bytes: ... - def top(self, which: Any, howmuch: int) -> _LongResp: ... - @overload - def uidl(self) -> _LongResp: ... - @overload - def uidl(self, which: Any) -> bytes: ... - def utf8(self) -> bytes: ... - def capa(self) -> dict[str, _list[str]]: ... - def stls(self, context: ssl.SSLContext | None = None) -> bytes: ... - -class POP3_SSL(POP3): - if sys.version_info >= (3, 12): - def __init__( - self, host: str, port: int = 995, *, timeout: float = ..., context: ssl.SSLContext | None = None - ) -> None: ... - def stls(self, context: Any = None) -> NoReturn: ... - else: - def __init__( - self, - host: str, - port: int = 995, - keyfile: str | None = None, - certfile: str | None = None, - timeout: float = ..., - context: ssl.SSLContext | None = None, - ) -> None: ... - # "context" is actually the last argument, - # but that breaks LSP and it doesn't really matter because all the arguments are ignored - def stls(self, context: Any = None, keyfile: Any = None, certfile: Any = None) -> NoReturn: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/posix.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/posix.pyi deleted file mode 100644 index 88f4135af2..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/posix.pyi +++ /dev/null @@ -1,399 +0,0 @@ -import sys - -if sys.platform != "win32": - # Actually defined here, but defining in os allows sharing code with windows - from os import ( - CLD_CONTINUED as CLD_CONTINUED, - CLD_DUMPED as CLD_DUMPED, - CLD_EXITED as CLD_EXITED, - CLD_KILLED as CLD_KILLED, - CLD_STOPPED as CLD_STOPPED, - CLD_TRAPPED as CLD_TRAPPED, - EX_CANTCREAT as EX_CANTCREAT, - EX_CONFIG as EX_CONFIG, - EX_DATAERR as EX_DATAERR, - EX_IOERR as EX_IOERR, - EX_NOHOST as EX_NOHOST, - EX_NOINPUT as EX_NOINPUT, - EX_NOPERM as EX_NOPERM, - EX_NOUSER as EX_NOUSER, - EX_OK as EX_OK, - EX_OSERR as EX_OSERR, - EX_OSFILE as EX_OSFILE, - EX_PROTOCOL as EX_PROTOCOL, - EX_SOFTWARE as EX_SOFTWARE, - EX_TEMPFAIL as EX_TEMPFAIL, - EX_UNAVAILABLE as EX_UNAVAILABLE, - EX_USAGE as EX_USAGE, - F_LOCK as F_LOCK, - F_OK as F_OK, - F_TEST as F_TEST, - F_TLOCK as F_TLOCK, - F_ULOCK as F_ULOCK, - NGROUPS_MAX as NGROUPS_MAX, - O_ACCMODE as O_ACCMODE, - O_APPEND as O_APPEND, - O_ASYNC as O_ASYNC, - O_CLOEXEC as O_CLOEXEC, - O_CREAT as O_CREAT, - O_DIRECTORY as O_DIRECTORY, - O_DSYNC as O_DSYNC, - O_EXCL as O_EXCL, - O_NDELAY as O_NDELAY, - O_NOCTTY as O_NOCTTY, - O_NOFOLLOW as O_NOFOLLOW, - O_NONBLOCK as O_NONBLOCK, - O_RDONLY as O_RDONLY, - O_RDWR as O_RDWR, - O_SYNC as O_SYNC, - O_TRUNC as O_TRUNC, - O_WRONLY as O_WRONLY, - P_ALL as P_ALL, - P_PGID as P_PGID, - P_PID as P_PID, - POSIX_SPAWN_CLOSE as POSIX_SPAWN_CLOSE, - POSIX_SPAWN_DUP2 as POSIX_SPAWN_DUP2, - POSIX_SPAWN_OPEN as POSIX_SPAWN_OPEN, - PRIO_PGRP as PRIO_PGRP, - PRIO_PROCESS as PRIO_PROCESS, - PRIO_USER as PRIO_USER, - R_OK as R_OK, - RTLD_GLOBAL as RTLD_GLOBAL, - RTLD_LAZY as RTLD_LAZY, - RTLD_LOCAL as RTLD_LOCAL, - RTLD_NODELETE as RTLD_NODELETE, - RTLD_NOLOAD as RTLD_NOLOAD, - RTLD_NOW as RTLD_NOW, - SCHED_FIFO as SCHED_FIFO, - SCHED_OTHER as SCHED_OTHER, - SCHED_RR as SCHED_RR, - SEEK_DATA as SEEK_DATA, - SEEK_HOLE as SEEK_HOLE, - ST_NOSUID as ST_NOSUID, - ST_RDONLY as ST_RDONLY, - TMP_MAX as TMP_MAX, - W_OK as W_OK, - WCONTINUED as WCONTINUED, - WCOREDUMP as WCOREDUMP, - WEXITED as WEXITED, - WEXITSTATUS as WEXITSTATUS, - WIFCONTINUED as WIFCONTINUED, - WIFEXITED as WIFEXITED, - WIFSIGNALED as WIFSIGNALED, - WIFSTOPPED as WIFSTOPPED, - WNOHANG as WNOHANG, - WNOWAIT as WNOWAIT, - WSTOPPED as WSTOPPED, - WSTOPSIG as WSTOPSIG, - WTERMSIG as WTERMSIG, - WUNTRACED as WUNTRACED, - X_OK as X_OK, - DirEntry as DirEntry, - _exit as _exit, - abort as abort, - access as access, - chdir as chdir, - chmod as chmod, - chown as chown, - chroot as chroot, - close as close, - closerange as closerange, - confstr as confstr, - confstr_names as confstr_names, - cpu_count as cpu_count, - ctermid as ctermid, - device_encoding as device_encoding, - dup as dup, - dup2 as dup2, - error as error, - execv as execv, - execve as execve, - fchdir as fchdir, - fchmod as fchmod, - fchown as fchown, - fork as fork, - forkpty as forkpty, - fpathconf as fpathconf, - fspath as fspath, - fstat as fstat, - fstatvfs as fstatvfs, - fsync as fsync, - ftruncate as ftruncate, - get_blocking as get_blocking, - get_inheritable as get_inheritable, - get_terminal_size as get_terminal_size, - getcwd as getcwd, - getcwdb as getcwdb, - getegid as getegid, - geteuid as geteuid, - getgid as getgid, - getgrouplist as getgrouplist, - getgroups as getgroups, - getloadavg as getloadavg, - getlogin as getlogin, - getpgid as getpgid, - getpgrp as getpgrp, - getpid as getpid, - getppid as getppid, - getpriority as getpriority, - getsid as getsid, - getuid as getuid, - initgroups as initgroups, - isatty as isatty, - kill as kill, - killpg as killpg, - lchown as lchown, - link as link, - listdir as listdir, - lockf as lockf, - lseek as lseek, - lstat as lstat, - major as major, - makedev as makedev, - minor as minor, - mkdir as mkdir, - mkfifo as mkfifo, - mknod as mknod, - nice as nice, - open as open, - openpty as openpty, - pathconf as pathconf, - pathconf_names as pathconf_names, - pipe as pipe, - posix_spawn as posix_spawn, - posix_spawnp as posix_spawnp, - pread as pread, - preadv as preadv, - putenv as putenv, - pwrite as pwrite, - pwritev as pwritev, - read as read, - readlink as readlink, - readv as readv, - register_at_fork as register_at_fork, - remove as remove, - rename as rename, - replace as replace, - rmdir as rmdir, - scandir as scandir, - sched_get_priority_max as sched_get_priority_max, - sched_get_priority_min as sched_get_priority_min, - sched_param as sched_param, - sched_yield as sched_yield, - sendfile as sendfile, - set_blocking as set_blocking, - set_inheritable as set_inheritable, - setegid as setegid, - seteuid as seteuid, - setgid as setgid, - setgroups as setgroups, - setpgid as setpgid, - setpgrp as setpgrp, - setpriority as setpriority, - setregid as setregid, - setreuid as setreuid, - setsid as setsid, - setuid as setuid, - stat as stat, - stat_result as stat_result, - statvfs as statvfs, - statvfs_result as statvfs_result, - strerror as strerror, - symlink as symlink, - sync as sync, - sysconf as sysconf, - sysconf_names as sysconf_names, - system as system, - tcgetpgrp as tcgetpgrp, - tcsetpgrp as tcsetpgrp, - terminal_size as terminal_size, - times as times, - times_result as times_result, - truncate as truncate, - ttyname as ttyname, - umask as umask, - uname as uname, - uname_result as uname_result, - unlink as unlink, - unsetenv as unsetenv, - urandom as urandom, - utime as utime, - wait as wait, - wait3 as wait3, - wait4 as wait4, - waitpid as waitpid, - waitstatus_to_exitcode as waitstatus_to_exitcode, - write as write, - writev as writev, - ) - - if sys.version_info >= (3, 10): - from os import O_FSYNC as O_FSYNC - - if sys.version_info >= (3, 11): - from os import login_tty as login_tty - - if sys.version_info >= (3, 13): - from os import grantpt as grantpt, posix_openpt as posix_openpt, ptsname as ptsname, unlockpt as unlockpt - - if sys.version_info >= (3, 13) and sys.platform == "linux": - from os import ( - POSIX_SPAWN_CLOSEFROM as POSIX_SPAWN_CLOSEFROM, - TFD_CLOEXEC as TFD_CLOEXEC, - TFD_NONBLOCK as TFD_NONBLOCK, - TFD_TIMER_ABSTIME as TFD_TIMER_ABSTIME, - TFD_TIMER_CANCEL_ON_SET as TFD_TIMER_CANCEL_ON_SET, - timerfd_create as timerfd_create, - timerfd_gettime as timerfd_gettime, - timerfd_gettime_ns as timerfd_gettime_ns, - timerfd_settime as timerfd_settime, - timerfd_settime_ns as timerfd_settime_ns, - ) - - if sys.platform != "linux": - from os import O_EXLOCK as O_EXLOCK, O_SHLOCK as O_SHLOCK, chflags as chflags, lchflags as lchflags, lchmod as lchmod - - if sys.platform != "linux" and sys.platform != "darwin": - from os import EX_NOTFOUND as EX_NOTFOUND, SCHED_SPORADIC as SCHED_SPORADIC - - if sys.platform != "linux" and sys.version_info >= (3, 13): - from os import O_EXEC as O_EXEC, O_SEARCH as O_SEARCH - - if sys.platform != "darwin": - from os import ( - POSIX_FADV_DONTNEED as POSIX_FADV_DONTNEED, - POSIX_FADV_NOREUSE as POSIX_FADV_NOREUSE, - POSIX_FADV_NORMAL as POSIX_FADV_NORMAL, - POSIX_FADV_RANDOM as POSIX_FADV_RANDOM, - POSIX_FADV_SEQUENTIAL as POSIX_FADV_SEQUENTIAL, - POSIX_FADV_WILLNEED as POSIX_FADV_WILLNEED, - RWF_DSYNC as RWF_DSYNC, - RWF_HIPRI as RWF_HIPRI, - RWF_NOWAIT as RWF_NOWAIT, - RWF_SYNC as RWF_SYNC, - ST_APPEND as ST_APPEND, - ST_MANDLOCK as ST_MANDLOCK, - ST_NOATIME as ST_NOATIME, - ST_NODEV as ST_NODEV, - ST_NODIRATIME as ST_NODIRATIME, - ST_NOEXEC as ST_NOEXEC, - ST_RELATIME as ST_RELATIME, - ST_SYNCHRONOUS as ST_SYNCHRONOUS, - ST_WRITE as ST_WRITE, - fdatasync as fdatasync, - getresgid as getresgid, - getresuid as getresuid, - pipe2 as pipe2, - posix_fadvise as posix_fadvise, - posix_fallocate as posix_fallocate, - sched_getaffinity as sched_getaffinity, - sched_getparam as sched_getparam, - sched_getscheduler as sched_getscheduler, - sched_rr_get_interval as sched_rr_get_interval, - sched_setaffinity as sched_setaffinity, - sched_setparam as sched_setparam, - sched_setscheduler as sched_setscheduler, - setresgid as setresgid, - setresuid as setresuid, - ) - - if sys.version_info >= (3, 10): - from os import RWF_APPEND as RWF_APPEND - - if sys.platform != "darwin" or sys.version_info >= (3, 13): - from os import waitid as waitid, waitid_result as waitid_result - - if sys.platform == "linux": - from os import ( - GRND_NONBLOCK as GRND_NONBLOCK, - GRND_RANDOM as GRND_RANDOM, - MFD_ALLOW_SEALING as MFD_ALLOW_SEALING, - MFD_CLOEXEC as MFD_CLOEXEC, - MFD_HUGE_1GB as MFD_HUGE_1GB, - MFD_HUGE_1MB as MFD_HUGE_1MB, - MFD_HUGE_2GB as MFD_HUGE_2GB, - MFD_HUGE_2MB as MFD_HUGE_2MB, - MFD_HUGE_8MB as MFD_HUGE_8MB, - MFD_HUGE_16GB as MFD_HUGE_16GB, - MFD_HUGE_16MB as MFD_HUGE_16MB, - MFD_HUGE_32MB as MFD_HUGE_32MB, - MFD_HUGE_64KB as MFD_HUGE_64KB, - MFD_HUGE_256MB as MFD_HUGE_256MB, - MFD_HUGE_512KB as MFD_HUGE_512KB, - MFD_HUGE_512MB as MFD_HUGE_512MB, - MFD_HUGE_MASK as MFD_HUGE_MASK, - MFD_HUGE_SHIFT as MFD_HUGE_SHIFT, - MFD_HUGETLB as MFD_HUGETLB, - O_DIRECT as O_DIRECT, - O_LARGEFILE as O_LARGEFILE, - O_NOATIME as O_NOATIME, - O_PATH as O_PATH, - O_RSYNC as O_RSYNC, - O_TMPFILE as O_TMPFILE, - P_PIDFD as P_PIDFD, - RTLD_DEEPBIND as RTLD_DEEPBIND, - SCHED_BATCH as SCHED_BATCH, - SCHED_IDLE as SCHED_IDLE, - SCHED_RESET_ON_FORK as SCHED_RESET_ON_FORK, - XATTR_CREATE as XATTR_CREATE, - XATTR_REPLACE as XATTR_REPLACE, - XATTR_SIZE_MAX as XATTR_SIZE_MAX, - copy_file_range as copy_file_range, - getrandom as getrandom, - getxattr as getxattr, - listxattr as listxattr, - memfd_create as memfd_create, - pidfd_open as pidfd_open, - removexattr as removexattr, - setxattr as setxattr, - ) - - if sys.version_info >= (3, 10): - from os import ( - EFD_CLOEXEC as EFD_CLOEXEC, - EFD_NONBLOCK as EFD_NONBLOCK, - EFD_SEMAPHORE as EFD_SEMAPHORE, - SPLICE_F_MORE as SPLICE_F_MORE, - SPLICE_F_MOVE as SPLICE_F_MOVE, - SPLICE_F_NONBLOCK as SPLICE_F_NONBLOCK, - eventfd as eventfd, - eventfd_read as eventfd_read, - eventfd_write as eventfd_write, - splice as splice, - ) - - if sys.version_info >= (3, 12): - from os import ( - CLONE_FILES as CLONE_FILES, - CLONE_FS as CLONE_FS, - CLONE_NEWCGROUP as CLONE_NEWCGROUP, - CLONE_NEWIPC as CLONE_NEWIPC, - CLONE_NEWNET as CLONE_NEWNET, - CLONE_NEWNS as CLONE_NEWNS, - CLONE_NEWPID as CLONE_NEWPID, - CLONE_NEWTIME as CLONE_NEWTIME, - CLONE_NEWUSER as CLONE_NEWUSER, - CLONE_NEWUTS as CLONE_NEWUTS, - CLONE_SIGHAND as CLONE_SIGHAND, - CLONE_SYSVSEM as CLONE_SYSVSEM, - CLONE_THREAD as CLONE_THREAD, - CLONE_VM as CLONE_VM, - PIDFD_NONBLOCK as PIDFD_NONBLOCK, - setns as setns, - unshare as unshare, - ) - - if sys.platform == "darwin": - if sys.version_info >= (3, 12): - from os import ( - PRIO_DARWIN_BG as PRIO_DARWIN_BG, - PRIO_DARWIN_NONUI as PRIO_DARWIN_NONUI, - PRIO_DARWIN_PROCESS as PRIO_DARWIN_PROCESS, - PRIO_DARWIN_THREAD as PRIO_DARWIN_THREAD, - ) - if sys.platform == "darwin" and sys.version_info >= (3, 10): - from os import O_EVTONLY as O_EVTONLY, O_NOFOLLOW_ANY as O_NOFOLLOW_ANY, O_SYMLINK as O_SYMLINK - - # Not same as os.environ or os.environb - # Because of this variable, we can't do "from posix import *" in os/__init__.pyi - environ: dict[bytes, bytes] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/posixpath.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/posixpath.pyi deleted file mode 100644 index 3313667f17..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/posixpath.pyi +++ /dev/null @@ -1,166 +0,0 @@ -import sys -from _typeshed import AnyOrLiteralStr, BytesPath, FileDescriptorOrPath, StrOrBytesPath, StrPath -from collections.abc import Iterable -from genericpath import ( - commonprefix as commonprefix, - exists as exists, - getatime as getatime, - getctime as getctime, - getmtime as getmtime, - getsize as getsize, - isdir as isdir, - isfile as isfile, - samefile as samefile, - sameopenfile as sameopenfile, - samestat as samestat, -) - -if sys.version_info >= (3, 13): - from genericpath import isdevdrive as isdevdrive -from os import PathLike -from typing import AnyStr, overload -from typing_extensions import LiteralString - -__all__ = [ - "normcase", - "isabs", - "join", - "splitdrive", - "split", - "splitext", - "basename", - "dirname", - "commonprefix", - "getsize", - "getmtime", - "getatime", - "getctime", - "islink", - "exists", - "lexists", - "isdir", - "isfile", - "ismount", - "expanduser", - "expandvars", - "normpath", - "abspath", - "samefile", - "sameopenfile", - "samestat", - "curdir", - "pardir", - "sep", - "pathsep", - "defpath", - "altsep", - "extsep", - "devnull", - "realpath", - "supports_unicode_filenames", - "relpath", - "commonpath", -] -if sys.version_info >= (3, 12): - __all__ += ["isjunction", "splitroot"] -if sys.version_info >= (3, 13): - __all__ += ["isdevdrive"] - -supports_unicode_filenames: bool -# aliases (also in os) -curdir: LiteralString -pardir: LiteralString -sep: LiteralString -altsep: LiteralString | None -extsep: LiteralString -pathsep: LiteralString -defpath: LiteralString -devnull: LiteralString - -# Overloads are necessary to work around python/mypy#17952 & python/mypy#11880 -@overload -def abspath(path: PathLike[AnyStr]) -> AnyStr: ... -@overload -def abspath(path: AnyStr) -> AnyStr: ... -@overload -def basename(p: PathLike[AnyStr]) -> AnyStr: ... -@overload -def basename(p: AnyOrLiteralStr) -> AnyOrLiteralStr: ... -@overload -def dirname(p: PathLike[AnyStr]) -> AnyStr: ... -@overload -def dirname(p: AnyOrLiteralStr) -> AnyOrLiteralStr: ... -@overload -def expanduser(path: PathLike[AnyStr]) -> AnyStr: ... -@overload -def expanduser(path: AnyStr) -> AnyStr: ... -@overload -def expandvars(path: PathLike[AnyStr]) -> AnyStr: ... -@overload -def expandvars(path: AnyStr) -> AnyStr: ... -@overload -def normcase(s: PathLike[AnyStr]) -> AnyStr: ... -@overload -def normcase(s: AnyOrLiteralStr) -> AnyOrLiteralStr: ... -@overload -def normpath(path: PathLike[AnyStr]) -> AnyStr: ... -@overload -def normpath(path: AnyOrLiteralStr) -> AnyOrLiteralStr: ... -@overload -def commonpath(paths: Iterable[LiteralString]) -> LiteralString: ... -@overload -def commonpath(paths: Iterable[StrPath]) -> str: ... -@overload -def commonpath(paths: Iterable[BytesPath]) -> bytes: ... - -# First parameter is not actually pos-only, -# but must be defined as pos-only in the stub or cross-platform code doesn't type-check, -# as the parameter name is different in ntpath.join() -@overload -def join(a: LiteralString, /, *paths: LiteralString) -> LiteralString: ... -@overload -def join(a: StrPath, /, *paths: StrPath) -> str: ... -@overload -def join(a: BytesPath, /, *paths: BytesPath) -> bytes: ... - -if sys.version_info >= (3, 10): - @overload - def realpath(filename: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ... - @overload - def realpath(filename: AnyStr, *, strict: bool = False) -> AnyStr: ... - -else: - @overload - def realpath(filename: PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(filename: AnyStr) -> AnyStr: ... - -@overload -def relpath(path: LiteralString, start: LiteralString | None = None) -> LiteralString: ... -@overload -def relpath(path: BytesPath, start: BytesPath | None = None) -> bytes: ... -@overload -def relpath(path: StrPath, start: StrPath | None = None) -> str: ... -@overload -def split(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ... -@overload -def split(p: AnyOrLiteralStr) -> tuple[AnyOrLiteralStr, AnyOrLiteralStr]: ... -@overload -def splitdrive(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ... -@overload -def splitdrive(p: AnyOrLiteralStr) -> tuple[AnyOrLiteralStr, AnyOrLiteralStr]: ... -@overload -def splitext(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr]: ... -@overload -def splitext(p: AnyOrLiteralStr) -> tuple[AnyOrLiteralStr, AnyOrLiteralStr]: ... -def isabs(s: StrOrBytesPath) -> bool: ... -def islink(path: FileDescriptorOrPath) -> bool: ... -def ismount(path: FileDescriptorOrPath) -> bool: ... -def lexists(path: FileDescriptorOrPath) -> bool: ... - -if sys.version_info >= (3, 12): - def isjunction(path: StrOrBytesPath) -> bool: ... - @overload - def splitroot(p: AnyOrLiteralStr) -> tuple[AnyOrLiteralStr, AnyOrLiteralStr, AnyOrLiteralStr]: ... - @overload - def splitroot(p: PathLike[AnyStr]) -> tuple[AnyStr, AnyStr, AnyStr]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pprint.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pprint.pyi deleted file mode 100644 index 171878f416..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pprint.pyi +++ /dev/null @@ -1,112 +0,0 @@ -import sys -from typing import IO - -__all__ = ["pprint", "pformat", "isreadable", "isrecursive", "saferepr", "PrettyPrinter", "pp"] - -if sys.version_info >= (3, 10): - def pformat( - object: object, - indent: int = 1, - width: int = 80, - depth: int | None = None, - *, - compact: bool = False, - sort_dicts: bool = True, - underscore_numbers: bool = False, - ) -> str: ... - -else: - def pformat( - object: object, - indent: int = 1, - width: int = 80, - depth: int | None = None, - *, - compact: bool = False, - sort_dicts: bool = True, - ) -> str: ... - -if sys.version_info >= (3, 10): - def pp( - object: object, - stream: IO[str] | None = ..., - indent: int = ..., - width: int = ..., - depth: int | None = ..., - *, - compact: bool = ..., - sort_dicts: bool = False, - underscore_numbers: bool = ..., - ) -> None: ... - -else: - def pp( - object: object, - stream: IO[str] | None = ..., - indent: int = ..., - width: int = ..., - depth: int | None = ..., - *, - compact: bool = ..., - sort_dicts: bool = False, - ) -> None: ... - -if sys.version_info >= (3, 10): - def pprint( - object: object, - stream: IO[str] | None = None, - indent: int = 1, - width: int = 80, - depth: int | None = None, - *, - compact: bool = False, - sort_dicts: bool = True, - underscore_numbers: bool = False, - ) -> None: ... - -else: - def pprint( - object: object, - stream: IO[str] | None = None, - indent: int = 1, - width: int = 80, - depth: int | None = None, - *, - compact: bool = False, - sort_dicts: bool = True, - ) -> None: ... - -def isreadable(object: object) -> bool: ... -def isrecursive(object: object) -> bool: ... -def saferepr(object: object) -> str: ... - -class PrettyPrinter: - if sys.version_info >= (3, 10): - def __init__( - self, - indent: int = 1, - width: int = 80, - depth: int | None = None, - stream: IO[str] | None = None, - *, - compact: bool = False, - sort_dicts: bool = True, - underscore_numbers: bool = False, - ) -> None: ... - else: - def __init__( - self, - indent: int = 1, - width: int = 80, - depth: int | None = None, - stream: IO[str] | None = None, - *, - compact: bool = False, - sort_dicts: bool = True, - ) -> None: ... - - def pformat(self, object: object) -> str: ... - def pprint(self, object: object) -> None: ... - def isreadable(self, object: object) -> bool: ... - def isrecursive(self, object: object) -> bool: ... - def format(self, object: object, context: dict[int, int], maxlevels: int, level: int) -> tuple[str, bool, bool]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/profile.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/profile.pyi deleted file mode 100644 index 696193d9dc..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/profile.pyi +++ /dev/null @@ -1,31 +0,0 @@ -from _typeshed import StrOrBytesPath -from collections.abc import Callable, Mapping -from typing import Any, TypeVar -from typing_extensions import ParamSpec, Self, TypeAlias - -__all__ = ["run", "runctx", "Profile"] - -def run(statement: str, filename: str | None = None, sort: str | int = -1) -> None: ... -def runctx( - statement: str, globals: dict[str, Any], locals: Mapping[str, Any], filename: str | None = None, sort: str | int = -1 -) -> None: ... - -_T = TypeVar("_T") -_P = ParamSpec("_P") -_Label: TypeAlias = tuple[str, int, str] - -class Profile: - bias: int - stats: dict[_Label, tuple[int, int, int, int, dict[_Label, tuple[int, int, int, int]]]] # undocumented - def __init__(self, timer: Callable[[], float] | None = None, bias: int | None = None) -> None: ... - def set_cmd(self, cmd: str) -> None: ... - def simulate_call(self, name: str) -> None: ... - def simulate_cmd_complete(self) -> None: ... - def print_stats(self, sort: str | int = -1) -> None: ... - def dump_stats(self, file: StrOrBytesPath) -> None: ... - def create_stats(self) -> None: ... - def snapshot_stats(self) -> None: ... - def run(self, cmd: str) -> Self: ... - def runctx(self, cmd: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> Self: ... - def runcall(self, func: Callable[_P, _T], /, *args: _P.args, **kw: _P.kwargs) -> _T: ... - def calibrate(self, m: int, verbose: int = 0) -> float: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pstats.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pstats.pyi deleted file mode 100644 index c4dee1f6b8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pstats.pyi +++ /dev/null @@ -1,91 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from collections.abc import Iterable -from cProfile import Profile as _cProfile -from dataclasses import dataclass -from profile import Profile -from typing import IO, Any, Literal, overload -from typing_extensions import Self, TypeAlias - -if sys.version_info >= (3, 11): - from enum import StrEnum -else: - from enum import Enum - -__all__ = ["Stats", "SortKey", "FunctionProfile", "StatsProfile"] - -_Selector: TypeAlias = str | float | int - -if sys.version_info >= (3, 11): - class SortKey(StrEnum): - CALLS = "calls" - CUMULATIVE = "cumulative" - FILENAME = "filename" - LINE = "line" - NAME = "name" - NFL = "nfl" - PCALLS = "pcalls" - STDNAME = "stdname" - TIME = "time" - -else: - class SortKey(str, Enum): - CALLS = "calls" - CUMULATIVE = "cumulative" - FILENAME = "filename" - LINE = "line" - NAME = "name" - NFL = "nfl" - PCALLS = "pcalls" - STDNAME = "stdname" - TIME = "time" - -@dataclass(unsafe_hash=True) -class FunctionProfile: - ncalls: str - tottime: float - percall_tottime: float - cumtime: float - percall_cumtime: float - file_name: str - line_number: int - -@dataclass(unsafe_hash=True) -class StatsProfile: - total_tt: float - func_profiles: dict[str, FunctionProfile] - -_SortArgDict: TypeAlias = dict[str, tuple[tuple[tuple[int, int], ...], str]] - -class Stats: - sort_arg_dict_default: _SortArgDict - def __init__( - self, - arg: None | str | Profile | _cProfile = ..., - /, - *args: None | str | Profile | _cProfile | Self, - stream: IO[Any] | None = None, - ) -> None: ... - def init(self, arg: None | str | Profile | _cProfile) -> None: ... - def load_stats(self, arg: None | str | Profile | _cProfile) -> None: ... - def get_top_level_stats(self) -> None: ... - def add(self, *arg_list: None | str | Profile | _cProfile | Self) -> Self: ... - def dump_stats(self, filename: StrOrBytesPath) -> None: ... - def get_sort_arg_defs(self) -> _SortArgDict: ... - @overload - def sort_stats(self, field: Literal[-1, 0, 1, 2]) -> Self: ... - @overload - def sort_stats(self, *field: str) -> Self: ... - def reverse_order(self) -> Self: ... - def strip_dirs(self) -> Self: ... - def calc_callees(self) -> None: ... - def eval_print_amount(self, sel: _Selector, list: list[str], msg: str) -> tuple[list[str], str]: ... - def get_stats_profile(self) -> StatsProfile: ... - def get_print_list(self, sel_list: Iterable[_Selector]) -> tuple[int, list[str]]: ... - def print_stats(self, *amount: _Selector) -> Self: ... - def print_callees(self, *amount: _Selector) -> Self: ... - def print_callers(self, *amount: _Selector) -> Self: ... - def print_call_heading(self, name_size: int, column_title: str) -> None: ... - def print_call_line(self, name_size: int, source: str, call_dict: dict[str, Any], arrow: str = "->") -> None: ... - def print_title(self) -> None: ... - def print_line(self, func: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pty.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pty.pyi deleted file mode 100644 index 941915179c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pty.pyi +++ /dev/null @@ -1,24 +0,0 @@ -import sys -from collections.abc import Callable, Iterable -from typing import Final -from typing_extensions import TypeAlias, deprecated - -if sys.platform != "win32": - __all__ = ["openpty", "fork", "spawn"] - _Reader: TypeAlias = Callable[[int], bytes] - - STDIN_FILENO: Final = 0 - STDOUT_FILENO: Final = 1 - STDERR_FILENO: Final = 2 - - CHILD: Final = 0 - def openpty() -> tuple[int, int]: ... - - if sys.version_info < (3, 14): - @deprecated("Deprecated in 3.12, to be removed in 3.14; use openpty() instead") - def master_open() -> tuple[int, str]: ... - @deprecated("Deprecated in 3.12, to be removed in 3.14; use openpty() instead") - def slave_open(tty_name: str) -> int: ... - - def fork() -> tuple[int, int]: ... - def spawn(argv: str | Iterable[str], master_read: _Reader = ..., stdin_read: _Reader = ...) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pwd.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pwd.pyi deleted file mode 100644 index a84ba32471..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pwd.pyi +++ /dev/null @@ -1,28 +0,0 @@ -import sys -from _typeshed import structseq -from typing import Any, Final, final - -if sys.platform != "win32": - @final - class struct_passwd(structseq[Any], tuple[str, str, int, int, str, str, str]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("pw_name", "pw_passwd", "pw_uid", "pw_gid", "pw_gecos", "pw_dir", "pw_shell") - - @property - def pw_name(self) -> str: ... - @property - def pw_passwd(self) -> str: ... - @property - def pw_uid(self) -> int: ... - @property - def pw_gid(self) -> int: ... - @property - def pw_gecos(self) -> str: ... - @property - def pw_dir(self) -> str: ... - @property - def pw_shell(self) -> str: ... - - def getpwall() -> list[struct_passwd]: ... - def getpwuid(uid: int, /) -> struct_passwd: ... - def getpwnam(name: str, /) -> struct_passwd: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/py_compile.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/py_compile.pyi deleted file mode 100644 index 334ce79b5d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/py_compile.pyi +++ /dev/null @@ -1,34 +0,0 @@ -import enum -import sys -from typing import AnyStr - -__all__ = ["compile", "main", "PyCompileError", "PycInvalidationMode"] - -class PyCompileError(Exception): - exc_type_name: str - exc_value: BaseException - file: str - msg: str - def __init__(self, exc_type: type[BaseException], exc_value: BaseException, file: str, msg: str = "") -> None: ... - -class PycInvalidationMode(enum.Enum): - TIMESTAMP = 1 - CHECKED_HASH = 2 - UNCHECKED_HASH = 3 - -def _get_default_invalidation_mode() -> PycInvalidationMode: ... -def compile( - file: AnyStr, - cfile: AnyStr | None = None, - dfile: AnyStr | None = None, - doraise: bool = False, - optimize: int = -1, - invalidation_mode: PycInvalidationMode | None = None, - quiet: int = 0, -) -> AnyStr | None: ... - -if sys.version_info >= (3, 10): - def main() -> None: ... - -else: - def main(args: list[str] | None = None) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pyclbr.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pyclbr.pyi deleted file mode 100644 index 504a5d5f11..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pyclbr.pyi +++ /dev/null @@ -1,74 +0,0 @@ -import sys -from collections.abc import Mapping, Sequence - -__all__ = ["readmodule", "readmodule_ex", "Class", "Function"] - -class _Object: - module: str - name: str - file: int - lineno: int - - if sys.version_info >= (3, 10): - end_lineno: int | None - - parent: _Object | None - - # This is a dict at runtime, but we're typing it as Mapping to - # avoid variance issues in the subclasses - children: Mapping[str, _Object] - - if sys.version_info >= (3, 10): - def __init__( - self, module: str, name: str, file: str, lineno: int, end_lineno: int | None, parent: _Object | None - ) -> None: ... - else: - def __init__(self, module: str, name: str, file: str, lineno: int, parent: _Object | None) -> None: ... - -class Function(_Object): - if sys.version_info >= (3, 10): - is_async: bool - - parent: Function | Class | None - children: dict[str, Class | Function] - - if sys.version_info >= (3, 10): - def __init__( - self, - module: str, - name: str, - file: str, - lineno: int, - parent: Function | Class | None = None, - is_async: bool = False, - *, - end_lineno: int | None = None, - ) -> None: ... - else: - def __init__(self, module: str, name: str, file: str, lineno: int, parent: Function | Class | None = None) -> None: ... - -class Class(_Object): - super: list[Class | str] | None - methods: dict[str, int] - parent: Class | None - children: dict[str, Class | Function] - - if sys.version_info >= (3, 10): - def __init__( - self, - module: str, - name: str, - super_: list[Class | str] | None, - file: str, - lineno: int, - parent: Class | None = None, - *, - end_lineno: int | None = None, - ) -> None: ... - else: - def __init__( - self, module: str, name: str, super: list[Class | str] | None, file: str, lineno: int, parent: Class | None = None - ) -> None: ... - -def readmodule(module: str, path: Sequence[str] | None = None) -> dict[str, Class]: ... -def readmodule_ex(module: str, path: Sequence[str] | None = None) -> dict[str, Class | Function | list[str]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pydoc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pydoc.pyi deleted file mode 100644 index 144f782aca..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pydoc.pyi +++ /dev/null @@ -1,333 +0,0 @@ -import sys -from _typeshed import OptExcInfo, SupportsWrite, Unused -from abc import abstractmethod -from builtins import list as _list # "list" conflicts with method name -from collections.abc import Callable, Container, Mapping, MutableMapping -from reprlib import Repr -from types import MethodType, ModuleType, TracebackType -from typing import IO, Any, AnyStr, Final, NoReturn, Protocol, TypeVar -from typing_extensions import TypeGuard - -__all__ = ["help"] - -_T = TypeVar("_T") - -__author__: Final[str] -__date__: Final[str] -__version__: Final[str] -__credits__: Final[str] - -class _Pager(Protocol): - def __call__(self, text: str, title: str = "") -> None: ... - -def pathdirs() -> list[str]: ... -def getdoc(object: object) -> str: ... -def splitdoc(doc: AnyStr) -> tuple[AnyStr, AnyStr]: ... -def classname(object: object, modname: str) -> str: ... -def isdata(object: object) -> bool: ... -def replace(text: AnyStr, *pairs: AnyStr) -> AnyStr: ... -def cram(text: str, maxlen: int) -> str: ... -def stripid(text: str) -> str: ... -def allmethods(cl: type) -> MutableMapping[str, MethodType]: ... -def visiblename(name: str, all: Container[str] | None = None, obj: object = None) -> bool: ... -def classify_class_attrs(object: object) -> list[tuple[str, str, type, str]]: ... -def ispackage(path: str) -> bool: ... -def source_synopsis(file: IO[AnyStr]) -> AnyStr | None: ... -def synopsis(filename: str, cache: MutableMapping[str, tuple[int, str]] = {}) -> str | None: ... - -class ErrorDuringImport(Exception): - filename: str - exc: type[BaseException] | None - value: BaseException | None - tb: TracebackType | None - def __init__(self, filename: str, exc_info: OptExcInfo) -> None: ... - -def importfile(path: str) -> ModuleType: ... -def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, ModuleType] = {}) -> ModuleType | None: ... - -class Doc: - PYTHONDOCS: str - def document(self, object: object, name: str | None = None, *args: Any) -> str: ... - def fail(self, object: object, name: str | None = None, *args: Any) -> NoReturn: ... - @abstractmethod - def docmodule(self, object: object, name: str | None = None, *args: Any) -> str: ... - @abstractmethod - def docclass(self, object: object, name: str | None = None, *args: Any) -> str: ... - @abstractmethod - def docroutine(self, object: object, name: str | None = None, *args: Any) -> str: ... - @abstractmethod - def docother(self, object: object, name: str | None = None, *args: Any) -> str: ... - @abstractmethod - def docproperty(self, object: object, name: str | None = None, *args: Any) -> str: ... - @abstractmethod - def docdata(self, object: object, name: str | None = None, *args: Any) -> str: ... - 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: ... - def repr_string(self, x: str, level: complex) -> str: ... - def repr_str(self, x: str, level: complex) -> str: ... - def repr_instance(self, x: object, level: complex) -> str: ... - def repr_unicode(self, x: AnyStr, level: complex) -> str: ... - -class HTMLDoc(Doc): - _repr_instance: HTMLRepr - repr = _repr_instance.repr - escape = _repr_instance.escape - def page(self, title: str, contents: str) -> str: ... - if sys.version_info >= (3, 11): - def heading(self, title: str, extras: str = "") -> str: ... - def section( - self, - title: str, - cls: str, - contents: str, - width: int = 6, - prelude: str = "", - marginalia: str | None = None, - gap: str = " ", - ) -> str: ... - def multicolumn(self, list: list[_T], format: Callable[[_T], str]) -> str: ... - else: - def heading(self, title: str, fgcol: str, bgcol: str, extras: str = "") -> str: ... - def section( - self, - title: str, - fgcol: str, - bgcol: str, - contents: str, - width: int = 6, - prelude: str = "", - marginalia: str | None = None, - gap: str = " ", - ) -> str: ... - def multicolumn(self, list: list[_T], format: Callable[[_T], str], cols: int = 4) -> str: ... - - def bigsection(self, title: str, *args: Any) -> str: ... - def preformat(self, text: str) -> str: ... - def grey(self, text: str) -> str: ... - def namelink(self, name: str, *dicts: MutableMapping[str, str]) -> str: ... - def classlink(self, object: object, modname: str) -> str: ... - def modulelink(self, object: object) -> str: ... - def modpkglink(self, modpkginfo: tuple[str, str, bool, bool]) -> str: ... - def markup( - self, - text: str, - escape: Callable[[str], str] | None = None, - funcs: Mapping[str, str] = {}, - classes: Mapping[str, str] = {}, - methods: Mapping[str, str] = {}, - ) -> str: ... - def formattree( - self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = None - ) -> str: ... - def docmodule(self, object: object, name: str | None = None, mod: str | None = None, *ignored: Unused) -> str: ... - def docclass( - self, - object: object, - name: str | None = None, - mod: str | None = None, - funcs: Mapping[str, str] = {}, - classes: Mapping[str, str] = {}, - *ignored: Unused, - ) -> str: ... - def formatvalue(self, object: object) -> str: ... - def docother(self, object: object, name: str | None = None, mod: Any | None = None, *ignored: Unused) -> str: ... - if sys.version_info >= (3, 11): - def docroutine( # type: ignore[override] - self, - object: object, - name: str | None = None, - mod: str | None = None, - funcs: Mapping[str, str] = {}, - classes: Mapping[str, str] = {}, - methods: Mapping[str, str] = {}, - cl: type | None = None, - homecls: type | None = None, - ) -> str: ... - def docproperty( - self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None, *ignored: Unused - ) -> str: ... - def docdata( - self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None, *ignored: Unused - ) -> str: ... - else: - def docroutine( # type: ignore[override] - self, - object: object, - name: str | None = None, - mod: str | None = None, - funcs: Mapping[str, str] = {}, - classes: Mapping[str, str] = {}, - methods: Mapping[str, str] = {}, - cl: type | None = None, - ) -> str: ... - def docproperty(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override] - def docdata(self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None) -> str: ... # type: ignore[override] - if sys.version_info >= (3, 11): - def parentlink(self, object: type | ModuleType, modname: str) -> str: ... - - def index(self, dir: str, shadowed: MutableMapping[str, bool] | None = None) -> str: ... - 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: ... - def repr_instance(self, x: object, level: complex) -> str: ... - -class TextDoc(Doc): - _repr_instance: TextRepr - repr = _repr_instance.repr - def bold(self, text: str) -> str: ... - def indent(self, text: str, prefix: str = " ") -> str: ... - def section(self, title: str, contents: str) -> str: ... - def formattree( - self, tree: list[tuple[type, tuple[type, ...]] | list[Any]], modname: str, parent: type | None = None, prefix: str = "" - ) -> str: ... - def docclass(self, object: object, name: str | None = None, mod: str | None = None, *ignored: Unused) -> str: ... - def formatvalue(self, object: object) -> str: ... - if sys.version_info >= (3, 11): - def docroutine( # type: ignore[override] - self, - object: object, - name: str | None = None, - mod: str | None = None, - cl: Any | None = None, - homecls: Any | None = None, - ) -> str: ... - def docmodule(self, object: object, name: str | None = None, mod: Any | None = None, *ignored: Unused) -> str: ... - def docproperty( - self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None, *ignored: Unused - ) -> str: ... - def docdata( - self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None, *ignored: Unused - ) -> str: ... - def docother( - self, - object: object, - name: str | None = None, - mod: str | None = None, - parent: str | None = None, - *ignored: Unused, - maxlen: int | None = None, - doc: Any | None = None, - ) -> str: ... - else: - def docroutine(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override] - def docmodule(self, object: object, name: str | None = None, mod: Any | None = None) -> str: ... # type: ignore[override] - def docproperty(self, object: object, name: str | None = None, mod: Any | None = None, cl: Any | None = None) -> str: ... # type: ignore[override] - def docdata(self, object: object, name: str | None = None, mod: str | None = None, cl: Any | None = None) -> str: ... # type: ignore[override] - def docother( # type: ignore[override] - self, - object: object, - name: str | None = None, - mod: str | None = None, - parent: str | None = None, - maxlen: int | None = None, - doc: Any | None = None, - ) -> str: ... - -if sys.version_info >= (3, 13): - def pager(text: str, title: str = "") -> None: ... - -else: - def pager(text: str) -> None: ... - -def plain(text: str) -> str: ... -def describe(thing: Any) -> str: ... -def locate(path: str, forceload: bool = ...) -> object: ... - -if sys.version_info >= (3, 13): - def get_pager() -> _Pager: ... - def pipe_pager(text: str, cmd: str, title: str = "") -> None: ... - def tempfile_pager(text: str, cmd: str, title: str = "") -> None: ... - def tty_pager(text: str, title: str = "") -> None: ... - def plain_pager(text: str, title: str = "") -> None: ... - - # For backwards compatibility. - getpager = get_pager - pipepager = pipe_pager - tempfilepager = tempfile_pager - ttypager = tty_pager - plainpager = plain_pager -else: - def getpager() -> Callable[[str], None]: ... - def pipepager(text: str, cmd: str) -> None: ... - def tempfilepager(text: str, cmd: str) -> None: ... - def ttypager(text: str) -> None: ... - def plainpager(text: str) -> None: ... - -text: TextDoc -html: HTMLDoc - -def resolve(thing: str | object, forceload: bool = ...) -> tuple[object, str] | None: ... -def render_doc( - thing: str | object, title: str = "Python Library Documentation: %s", forceload: bool = ..., renderer: Doc | None = None -) -> str: ... - -if sys.version_info >= (3, 11): - def doc( - thing: str | object, - title: str = "Python Library Documentation: %s", - forceload: bool = ..., - output: SupportsWrite[str] | None = None, - is_cli: bool = False, - ) -> None: ... - -else: - def doc( - thing: str | object, - title: str = "Python Library Documentation: %s", - forceload: bool = ..., - output: SupportsWrite[str] | None = None, - ) -> None: ... - -def writedoc(thing: str | object, forceload: bool = ...) -> None: ... -def writedocs(dir: str, pkgpath: str = "", done: Any | None = None) -> None: ... - -class Helper: - keywords: dict[str, str | tuple[str, str]] - symbols: dict[str, str] - topics: dict[str, str | tuple[str, ...]] - def __init__(self, input: IO[str] | None = None, output: IO[str] | None = None) -> None: ... - @property - def input(self) -> IO[str]: ... - @property - def output(self) -> IO[str]: ... - def __call__(self, request: str | Helper | object = ...) -> None: ... - def interact(self) -> None: ... - def getline(self, prompt: str) -> str: ... - if sys.version_info >= (3, 11): - def help(self, request: Any, is_cli: bool = False) -> None: ... - else: - def help(self, request: Any) -> None: ... - - def intro(self) -> None: ... - def list(self, items: _list[str], columns: int = 4, width: int = 80) -> None: ... - def listkeywords(self) -> None: ... - def listsymbols(self) -> None: ... - def listtopics(self) -> None: ... - def showtopic(self, topic: str, more_xrefs: str = "") -> None: ... - def showsymbol(self, symbol: str) -> None: ... - def listmodules(self, key: str = "") -> None: ... - -help: Helper - -class ModuleScanner: - quit: bool - def run( - self, - callback: Callable[[str | None, str, str], object], - key: str | None = None, - completer: Callable[[], object] | None = None, - onerror: Callable[[str], object] | None = None, - ) -> None: ... - -def apropos(key: str) -> None: ... -def ispath(x: object) -> TypeGuard[str]: ... -def cli() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pydoc_data/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pydoc_data/__init__.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pydoc_data/topics.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pydoc_data/topics.pyi deleted file mode 100644 index 091d343001..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pydoc_data/topics.pyi +++ /dev/null @@ -1 +0,0 @@ -topics: dict[str, str] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pyexpat/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pyexpat/__init__.pyi deleted file mode 100644 index 21e6760520..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pyexpat/__init__.pyi +++ /dev/null @@ -1,82 +0,0 @@ -from _typeshed import ReadableBuffer, SupportsRead -from collections.abc import Callable -from pyexpat import errors as errors, model as model -from typing import Any, Final, final -from typing_extensions import CapsuleType, TypeAlias -from xml.parsers.expat import ExpatError as ExpatError - -EXPAT_VERSION: Final[str] # undocumented -version_info: tuple[int, int, int] # undocumented -native_encoding: str # undocumented -features: list[tuple[str, int]] # undocumented - -error = ExpatError -XML_PARAM_ENTITY_PARSING_NEVER: Final = 0 -XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE: Final = 1 -XML_PARAM_ENTITY_PARSING_ALWAYS: Final = 2 - -_Model: TypeAlias = tuple[int, int, str | None, tuple[Any, ...]] - -@final -class XMLParserType: - def Parse(self, data: str | ReadableBuffer, isfinal: bool = False, /) -> int: ... - def ParseFile(self, file: SupportsRead[bytes], /) -> int: ... - def SetBase(self, base: str, /) -> None: ... - def GetBase(self) -> str | None: ... - def GetInputContext(self) -> bytes | None: ... - def ExternalEntityParserCreate(self, context: str | None, encoding: str = ..., /) -> XMLParserType: ... - def SetParamEntityParsing(self, flag: int, /) -> int: ... - def UseForeignDTD(self, flag: bool = True, /) -> None: ... - def GetReparseDeferralEnabled(self) -> bool: ... - def SetReparseDeferralEnabled(self, enabled: bool, /) -> None: ... - @property - def intern(self) -> dict[str, str]: ... - buffer_size: int - buffer_text: bool - buffer_used: int - namespace_prefixes: bool # undocumented - ordered_attributes: bool - specified_attributes: bool - ErrorByteIndex: int - ErrorCode: int - ErrorColumnNumber: int - ErrorLineNumber: int - CurrentByteIndex: int - CurrentColumnNumber: int - CurrentLineNumber: int - XmlDeclHandler: Callable[[str, str | None, int], Any] | None - StartDoctypeDeclHandler: Callable[[str, str | None, str | None, bool], Any] | None - EndDoctypeDeclHandler: Callable[[], Any] | None - ElementDeclHandler: Callable[[str, _Model], Any] | None - AttlistDeclHandler: Callable[[str, str, str, str | None, bool], Any] | None - StartElementHandler: ( - Callable[[str, dict[str, str]], Any] - | Callable[[str, list[str]], Any] - | Callable[[str, dict[str, str], list[str]], Any] - | None - ) - EndElementHandler: Callable[[str], Any] | None - ProcessingInstructionHandler: Callable[[str, str], Any] | None - CharacterDataHandler: Callable[[str], Any] | None - UnparsedEntityDeclHandler: Callable[[str, str | None, str, str | None, str], Any] | None - EntityDeclHandler: Callable[[str, bool, str | None, str | None, str, str | None, str | None], Any] | None - NotationDeclHandler: Callable[[str, str | None, str, str | None], Any] | None - StartNamespaceDeclHandler: Callable[[str, str], Any] | None - EndNamespaceDeclHandler: Callable[[str], Any] | None - CommentHandler: Callable[[str], Any] | None - StartCdataSectionHandler: Callable[[], Any] | None - EndCdataSectionHandler: Callable[[], Any] | None - DefaultHandler: Callable[[str], Any] | None - DefaultHandlerExpand: Callable[[str], Any] | None - NotStandaloneHandler: Callable[[], int] | None - ExternalEntityRefHandler: Callable[[str, str | None, str | None, str | None], int] | None - SkippedEntityHandler: Callable[[str, bool], Any] | None - -def ErrorString(code: int, /) -> str: ... - -# intern is undocumented -def ParserCreate( - encoding: str | None = None, namespace_separator: str | None = None, intern: dict[str, Any] | None = None -) -> XMLParserType: ... - -expat_CAPI: CapsuleType diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pyexpat/errors.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pyexpat/errors.pyi deleted file mode 100644 index cae4da0891..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pyexpat/errors.pyi +++ /dev/null @@ -1,51 +0,0 @@ -import sys -from typing import Final -from typing_extensions import LiteralString - -codes: dict[str, int] -messages: dict[int, str] - -XML_ERROR_ABORTED: Final[LiteralString] -XML_ERROR_ASYNC_ENTITY: Final[LiteralString] -XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: Final[LiteralString] -XML_ERROR_BAD_CHAR_REF: Final[LiteralString] -XML_ERROR_BINARY_ENTITY_REF: Final[LiteralString] -XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING: Final[LiteralString] -XML_ERROR_DUPLICATE_ATTRIBUTE: Final[LiteralString] -XML_ERROR_ENTITY_DECLARED_IN_PE: Final[LiteralString] -XML_ERROR_EXTERNAL_ENTITY_HANDLING: Final[LiteralString] -XML_ERROR_FEATURE_REQUIRES_XML_DTD: Final[LiteralString] -XML_ERROR_FINISHED: Final[LiteralString] -XML_ERROR_INCOMPLETE_PE: Final[LiteralString] -XML_ERROR_INCORRECT_ENCODING: Final[LiteralString] -XML_ERROR_INVALID_TOKEN: Final[LiteralString] -XML_ERROR_JUNK_AFTER_DOC_ELEMENT: Final[LiteralString] -XML_ERROR_MISPLACED_XML_PI: Final[LiteralString] -XML_ERROR_NOT_STANDALONE: Final[LiteralString] -XML_ERROR_NOT_SUSPENDED: Final[LiteralString] -XML_ERROR_NO_ELEMENTS: Final[LiteralString] -XML_ERROR_NO_MEMORY: Final[LiteralString] -XML_ERROR_PARAM_ENTITY_REF: Final[LiteralString] -XML_ERROR_PARTIAL_CHAR: Final[LiteralString] -XML_ERROR_PUBLICID: Final[LiteralString] -XML_ERROR_RECURSIVE_ENTITY_REF: Final[LiteralString] -XML_ERROR_SUSPENDED: Final[LiteralString] -XML_ERROR_SUSPEND_PE: Final[LiteralString] -XML_ERROR_SYNTAX: Final[LiteralString] -XML_ERROR_TAG_MISMATCH: Final[LiteralString] -XML_ERROR_TEXT_DECL: Final[LiteralString] -XML_ERROR_UNBOUND_PREFIX: Final[LiteralString] -XML_ERROR_UNCLOSED_CDATA_SECTION: Final[LiteralString] -XML_ERROR_UNCLOSED_TOKEN: Final[LiteralString] -XML_ERROR_UNDECLARING_PREFIX: Final[LiteralString] -XML_ERROR_UNDEFINED_ENTITY: Final[LiteralString] -XML_ERROR_UNEXPECTED_STATE: Final[LiteralString] -XML_ERROR_UNKNOWN_ENCODING: Final[LiteralString] -XML_ERROR_XML_DECL: Final[LiteralString] -if sys.version_info >= (3, 11): - XML_ERROR_RESERVED_PREFIX_XML: Final[LiteralString] - XML_ERROR_RESERVED_PREFIX_XMLNS: Final[LiteralString] - XML_ERROR_RESERVED_NAMESPACE_URI: Final[LiteralString] - XML_ERROR_INVALID_ARGUMENT: Final[LiteralString] - XML_ERROR_NO_BUFFER: Final[LiteralString] - XML_ERROR_AMPLIFICATION_LIMIT_BREACH: Final[LiteralString] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/pyexpat/model.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/pyexpat/model.pyi deleted file mode 100644 index bac8f3692c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/pyexpat/model.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import Final - -XML_CTYPE_ANY: Final = 2 -XML_CTYPE_EMPTY: Final = 1 -XML_CTYPE_MIXED: Final = 3 -XML_CTYPE_NAME: Final = 4 -XML_CTYPE_CHOICE: Final = 5 -XML_CTYPE_SEQ: Final = 6 - -XML_CQUANT_NONE: Final = 0 -XML_CQUANT_OPT: Final = 1 -XML_CQUANT_REP: Final = 2 -XML_CQUANT_PLUS: Final = 3 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/queue.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/queue.pyi deleted file mode 100644 index f5d9179e07..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/queue.pyi +++ /dev/null @@ -1,54 +0,0 @@ -import sys -from _queue import Empty as Empty, SimpleQueue as SimpleQueue -from threading import Condition, Lock -from types import GenericAlias -from typing import Any, Generic, TypeVar - -__all__ = ["Empty", "Full", "Queue", "PriorityQueue", "LifoQueue", "SimpleQueue"] -if sys.version_info >= (3, 13): - __all__ += ["ShutDown"] - -_T = TypeVar("_T") - -class Full(Exception): ... - -if sys.version_info >= (3, 13): - class ShutDown(Exception): ... - -class Queue(Generic[_T]): - maxsize: int - - mutex: Lock # undocumented - not_empty: Condition # undocumented - not_full: Condition # undocumented - all_tasks_done: Condition # undocumented - unfinished_tasks: int # undocumented - if sys.version_info >= (3, 13): - is_shutdown: bool # undocumented - # Despite the fact that `queue` has `deque` type, - # we treat it as `Any` to allow different implementations in subtypes. - queue: Any # undocumented - def __init__(self, maxsize: int = 0) -> None: ... - def _init(self, maxsize: int) -> None: ... - def empty(self) -> bool: ... - def full(self) -> bool: ... - def get(self, block: bool = True, timeout: float | None = None) -> _T: ... - def get_nowait(self) -> _T: ... - if sys.version_info >= (3, 13): - def shutdown(self, immediate: bool = False) -> None: ... - - def _get(self) -> _T: ... - def put(self, item: _T, block: bool = True, timeout: float | None = None) -> None: ... - def put_nowait(self, item: _T) -> None: ... - def _put(self, item: _T) -> None: ... - def join(self) -> None: ... - def qsize(self) -> int: ... - def _qsize(self) -> int: ... - def task_done(self) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class PriorityQueue(Queue[_T]): - queue: list[_T] - -class LifoQueue(Queue[_T]): - queue: list[_T] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/quopri.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/quopri.pyi deleted file mode 100644 index b652e139bd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/quopri.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from _typeshed import ReadableBuffer, SupportsNoArgReadline, SupportsRead, SupportsWrite -from typing import Protocol - -__all__ = ["encode", "decode", "encodestring", "decodestring"] - -class _Input(SupportsRead[bytes], SupportsNoArgReadline[bytes], Protocol): ... - -def encode(input: _Input, output: SupportsWrite[bytes], quotetabs: int, header: bool = False) -> None: ... -def encodestring(s: ReadableBuffer, quotetabs: bool = False, header: bool = False) -> bytes: ... -def decode(input: _Input, output: SupportsWrite[bytes], header: bool = False) -> None: ... -def decodestring(s: str | ReadableBuffer, header: bool = False) -> bytes: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/random.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/random.pyi deleted file mode 100644 index 83e37113a9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/random.pyi +++ /dev/null @@ -1,128 +0,0 @@ -import _random -import sys -from _typeshed import SupportsLenAndGetItem -from collections.abc import Callable, Iterable, MutableSequence, Sequence, Set as AbstractSet -from fractions import Fraction -from typing import Any, ClassVar, NoReturn, TypeVar - -__all__ = [ - "Random", - "seed", - "random", - "uniform", - "randint", - "choice", - "sample", - "randrange", - "shuffle", - "normalvariate", - "lognormvariate", - "expovariate", - "vonmisesvariate", - "gammavariate", - "triangular", - "gauss", - "betavariate", - "paretovariate", - "weibullvariate", - "getstate", - "setstate", - "getrandbits", - "choices", - "SystemRandom", - "randbytes", -] - -if sys.version_info >= (3, 12): - __all__ += ["binomialvariate"] - -_T = TypeVar("_T") - -class Random(_random.Random): - VERSION: ClassVar[int] - def __init__(self, x: int | float | str | bytes | bytearray | None = None) -> None: ... # noqa: Y041 - # Using other `seed` types is deprecated since 3.9 and removed in 3.11 - # Ignore Y041, since random.seed doesn't treat int like a float subtype. Having an explicit - # int better documents conventional usage of random.seed. - def seed(self, a: int | float | str | bytes | bytearray | None = None, version: int = 2) -> None: ... # type: ignore[override] # noqa: Y041 - def getstate(self) -> tuple[Any, ...]: ... - def setstate(self, state: tuple[Any, ...]) -> None: ... - def randrange(self, start: int, stop: int | None = None, step: int = 1) -> int: ... - def randint(self, a: int, b: int) -> int: ... - def randbytes(self, n: int) -> bytes: ... - def choice(self, seq: SupportsLenAndGetItem[_T]) -> _T: ... - def choices( - self, - population: SupportsLenAndGetItem[_T], - weights: Sequence[float | Fraction] | None = None, - *, - cum_weights: Sequence[float | Fraction] | None = None, - k: int = 1, - ) -> list[_T]: ... - if sys.version_info >= (3, 11): - def shuffle(self, x: MutableSequence[Any]) -> None: ... - else: - def shuffle(self, x: MutableSequence[Any], random: Callable[[], float] | None = None) -> None: ... - if sys.version_info >= (3, 11): - def sample(self, population: Sequence[_T], k: int, *, counts: Iterable[int] | None = None) -> list[_T]: ... - else: - def sample( - self, population: Sequence[_T] | AbstractSet[_T], k: int, *, counts: Iterable[int] | None = None - ) -> list[_T]: ... - - def uniform(self, a: float, b: float) -> float: ... - def triangular(self, low: float = 0.0, high: float = 1.0, mode: float | None = None) -> float: ... - if sys.version_info >= (3, 12): - def binomialvariate(self, n: int = 1, p: float = 0.5) -> int: ... - - def betavariate(self, alpha: float, beta: float) -> float: ... - if sys.version_info >= (3, 12): - def expovariate(self, lambd: float = 1.0) -> float: ... - else: - def expovariate(self, lambd: float) -> float: ... - - def gammavariate(self, alpha: float, beta: float) -> float: ... - if sys.version_info >= (3, 11): - def gauss(self, mu: float = 0.0, sigma: float = 1.0) -> float: ... - def normalvariate(self, mu: float = 0.0, sigma: float = 1.0) -> float: ... - else: - def gauss(self, mu: float, sigma: float) -> float: ... - def normalvariate(self, mu: float, sigma: float) -> float: ... - - def lognormvariate(self, mu: float, sigma: float) -> float: ... - def vonmisesvariate(self, mu: float, kappa: float) -> float: ... - def paretovariate(self, alpha: float) -> float: ... - def weibullvariate(self, alpha: float, beta: float) -> float: ... - -# SystemRandom is not implemented for all OS's; good on Windows & Linux -class SystemRandom(Random): - def getrandbits(self, k: int) -> int: ... # k can be passed by keyword - def getstate(self, *args: Any, **kwds: Any) -> NoReturn: ... - def setstate(self, *args: Any, **kwds: Any) -> NoReturn: ... - -_inst: Random -seed = _inst.seed -random = _inst.random -uniform = _inst.uniform -triangular = _inst.triangular -randint = _inst.randint -choice = _inst.choice -randrange = _inst.randrange -sample = _inst.sample -shuffle = _inst.shuffle -choices = _inst.choices -normalvariate = _inst.normalvariate -lognormvariate = _inst.lognormvariate -expovariate = _inst.expovariate -vonmisesvariate = _inst.vonmisesvariate -gammavariate = _inst.gammavariate -gauss = _inst.gauss -if sys.version_info >= (3, 12): - binomialvariate = _inst.binomialvariate -betavariate = _inst.betavariate -paretovariate = _inst.paretovariate -weibullvariate = _inst.weibullvariate -getstate = _inst.getstate -setstate = _inst.setstate -getrandbits = _inst.getrandbits -randbytes = _inst.randbytes diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/re.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/re.pyi deleted file mode 100644 index f25a0a3767..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/re.pyi +++ /dev/null @@ -1,312 +0,0 @@ -import enum -import sre_compile -import sre_constants -import sys -from _typeshed import MaybeNone, ReadableBuffer -from collections.abc import Callable, Iterator, Mapping -from types import GenericAlias -from typing import Any, AnyStr, Final, Generic, Literal, TypeVar, final, overload -from typing_extensions import TypeAlias - -__all__ = [ - "match", - "fullmatch", - "search", - "sub", - "subn", - "split", - "findall", - "finditer", - "compile", - "purge", - "escape", - "error", - "A", - "I", - "L", - "M", - "S", - "X", - "U", - "ASCII", - "IGNORECASE", - "LOCALE", - "MULTILINE", - "DOTALL", - "VERBOSE", - "UNICODE", - "Match", - "Pattern", -] -if sys.version_info < (3, 13): - __all__ += ["template"] - -if sys.version_info >= (3, 11): - __all__ += ["NOFLAG", "RegexFlag"] - -if sys.version_info >= (3, 13): - __all__ += ["PatternError"] - - PatternError = sre_constants.error - -_T = TypeVar("_T") - -# The implementation defines this in re._constants (version_info >= 3, 11) or -# sre_constants. Typeshed has it here because its __module__ attribute is set to "re". -class error(Exception): - msg: str - pattern: str | bytes | None - pos: int | None - lineno: int - colno: int - def __init__(self, msg: str, pattern: str | bytes | None = None, pos: int | None = None) -> None: ... - -@final -class Match(Generic[AnyStr]): - @property - def pos(self) -> int: ... - @property - def endpos(self) -> int: ... - @property - def lastindex(self) -> int | None: ... - @property - def lastgroup(self) -> str | None: ... - @property - def string(self) -> AnyStr: ... - - # The regular expression object whose match() or search() method produced - # this match instance. - @property - def re(self) -> Pattern[AnyStr]: ... - @overload - def expand(self: Match[str], template: str) -> str: ... - @overload - def expand(self: Match[bytes], template: ReadableBuffer) -> bytes: ... - @overload - def expand(self, template: AnyStr) -> AnyStr: ... - # group() returns "AnyStr" or "AnyStr | None", depending on the pattern. - @overload - def group(self, group: Literal[0] = 0, /) -> AnyStr: ... - @overload - def group(self, group: str | int, /) -> AnyStr | MaybeNone: ... - @overload - def group(self, group1: str | int, group2: str | int, /, *groups: str | int) -> tuple[AnyStr | MaybeNone, ...]: ... - # Each item of groups()'s return tuple is either "AnyStr" or - # "AnyStr | None", depending on the pattern. - @overload - def groups(self) -> tuple[AnyStr | MaybeNone, ...]: ... - @overload - def groups(self, default: _T) -> tuple[AnyStr | _T, ...]: ... - # Each value in groupdict()'s return dict is either "AnyStr" or - # "AnyStr | None", depending on the pattern. - @overload - def groupdict(self) -> dict[str, AnyStr | MaybeNone]: ... - @overload - def groupdict(self, default: _T) -> dict[str, AnyStr | _T]: ... - def start(self, group: int | str = 0, /) -> int: ... - def end(self, group: int | str = 0, /) -> int: ... - def span(self, group: int | str = 0, /) -> tuple[int, int]: ... - @property - def regs(self) -> tuple[tuple[int, int], ...]: ... # undocumented - # __getitem__() returns "AnyStr" or "AnyStr | None", depending on the pattern. - @overload - def __getitem__(self, key: Literal[0], /) -> AnyStr: ... - @overload - def __getitem__(self, key: int | str, /) -> AnyStr | MaybeNone: ... - def __copy__(self) -> Match[AnyStr]: ... - def __deepcopy__(self, memo: Any, /) -> Match[AnyStr]: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -@final -class Pattern(Generic[AnyStr]): - @property - def flags(self) -> int: ... - @property - def groupindex(self) -> Mapping[str, int]: ... - @property - def groups(self) -> int: ... - @property - def pattern(self) -> AnyStr: ... - @overload - def search(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... - @overload - def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... - @overload - def search(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... - @overload - def match(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... - @overload - def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... - @overload - def match(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... - @overload - def fullmatch(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... - @overload - def fullmatch( - self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize - ) -> Match[bytes] | None: ... - @overload - def fullmatch(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... - @overload - def split(self: Pattern[str], string: str, maxsplit: int = 0) -> list[str | MaybeNone]: ... - @overload - def split(self: Pattern[bytes], string: ReadableBuffer, maxsplit: int = 0) -> list[bytes | MaybeNone]: ... - @overload - def split(self, string: AnyStr, maxsplit: int = 0) -> list[AnyStr | MaybeNone]: ... - # return type depends on the number of groups in the pattern - @overload - def findall(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> list[Any]: ... - @overload - def findall(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> list[Any]: ... - @overload - def findall(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> list[AnyStr]: ... - @overload - def finditer(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[str]]: ... - @overload - def finditer( - self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize - ) -> Iterator[Match[bytes]]: ... - @overload - def finditer(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[AnyStr]]: ... - @overload - def sub(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> str: ... - @overload - def sub( - self: Pattern[bytes], - repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], - string: ReadableBuffer, - count: int = 0, - ) -> bytes: ... - @overload - def sub(self, repl: AnyStr | Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = 0) -> AnyStr: ... - @overload - def subn(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> tuple[str, int]: ... - @overload - def subn( - self: Pattern[bytes], - repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], - string: ReadableBuffer, - count: int = 0, - ) -> tuple[bytes, int]: ... - @overload - 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: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -# ----- re variables and constants ----- - -class RegexFlag(enum.IntFlag): - A = sre_compile.SRE_FLAG_ASCII - ASCII = A - DEBUG = sre_compile.SRE_FLAG_DEBUG - I = sre_compile.SRE_FLAG_IGNORECASE - IGNORECASE = I - L = sre_compile.SRE_FLAG_LOCALE - LOCALE = L - M = sre_compile.SRE_FLAG_MULTILINE - MULTILINE = M - S = sre_compile.SRE_FLAG_DOTALL - DOTALL = S - X = sre_compile.SRE_FLAG_VERBOSE - VERBOSE = X - U = sre_compile.SRE_FLAG_UNICODE - UNICODE = U - if sys.version_info < (3, 13): - T = sre_compile.SRE_FLAG_TEMPLATE - TEMPLATE = T - if sys.version_info >= (3, 11): - NOFLAG = 0 - -A: Final = RegexFlag.A -ASCII: Final = RegexFlag.ASCII -DEBUG: Final = RegexFlag.DEBUG -I: Final = RegexFlag.I -IGNORECASE: Final = RegexFlag.IGNORECASE -L: Final = RegexFlag.L -LOCALE: Final = RegexFlag.LOCALE -M: Final = RegexFlag.M -MULTILINE: Final = RegexFlag.MULTILINE -S: Final = RegexFlag.S -DOTALL: Final = RegexFlag.DOTALL -X: Final = RegexFlag.X -VERBOSE: Final = RegexFlag.VERBOSE -U: Final = RegexFlag.U -UNICODE: Final = RegexFlag.UNICODE -if sys.version_info < (3, 13): - T: Final = RegexFlag.T - TEMPLATE: Final = RegexFlag.TEMPLATE -if sys.version_info >= (3, 11): - # pytype chokes on `NOFLAG: Final = RegexFlag.NOFLAG` with `LiteralValueError` - # mypy chokes on `NOFLAG: Final[Literal[RegexFlag.NOFLAG]]` with `Literal[...] is invalid` - NOFLAG = RegexFlag.NOFLAG -_FlagsType: TypeAlias = int | RegexFlag - -# Type-wise the compile() overloads are unnecessary, they could also be modeled using -# unions in the parameter types. However mypy has a bug regarding TypeVar -# constraints (https://github.com/python/mypy/issues/11880), -# which limits us here because AnyStr is a constrained TypeVar. - -# pattern arguments do *not* accept arbitrary buffers such as bytearray, -# because the pattern must be hashable. -@overload -def compile(pattern: AnyStr, flags: _FlagsType = 0) -> Pattern[AnyStr]: ... -@overload -def compile(pattern: Pattern[AnyStr], flags: _FlagsType = 0) -> Pattern[AnyStr]: ... -@overload -def search(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... -@overload -def search(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... -@overload -def match(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... -@overload -def match(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... -@overload -def fullmatch(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Match[str] | None: ... -@overload -def fullmatch(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Match[bytes] | None: ... -@overload -def split(pattern: str | Pattern[str], string: str, maxsplit: int = 0, flags: _FlagsType = 0) -> list[str | MaybeNone]: ... -@overload -def split( - pattern: bytes | Pattern[bytes], string: ReadableBuffer, maxsplit: int = 0, flags: _FlagsType = 0 -) -> list[bytes | MaybeNone]: ... -@overload -def findall(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> list[Any]: ... -@overload -def findall(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> list[Any]: ... -@overload -def finditer(pattern: str | Pattern[str], string: str, flags: _FlagsType = 0) -> Iterator[Match[str]]: ... -@overload -def finditer(pattern: bytes | Pattern[bytes], string: ReadableBuffer, flags: _FlagsType = 0) -> Iterator[Match[bytes]]: ... -@overload -def sub( - pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0, flags: _FlagsType = 0 -) -> str: ... -@overload -def sub( - pattern: bytes | Pattern[bytes], - repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], - string: ReadableBuffer, - count: int = 0, - flags: _FlagsType = 0, -) -> bytes: ... -@overload -def subn( - pattern: str | Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0, flags: _FlagsType = 0 -) -> tuple[str, int]: ... -@overload -def subn( - pattern: bytes | Pattern[bytes], - repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], - string: ReadableBuffer, - count: int = 0, - flags: _FlagsType = 0, -) -> tuple[bytes, int]: ... -def escape(pattern: AnyStr) -> AnyStr: ... -def purge() -> None: ... - -if sys.version_info < (3, 13): - def template(pattern: AnyStr | Pattern[AnyStr], flags: _FlagsType = 0) -> Pattern[AnyStr]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/readline.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/readline.pyi deleted file mode 100644 index 7325c267b3..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/readline.pyi +++ /dev/null @@ -1,40 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from collections.abc import Callable, Sequence -from typing import Literal -from typing_extensions import TypeAlias - -if sys.platform != "win32": - _Completer: TypeAlias = Callable[[str, int], str | None] - _CompDisp: TypeAlias = Callable[[str, Sequence[str], int], None] - - def parse_and_bind(string: str, /) -> None: ... - def read_init_file(filename: StrOrBytesPath | None = None, /) -> None: ... - def get_line_buffer() -> str: ... - def insert_text(string: str, /) -> None: ... - def redisplay() -> None: ... - def read_history_file(filename: StrOrBytesPath | None = None, /) -> None: ... - def write_history_file(filename: StrOrBytesPath | None = None, /) -> None: ... - def append_history_file(nelements: int, filename: StrOrBytesPath | None = None, /) -> None: ... - def get_history_length() -> int: ... - def set_history_length(length: int, /) -> None: ... - def clear_history() -> None: ... - def get_current_history_length() -> int: ... - def get_history_item(index: int, /) -> str: ... - def remove_history_item(pos: int, /) -> None: ... - def replace_history_item(pos: int, line: str, /) -> None: ... - def add_history(string: str, /) -> None: ... - def set_auto_history(enabled: bool, /) -> None: ... - def set_startup_hook(function: Callable[[], object] | None = None, /) -> None: ... - def set_pre_input_hook(function: Callable[[], object] | None = None, /) -> None: ... - def set_completer(function: _Completer | None = None, /) -> None: ... - def get_completer() -> _Completer | None: ... - def get_completion_type() -> int: ... - def get_begidx() -> int: ... - def get_endidx() -> int: ... - def set_completer_delims(string: str, /) -> None: ... - def get_completer_delims() -> str: ... - def set_completion_display_matches_hook(function: _CompDisp | None = None, /) -> None: ... - - if sys.version_info >= (3, 13): - backend: Literal["readline", "editline"] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/reprlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/reprlib.pyi deleted file mode 100644 index 68ada65693..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/reprlib.pyi +++ /dev/null @@ -1,65 +0,0 @@ -import sys -from array import array -from collections import deque -from collections.abc import Callable -from typing import Any -from typing_extensions import TypeAlias - -__all__ = ["Repr", "repr", "recursive_repr"] - -_ReprFunc: TypeAlias = Callable[[Any], str] - -def recursive_repr(fillvalue: str = "...") -> Callable[[_ReprFunc], _ReprFunc]: ... - -class Repr: - maxlevel: int - maxdict: int - maxlist: int - maxtuple: int - maxset: int - maxfrozenset: int - maxdeque: int - maxarray: int - maxlong: int - maxstring: int - maxother: int - if sys.version_info >= (3, 11): - fillvalue: str - if sys.version_info >= (3, 12): - indent: str | int | None - - if sys.version_info >= (3, 12): - def __init__( - self, - *, - maxlevel: int = 6, - maxtuple: int = 6, - maxlist: int = 6, - maxarray: int = 5, - maxdict: int = 4, - maxset: int = 6, - maxfrozenset: int = 6, - maxdeque: int = 6, - maxstring: int = 30, - maxlong: int = 40, - maxother: int = 30, - fillvalue: str = "...", - indent: str | int | None = None, - ) -> None: ... - - def repr(self, x: Any) -> str: ... - def repr1(self, x: Any, level: int) -> str: ... - def repr_tuple(self, x: tuple[Any, ...], level: int) -> str: ... - def repr_list(self, x: list[Any], level: int) -> str: ... - def repr_array(self, x: array[Any], level: int) -> str: ... - def repr_set(self, x: set[Any], level: int) -> str: ... - def repr_frozenset(self, x: frozenset[Any], level: int) -> str: ... - def repr_deque(self, x: deque[Any], level: int) -> str: ... - def repr_dict(self, x: dict[Any, Any], level: int) -> str: ... - def repr_str(self, x: str, level: int) -> str: ... - def repr_int(self, x: int, level: int) -> str: ... - def repr_instance(self, x: Any, level: int) -> str: ... - -aRepr: Repr - -def repr(x: object) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/resource.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/resource.pyi deleted file mode 100644 index 5e468c2cea..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/resource.pyi +++ /dev/null @@ -1,94 +0,0 @@ -import sys -from _typeshed import structseq -from typing import Final, final - -if sys.platform != "win32": - RLIMIT_AS: int - RLIMIT_CORE: int - RLIMIT_CPU: int - RLIMIT_DATA: int - RLIMIT_FSIZE: int - RLIMIT_MEMLOCK: int - RLIMIT_NOFILE: int - RLIMIT_NPROC: int - RLIMIT_RSS: int - RLIMIT_STACK: int - RLIM_INFINITY: int - RUSAGE_CHILDREN: int - RUSAGE_SELF: int - if sys.platform == "linux": - RLIMIT_MSGQUEUE: int - RLIMIT_NICE: int - RLIMIT_OFILE: int - RLIMIT_RTPRIO: int - RLIMIT_RTTIME: int - RLIMIT_SIGPENDING: int - RUSAGE_THREAD: int - - @final - class struct_rusage( - structseq[float], tuple[float, float, int, int, int, int, int, int, int, int, int, int, int, int, int, int] - ): - if sys.version_info >= (3, 10): - __match_args__: Final = ( - "ru_utime", - "ru_stime", - "ru_maxrss", - "ru_ixrss", - "ru_idrss", - "ru_isrss", - "ru_minflt", - "ru_majflt", - "ru_nswap", - "ru_inblock", - "ru_oublock", - "ru_msgsnd", - "ru_msgrcv", - "ru_nsignals", - "ru_nvcsw", - "ru_nivcsw", - ) - - @property - def ru_utime(self) -> float: ... - @property - def ru_stime(self) -> float: ... - @property - def ru_maxrss(self) -> int: ... - @property - def ru_ixrss(self) -> int: ... - @property - def ru_idrss(self) -> int: ... - @property - def ru_isrss(self) -> int: ... - @property - def ru_minflt(self) -> int: ... - @property - def ru_majflt(self) -> int: ... - @property - def ru_nswap(self) -> int: ... - @property - def ru_inblock(self) -> int: ... - @property - def ru_oublock(self) -> int: ... - @property - def ru_msgsnd(self) -> int: ... - @property - def ru_msgrcv(self) -> int: ... - @property - def ru_nsignals(self) -> int: ... - @property - def ru_nvcsw(self) -> int: ... - @property - def ru_nivcsw(self) -> int: ... - - def getpagesize() -> int: ... - def getrlimit(resource: int, /) -> tuple[int, int]: ... - def getrusage(who: int, /) -> struct_rusage: ... - def setrlimit(resource: int, limits: tuple[int, int], /) -> None: ... - if sys.platform == "linux": - if sys.version_info >= (3, 12): - def prlimit(pid: int, resource: int, limits: tuple[int, int] | None = None, /) -> tuple[int, int]: ... - else: - def prlimit(pid: int, resource: int, limits: tuple[int, int] = ..., /) -> tuple[int, int]: ... - error = OSError diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/rlcompleter.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/rlcompleter.pyi deleted file mode 100644 index 8d9477e3ee..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/rlcompleter.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Any - -__all__ = ["Completer"] - -class Completer: - def __init__(self, namespace: dict[str, Any] | None = None) -> None: ... - def complete(self, text: str, state: int) -> str | None: ... - def attr_matches(self, text: str) -> list[str]: ... - def global_matches(self, text: str) -> list[str]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/runpy.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/runpy.pyi deleted file mode 100644 index d4406ea4ac..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/runpy.pyi +++ /dev/null @@ -1,24 +0,0 @@ -from _typeshed import Unused -from types import ModuleType -from typing import Any -from typing_extensions import Self - -__all__ = ["run_module", "run_path"] - -class _TempModule: - mod_name: str - module: ModuleType - def __init__(self, mod_name: str) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - -class _ModifiedArgv0: - value: Any - def __init__(self, value: Any) -> None: ... - def __enter__(self) -> None: ... - def __exit__(self, *args: Unused) -> None: ... - -def run_module( - mod_name: str, init_globals: dict[str, Any] | None = None, run_name: str | None = None, alter_sys: bool = False -) -> dict[str, Any]: ... -def run_path(path_name: str, init_globals: dict[str, Any] | None = None, run_name: str | None = None) -> dict[str, Any]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sched.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sched.pyi deleted file mode 100644 index 52f87ab68f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sched.pyi +++ /dev/null @@ -1,46 +0,0 @@ -import sys -from collections.abc import Callable -from typing import Any, ClassVar, NamedTuple, type_check_only -from typing_extensions import TypeAlias - -__all__ = ["scheduler"] - -_ActionCallback: TypeAlias = Callable[..., Any] - -if sys.version_info >= (3, 10): - class Event(NamedTuple): - time: float - priority: Any - sequence: int - action: _ActionCallback - argument: tuple[Any, ...] - kwargs: dict[str, Any] - -else: - @type_check_only - class _EventBase(NamedTuple): - time: float - priority: Any - action: _ActionCallback - argument: tuple[Any, ...] - kwargs: dict[str, Any] - - class Event(_EventBase): - __hash__: ClassVar[None] # type: ignore[assignment] - -class scheduler: - timefunc: Callable[[], float] - delayfunc: Callable[[float], object] - - def __init__(self, timefunc: Callable[[], float] = ..., delayfunc: Callable[[float], object] = ...) -> None: ... - def enterabs( - self, time: float, priority: Any, action: _ActionCallback, argument: tuple[Any, ...] = (), kwargs: dict[str, Any] = ... - ) -> Event: ... - def enter( - self, delay: float, priority: Any, action: _ActionCallback, argument: tuple[Any, ...] = (), kwargs: dict[str, Any] = ... - ) -> Event: ... - def run(self, blocking: bool = True) -> float | None: ... - def cancel(self, event: Event) -> None: ... - def empty(self) -> bool: ... - @property - def queue(self) -> list[Event]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/secrets.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/secrets.pyi deleted file mode 100644 index 4861b6f093..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/secrets.pyi +++ /dev/null @@ -1,15 +0,0 @@ -from _typeshed import SupportsLenAndGetItem -from hmac import compare_digest as compare_digest -from random import SystemRandom as SystemRandom -from typing import TypeVar - -__all__ = ["choice", "randbelow", "randbits", "SystemRandom", "token_bytes", "token_hex", "token_urlsafe", "compare_digest"] - -_T = TypeVar("_T") - -def randbelow(exclusive_upper_bound: int) -> int: ... -def randbits(k: int) -> int: ... -def choice(seq: SupportsLenAndGetItem[_T]) -> _T: ... -def token_bytes(nbytes: int | None = None) -> bytes: ... -def token_hex(nbytes: int | None = None) -> str: ... -def token_urlsafe(nbytes: int | None = None) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/select.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/select.pyi deleted file mode 100644 index 42941b9e41..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/select.pyi +++ /dev/null @@ -1,161 +0,0 @@ -import sys -from _typeshed import FileDescriptorLike -from collections.abc import Iterable -from types import TracebackType -from typing import Any, ClassVar, final -from typing_extensions import Self - -if sys.platform != "win32": - PIPE_BUF: int - POLLERR: int - POLLHUP: int - POLLIN: int - if sys.platform == "linux": - POLLMSG: int - POLLNVAL: int - POLLOUT: int - POLLPRI: int - POLLRDBAND: int - if sys.platform == "linux": - POLLRDHUP: int - POLLRDNORM: int - POLLWRBAND: int - POLLWRNORM: int - - # This is actually a function that returns an instance of a class. - # The class is not accessible directly, and also calls itself select.poll. - class poll: - # default value is select.POLLIN | select.POLLPRI | select.POLLOUT - def register(self, fd: FileDescriptorLike, eventmask: int = 7, /) -> None: ... - def modify(self, fd: FileDescriptorLike, eventmask: int, /) -> None: ... - def unregister(self, fd: FileDescriptorLike, /) -> None: ... - def poll(self, timeout: float | None = None, /) -> list[tuple[int, int]]: ... - -def select( - rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], timeout: float | None = None, / -) -> tuple[list[Any], list[Any], list[Any]]: ... - -error = OSError - -if sys.platform != "linux" and sys.platform != "win32": - # BSD only - @final - class kevent: - data: Any - fflags: int - filter: int - flags: int - ident: int - udata: Any - def __init__( - self, - ident: FileDescriptorLike, - filter: int = ..., - flags: int = ..., - fflags: int = ..., - data: Any = ..., - udata: Any = ..., - ) -> None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - - # BSD only - @final - class kqueue: - closed: bool - def __init__(self) -> None: ... - def close(self) -> None: ... - def control( - self, changelist: Iterable[kevent] | None, maxevents: int, timeout: float | None = None, / - ) -> list[kevent]: ... - def fileno(self) -> int: ... - @classmethod - def fromfd(cls, fd: FileDescriptorLike, /) -> kqueue: ... - - KQ_EV_ADD: int - KQ_EV_CLEAR: int - KQ_EV_DELETE: int - KQ_EV_DISABLE: int - KQ_EV_ENABLE: int - KQ_EV_EOF: int - KQ_EV_ERROR: int - KQ_EV_FLAG1: int - KQ_EV_ONESHOT: int - KQ_EV_SYSFLAGS: int - KQ_FILTER_AIO: int - if sys.platform != "darwin": - KQ_FILTER_NETDEV: int - KQ_FILTER_PROC: int - KQ_FILTER_READ: int - KQ_FILTER_SIGNAL: int - KQ_FILTER_TIMER: int - KQ_FILTER_VNODE: int - KQ_FILTER_WRITE: int - KQ_NOTE_ATTRIB: int - KQ_NOTE_CHILD: int - KQ_NOTE_DELETE: int - KQ_NOTE_EXEC: int - KQ_NOTE_EXIT: int - KQ_NOTE_EXTEND: int - KQ_NOTE_FORK: int - KQ_NOTE_LINK: int - if sys.platform != "darwin": - KQ_NOTE_LINKDOWN: int - KQ_NOTE_LINKINV: int - KQ_NOTE_LINKUP: int - KQ_NOTE_LOWAT: int - KQ_NOTE_PCTRLMASK: int - KQ_NOTE_PDATAMASK: int - KQ_NOTE_RENAME: int - KQ_NOTE_REVOKE: int - KQ_NOTE_TRACK: int - KQ_NOTE_TRACKERR: int - KQ_NOTE_WRITE: int - -if sys.platform == "linux": - @final - class epoll: - def __init__(self, sizehint: int = ..., flags: int = ...) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, - exc_type: type[BaseException] | None = None, - exc_value: BaseException | None = ..., - exc_tb: TracebackType | None = None, - /, - ) -> None: ... - def close(self) -> None: ... - closed: bool - def fileno(self) -> int: ... - def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ... - def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ... - def unregister(self, fd: FileDescriptorLike) -> None: ... - def poll(self, timeout: float | None = None, maxevents: int = -1) -> list[tuple[int, int]]: ... - @classmethod - def fromfd(cls, fd: FileDescriptorLike, /) -> epoll: ... - - EPOLLERR: int - EPOLLEXCLUSIVE: int - EPOLLET: int - EPOLLHUP: int - EPOLLIN: int - EPOLLMSG: int - EPOLLONESHOT: int - EPOLLOUT: int - EPOLLPRI: int - EPOLLRDBAND: int - EPOLLRDHUP: int - EPOLLRDNORM: int - EPOLLWRBAND: int - EPOLLWRNORM: int - EPOLL_CLOEXEC: int - -if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win32": - # Solaris only - class devpoll: - def close(self) -> None: ... - closed: bool - def fileno(self) -> int: ... - def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ... - def modify(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ... - def unregister(self, fd: FileDescriptorLike) -> None: ... - def poll(self, timeout: float | None = ...) -> list[tuple[int, int]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/selectors.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/selectors.pyi deleted file mode 100644 index 0ba843a403..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/selectors.pyi +++ /dev/null @@ -1,69 +0,0 @@ -import sys -from _typeshed import FileDescriptor, FileDescriptorLike, Unused -from abc import ABCMeta, abstractmethod -from collections.abc import Mapping -from typing import Any, NamedTuple -from typing_extensions import Self, TypeAlias - -_EventMask: TypeAlias = int - -EVENT_READ: _EventMask -EVENT_WRITE: _EventMask - -class SelectorKey(NamedTuple): - fileobj: FileDescriptorLike - fd: FileDescriptor - events: _EventMask - data: Any - -class BaseSelector(metaclass=ABCMeta): - @abstractmethod - def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... - @abstractmethod - def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - def modify(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... - @abstractmethod - def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... - def close(self) -> None: ... - def get_key(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - @abstractmethod - def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - -class _BaseSelectorImpl(BaseSelector, metaclass=ABCMeta): - def register(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... - def unregister(self, fileobj: FileDescriptorLike) -> SelectorKey: ... - def modify(self, fileobj: FileDescriptorLike, events: _EventMask, data: Any = None) -> SelectorKey: ... - def get_map(self) -> Mapping[FileDescriptorLike, SelectorKey]: ... - -class SelectSelector(_BaseSelectorImpl): - def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... - -class _PollLikeSelector(_BaseSelectorImpl): - def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... - -if sys.platform != "win32": - class PollSelector(_PollLikeSelector): ... - -if sys.platform == "linux": - class EpollSelector(_PollLikeSelector): - def fileno(self) -> int: ... - -if sys.platform != "linux" and sys.platform != "darwin" and sys.platform != "win32": - # Solaris only - class DevpollSelector(_PollLikeSelector): - def fileno(self) -> int: ... - -if sys.platform != "win32" and sys.platform != "linux": - class KqueueSelector(_BaseSelectorImpl): - def fileno(self) -> int: ... - def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... - -# Not a real class at runtime, it is just a conditional alias to other real selectors. -# The runtime logic is more fine-grained than a `sys.platform` check; -# not really expressible in the stubs -class DefaultSelector(_BaseSelectorImpl): - def select(self, timeout: float | None = None) -> list[tuple[SelectorKey, _EventMask]]: ... - if sys.platform != "win32": - def fileno(self) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/shelve.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/shelve.pyi deleted file mode 100644 index 654c2ea097..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/shelve.pyi +++ /dev/null @@ -1,59 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from collections.abc import Iterator, MutableMapping -from dbm import _TFlags -from types import TracebackType -from typing import Any, TypeVar, overload -from typing_extensions import Self - -__all__ = ["Shelf", "BsdDbShelf", "DbfilenameShelf", "open"] - -_T = TypeVar("_T") -_VT = TypeVar("_VT") - -class Shelf(MutableMapping[str, _VT]): - def __init__( - self, dict: MutableMapping[bytes, bytes], protocol: int | None = None, writeback: bool = False, keyencoding: str = "utf-8" - ) -> None: ... - def __iter__(self) -> Iterator[str]: ... - def __len__(self) -> int: ... - @overload # type: ignore[override] - def get(self, key: str, default: None = None) -> _VT | None: ... - @overload - def get(self, key: str, default: _VT) -> _VT: ... - @overload - def get(self, key: str, default: _T) -> _VT | _T: ... - def __getitem__(self, key: str) -> _VT: ... - def __setitem__(self, key: str, value: _VT) -> None: ... - def __delitem__(self, key: str) -> None: ... - def __contains__(self, key: str) -> bool: ... # type: ignore[override] - def __enter__(self) -> Self: ... - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> None: ... - def __del__(self) -> None: ... - def close(self) -> None: ... - def sync(self) -> None: ... - -class BsdDbShelf(Shelf[_VT]): - def set_location(self, key: str) -> tuple[str, _VT]: ... - def next(self) -> tuple[str, _VT]: ... - def previous(self) -> tuple[str, _VT]: ... - def first(self) -> tuple[str, _VT]: ... - def last(self) -> tuple[str, _VT]: ... - -class DbfilenameShelf(Shelf[_VT]): - if sys.version_info >= (3, 11): - def __init__( - self, filename: StrOrBytesPath, flag: _TFlags = "c", protocol: int | None = None, writeback: bool = False - ) -> None: ... - else: - def __init__(self, filename: str, flag: _TFlags = "c", protocol: int | None = None, writeback: bool = False) -> None: ... - -if sys.version_info >= (3, 11): - def open( - filename: StrOrBytesPath, flag: _TFlags = "c", protocol: int | None = None, writeback: bool = False - ) -> Shelf[Any]: ... - -else: - def open(filename: str, flag: _TFlags = "c", protocol: int | None = None, writeback: bool = False) -> Shelf[Any]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/shlex.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/shlex.pyi deleted file mode 100644 index 1c27483782..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/shlex.pyi +++ /dev/null @@ -1,63 +0,0 @@ -import sys -from collections import deque -from collections.abc import Iterable -from io import TextIOWrapper -from typing import Literal, Protocol, overload, type_check_only -from typing_extensions import Self, deprecated - -__all__ = ["shlex", "split", "quote", "join"] - -@type_check_only -class _ShlexInstream(Protocol): - def read(self, size: Literal[1], /) -> str: ... - def readline(self) -> object: ... - def close(self) -> object: ... - -if sys.version_info >= (3, 12): - def split(s: str | _ShlexInstream, comments: bool = False, posix: bool = True) -> list[str]: ... - -else: - @overload - def split(s: str | _ShlexInstream, comments: bool = False, posix: bool = True) -> list[str]: ... - @overload - @deprecated("Passing None for 's' to shlex.split() is deprecated and will raise an error in Python 3.12.") - def split(s: None, comments: bool = False, posix: bool = True) -> list[str]: ... - -def join(split_command: Iterable[str]) -> str: ... -def quote(s: str) -> str: ... - -# TODO: Make generic over infile once PEP 696 is implemented. -class shlex: - commenters: str - wordchars: str - whitespace: str - escape: str - quotes: str - escapedquotes: str - whitespace_split: bool - infile: str | None - instream: _ShlexInstream - source: str - debug: int - lineno: int - token: str - filestack: deque[tuple[str | None, _ShlexInstream, int]] - eof: str | None - @property - def punctuation_chars(self) -> str: ... - def __init__( - self, - instream: str | _ShlexInstream | None = None, - infile: str | None = None, - posix: bool = False, - punctuation_chars: bool | str = False, - ) -> None: ... - def get_token(self) -> str | None: ... - def push_token(self, tok: str) -> None: ... - def read_token(self) -> str | None: ... - def sourcehook(self, newfile: str) -> tuple[str, TextIOWrapper] | None: ... - def push_source(self, newstream: str | _ShlexInstream, newfile: str | None = None) -> None: ... - def pop_source(self) -> None: ... - def error_leader(self, infile: str | None = None, lineno: int | None = None) -> str: ... - def __iter__(self) -> Self: ... - def __next__(self) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/shutil.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/shutil.pyi deleted file mode 100644 index ea2c29d462..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/shutil.pyi +++ /dev/null @@ -1,228 +0,0 @@ -import os -import sys -from _typeshed import BytesPath, ExcInfo, FileDescriptorOrPath, MaybeNone, StrOrBytesPath, StrPath, SupportsRead, SupportsWrite -from collections.abc import Callable, Iterable, Sequence -from tarfile import _TarfileFilter -from typing import Any, AnyStr, NamedTuple, NoReturn, Protocol, TypeVar, overload -from typing_extensions import TypeAlias, deprecated - -__all__ = [ - "copyfileobj", - "copyfile", - "copymode", - "copystat", - "copy", - "copy2", - "copytree", - "move", - "rmtree", - "Error", - "SpecialFileError", - "ExecError", - "make_archive", - "get_archive_formats", - "register_archive_format", - "unregister_archive_format", - "get_unpack_formats", - "register_unpack_format", - "unregister_unpack_format", - "unpack_archive", - "ignore_patterns", - "chown", - "which", - "get_terminal_size", - "SameFileError", - "disk_usage", -] - -_StrOrBytesPathT = TypeVar("_StrOrBytesPathT", bound=StrOrBytesPath) -_StrPathT = TypeVar("_StrPathT", bound=StrPath) -_BytesPathT = TypeVar("_BytesPathT", bound=BytesPath) - -class Error(OSError): ... -class SameFileError(Error): ... -class SpecialFileError(OSError): ... -class ExecError(OSError): ... -class ReadError(OSError): ... -class RegistryError(Exception): ... - -def copyfileobj(fsrc: SupportsRead[AnyStr], fdst: SupportsWrite[AnyStr], length: int = 0) -> None: ... -def copyfile(src: StrOrBytesPath, dst: _StrOrBytesPathT, *, follow_symlinks: bool = True) -> _StrOrBytesPathT: ... -def copymode(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... -def copystat(src: StrOrBytesPath, dst: StrOrBytesPath, *, follow_symlinks: bool = True) -> None: ... -@overload -def copy(src: StrPath, dst: _StrPathT, *, follow_symlinks: bool = True) -> _StrPathT | str: ... -@overload -def copy(src: BytesPath, dst: _BytesPathT, *, follow_symlinks: bool = True) -> _BytesPathT | bytes: ... -@overload -def copy2(src: StrPath, dst: _StrPathT, *, follow_symlinks: bool = True) -> _StrPathT | str: ... -@overload -def copy2(src: BytesPath, dst: _BytesPathT, *, follow_symlinks: bool = True) -> _BytesPathT | bytes: ... -def ignore_patterns(*patterns: StrPath) -> Callable[[Any, list[str]], set[str]]: ... -def copytree( - src: StrPath, - dst: _StrPathT, - symlinks: bool = False, - ignore: None | Callable[[str, list[str]], Iterable[str]] | Callable[[StrPath, list[str]], Iterable[str]] = None, - copy_function: Callable[[str, str], object] = ..., - ignore_dangling_symlinks: bool = False, - dirs_exist_ok: bool = False, -) -> _StrPathT: ... - -_OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], str, ExcInfo], object] -_OnExcCallback: TypeAlias = Callable[[Callable[..., Any], str, BaseException], object] - -class _RmtreeType(Protocol): - avoids_symlink_attacks: bool - if sys.version_info >= (3, 12): - @overload - @deprecated("The `onerror` parameter is deprecated. Use `onexc` instead.") - def __call__( - self, - path: StrOrBytesPath, - ignore_errors: bool, - onerror: _OnErrorCallback | None, - *, - onexc: None = None, - dir_fd: int | None = None, - ) -> None: ... - @overload - @deprecated("The `onerror` parameter is deprecated. Use `onexc` instead.") - def __call__( - self, - path: StrOrBytesPath, - ignore_errors: bool = False, - *, - onerror: _OnErrorCallback | None, - onexc: None = None, - dir_fd: int | None = None, - ) -> None: ... - @overload - def __call__( - self, - path: StrOrBytesPath, - ignore_errors: bool = False, - *, - onexc: _OnExcCallback | None = None, - dir_fd: int | None = None, - ) -> None: ... - elif sys.version_info >= (3, 11): - def __call__( - self, - path: StrOrBytesPath, - ignore_errors: bool = False, - onerror: _OnErrorCallback | None = None, - *, - dir_fd: int | None = None, - ) -> None: ... - - else: - def __call__( - self, path: StrOrBytesPath, ignore_errors: bool = False, onerror: _OnErrorCallback | None = None - ) -> None: ... - -rmtree: _RmtreeType - -_CopyFn: TypeAlias = Callable[[str, str], object] | Callable[[StrPath, StrPath], object] - -# N.B. shutil.move appears to take bytes arguments, however, -# this does not work when dst is (or is within) an existing directory. -# (#6832) -def move(src: StrPath, dst: _StrPathT, copy_function: _CopyFn = ...) -> _StrPathT | str | MaybeNone: ... - -class _ntuple_diskusage(NamedTuple): - total: int - used: int - free: int - -def disk_usage(path: FileDescriptorOrPath) -> _ntuple_diskusage: ... - -# While chown can be imported on Windows, it doesn't actually work; -# see https://bugs.python.org/issue33140. We keep it here because it's -# in __all__. -if sys.version_info >= (3, 13): - @overload - def chown( - path: FileDescriptorOrPath, - user: str | int, - group: None = None, - *, - dir_fd: int | None = None, - follow_symlinks: bool = True, - ) -> None: ... - @overload - def chown( - path: FileDescriptorOrPath, - user: None = None, - *, - group: str | int, - dir_fd: int | None = None, - follow_symlinks: bool = True, - ) -> None: ... - @overload - def chown( - path: FileDescriptorOrPath, user: None, group: str | int, *, dir_fd: int | None = None, follow_symlinks: bool = True - ) -> None: ... - @overload - def chown( - path: FileDescriptorOrPath, user: str | int, group: str | int, *, dir_fd: int | None = None, follow_symlinks: bool = True - ) -> None: ... - -else: - @overload - def chown(path: FileDescriptorOrPath, user: str | int, group: None = None) -> None: ... - @overload - def chown(path: FileDescriptorOrPath, user: None = None, *, group: str | int) -> None: ... - @overload - def chown(path: FileDescriptorOrPath, user: None, group: str | int) -> None: ... - @overload - def chown(path: FileDescriptorOrPath, user: str | int, group: str | int) -> None: ... - -if sys.platform == "win32" and sys.version_info < (3, 12): - @overload - @deprecated("On Windows before Python 3.12, using a PathLike as `cmd` would always fail or return `None`.") - def which(cmd: os.PathLike[str], mode: int = 1, path: StrPath | None = None) -> NoReturn: ... - -@overload -def which(cmd: StrPath, mode: int = 1, path: StrPath | None = None) -> str | None: ... -@overload -def which(cmd: bytes, mode: int = 1, path: StrPath | None = None) -> bytes | None: ... -def make_archive( - base_name: str, - format: str, - root_dir: StrPath | None = None, - base_dir: StrPath | None = None, - verbose: bool = ..., - dry_run: bool = ..., - owner: str | None = None, - group: str | None = None, - logger: Any | None = None, -) -> str: ... -def get_archive_formats() -> list[tuple[str, str]]: ... -@overload -def register_archive_format( - name: str, function: Callable[..., object], extra_args: Sequence[tuple[str, Any] | list[Any]], description: str = "" -) -> None: ... -@overload -def register_archive_format( - name: str, function: Callable[[str, str], object], extra_args: None = None, description: str = "" -) -> None: ... -def unregister_archive_format(name: str) -> None: ... -def unpack_archive( - filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None, *, filter: _TarfileFilter | None = None -) -> None: ... -@overload -def register_unpack_format( - name: str, - extensions: list[str], - function: Callable[..., object], - extra_args: Sequence[tuple[str, Any]], - description: str = "", -) -> None: ... -@overload -def register_unpack_format( - name: str, extensions: list[str], function: Callable[[str, str], object], extra_args: None = None, description: str = "" -) -> None: ... -def unregister_unpack_format(name: str) -> None: ... -def get_unpack_formats() -> list[tuple[str, list[str], str]]: ... -def get_terminal_size(fallback: tuple[int, int] = (80, 24)) -> os.terminal_size: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/signal.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/signal.pyi deleted file mode 100644 index d50565d1c8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/signal.pyi +++ /dev/null @@ -1,187 +0,0 @@ -import sys -from _typeshed import structseq -from collections.abc import Callable, Iterable -from enum import IntEnum -from types import FrameType -from typing import Any, Final, Literal, final -from typing_extensions import Never, TypeAlias - -NSIG: int - -class Signals(IntEnum): - SIGABRT = 6 - SIGFPE = 8 - SIGILL = 4 - SIGINT = 2 - SIGSEGV = 11 - SIGTERM = 15 - - if sys.platform == "win32": - SIGBREAK = 21 - CTRL_C_EVENT = 0 - CTRL_BREAK_EVENT = 1 - else: - SIGALRM = 14 - SIGBUS = 7 - SIGCHLD = 17 - SIGCONT = 18 - SIGHUP = 1 - SIGIO = 29 - SIGIOT = 6 - SIGKILL = 9 - SIGPIPE = 13 - SIGPROF = 27 - SIGQUIT = 3 - SIGSTOP = 19 - SIGSYS = 31 - SIGTRAP = 5 - SIGTSTP = 20 - SIGTTIN = 21 - SIGTTOU = 22 - SIGURG = 23 - SIGUSR1 = 10 - SIGUSR2 = 12 - SIGVTALRM = 26 - SIGWINCH = 28 - SIGXCPU = 24 - SIGXFSZ = 25 - if sys.platform != "linux": - SIGEMT = 7 - SIGINFO = 29 - if sys.platform != "darwin": - SIGCLD = 17 - SIGPOLL = 29 - SIGPWR = 30 - SIGRTMAX = 64 - SIGRTMIN = 34 - if sys.version_info >= (3, 11): - SIGSTKFLT = 16 - -class Handlers(IntEnum): - SIG_DFL = 0 - SIG_IGN = 1 - -SIG_DFL: Literal[Handlers.SIG_DFL] -SIG_IGN: Literal[Handlers.SIG_IGN] - -_SIGNUM: TypeAlias = int | Signals -_HANDLER: TypeAlias = Callable[[int, FrameType | None], Any] | int | Handlers | None - -def default_int_handler(signalnum: int, frame: FrameType | None, /) -> Never: ... - -if sys.version_info >= (3, 10): # arguments changed in 3.10.2 - def getsignal(signalnum: _SIGNUM) -> _HANDLER: ... - def signal(signalnum: _SIGNUM, handler: _HANDLER) -> _HANDLER: ... - -else: - def getsignal(signalnum: _SIGNUM, /) -> _HANDLER: ... - def signal(signalnum: _SIGNUM, handler: _HANDLER, /) -> _HANDLER: ... - -SIGABRT: Literal[Signals.SIGABRT] -SIGFPE: Literal[Signals.SIGFPE] -SIGILL: Literal[Signals.SIGILL] -SIGINT: Literal[Signals.SIGINT] -SIGSEGV: Literal[Signals.SIGSEGV] -SIGTERM: Literal[Signals.SIGTERM] - -if sys.platform == "win32": - SIGBREAK: Literal[Signals.SIGBREAK] - CTRL_C_EVENT: Literal[Signals.CTRL_C_EVENT] - CTRL_BREAK_EVENT: Literal[Signals.CTRL_BREAK_EVENT] -else: - if sys.platform != "linux": - SIGINFO: Literal[Signals.SIGINFO] - SIGEMT: Literal[Signals.SIGEMT] - SIGALRM: Literal[Signals.SIGALRM] - SIGBUS: Literal[Signals.SIGBUS] - SIGCHLD: Literal[Signals.SIGCHLD] - SIGCONT: Literal[Signals.SIGCONT] - SIGHUP: Literal[Signals.SIGHUP] - SIGIO: Literal[Signals.SIGIO] - SIGIOT: Literal[Signals.SIGABRT] # alias - SIGKILL: Literal[Signals.SIGKILL] - SIGPIPE: Literal[Signals.SIGPIPE] - SIGPROF: Literal[Signals.SIGPROF] - SIGQUIT: Literal[Signals.SIGQUIT] - SIGSTOP: Literal[Signals.SIGSTOP] - SIGSYS: Literal[Signals.SIGSYS] - SIGTRAP: Literal[Signals.SIGTRAP] - SIGTSTP: Literal[Signals.SIGTSTP] - SIGTTIN: Literal[Signals.SIGTTIN] - SIGTTOU: Literal[Signals.SIGTTOU] - SIGURG: Literal[Signals.SIGURG] - SIGUSR1: Literal[Signals.SIGUSR1] - SIGUSR2: Literal[Signals.SIGUSR2] - SIGVTALRM: Literal[Signals.SIGVTALRM] - SIGWINCH: Literal[Signals.SIGWINCH] - SIGXCPU: Literal[Signals.SIGXCPU] - SIGXFSZ: Literal[Signals.SIGXFSZ] - - class ItimerError(OSError): ... - ITIMER_PROF: int - ITIMER_REAL: int - ITIMER_VIRTUAL: int - - class Sigmasks(IntEnum): - SIG_BLOCK = 0 - SIG_UNBLOCK = 1 - SIG_SETMASK = 2 - - SIG_BLOCK: Literal[Sigmasks.SIG_BLOCK] - SIG_UNBLOCK: Literal[Sigmasks.SIG_UNBLOCK] - SIG_SETMASK: Literal[Sigmasks.SIG_SETMASK] - def alarm(seconds: int, /) -> int: ... - def getitimer(which: int, /) -> tuple[float, float]: ... - def pause() -> None: ... - def pthread_kill(thread_id: int, signalnum: int, /) -> None: ... - if sys.version_info >= (3, 10): # arguments changed in 3.10.2 - def pthread_sigmask(how: int, mask: Iterable[int]) -> set[_SIGNUM]: ... - else: - def pthread_sigmask(how: int, mask: Iterable[int], /) -> set[_SIGNUM]: ... - - def setitimer(which: int, seconds: float, interval: float = 0.0, /) -> tuple[float, float]: ... - def siginterrupt(signalnum: int, flag: bool, /) -> None: ... - def sigpending() -> Any: ... - if sys.version_info >= (3, 10): # argument changed in 3.10.2 - def sigwait(sigset: Iterable[int]) -> _SIGNUM: ... - else: - def sigwait(sigset: Iterable[int], /) -> _SIGNUM: ... - if sys.platform != "darwin": - SIGCLD: Literal[Signals.SIGCHLD] # alias - SIGPOLL: Literal[Signals.SIGIO] # alias - SIGPWR: Literal[Signals.SIGPWR] - SIGRTMAX: Literal[Signals.SIGRTMAX] - SIGRTMIN: Literal[Signals.SIGRTMIN] - if sys.version_info >= (3, 11): - SIGSTKFLT: Literal[Signals.SIGSTKFLT] - - @final - class struct_siginfo(structseq[int], tuple[int, int, int, int, int, int, int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("si_signo", "si_code", "si_errno", "si_pid", "si_uid", "si_status", "si_band") - - @property - def si_signo(self) -> int: ... - @property - def si_code(self) -> int: ... - @property - def si_errno(self) -> int: ... - @property - def si_pid(self) -> int: ... - @property - def si_uid(self) -> int: ... - @property - def si_status(self) -> int: ... - @property - def si_band(self) -> int: ... - - def sigtimedwait(sigset: Iterable[int], timeout: float, /) -> struct_siginfo | None: ... - def sigwaitinfo(sigset: Iterable[int], /) -> struct_siginfo: ... - -def strsignal(signalnum: _SIGNUM, /) -> str | None: ... -def valid_signals() -> set[Signals]: ... -def raise_signal(signalnum: _SIGNUM, /) -> None: ... -def set_wakeup_fd(fd: int, /, *, warn_on_full_buffer: bool = ...) -> int: ... - -if sys.platform == "linux": - def pidfd_send_signal(pidfd: int, sig: int, siginfo: None = None, flags: int = ..., /) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/site.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/site.pyi deleted file mode 100644 index 6e39677aae..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/site.pyi +++ /dev/null @@ -1,36 +0,0 @@ -import sys -from _typeshed import StrPath -from collections.abc import Iterable - -PREFIXES: list[str] -ENABLE_USER_SITE: bool | None -USER_SITE: str | None -USER_BASE: str | None - -def main() -> None: ... -def abs_paths() -> None: ... # undocumented -def addpackage(sitedir: StrPath, name: StrPath, known_paths: set[str] | None) -> set[str] | None: ... # undocumented -def addsitedir(sitedir: str, known_paths: set[str] | None = None) -> None: ... -def addsitepackages(known_paths: set[str] | None, prefixes: Iterable[str] | None = None) -> set[str] | None: ... # undocumented -def addusersitepackages(known_paths: set[str] | None) -> set[str] | None: ... # undocumented -def check_enableusersite() -> bool | None: ... # undocumented - -if sys.version_info >= (3, 13): - def gethistoryfile() -> str: ... # undocumented - -def enablerlcompleter() -> None: ... # undocumented - -if sys.version_info >= (3, 13): - def register_readline() -> None: ... # undocumented - -def execsitecustomize() -> None: ... # undocumented -def execusercustomize() -> None: ... # undocumented -def getsitepackages(prefixes: Iterable[str] | None = None) -> list[str]: ... -def getuserbase() -> str: ... -def getusersitepackages() -> str: ... -def makepath(*paths: StrPath) -> tuple[str, str]: ... # undocumented -def removeduppaths() -> set[str]: ... # undocumented -def setcopyright() -> None: ... # undocumented -def sethelper() -> None: ... # undocumented -def setquit() -> None: ... # undocumented -def venv(known_paths: set[str] | None) -> set[str] | None: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/smtpd.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/smtpd.pyi deleted file mode 100644 index 7392bd5162..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/smtpd.pyi +++ /dev/null @@ -1,91 +0,0 @@ -import asynchat -import asyncore -import socket -import sys -from collections import defaultdict -from typing import Any -from typing_extensions import TypeAlias - -if sys.version_info >= (3, 11): - __all__ = ["SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy"] -else: - __all__ = ["SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy", "MailmanProxy"] - -_Address: TypeAlias = tuple[str, int] # (host, port) - -class SMTPChannel(asynchat.async_chat): - COMMAND: int - DATA: int - - command_size_limits: defaultdict[str, int] - smtp_server: SMTPServer - conn: socket.socket - addr: Any - received_lines: list[str] - smtp_state: int - seen_greeting: str - mailfrom: str - rcpttos: list[str] - received_data: str - fqdn: str - peer: str - - command_size_limit: int - data_size_limit: int - - enable_SMTPUTF8: bool - @property - def max_command_size_limit(self) -> int: ... - def __init__( - self, - server: SMTPServer, - conn: socket.socket, - addr: Any, - data_size_limit: int = 33554432, - map: asyncore._MapType | None = None, - enable_SMTPUTF8: bool = False, - decode_data: bool = False, - ) -> None: ... - # base asynchat.async_chat.push() accepts bytes - def push(self, msg: str) -> None: ... # type: ignore[override] - def collect_incoming_data(self, data: bytes) -> None: ... - def found_terminator(self) -> None: ... - def smtp_HELO(self, arg: str) -> None: ... - def smtp_NOOP(self, arg: str) -> None: ... - def smtp_QUIT(self, arg: str) -> None: ... - def smtp_MAIL(self, arg: str) -> None: ... - def smtp_RCPT(self, arg: str) -> None: ... - def smtp_RSET(self, arg: str) -> None: ... - def smtp_DATA(self, arg: str) -> None: ... - def smtp_EHLO(self, arg: str) -> None: ... - def smtp_HELP(self, arg: str) -> None: ... - def smtp_VRFY(self, arg: str) -> None: ... - def smtp_EXPN(self, arg: str) -> None: ... - -class SMTPServer(asyncore.dispatcher): - channel_class: type[SMTPChannel] - - data_size_limit: int - enable_SMTPUTF8: bool - def __init__( - self, - localaddr: _Address, - remoteaddr: _Address, - data_size_limit: int = 33554432, - map: asyncore._MapType | None = None, - enable_SMTPUTF8: bool = False, - decode_data: bool = False, - ) -> None: ... - def handle_accepted(self, conn: socket.socket, addr: Any) -> None: ... - def process_message( - self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str, **kwargs: Any - ) -> str | None: ... - -class DebuggingServer(SMTPServer): ... - -class PureProxy(SMTPServer): - def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str) -> str | None: ... # type: ignore[override] - -if sys.version_info < (3, 11): - class MailmanProxy(PureProxy): - def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str) -> str | None: ... # type: ignore[override] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/smtplib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/smtplib.pyi deleted file mode 100644 index 609b3e6426..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/smtplib.pyi +++ /dev/null @@ -1,195 +0,0 @@ -import sys -from _socket import _Address as _SourceAddress -from _typeshed import ReadableBuffer, SizedBuffer -from collections.abc import Sequence -from email.message import Message as _Message -from re import Pattern -from socket import socket -from ssl import SSLContext -from types import TracebackType -from typing import Any, Protocol, overload -from typing_extensions import Self, TypeAlias - -__all__ = [ - "SMTPException", - "SMTPServerDisconnected", - "SMTPResponseException", - "SMTPSenderRefused", - "SMTPRecipientsRefused", - "SMTPDataError", - "SMTPConnectError", - "SMTPHeloError", - "SMTPAuthenticationError", - "quoteaddr", - "quotedata", - "SMTP", - "SMTP_SSL", - "SMTPNotSupportedError", -] - -_Reply: TypeAlias = tuple[int, bytes] -_SendErrs: TypeAlias = dict[str, _Reply] - -SMTP_PORT: int -SMTP_SSL_PORT: int -CRLF: str -bCRLF: bytes - -OLDSTYLE_AUTH: Pattern[str] - -class SMTPException(OSError): ... -class SMTPNotSupportedError(SMTPException): ... -class SMTPServerDisconnected(SMTPException): ... - -class SMTPResponseException(SMTPException): - smtp_code: int - smtp_error: bytes | str - args: tuple[int, bytes | str] | tuple[int, bytes, str] - def __init__(self, code: int, msg: bytes | str) -> None: ... - -class SMTPSenderRefused(SMTPResponseException): - smtp_error: bytes - sender: str - args: tuple[int, bytes, str] - def __init__(self, code: int, msg: bytes, sender: str) -> None: ... - -class SMTPRecipientsRefused(SMTPException): - recipients: _SendErrs - args: tuple[_SendErrs] - def __init__(self, recipients: _SendErrs) -> None: ... - -class SMTPDataError(SMTPResponseException): ... -class SMTPConnectError(SMTPResponseException): ... -class SMTPHeloError(SMTPResponseException): ... -class SMTPAuthenticationError(SMTPResponseException): ... - -def quoteaddr(addrstring: str) -> str: ... -def quotedata(data: str) -> str: ... - -class _AuthObject(Protocol): - @overload - def __call__(self, challenge: None = None, /) -> str | None: ... - @overload - def __call__(self, challenge: bytes, /) -> str: ... - -class SMTP: - debuglevel: int - sock: socket | None - # Type of file should match what socket.makefile() returns - file: Any | None - helo_resp: bytes | None - ehlo_msg: str - ehlo_resp: bytes | None - does_esmtp: bool - default_port: int - timeout: float - esmtp_features: dict[str, str] - command_encoding: str - source_address: _SourceAddress | None - local_hostname: str - def __init__( - self, - host: str = "", - port: int = 0, - local_hostname: str | None = None, - timeout: float = ..., - source_address: _SourceAddress | None = None, - ) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None - ) -> None: ... - def set_debuglevel(self, debuglevel: int) -> None: ... - def connect(self, host: str = "localhost", port: int = 0, source_address: _SourceAddress | None = None) -> _Reply: ... - def send(self, s: ReadableBuffer | str) -> None: ... - def putcmd(self, cmd: str, args: str = "") -> None: ... - def getreply(self) -> _Reply: ... - def docmd(self, cmd: str, args: str = "") -> _Reply: ... - def helo(self, name: str = "") -> _Reply: ... - def ehlo(self, name: str = "") -> _Reply: ... - def has_extn(self, opt: str) -> bool: ... - def help(self, args: str = "") -> bytes: ... - def rset(self) -> _Reply: ... - def noop(self) -> _Reply: ... - def mail(self, sender: str, options: Sequence[str] = ()) -> _Reply: ... - def rcpt(self, recip: str, options: Sequence[str] = ()) -> _Reply: ... - def data(self, msg: ReadableBuffer | str) -> _Reply: ... - def verify(self, address: str) -> _Reply: ... - vrfy = verify - def expn(self, address: str) -> _Reply: ... - def ehlo_or_helo_if_needed(self) -> None: ... - user: str - password: str - def auth(self, mechanism: str, authobject: _AuthObject, *, initial_response_ok: bool = True) -> _Reply: ... - @overload - def auth_cram_md5(self, challenge: None = None) -> None: ... - @overload - def auth_cram_md5(self, challenge: ReadableBuffer) -> str: ... - def auth_plain(self, challenge: ReadableBuffer | None = None) -> str: ... - def auth_login(self, challenge: ReadableBuffer | None = None) -> str: ... - def login(self, user: str, password: str, *, initial_response_ok: bool = True) -> _Reply: ... - if sys.version_info >= (3, 12): - def starttls(self, *, context: SSLContext | None = None) -> _Reply: ... - else: - def starttls( - self, keyfile: str | None = None, certfile: str | None = None, context: SSLContext | None = None - ) -> _Reply: ... - - def sendmail( - self, - from_addr: str, - to_addrs: str | Sequence[str], - msg: SizedBuffer | str, - mail_options: Sequence[str] = (), - rcpt_options: Sequence[str] = (), - ) -> _SendErrs: ... - def send_message( - self, - msg: _Message, - from_addr: str | None = None, - to_addrs: str | Sequence[str] | None = None, - mail_options: Sequence[str] = (), - rcpt_options: Sequence[str] = (), - ) -> _SendErrs: ... - def close(self) -> None: ... - def quit(self) -> _Reply: ... - -class SMTP_SSL(SMTP): - keyfile: str | None - certfile: str | None - context: SSLContext - if sys.version_info >= (3, 12): - def __init__( - self, - host: str = "", - port: int = 0, - local_hostname: str | None = None, - *, - timeout: float = ..., - source_address: _SourceAddress | None = None, - context: SSLContext | None = None, - ) -> None: ... - else: - def __init__( - self, - host: str = "", - port: int = 0, - local_hostname: str | None = None, - keyfile: str | None = None, - certfile: str | None = None, - timeout: float = ..., - source_address: _SourceAddress | None = None, - context: SSLContext | None = None, - ) -> None: ... - -LMTP_PORT: int - -class LMTP(SMTP): - def __init__( - self, - host: str = "", - port: int = 2003, - local_hostname: str | None = None, - source_address: _SourceAddress | None = None, - timeout: float = ..., - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sndhdr.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sndhdr.pyi deleted file mode 100644 index f4d487607f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sndhdr.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from _typeshed import StrOrBytesPath -from typing import NamedTuple - -__all__ = ["what", "whathdr"] - -class SndHeaders(NamedTuple): - filetype: str - framerate: int - nchannels: int - nframes: int - sampwidth: int | str - -def what(filename: StrOrBytesPath) -> SndHeaders | None: ... -def whathdr(filename: StrOrBytesPath) -> SndHeaders | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/socket.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/socket.pyi deleted file mode 100644 index ff89dcc722..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/socket.pyi +++ /dev/null @@ -1,1396 +0,0 @@ -# Ideally, we'd just do "from _socket import *". Unfortunately, socket -# overrides some definitions from _socket incompatibly. mypy incorrectly -# prefers the definitions from _socket over those defined here. -import _socket -import sys -from _socket import ( - CAPI as CAPI, - EAI_AGAIN as EAI_AGAIN, - EAI_BADFLAGS as EAI_BADFLAGS, - EAI_FAIL as EAI_FAIL, - EAI_FAMILY as EAI_FAMILY, - EAI_MEMORY as EAI_MEMORY, - EAI_NODATA as EAI_NODATA, - EAI_NONAME as EAI_NONAME, - EAI_SERVICE as EAI_SERVICE, - EAI_SOCKTYPE as EAI_SOCKTYPE, - INADDR_ALLHOSTS_GROUP as INADDR_ALLHOSTS_GROUP, - INADDR_ANY as INADDR_ANY, - INADDR_BROADCAST as INADDR_BROADCAST, - INADDR_LOOPBACK as INADDR_LOOPBACK, - INADDR_MAX_LOCAL_GROUP as INADDR_MAX_LOCAL_GROUP, - INADDR_NONE as INADDR_NONE, - INADDR_UNSPEC_GROUP as INADDR_UNSPEC_GROUP, - IP_ADD_MEMBERSHIP as IP_ADD_MEMBERSHIP, - IP_DROP_MEMBERSHIP as IP_DROP_MEMBERSHIP, - IP_HDRINCL as IP_HDRINCL, - IP_MULTICAST_IF as IP_MULTICAST_IF, - IP_MULTICAST_LOOP as IP_MULTICAST_LOOP, - IP_MULTICAST_TTL as IP_MULTICAST_TTL, - IP_OPTIONS as IP_OPTIONS, - IP_TOS as IP_TOS, - IP_TTL as IP_TTL, - IPPORT_RESERVED as IPPORT_RESERVED, - IPPORT_USERRESERVED as IPPORT_USERRESERVED, - IPPROTO_AH as IPPROTO_AH, - IPPROTO_DSTOPTS as IPPROTO_DSTOPTS, - IPPROTO_EGP as IPPROTO_EGP, - IPPROTO_ESP as IPPROTO_ESP, - IPPROTO_FRAGMENT as IPPROTO_FRAGMENT, - IPPROTO_HOPOPTS as IPPROTO_HOPOPTS, - IPPROTO_ICMP as IPPROTO_ICMP, - IPPROTO_ICMPV6 as IPPROTO_ICMPV6, - IPPROTO_IDP as IPPROTO_IDP, - IPPROTO_IGMP as IPPROTO_IGMP, - IPPROTO_IP as IPPROTO_IP, - IPPROTO_IPV6 as IPPROTO_IPV6, - IPPROTO_NONE as IPPROTO_NONE, - IPPROTO_PIM as IPPROTO_PIM, - IPPROTO_PUP as IPPROTO_PUP, - IPPROTO_RAW as IPPROTO_RAW, - IPPROTO_ROUTING as IPPROTO_ROUTING, - IPPROTO_SCTP as IPPROTO_SCTP, - IPPROTO_TCP as IPPROTO_TCP, - IPPROTO_UDP as IPPROTO_UDP, - IPV6_CHECKSUM as IPV6_CHECKSUM, - IPV6_DONTFRAG as IPV6_DONTFRAG, - IPV6_HOPLIMIT as IPV6_HOPLIMIT, - IPV6_HOPOPTS as IPV6_HOPOPTS, - IPV6_JOIN_GROUP as IPV6_JOIN_GROUP, - IPV6_LEAVE_GROUP as IPV6_LEAVE_GROUP, - IPV6_MULTICAST_HOPS as IPV6_MULTICAST_HOPS, - IPV6_MULTICAST_IF as IPV6_MULTICAST_IF, - IPV6_MULTICAST_LOOP as IPV6_MULTICAST_LOOP, - IPV6_PKTINFO as IPV6_PKTINFO, - IPV6_RECVRTHDR as IPV6_RECVRTHDR, - IPV6_RECVTCLASS as IPV6_RECVTCLASS, - IPV6_RTHDR as IPV6_RTHDR, - IPV6_TCLASS as IPV6_TCLASS, - IPV6_UNICAST_HOPS as IPV6_UNICAST_HOPS, - IPV6_V6ONLY as IPV6_V6ONLY, - NI_DGRAM as NI_DGRAM, - NI_MAXHOST as NI_MAXHOST, - NI_MAXSERV as NI_MAXSERV, - NI_NAMEREQD as NI_NAMEREQD, - NI_NOFQDN as NI_NOFQDN, - NI_NUMERICHOST as NI_NUMERICHOST, - NI_NUMERICSERV as NI_NUMERICSERV, - SHUT_RD as SHUT_RD, - SHUT_RDWR as SHUT_RDWR, - SHUT_WR as SHUT_WR, - SO_ACCEPTCONN as SO_ACCEPTCONN, - SO_BROADCAST as SO_BROADCAST, - SO_DEBUG as SO_DEBUG, - SO_DONTROUTE as SO_DONTROUTE, - SO_ERROR as SO_ERROR, - SO_KEEPALIVE as SO_KEEPALIVE, - SO_LINGER as SO_LINGER, - SO_OOBINLINE as SO_OOBINLINE, - SO_RCVBUF as SO_RCVBUF, - SO_RCVLOWAT as SO_RCVLOWAT, - SO_RCVTIMEO as SO_RCVTIMEO, - SO_REUSEADDR as SO_REUSEADDR, - SO_SNDBUF as SO_SNDBUF, - SO_SNDLOWAT as SO_SNDLOWAT, - SO_SNDTIMEO as SO_SNDTIMEO, - SO_TYPE as SO_TYPE, - SOL_IP as SOL_IP, - SOL_SOCKET as SOL_SOCKET, - SOL_TCP as SOL_TCP, - SOL_UDP as SOL_UDP, - SOMAXCONN as SOMAXCONN, - TCP_FASTOPEN as TCP_FASTOPEN, - TCP_KEEPCNT as TCP_KEEPCNT, - TCP_KEEPINTVL as TCP_KEEPINTVL, - TCP_MAXSEG as TCP_MAXSEG, - TCP_NODELAY as TCP_NODELAY, - SocketType as SocketType, - _Address as _Address, - _RetAddress as _RetAddress, - close as close, - dup as dup, - getdefaulttimeout as getdefaulttimeout, - gethostbyaddr as gethostbyaddr, - gethostbyname as gethostbyname, - gethostbyname_ex as gethostbyname_ex, - gethostname as gethostname, - getnameinfo as getnameinfo, - getprotobyname as getprotobyname, - getservbyname as getservbyname, - getservbyport as getservbyport, - has_ipv6 as has_ipv6, - htonl as htonl, - htons as htons, - if_indextoname as if_indextoname, - if_nameindex as if_nameindex, - if_nametoindex as if_nametoindex, - inet_aton as inet_aton, - inet_ntoa as inet_ntoa, - inet_ntop as inet_ntop, - inet_pton as inet_pton, - ntohl as ntohl, - ntohs as ntohs, - setdefaulttimeout as setdefaulttimeout, -) -from _typeshed import ReadableBuffer, Unused, WriteableBuffer -from collections.abc import Iterable -from enum import IntEnum, IntFlag -from io import BufferedReader, BufferedRWPair, BufferedWriter, IOBase, RawIOBase, TextIOWrapper -from typing import Any, Literal, Protocol, SupportsIndex, overload -from typing_extensions import Self - -__all__ = [ - "fromfd", - "getfqdn", - "create_connection", - "create_server", - "has_dualstack_ipv6", - "AddressFamily", - "SocketKind", - "AF_APPLETALK", - "AF_DECnet", - "AF_INET", - "AF_INET6", - "AF_IPX", - "AF_SNA", - "AF_UNSPEC", - "AI_ADDRCONFIG", - "AI_ALL", - "AI_CANONNAME", - "AI_NUMERICHOST", - "AI_NUMERICSERV", - "AI_PASSIVE", - "AI_V4MAPPED", - "CAPI", - "EAI_AGAIN", - "EAI_BADFLAGS", - "EAI_FAIL", - "EAI_FAMILY", - "EAI_MEMORY", - "EAI_NODATA", - "EAI_NONAME", - "EAI_SERVICE", - "EAI_SOCKTYPE", - "INADDR_ALLHOSTS_GROUP", - "INADDR_ANY", - "INADDR_BROADCAST", - "INADDR_LOOPBACK", - "INADDR_MAX_LOCAL_GROUP", - "INADDR_NONE", - "INADDR_UNSPEC_GROUP", - "IPPORT_RESERVED", - "IPPORT_USERRESERVED", - "IPPROTO_AH", - "IPPROTO_DSTOPTS", - "IPPROTO_EGP", - "IPPROTO_ESP", - "IPPROTO_FRAGMENT", - "IPPROTO_HOPOPTS", - "IPPROTO_ICMP", - "IPPROTO_ICMPV6", - "IPPROTO_IDP", - "IPPROTO_IGMP", - "IPPROTO_IP", - "IPPROTO_IPV6", - "IPPROTO_NONE", - "IPPROTO_PIM", - "IPPROTO_PUP", - "IPPROTO_RAW", - "IPPROTO_ROUTING", - "IPPROTO_SCTP", - "IPPROTO_TCP", - "IPPROTO_UDP", - "IPV6_CHECKSUM", - "IPV6_DONTFRAG", - "IPV6_HOPLIMIT", - "IPV6_HOPOPTS", - "IPV6_JOIN_GROUP", - "IPV6_LEAVE_GROUP", - "IPV6_MULTICAST_HOPS", - "IPV6_MULTICAST_IF", - "IPV6_MULTICAST_LOOP", - "IPV6_PKTINFO", - "IPV6_RECVRTHDR", - "IPV6_RECVTCLASS", - "IPV6_RTHDR", - "IPV6_TCLASS", - "IPV6_UNICAST_HOPS", - "IPV6_V6ONLY", - "IP_ADD_MEMBERSHIP", - "IP_DROP_MEMBERSHIP", - "IP_HDRINCL", - "IP_MULTICAST_IF", - "IP_MULTICAST_LOOP", - "IP_MULTICAST_TTL", - "IP_OPTIONS", - "IP_TOS", - "IP_TTL", - "MSG_CTRUNC", - "MSG_DONTROUTE", - "MSG_OOB", - "MSG_PEEK", - "MSG_TRUNC", - "MSG_WAITALL", - "NI_DGRAM", - "NI_MAXHOST", - "NI_MAXSERV", - "NI_NAMEREQD", - "NI_NOFQDN", - "NI_NUMERICHOST", - "NI_NUMERICSERV", - "SHUT_RD", - "SHUT_RDWR", - "SHUT_WR", - "SOCK_DGRAM", - "SOCK_RAW", - "SOCK_RDM", - "SOCK_SEQPACKET", - "SOCK_STREAM", - "SOL_IP", - "SOL_SOCKET", - "SOL_TCP", - "SOL_UDP", - "SOMAXCONN", - "SO_ACCEPTCONN", - "SO_BROADCAST", - "SO_DEBUG", - "SO_DONTROUTE", - "SO_ERROR", - "SO_KEEPALIVE", - "SO_LINGER", - "SO_OOBINLINE", - "SO_RCVBUF", - "SO_RCVLOWAT", - "SO_RCVTIMEO", - "SO_REUSEADDR", - "SO_SNDBUF", - "SO_SNDLOWAT", - "SO_SNDTIMEO", - "SO_TYPE", - "SocketType", - "TCP_FASTOPEN", - "TCP_KEEPCNT", - "TCP_KEEPINTVL", - "TCP_MAXSEG", - "TCP_NODELAY", - "close", - "dup", - "error", - "gaierror", - "getaddrinfo", - "getdefaulttimeout", - "gethostbyaddr", - "gethostbyname", - "gethostbyname_ex", - "gethostname", - "getnameinfo", - "getprotobyname", - "getservbyname", - "getservbyport", - "has_ipv6", - "herror", - "htonl", - "htons", - "if_indextoname", - "if_nameindex", - "if_nametoindex", - "inet_aton", - "inet_ntoa", - "inet_ntop", - "inet_pton", - "ntohl", - "ntohs", - "setdefaulttimeout", - "socket", - "socketpair", - "timeout", -] - -if sys.platform == "win32": - from _socket import ( - IPPROTO_CBT as IPPROTO_CBT, - IPPROTO_ICLFXBM as IPPROTO_ICLFXBM, - IPPROTO_IGP as IPPROTO_IGP, - IPPROTO_L2TP as IPPROTO_L2TP, - IPPROTO_PGM as IPPROTO_PGM, - IPPROTO_RDP as IPPROTO_RDP, - IPPROTO_ST as IPPROTO_ST, - RCVALL_MAX as RCVALL_MAX, - RCVALL_OFF as RCVALL_OFF, - RCVALL_ON as RCVALL_ON, - RCVALL_SOCKETLEVELONLY as RCVALL_SOCKETLEVELONLY, - SIO_KEEPALIVE_VALS as SIO_KEEPALIVE_VALS, - SIO_LOOPBACK_FAST_PATH as SIO_LOOPBACK_FAST_PATH, - SIO_RCVALL as SIO_RCVALL, - SO_EXCLUSIVEADDRUSE as SO_EXCLUSIVEADDRUSE, - ) - - __all__ += [ - "IPPROTO_CBT", - "IPPROTO_ICLFXBM", - "IPPROTO_IGP", - "IPPROTO_L2TP", - "IPPROTO_PGM", - "IPPROTO_RDP", - "IPPROTO_ST", - "RCVALL_MAX", - "RCVALL_OFF", - "RCVALL_ON", - "RCVALL_SOCKETLEVELONLY", - "SIO_KEEPALIVE_VALS", - "SIO_LOOPBACK_FAST_PATH", - "SIO_RCVALL", - "SO_EXCLUSIVEADDRUSE", - "fromshare", - "errorTab", - "MSG_BCAST", - "MSG_MCAST", - ] - -if sys.platform == "darwin": - from _socket import PF_SYSTEM as PF_SYSTEM, SYSPROTO_CONTROL as SYSPROTO_CONTROL - - __all__ += ["PF_SYSTEM", "SYSPROTO_CONTROL", "AF_SYSTEM"] - -if sys.platform != "darwin": - from _socket import TCP_KEEPIDLE as TCP_KEEPIDLE - - __all__ += ["TCP_KEEPIDLE", "AF_IRDA", "MSG_ERRQUEUE"] - -if sys.version_info >= (3, 10): - from _socket import IP_RECVTOS as IP_RECVTOS - - __all__ += ["IP_RECVTOS"] - -if sys.platform != "win32" and sys.platform != "darwin": - from _socket import ( - IP_TRANSPARENT as IP_TRANSPARENT, - IPX_TYPE as IPX_TYPE, - SCM_CREDENTIALS as SCM_CREDENTIALS, - SO_DOMAIN as SO_DOMAIN, - SO_MARK as SO_MARK, - SO_PASSCRED as SO_PASSCRED, - SO_PASSSEC as SO_PASSSEC, - SO_PEERCRED as SO_PEERCRED, - SO_PEERSEC as SO_PEERSEC, - SO_PRIORITY as SO_PRIORITY, - SO_PROTOCOL as SO_PROTOCOL, - SOL_ATALK as SOL_ATALK, - SOL_AX25 as SOL_AX25, - SOL_HCI as SOL_HCI, - SOL_IPX as SOL_IPX, - SOL_NETROM as SOL_NETROM, - SOL_ROSE as SOL_ROSE, - TCP_CONGESTION as TCP_CONGESTION, - TCP_CORK as TCP_CORK, - TCP_DEFER_ACCEPT as TCP_DEFER_ACCEPT, - TCP_INFO as TCP_INFO, - TCP_LINGER2 as TCP_LINGER2, - TCP_QUICKACK as TCP_QUICKACK, - TCP_SYNCNT as TCP_SYNCNT, - TCP_USER_TIMEOUT as TCP_USER_TIMEOUT, - TCP_WINDOW_CLAMP as TCP_WINDOW_CLAMP, - ) - - __all__ += [ - "IP_TRANSPARENT", - "SCM_CREDENTIALS", - "SO_DOMAIN", - "SO_MARK", - "SO_PASSCRED", - "SO_PASSSEC", - "SO_PEERCRED", - "SO_PEERSEC", - "SO_PRIORITY", - "SO_PROTOCOL", - "TCP_CONGESTION", - "TCP_CORK", - "TCP_DEFER_ACCEPT", - "TCP_INFO", - "TCP_LINGER2", - "TCP_QUICKACK", - "TCP_SYNCNT", - "TCP_USER_TIMEOUT", - "TCP_WINDOW_CLAMP", - "AF_ASH", - "AF_ATMPVC", - "AF_ATMSVC", - "AF_AX25", - "AF_BRIDGE", - "AF_ECONET", - "AF_KEY", - "AF_LLC", - "AF_NETBEUI", - "AF_NETROM", - "AF_PPPOX", - "AF_ROSE", - "AF_SECURITY", - "AF_WANPIPE", - "AF_X25", - "MSG_CMSG_CLOEXEC", - "MSG_CONFIRM", - "MSG_FASTOPEN", - "MSG_MORE", - ] - -if sys.platform != "win32" and sys.platform != "darwin" and sys.version_info >= (3, 11): - from _socket import IP_BIND_ADDRESS_NO_PORT as IP_BIND_ADDRESS_NO_PORT - - __all__ += ["IP_BIND_ADDRESS_NO_PORT"] - -if sys.platform != "win32": - from _socket import ( - CMSG_LEN as CMSG_LEN, - CMSG_SPACE as CMSG_SPACE, - EAI_ADDRFAMILY as EAI_ADDRFAMILY, - EAI_OVERFLOW as EAI_OVERFLOW, - EAI_SYSTEM as EAI_SYSTEM, - IP_DEFAULT_MULTICAST_LOOP as IP_DEFAULT_MULTICAST_LOOP, - IP_DEFAULT_MULTICAST_TTL as IP_DEFAULT_MULTICAST_TTL, - IP_MAX_MEMBERSHIPS as IP_MAX_MEMBERSHIPS, - IP_RECVOPTS as IP_RECVOPTS, - IP_RECVRETOPTS as IP_RECVRETOPTS, - IP_RETOPTS as IP_RETOPTS, - IPPROTO_GRE as IPPROTO_GRE, - IPPROTO_IPIP as IPPROTO_IPIP, - IPPROTO_RSVP as IPPROTO_RSVP, - IPPROTO_TP as IPPROTO_TP, - IPV6_RTHDR_TYPE_0 as IPV6_RTHDR_TYPE_0, - SCM_RIGHTS as SCM_RIGHTS, - SO_REUSEPORT as SO_REUSEPORT, - TCP_NOTSENT_LOWAT as TCP_NOTSENT_LOWAT, - sethostname as sethostname, - ) - - __all__ += [ - "CMSG_LEN", - "CMSG_SPACE", - "EAI_ADDRFAMILY", - "EAI_OVERFLOW", - "EAI_SYSTEM", - "IP_DEFAULT_MULTICAST_LOOP", - "IP_DEFAULT_MULTICAST_TTL", - "IP_MAX_MEMBERSHIPS", - "IP_RECVOPTS", - "IP_RECVRETOPTS", - "IP_RETOPTS", - "IPPROTO_GRE", - "IPPROTO_IPIP", - "IPPROTO_RSVP", - "IPPROTO_TP", - "IPV6_RTHDR_TYPE_0", - "SCM_RIGHTS", - "SO_REUSEPORT", - "TCP_NOTSENT_LOWAT", - "sethostname", - "AF_ROUTE", - "AF_UNIX", - "MSG_DONTWAIT", - "MSG_EOR", - "MSG_NOSIGNAL", - ] - - from _socket import ( - IPV6_DSTOPTS as IPV6_DSTOPTS, - IPV6_NEXTHOP as IPV6_NEXTHOP, - IPV6_PATHMTU as IPV6_PATHMTU, - IPV6_RECVDSTOPTS as IPV6_RECVDSTOPTS, - IPV6_RECVHOPLIMIT as IPV6_RECVHOPLIMIT, - IPV6_RECVHOPOPTS as IPV6_RECVHOPOPTS, - IPV6_RECVPATHMTU as IPV6_RECVPATHMTU, - IPV6_RECVPKTINFO as IPV6_RECVPKTINFO, - IPV6_RTHDRDSTOPTS as IPV6_RTHDRDSTOPTS, - ) - - __all__ += [ - "IPV6_DSTOPTS", - "IPV6_NEXTHOP", - "IPV6_PATHMTU", - "IPV6_RECVDSTOPTS", - "IPV6_RECVHOPLIMIT", - "IPV6_RECVHOPOPTS", - "IPV6_RECVPATHMTU", - "IPV6_RECVPKTINFO", - "IPV6_RTHDRDSTOPTS", - ] - - if sys.platform != "darwin" or sys.version_info >= (3, 13): - from _socket import SO_BINDTODEVICE as SO_BINDTODEVICE - - __all__ += ["SO_BINDTODEVICE"] - -if sys.platform != "darwin" and sys.platform != "linux": - from _socket import BDADDR_ANY as BDADDR_ANY, BDADDR_LOCAL as BDADDR_LOCAL, BTPROTO_RFCOMM as BTPROTO_RFCOMM - - __all__ += ["BDADDR_ANY", "BDADDR_LOCAL", "BTPROTO_RFCOMM"] - -if sys.platform == "darwin" and sys.version_info >= (3, 10): - from _socket import TCP_KEEPALIVE as TCP_KEEPALIVE - - __all__ += ["TCP_KEEPALIVE"] - -if sys.platform == "darwin" and sys.version_info >= (3, 11): - from _socket import TCP_CONNECTION_INFO as TCP_CONNECTION_INFO - - __all__ += ["TCP_CONNECTION_INFO"] - -if sys.platform == "linux": - from _socket import ( - ALG_OP_DECRYPT as ALG_OP_DECRYPT, - ALG_OP_ENCRYPT as ALG_OP_ENCRYPT, - ALG_OP_SIGN as ALG_OP_SIGN, - ALG_OP_VERIFY as ALG_OP_VERIFY, - ALG_SET_AEAD_ASSOCLEN as ALG_SET_AEAD_ASSOCLEN, - ALG_SET_AEAD_AUTHSIZE as ALG_SET_AEAD_AUTHSIZE, - ALG_SET_IV as ALG_SET_IV, - ALG_SET_KEY as ALG_SET_KEY, - ALG_SET_OP as ALG_SET_OP, - ALG_SET_PUBKEY as ALG_SET_PUBKEY, - CAN_BCM as CAN_BCM, - CAN_BCM_CAN_FD_FRAME as CAN_BCM_CAN_FD_FRAME, - CAN_BCM_RX_ANNOUNCE_RESUME as CAN_BCM_RX_ANNOUNCE_RESUME, - CAN_BCM_RX_CHANGED as CAN_BCM_RX_CHANGED, - CAN_BCM_RX_CHECK_DLC as CAN_BCM_RX_CHECK_DLC, - CAN_BCM_RX_DELETE as CAN_BCM_RX_DELETE, - CAN_BCM_RX_FILTER_ID as CAN_BCM_RX_FILTER_ID, - CAN_BCM_RX_NO_AUTOTIMER as CAN_BCM_RX_NO_AUTOTIMER, - CAN_BCM_RX_READ as CAN_BCM_RX_READ, - CAN_BCM_RX_RTR_FRAME as CAN_BCM_RX_RTR_FRAME, - CAN_BCM_RX_SETUP as CAN_BCM_RX_SETUP, - CAN_BCM_RX_STATUS as CAN_BCM_RX_STATUS, - CAN_BCM_RX_TIMEOUT as CAN_BCM_RX_TIMEOUT, - CAN_BCM_SETTIMER as CAN_BCM_SETTIMER, - CAN_BCM_STARTTIMER as CAN_BCM_STARTTIMER, - CAN_BCM_TX_ANNOUNCE as CAN_BCM_TX_ANNOUNCE, - CAN_BCM_TX_COUNTEVT as CAN_BCM_TX_COUNTEVT, - CAN_BCM_TX_CP_CAN_ID as CAN_BCM_TX_CP_CAN_ID, - CAN_BCM_TX_DELETE as CAN_BCM_TX_DELETE, - CAN_BCM_TX_EXPIRED as CAN_BCM_TX_EXPIRED, - CAN_BCM_TX_READ as CAN_BCM_TX_READ, - CAN_BCM_TX_RESET_MULTI_IDX as CAN_BCM_TX_RESET_MULTI_IDX, - CAN_BCM_TX_SEND as CAN_BCM_TX_SEND, - CAN_BCM_TX_SETUP as CAN_BCM_TX_SETUP, - CAN_BCM_TX_STATUS as CAN_BCM_TX_STATUS, - CAN_EFF_FLAG as CAN_EFF_FLAG, - CAN_EFF_MASK as CAN_EFF_MASK, - CAN_ERR_FLAG as CAN_ERR_FLAG, - CAN_ERR_MASK as CAN_ERR_MASK, - CAN_ISOTP as CAN_ISOTP, - CAN_RAW as CAN_RAW, - CAN_RAW_FD_FRAMES as CAN_RAW_FD_FRAMES, - CAN_RAW_FILTER as CAN_RAW_FILTER, - CAN_RAW_LOOPBACK as CAN_RAW_LOOPBACK, - CAN_RAW_RECV_OWN_MSGS as CAN_RAW_RECV_OWN_MSGS, - CAN_RTR_FLAG as CAN_RTR_FLAG, - CAN_SFF_MASK as CAN_SFF_MASK, - IOCTL_VM_SOCKETS_GET_LOCAL_CID as IOCTL_VM_SOCKETS_GET_LOCAL_CID, - NETLINK_CRYPTO as NETLINK_CRYPTO, - NETLINK_DNRTMSG as NETLINK_DNRTMSG, - NETLINK_FIREWALL as NETLINK_FIREWALL, - NETLINK_IP6_FW as NETLINK_IP6_FW, - NETLINK_NFLOG as NETLINK_NFLOG, - NETLINK_ROUTE as NETLINK_ROUTE, - NETLINK_USERSOCK as NETLINK_USERSOCK, - NETLINK_XFRM as NETLINK_XFRM, - PACKET_BROADCAST as PACKET_BROADCAST, - PACKET_FASTROUTE as PACKET_FASTROUTE, - PACKET_HOST as PACKET_HOST, - PACKET_LOOPBACK as PACKET_LOOPBACK, - PACKET_MULTICAST as PACKET_MULTICAST, - PACKET_OTHERHOST as PACKET_OTHERHOST, - PACKET_OUTGOING as PACKET_OUTGOING, - PF_CAN as PF_CAN, - PF_PACKET as PF_PACKET, - PF_RDS as PF_RDS, - RDS_CANCEL_SENT_TO as RDS_CANCEL_SENT_TO, - RDS_CMSG_RDMA_ARGS as RDS_CMSG_RDMA_ARGS, - RDS_CMSG_RDMA_DEST as RDS_CMSG_RDMA_DEST, - RDS_CMSG_RDMA_MAP as RDS_CMSG_RDMA_MAP, - RDS_CMSG_RDMA_STATUS as RDS_CMSG_RDMA_STATUS, - RDS_CONG_MONITOR as RDS_CONG_MONITOR, - RDS_FREE_MR as RDS_FREE_MR, - RDS_GET_MR as RDS_GET_MR, - RDS_GET_MR_FOR_DEST as RDS_GET_MR_FOR_DEST, - RDS_RDMA_DONTWAIT as RDS_RDMA_DONTWAIT, - RDS_RDMA_FENCE as RDS_RDMA_FENCE, - RDS_RDMA_INVALIDATE as RDS_RDMA_INVALIDATE, - RDS_RDMA_NOTIFY_ME as RDS_RDMA_NOTIFY_ME, - RDS_RDMA_READWRITE as RDS_RDMA_READWRITE, - RDS_RDMA_SILENT as RDS_RDMA_SILENT, - RDS_RDMA_USE_ONCE as RDS_RDMA_USE_ONCE, - RDS_RECVERR as RDS_RECVERR, - SO_VM_SOCKETS_BUFFER_MAX_SIZE as SO_VM_SOCKETS_BUFFER_MAX_SIZE, - SO_VM_SOCKETS_BUFFER_MIN_SIZE as SO_VM_SOCKETS_BUFFER_MIN_SIZE, - SO_VM_SOCKETS_BUFFER_SIZE as SO_VM_SOCKETS_BUFFER_SIZE, - SOL_ALG as SOL_ALG, - SOL_CAN_BASE as SOL_CAN_BASE, - SOL_CAN_RAW as SOL_CAN_RAW, - SOL_RDS as SOL_RDS, - SOL_TIPC as SOL_TIPC, - TIPC_ADDR_ID as TIPC_ADDR_ID, - TIPC_ADDR_NAME as TIPC_ADDR_NAME, - TIPC_ADDR_NAMESEQ as TIPC_ADDR_NAMESEQ, - TIPC_CFG_SRV as TIPC_CFG_SRV, - TIPC_CLUSTER_SCOPE as TIPC_CLUSTER_SCOPE, - TIPC_CONN_TIMEOUT as TIPC_CONN_TIMEOUT, - TIPC_CRITICAL_IMPORTANCE as TIPC_CRITICAL_IMPORTANCE, - TIPC_DEST_DROPPABLE as TIPC_DEST_DROPPABLE, - TIPC_HIGH_IMPORTANCE as TIPC_HIGH_IMPORTANCE, - TIPC_IMPORTANCE as TIPC_IMPORTANCE, - TIPC_LOW_IMPORTANCE as TIPC_LOW_IMPORTANCE, - TIPC_MEDIUM_IMPORTANCE as TIPC_MEDIUM_IMPORTANCE, - TIPC_NODE_SCOPE as TIPC_NODE_SCOPE, - TIPC_PUBLISHED as TIPC_PUBLISHED, - TIPC_SRC_DROPPABLE as TIPC_SRC_DROPPABLE, - TIPC_SUB_CANCEL as TIPC_SUB_CANCEL, - TIPC_SUB_PORTS as TIPC_SUB_PORTS, - TIPC_SUB_SERVICE as TIPC_SUB_SERVICE, - TIPC_SUBSCR_TIMEOUT as TIPC_SUBSCR_TIMEOUT, - TIPC_TOP_SRV as TIPC_TOP_SRV, - TIPC_WAIT_FOREVER as TIPC_WAIT_FOREVER, - TIPC_WITHDRAWN as TIPC_WITHDRAWN, - TIPC_ZONE_SCOPE as TIPC_ZONE_SCOPE, - VM_SOCKETS_INVALID_VERSION as VM_SOCKETS_INVALID_VERSION, - VMADDR_CID_ANY as VMADDR_CID_ANY, - VMADDR_CID_HOST as VMADDR_CID_HOST, - VMADDR_PORT_ANY as VMADDR_PORT_ANY, - ) - - __all__ += [ - "ALG_OP_DECRYPT", - "ALG_OP_ENCRYPT", - "ALG_OP_SIGN", - "ALG_OP_VERIFY", - "ALG_SET_AEAD_ASSOCLEN", - "ALG_SET_AEAD_AUTHSIZE", - "ALG_SET_IV", - "ALG_SET_KEY", - "ALG_SET_OP", - "ALG_SET_PUBKEY", - "CAN_BCM", - "CAN_BCM_CAN_FD_FRAME", - "CAN_BCM_RX_ANNOUNCE_RESUME", - "CAN_BCM_RX_CHANGED", - "CAN_BCM_RX_CHECK_DLC", - "CAN_BCM_RX_DELETE", - "CAN_BCM_RX_FILTER_ID", - "CAN_BCM_RX_NO_AUTOTIMER", - "CAN_BCM_RX_READ", - "CAN_BCM_RX_RTR_FRAME", - "CAN_BCM_RX_SETUP", - "CAN_BCM_RX_STATUS", - "CAN_BCM_RX_TIMEOUT", - "CAN_BCM_SETTIMER", - "CAN_BCM_STARTTIMER", - "CAN_BCM_TX_ANNOUNCE", - "CAN_BCM_TX_COUNTEVT", - "CAN_BCM_TX_CP_CAN_ID", - "CAN_BCM_TX_DELETE", - "CAN_BCM_TX_EXPIRED", - "CAN_BCM_TX_READ", - "CAN_BCM_TX_RESET_MULTI_IDX", - "CAN_BCM_TX_SEND", - "CAN_BCM_TX_SETUP", - "CAN_BCM_TX_STATUS", - "CAN_EFF_FLAG", - "CAN_EFF_MASK", - "CAN_ERR_FLAG", - "CAN_ERR_MASK", - "CAN_ISOTP", - "CAN_RAW", - "CAN_RAW_FD_FRAMES", - "CAN_RAW_FILTER", - "CAN_RAW_LOOPBACK", - "CAN_RAW_RECV_OWN_MSGS", - "CAN_RTR_FLAG", - "CAN_SFF_MASK", - "IOCTL_VM_SOCKETS_GET_LOCAL_CID", - "NETLINK_CRYPTO", - "NETLINK_DNRTMSG", - "NETLINK_FIREWALL", - "NETLINK_IP6_FW", - "NETLINK_NFLOG", - "NETLINK_ROUTE", - "NETLINK_USERSOCK", - "NETLINK_XFRM", - "PACKET_BROADCAST", - "PACKET_FASTROUTE", - "PACKET_HOST", - "PACKET_LOOPBACK", - "PACKET_MULTICAST", - "PACKET_OTHERHOST", - "PACKET_OUTGOING", - "PF_CAN", - "PF_PACKET", - "PF_RDS", - "SO_VM_SOCKETS_BUFFER_MAX_SIZE", - "SO_VM_SOCKETS_BUFFER_MIN_SIZE", - "SO_VM_SOCKETS_BUFFER_SIZE", - "SOL_ALG", - "SOL_CAN_BASE", - "SOL_CAN_RAW", - "SOL_RDS", - "SOL_TIPC", - "TIPC_ADDR_ID", - "TIPC_ADDR_NAME", - "TIPC_ADDR_NAMESEQ", - "TIPC_CFG_SRV", - "TIPC_CLUSTER_SCOPE", - "TIPC_CONN_TIMEOUT", - "TIPC_CRITICAL_IMPORTANCE", - "TIPC_DEST_DROPPABLE", - "TIPC_HIGH_IMPORTANCE", - "TIPC_IMPORTANCE", - "TIPC_LOW_IMPORTANCE", - "TIPC_MEDIUM_IMPORTANCE", - "TIPC_NODE_SCOPE", - "TIPC_PUBLISHED", - "TIPC_SRC_DROPPABLE", - "TIPC_SUB_CANCEL", - "TIPC_SUB_PORTS", - "TIPC_SUB_SERVICE", - "TIPC_SUBSCR_TIMEOUT", - "TIPC_TOP_SRV", - "TIPC_WAIT_FOREVER", - "TIPC_WITHDRAWN", - "TIPC_ZONE_SCOPE", - "VM_SOCKETS_INVALID_VERSION", - "VMADDR_CID_ANY", - "VMADDR_CID_HOST", - "VMADDR_PORT_ANY", - "AF_CAN", - "AF_PACKET", - "AF_RDS", - "AF_TIPC", - "AF_ALG", - "AF_NETLINK", - "AF_VSOCK", - "AF_QIPCRTR", - "SOCK_CLOEXEC", - "SOCK_NONBLOCK", - ] - - if sys.version_info < (3, 11): - from _socket import CAN_RAW_ERR_FILTER as CAN_RAW_ERR_FILTER - - __all__ += ["CAN_RAW_ERR_FILTER"] - -if sys.platform == "linux": - from _socket import ( - CAN_J1939 as CAN_J1939, - CAN_RAW_JOIN_FILTERS as CAN_RAW_JOIN_FILTERS, - IPPROTO_UDPLITE as IPPROTO_UDPLITE, - J1939_EE_INFO_NONE as J1939_EE_INFO_NONE, - J1939_EE_INFO_TX_ABORT as J1939_EE_INFO_TX_ABORT, - J1939_FILTER_MAX as J1939_FILTER_MAX, - J1939_IDLE_ADDR as J1939_IDLE_ADDR, - J1939_MAX_UNICAST_ADDR as J1939_MAX_UNICAST_ADDR, - J1939_NLA_BYTES_ACKED as J1939_NLA_BYTES_ACKED, - J1939_NLA_PAD as J1939_NLA_PAD, - J1939_NO_ADDR as J1939_NO_ADDR, - J1939_NO_NAME as J1939_NO_NAME, - J1939_NO_PGN as J1939_NO_PGN, - J1939_PGN_ADDRESS_CLAIMED as J1939_PGN_ADDRESS_CLAIMED, - J1939_PGN_ADDRESS_COMMANDED as J1939_PGN_ADDRESS_COMMANDED, - J1939_PGN_MAX as J1939_PGN_MAX, - J1939_PGN_PDU1_MAX as J1939_PGN_PDU1_MAX, - J1939_PGN_REQUEST as J1939_PGN_REQUEST, - SCM_J1939_DEST_ADDR as SCM_J1939_DEST_ADDR, - SCM_J1939_DEST_NAME as SCM_J1939_DEST_NAME, - SCM_J1939_ERRQUEUE as SCM_J1939_ERRQUEUE, - SCM_J1939_PRIO as SCM_J1939_PRIO, - SO_J1939_ERRQUEUE as SO_J1939_ERRQUEUE, - SO_J1939_FILTER as SO_J1939_FILTER, - SO_J1939_PROMISC as SO_J1939_PROMISC, - SO_J1939_SEND_PRIO as SO_J1939_SEND_PRIO, - UDPLITE_RECV_CSCOV as UDPLITE_RECV_CSCOV, - UDPLITE_SEND_CSCOV as UDPLITE_SEND_CSCOV, - ) - - __all__ += [ - "CAN_J1939", - "CAN_RAW_JOIN_FILTERS", - "IPPROTO_UDPLITE", - "J1939_EE_INFO_NONE", - "J1939_EE_INFO_TX_ABORT", - "J1939_FILTER_MAX", - "J1939_IDLE_ADDR", - "J1939_MAX_UNICAST_ADDR", - "J1939_NLA_BYTES_ACKED", - "J1939_NLA_PAD", - "J1939_NO_ADDR", - "J1939_NO_NAME", - "J1939_NO_PGN", - "J1939_PGN_ADDRESS_CLAIMED", - "J1939_PGN_ADDRESS_COMMANDED", - "J1939_PGN_MAX", - "J1939_PGN_PDU1_MAX", - "J1939_PGN_REQUEST", - "SCM_J1939_DEST_ADDR", - "SCM_J1939_DEST_NAME", - "SCM_J1939_ERRQUEUE", - "SCM_J1939_PRIO", - "SO_J1939_ERRQUEUE", - "SO_J1939_FILTER", - "SO_J1939_PROMISC", - "SO_J1939_SEND_PRIO", - "UDPLITE_RECV_CSCOV", - "UDPLITE_SEND_CSCOV", - ] -if sys.platform == "linux" and sys.version_info >= (3, 10): - from _socket import IPPROTO_MPTCP as IPPROTO_MPTCP - - __all__ += ["IPPROTO_MPTCP"] -if sys.platform == "linux" and sys.version_info >= (3, 11): - from _socket import SO_INCOMING_CPU as SO_INCOMING_CPU - - __all__ += ["SO_INCOMING_CPU"] -if sys.platform == "linux" and sys.version_info >= (3, 12): - from _socket import ( - TCP_CC_INFO as TCP_CC_INFO, - TCP_FASTOPEN_CONNECT as TCP_FASTOPEN_CONNECT, - TCP_FASTOPEN_KEY as TCP_FASTOPEN_KEY, - TCP_FASTOPEN_NO_COOKIE as TCP_FASTOPEN_NO_COOKIE, - TCP_INQ as TCP_INQ, - TCP_MD5SIG as TCP_MD5SIG, - TCP_MD5SIG_EXT as TCP_MD5SIG_EXT, - TCP_QUEUE_SEQ as TCP_QUEUE_SEQ, - TCP_REPAIR as TCP_REPAIR, - TCP_REPAIR_OPTIONS as TCP_REPAIR_OPTIONS, - TCP_REPAIR_QUEUE as TCP_REPAIR_QUEUE, - TCP_REPAIR_WINDOW as TCP_REPAIR_WINDOW, - TCP_SAVE_SYN as TCP_SAVE_SYN, - TCP_SAVED_SYN as TCP_SAVED_SYN, - TCP_THIN_DUPACK as TCP_THIN_DUPACK, - TCP_THIN_LINEAR_TIMEOUTS as TCP_THIN_LINEAR_TIMEOUTS, - TCP_TIMESTAMP as TCP_TIMESTAMP, - TCP_TX_DELAY as TCP_TX_DELAY, - TCP_ULP as TCP_ULP, - TCP_ZEROCOPY_RECEIVE as TCP_ZEROCOPY_RECEIVE, - ) - - __all__ += [ - "TCP_CC_INFO", - "TCP_FASTOPEN_CONNECT", - "TCP_FASTOPEN_KEY", - "TCP_FASTOPEN_NO_COOKIE", - "TCP_INQ", - "TCP_MD5SIG", - "TCP_MD5SIG_EXT", - "TCP_QUEUE_SEQ", - "TCP_REPAIR", - "TCP_REPAIR_OPTIONS", - "TCP_REPAIR_QUEUE", - "TCP_REPAIR_WINDOW", - "TCP_SAVED_SYN", - "TCP_SAVE_SYN", - "TCP_THIN_DUPACK", - "TCP_THIN_LINEAR_TIMEOUTS", - "TCP_TIMESTAMP", - "TCP_TX_DELAY", - "TCP_ULP", - "TCP_ZEROCOPY_RECEIVE", - ] - -if sys.platform == "linux" and sys.version_info >= (3, 13): - from _socket import NI_IDN as NI_IDN, SO_BINDTOIFINDEX as SO_BINDTOIFINDEX - - __all__ += ["NI_IDN", "SO_BINDTOIFINDEX"] - -if sys.version_info >= (3, 12): - from _socket import ( - IP_ADD_SOURCE_MEMBERSHIP as IP_ADD_SOURCE_MEMBERSHIP, - IP_BLOCK_SOURCE as IP_BLOCK_SOURCE, - IP_DROP_SOURCE_MEMBERSHIP as IP_DROP_SOURCE_MEMBERSHIP, - IP_PKTINFO as IP_PKTINFO, - IP_UNBLOCK_SOURCE as IP_UNBLOCK_SOURCE, - ) - - __all__ += ["IP_ADD_SOURCE_MEMBERSHIP", "IP_BLOCK_SOURCE", "IP_DROP_SOURCE_MEMBERSHIP", "IP_PKTINFO", "IP_UNBLOCK_SOURCE"] - - if sys.platform == "win32": - from _socket import ( - HV_GUID_BROADCAST as HV_GUID_BROADCAST, - HV_GUID_CHILDREN as HV_GUID_CHILDREN, - HV_GUID_LOOPBACK as HV_GUID_LOOPBACK, - HV_GUID_PARENT as HV_GUID_PARENT, - HV_GUID_WILDCARD as HV_GUID_WILDCARD, - HV_GUID_ZERO as HV_GUID_ZERO, - HV_PROTOCOL_RAW as HV_PROTOCOL_RAW, - HVSOCKET_ADDRESS_FLAG_PASSTHRU as HVSOCKET_ADDRESS_FLAG_PASSTHRU, - HVSOCKET_CONNECT_TIMEOUT as HVSOCKET_CONNECT_TIMEOUT, - HVSOCKET_CONNECT_TIMEOUT_MAX as HVSOCKET_CONNECT_TIMEOUT_MAX, - HVSOCKET_CONNECTED_SUSPEND as HVSOCKET_CONNECTED_SUSPEND, - ) - - __all__ += [ - "HV_GUID_BROADCAST", - "HV_GUID_CHILDREN", - "HV_GUID_LOOPBACK", - "HV_GUID_PARENT", - "HV_GUID_WILDCARD", - "HV_GUID_ZERO", - "HV_PROTOCOL_RAW", - "HVSOCKET_ADDRESS_FLAG_PASSTHRU", - "HVSOCKET_CONNECT_TIMEOUT", - "HVSOCKET_CONNECT_TIMEOUT_MAX", - "HVSOCKET_CONNECTED_SUSPEND", - ] - else: - from _socket import ( - ETHERTYPE_ARP as ETHERTYPE_ARP, - ETHERTYPE_IP as ETHERTYPE_IP, - ETHERTYPE_IPV6 as ETHERTYPE_IPV6, - ETHERTYPE_VLAN as ETHERTYPE_VLAN, - ) - - __all__ += ["ETHERTYPE_ARP", "ETHERTYPE_IP", "ETHERTYPE_IPV6", "ETHERTYPE_VLAN"] - - if sys.platform == "linux": - from _socket import ETH_P_ALL as ETH_P_ALL - - __all__ += ["ETH_P_ALL"] - - if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin": - # FreeBSD >= 14.0 - from _socket import PF_DIVERT as PF_DIVERT - - __all__ += ["PF_DIVERT", "AF_DIVERT"] - -if sys.platform != "win32": - __all__ += ["send_fds", "recv_fds"] - -if sys.platform != "linux": - __all__ += ["AF_LINK"] -if sys.platform != "darwin" and sys.platform != "linux": - __all__ += ["AF_BLUETOOTH"] - -if sys.platform == "win32" and sys.version_info >= (3, 12): - __all__ += ["AF_HYPERV"] - -if sys.platform != "win32" and sys.platform != "linux": - from _socket import ( - EAI_BADHINTS as EAI_BADHINTS, - EAI_MAX as EAI_MAX, - EAI_PROTOCOL as EAI_PROTOCOL, - IPPROTO_EON as IPPROTO_EON, - IPPROTO_HELLO as IPPROTO_HELLO, - IPPROTO_IPCOMP as IPPROTO_IPCOMP, - IPPROTO_XTP as IPPROTO_XTP, - IPV6_USE_MIN_MTU as IPV6_USE_MIN_MTU, - LOCAL_PEERCRED as LOCAL_PEERCRED, - SCM_CREDS as SCM_CREDS, - ) - - __all__ += [ - "EAI_BADHINTS", - "EAI_MAX", - "EAI_PROTOCOL", - "IPPROTO_EON", - "IPPROTO_HELLO", - "IPPROTO_IPCOMP", - "IPPROTO_XTP", - "IPV6_USE_MIN_MTU", - "LOCAL_PEERCRED", - "SCM_CREDS", - "AI_DEFAULT", - "AI_MASK", - "AI_V4MAPPED_CFG", - "MSG_EOF", - ] - -if sys.platform != "win32" and sys.platform != "darwin" and sys.platform != "linux": - from _socket import ( - IPPROTO_BIP as IPPROTO_BIP, - IPPROTO_MOBILE as IPPROTO_MOBILE, - IPPROTO_VRRP as IPPROTO_VRRP, - MSG_BTAG as MSG_BTAG, - MSG_ETAG as MSG_ETAG, - SO_SETFIB as SO_SETFIB, - ) - - __all__ += ["SO_SETFIB", "MSG_BTAG", "MSG_ETAG", "IPPROTO_BIP", "IPPROTO_MOBILE", "IPPROTO_VRRP", "MSG_NOTIFICATION"] - -if sys.platform != "linux": - from _socket import ( - IP_RECVDSTADDR as IP_RECVDSTADDR, - IPPROTO_GGP as IPPROTO_GGP, - IPPROTO_IPV4 as IPPROTO_IPV4, - IPPROTO_MAX as IPPROTO_MAX, - IPPROTO_ND as IPPROTO_ND, - SO_USELOOPBACK as SO_USELOOPBACK, - ) - - __all__ += ["IPPROTO_GGP", "IPPROTO_IPV4", "IPPROTO_MAX", "IPPROTO_ND", "IP_RECVDSTADDR", "SO_USELOOPBACK"] - -# Re-exported from errno -EBADF: int -EAGAIN: int -EWOULDBLOCK: int - -# These errors are implemented in _socket at runtime -# but they consider themselves to live in socket so we'll put them here. -error = OSError - -class herror(error): ... -class gaierror(error): ... - -if sys.version_info >= (3, 10): - timeout = TimeoutError -else: - class timeout(error): ... - -class AddressFamily(IntEnum): - AF_INET = 2 - AF_INET6 = 10 - AF_APPLETALK = 5 - AF_IPX = 4 - AF_SNA = 22 - AF_UNSPEC = 0 - if sys.platform != "darwin": - AF_IRDA = 23 - if sys.platform != "win32": - AF_ROUTE = 16 - AF_UNIX = 1 - if sys.platform == "darwin": - AF_SYSTEM = 32 - if sys.platform != "win32" and sys.platform != "darwin": - AF_ASH = 18 - AF_ATMPVC = 8 - AF_ATMSVC = 20 - AF_AX25 = 3 - AF_BRIDGE = 7 - AF_ECONET = 19 - AF_KEY = 15 - AF_LLC = 26 - AF_NETBEUI = 13 - AF_NETROM = 6 - AF_PPPOX = 24 - AF_ROSE = 11 - AF_SECURITY = 14 - AF_WANPIPE = 25 - AF_X25 = 9 - if sys.platform == "linux": - AF_CAN = 29 - AF_PACKET = 17 - AF_RDS = 21 - AF_TIPC = 30 - AF_ALG = 38 - AF_NETLINK = 16 - AF_VSOCK = 40 - AF_QIPCRTR = 42 - if sys.platform != "linux": - AF_LINK = 33 - if sys.platform != "darwin" and sys.platform != "linux": - AF_BLUETOOTH = 32 - if sys.platform == "win32" and sys.version_info >= (3, 12): - AF_HYPERV = 34 - if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin" and sys.version_info >= (3, 12): - # FreeBSD >= 14.0 - AF_DIVERT = 44 - -AF_INET = AddressFamily.AF_INET -AF_INET6 = AddressFamily.AF_INET6 -AF_APPLETALK = AddressFamily.AF_APPLETALK -AF_DECnet: Literal[12] -AF_IPX = AddressFamily.AF_IPX -AF_SNA = AddressFamily.AF_SNA -AF_UNSPEC = AddressFamily.AF_UNSPEC - -if sys.platform != "darwin": - AF_IRDA = AddressFamily.AF_IRDA - -if sys.platform != "win32": - AF_ROUTE = AddressFamily.AF_ROUTE - AF_UNIX = AddressFamily.AF_UNIX - -if sys.platform == "darwin": - AF_SYSTEM = AddressFamily.AF_SYSTEM - -if sys.platform != "win32" and sys.platform != "darwin": - AF_ASH = AddressFamily.AF_ASH - AF_ATMPVC = AddressFamily.AF_ATMPVC - AF_ATMSVC = AddressFamily.AF_ATMSVC - AF_AX25 = AddressFamily.AF_AX25 - AF_BRIDGE = AddressFamily.AF_BRIDGE - AF_ECONET = AddressFamily.AF_ECONET - AF_KEY = AddressFamily.AF_KEY - AF_LLC = AddressFamily.AF_LLC - AF_NETBEUI = AddressFamily.AF_NETBEUI - AF_NETROM = AddressFamily.AF_NETROM - AF_PPPOX = AddressFamily.AF_PPPOX - AF_ROSE = AddressFamily.AF_ROSE - AF_SECURITY = AddressFamily.AF_SECURITY - AF_WANPIPE = AddressFamily.AF_WANPIPE - AF_X25 = AddressFamily.AF_X25 - -if sys.platform == "linux": - AF_CAN = AddressFamily.AF_CAN - AF_PACKET = AddressFamily.AF_PACKET - AF_RDS = AddressFamily.AF_RDS - AF_TIPC = AddressFamily.AF_TIPC - AF_ALG = AddressFamily.AF_ALG - AF_NETLINK = AddressFamily.AF_NETLINK - AF_VSOCK = AddressFamily.AF_VSOCK - AF_QIPCRTR = AddressFamily.AF_QIPCRTR - -if sys.platform != "linux": - AF_LINK = AddressFamily.AF_LINK -if sys.platform != "darwin" and sys.platform != "linux": - AF_BLUETOOTH = AddressFamily.AF_BLUETOOTH -if sys.platform == "win32" and sys.version_info >= (3, 12): - AF_HYPERV = AddressFamily.AF_HYPERV -if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin" and sys.version_info >= (3, 12): - # FreeBSD >= 14.0 - AF_DIVERT = AddressFamily.AF_DIVERT - -class SocketKind(IntEnum): - SOCK_STREAM = 1 - SOCK_DGRAM = 2 - SOCK_RAW = 3 - SOCK_RDM = 4 - SOCK_SEQPACKET = 5 - if sys.platform == "linux": - SOCK_CLOEXEC = 524288 - SOCK_NONBLOCK = 2048 - -SOCK_STREAM = SocketKind.SOCK_STREAM -SOCK_DGRAM = SocketKind.SOCK_DGRAM -SOCK_RAW = SocketKind.SOCK_RAW -SOCK_RDM = SocketKind.SOCK_RDM -SOCK_SEQPACKET = SocketKind.SOCK_SEQPACKET -if sys.platform == "linux": - SOCK_CLOEXEC = SocketKind.SOCK_CLOEXEC - SOCK_NONBLOCK = SocketKind.SOCK_NONBLOCK - -class MsgFlag(IntFlag): - MSG_CTRUNC = 8 - MSG_DONTROUTE = 4 - MSG_OOB = 1 - MSG_PEEK = 2 - MSG_TRUNC = 32 - MSG_WAITALL = 256 - if sys.platform == "win32": - MSG_BCAST = 1024 - MSG_MCAST = 2048 - - if sys.platform != "darwin": - MSG_ERRQUEUE = 8192 - - if sys.platform != "win32" and sys.platform != "darwin": - MSG_CMSG_CLOEXEC = 1073741821 - MSG_CONFIRM = 2048 - MSG_FASTOPEN = 536870912 - MSG_MORE = 32768 - - if sys.platform != "win32" and sys.platform != "darwin" and sys.platform != "linux": - MSG_NOTIFICATION = 8192 - - if sys.platform != "win32": - MSG_DONTWAIT = 64 - MSG_EOR = 128 - MSG_NOSIGNAL = 16384 # sometimes this exists on darwin, sometimes not - if sys.platform != "win32" and sys.platform != "linux": - MSG_EOF = 256 - -MSG_CTRUNC = MsgFlag.MSG_CTRUNC -MSG_DONTROUTE = MsgFlag.MSG_DONTROUTE -MSG_OOB = MsgFlag.MSG_OOB -MSG_PEEK = MsgFlag.MSG_PEEK -MSG_TRUNC = MsgFlag.MSG_TRUNC -MSG_WAITALL = MsgFlag.MSG_WAITALL - -if sys.platform == "win32": - MSG_BCAST = MsgFlag.MSG_BCAST - MSG_MCAST = MsgFlag.MSG_MCAST - -if sys.platform != "darwin": - MSG_ERRQUEUE = MsgFlag.MSG_ERRQUEUE - -if sys.platform != "win32": - MSG_DONTWAIT = MsgFlag.MSG_DONTWAIT - MSG_EOR = MsgFlag.MSG_EOR - MSG_NOSIGNAL = MsgFlag.MSG_NOSIGNAL # Sometimes this exists on darwin, sometimes not - -if sys.platform != "win32" and sys.platform != "darwin": - MSG_CMSG_CLOEXEC = MsgFlag.MSG_CMSG_CLOEXEC - MSG_CONFIRM = MsgFlag.MSG_CONFIRM - MSG_FASTOPEN = MsgFlag.MSG_FASTOPEN - MSG_MORE = MsgFlag.MSG_MORE - -if sys.platform != "win32" and sys.platform != "darwin" and sys.platform != "linux": - MSG_NOTIFICATION = MsgFlag.MSG_NOTIFICATION - -if sys.platform != "win32" and sys.platform != "linux": - MSG_EOF = MsgFlag.MSG_EOF - -class AddressInfo(IntFlag): - AI_ADDRCONFIG = 32 - AI_ALL = 16 - AI_CANONNAME = 2 - AI_NUMERICHOST = 4 - AI_NUMERICSERV = 1024 - AI_PASSIVE = 1 - AI_V4MAPPED = 8 - if sys.platform != "win32" and sys.platform != "linux": - AI_DEFAULT = 1536 - AI_MASK = 5127 - AI_V4MAPPED_CFG = 512 - -AI_ADDRCONFIG = AddressInfo.AI_ADDRCONFIG -AI_ALL = AddressInfo.AI_ALL -AI_CANONNAME = AddressInfo.AI_CANONNAME -AI_NUMERICHOST = AddressInfo.AI_NUMERICHOST -AI_NUMERICSERV = AddressInfo.AI_NUMERICSERV -AI_PASSIVE = AddressInfo.AI_PASSIVE -AI_V4MAPPED = AddressInfo.AI_V4MAPPED - -if sys.platform != "win32" and sys.platform != "linux": - AI_DEFAULT = AddressInfo.AI_DEFAULT - AI_MASK = AddressInfo.AI_MASK - AI_V4MAPPED_CFG = AddressInfo.AI_V4MAPPED_CFG - -if sys.platform == "win32": - errorTab: dict[int, str] # undocumented - -class _SendableFile(Protocol): - def read(self, size: int, /) -> bytes: ... - def seek(self, offset: int, /) -> object: ... - - # optional fields: - # - # @property - # def mode(self) -> str: ... - # def fileno(self) -> int: ... - -class socket(_socket.socket): - def __init__( - self, family: AddressFamily | int = -1, type: SocketKind | int = -1, proto: int = -1, fileno: int | None = None - ) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - def dup(self) -> Self: ... - def accept(self) -> tuple[socket, _RetAddress]: ... - # Note that the makefile's documented windows-specific behavior is not represented - # mode strings with duplicates are intentionally excluded - @overload - def makefile( - self, - mode: Literal["b", "rb", "br", "wb", "bw", "rwb", "rbw", "wrb", "wbr", "brw", "bwr"], - buffering: Literal[0], - *, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - ) -> SocketIO: ... - @overload - def makefile( - self, - mode: Literal["rwb", "rbw", "wrb", "wbr", "brw", "bwr"], - buffering: Literal[-1, 1] | None = None, - *, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - ) -> BufferedRWPair: ... - @overload - def makefile( - self, - mode: Literal["rb", "br"], - buffering: Literal[-1, 1] | None = None, - *, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - ) -> BufferedReader: ... - @overload - def makefile( - self, - mode: Literal["wb", "bw"], - buffering: Literal[-1, 1] | None = None, - *, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - ) -> BufferedWriter: ... - @overload - def makefile( - self, - mode: Literal["b", "rb", "br", "wb", "bw", "rwb", "rbw", "wrb", "wbr", "brw", "bwr"], - buffering: int, - *, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - ) -> IOBase: ... - @overload - def makefile( - self, - mode: Literal["r", "w", "rw", "wr", ""] = "r", - buffering: int | None = None, - *, - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - ) -> TextIOWrapper: ... - def sendfile(self, file: _SendableFile, offset: int = 0, count: int | None = None) -> int: ... - @property - def family(self) -> AddressFamily: ... - @property - def type(self) -> SocketKind: ... - def get_inheritable(self) -> bool: ... - def set_inheritable(self, inheritable: bool) -> None: ... - -def fromfd(fd: SupportsIndex, family: AddressFamily | int, type: SocketKind | int, proto: int = 0) -> socket: ... - -if sys.platform != "win32": - def send_fds( - sock: socket, buffers: Iterable[ReadableBuffer], fds: Iterable[int], flags: Unused = 0, address: Unused = None - ) -> int: ... - def recv_fds(sock: socket, bufsize: int, maxfds: int, flags: int = 0) -> tuple[bytes, list[int], int, Any]: ... - -if sys.platform == "win32": - def fromshare(info: bytes) -> socket: ... - -if sys.platform == "win32": - def socketpair(family: int = ..., type: int = ..., proto: int = 0) -> tuple[socket, socket]: ... - -else: - def socketpair( - family: int | AddressFamily | None = None, type: SocketType | int = ..., proto: int = 0 - ) -> tuple[socket, socket]: ... - -class SocketIO(RawIOBase): - def __init__(self, sock: socket, mode: Literal["r", "w", "rw", "rb", "wb", "rwb"]) -> None: ... - def readinto(self, b: WriteableBuffer) -> int | None: ... - def write(self, b: ReadableBuffer) -> int | None: ... - @property - def name(self) -> int: ... # return value is really "int" - @property - def mode(self) -> Literal["rb", "wb", "rwb"]: ... - -def getfqdn(name: str = "") -> str: ... - -if sys.version_info >= (3, 11): - def create_connection( - address: tuple[str | None, int], - timeout: float | None = ..., - source_address: _Address | None = None, - *, - all_errors: bool = False, - ) -> socket: ... - -else: - def create_connection( - address: tuple[str | None, int], timeout: float | None = ..., source_address: _Address | None = None - ) -> socket: ... - -def has_dualstack_ipv6() -> bool: ... -def create_server( - address: _Address, *, family: int = ..., backlog: int | None = None, reuse_port: bool = False, dualstack_ipv6: bool = False -) -> socket: ... - -# The 5th tuple item is the socket address, for IP4, IP6, or IP6 if Python is compiled with --disable-ipv6, respectively. -def getaddrinfo( - host: bytes | str | None, port: bytes | str | int | None, family: int = 0, type: int = 0, proto: int = 0, flags: int = 0 -) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/socketserver.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/socketserver.pyi deleted file mode 100644 index 061932f0fa..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/socketserver.pyi +++ /dev/null @@ -1,169 +0,0 @@ -import sys -import types -from _socket import _Address, _RetAddress -from _typeshed import ReadableBuffer -from collections.abc import Callable -from io import BufferedIOBase -from socket import socket as _socket -from typing import Any, ClassVar -from typing_extensions import Self, TypeAlias - -__all__ = [ - "BaseServer", - "TCPServer", - "UDPServer", - "ThreadingUDPServer", - "ThreadingTCPServer", - "BaseRequestHandler", - "StreamRequestHandler", - "DatagramRequestHandler", - "ThreadingMixIn", -] -if sys.platform != "win32": - __all__ += [ - "ForkingMixIn", - "ForkingTCPServer", - "ForkingUDPServer", - "ThreadingUnixDatagramServer", - "ThreadingUnixStreamServer", - "UnixDatagramServer", - "UnixStreamServer", - ] - if sys.version_info >= (3, 12): - __all__ += ["ForkingUnixStreamServer", "ForkingUnixDatagramServer"] - -_RequestType: TypeAlias = _socket | tuple[bytes, _socket] -_AfUnixAddress: TypeAlias = str | ReadableBuffer # address acceptable for an AF_UNIX socket -_AfInetAddress: TypeAlias = tuple[str | bytes | bytearray, int] # address acceptable for an AF_INET socket - -# This can possibly be generic at some point: -class BaseServer: - server_address: _Address - timeout: float | None - RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler] - def __init__( - self, server_address: _Address, RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler] - ) -> None: ... - def handle_request(self) -> None: ... - def serve_forever(self, poll_interval: float = 0.5) -> None: ... - def shutdown(self) -> None: ... - def server_close(self) -> None: ... - def finish_request(self, request: _RequestType, client_address: _RetAddress) -> None: ... - def get_request(self) -> tuple[Any, Any]: ... # Not implemented here, but expected to exist on subclasses - def handle_error(self, request: _RequestType, client_address: _RetAddress) -> None: ... - def handle_timeout(self) -> None: ... - def process_request(self, request: _RequestType, client_address: _RetAddress) -> None: ... - def server_activate(self) -> None: ... - def verify_request(self, request: _RequestType, client_address: _RetAddress) -> bool: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None - ) -> None: ... - def service_actions(self) -> None: ... - def shutdown_request(self, request: _RequestType) -> None: ... # undocumented - def close_request(self, request: _RequestType) -> None: ... # undocumented - -class TCPServer(BaseServer): - address_family: int - socket: _socket - allow_reuse_address: bool - request_queue_size: int - socket_type: int - if sys.version_info >= (3, 11): - allow_reuse_port: bool - server_address: _AfInetAddress - def __init__( - self, - server_address: _AfInetAddress, - RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler], - bind_and_activate: bool = True, - ) -> None: ... - def fileno(self) -> int: ... - def get_request(self) -> tuple[_socket, _RetAddress]: ... - def server_bind(self) -> None: ... - -class UDPServer(TCPServer): - max_packet_size: ClassVar[int] - def get_request(self) -> tuple[tuple[bytes, _socket], _RetAddress]: ... # type: ignore[override] - -if sys.platform != "win32": - class UnixStreamServer(TCPServer): - server_address: _AfUnixAddress # type: ignore[assignment] - def __init__( - self, - server_address: _AfUnixAddress, - RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler], - bind_and_activate: bool = True, - ) -> None: ... - - class UnixDatagramServer(UDPServer): - server_address: _AfUnixAddress # type: ignore[assignment] - def __init__( - self, - server_address: _AfUnixAddress, - RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler], - bind_and_activate: bool = True, - ) -> None: ... - -if sys.platform != "win32": - class ForkingMixIn: - timeout: float | None # undocumented - active_children: set[int] | None # undocumented - max_children: int # undocumented - block_on_close: bool - def collect_children(self, *, blocking: bool = False) -> None: ... # undocumented - def handle_timeout(self) -> None: ... # undocumented - def service_actions(self) -> None: ... # undocumented - def process_request(self, request: _RequestType, client_address: _RetAddress) -> None: ... - def server_close(self) -> None: ... - -class ThreadingMixIn: - daemon_threads: bool - block_on_close: bool - def process_request_thread(self, request: _RequestType, client_address: _RetAddress) -> None: ... # undocumented - def process_request(self, request: _RequestType, client_address: _RetAddress) -> None: ... - def server_close(self) -> None: ... - -if sys.platform != "win32": - class ForkingTCPServer(ForkingMixIn, TCPServer): ... - class ForkingUDPServer(ForkingMixIn, UDPServer): ... - if sys.version_info >= (3, 12): - class ForkingUnixStreamServer(ForkingMixIn, UnixStreamServer): ... - class ForkingUnixDatagramServer(ForkingMixIn, UnixDatagramServer): ... - -class ThreadingTCPServer(ThreadingMixIn, TCPServer): ... -class ThreadingUDPServer(ThreadingMixIn, UDPServer): ... - -if sys.platform != "win32": - class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): ... - class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): ... - -class BaseRequestHandler: - # `request` is technically of type _RequestType, - # but there are some concerns that having a union here would cause - # too much inconvenience to people using it (see - # https://github.com/python/typeshed/pull/384#issuecomment-234649696) - # - # Note also that _RetAddress is also just an alias for `Any` - request: Any - client_address: _RetAddress - server: BaseServer - def __init__(self, request: _RequestType, client_address: _RetAddress, server: BaseServer) -> None: ... - def setup(self) -> None: ... - def handle(self) -> None: ... - def finish(self) -> None: ... - -class StreamRequestHandler(BaseRequestHandler): - rbufsize: ClassVar[int] # undocumented - wbufsize: ClassVar[int] # undocumented - timeout: ClassVar[float | None] # undocumented - disable_nagle_algorithm: ClassVar[bool] # undocumented - connection: Any # undocumented - rfile: BufferedIOBase - wfile: BufferedIOBase - -class DatagramRequestHandler(BaseRequestHandler): - packet: bytes # undocumented - socket: _socket # undocumented - rfile: BufferedIOBase - wfile: BufferedIOBase diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/spwd.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/spwd.pyi deleted file mode 100644 index 3a5d39997d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/spwd.pyi +++ /dev/null @@ -1,46 +0,0 @@ -import sys -from _typeshed import structseq -from typing import Any, Final, final - -if sys.platform != "win32": - @final - class struct_spwd(structseq[Any], tuple[str, str, int, int, int, int, int, int, int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ( - "sp_namp", - "sp_pwdp", - "sp_lstchg", - "sp_min", - "sp_max", - "sp_warn", - "sp_inact", - "sp_expire", - "sp_flag", - ) - - @property - def sp_namp(self) -> str: ... - @property - def sp_pwdp(self) -> str: ... - @property - def sp_lstchg(self) -> int: ... - @property - def sp_min(self) -> int: ... - @property - def sp_max(self) -> int: ... - @property - def sp_warn(self) -> int: ... - @property - def sp_inact(self) -> int: ... - @property - def sp_expire(self) -> int: ... - @property - def sp_flag(self) -> int: ... - # Deprecated aliases below. - @property - def sp_nam(self) -> str: ... - @property - def sp_pwd(self) -> str: ... - - def getspall() -> list[struct_spwd]: ... - def getspnam(arg: str, /) -> struct_spwd: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sqlite3/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sqlite3/__init__.pyi deleted file mode 100644 index b83516b4d4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sqlite3/__init__.pyi +++ /dev/null @@ -1,467 +0,0 @@ -import sys -from _typeshed import MaybeNone, ReadableBuffer, StrOrBytesPath, SupportsLenAndGetItem, Unused -from collections.abc import Callable, Generator, Iterable, Iterator, Mapping, Sequence -from sqlite3.dbapi2 import ( - PARSE_COLNAMES as PARSE_COLNAMES, - PARSE_DECLTYPES as PARSE_DECLTYPES, - SQLITE_ALTER_TABLE as SQLITE_ALTER_TABLE, - SQLITE_ANALYZE as SQLITE_ANALYZE, - SQLITE_ATTACH as SQLITE_ATTACH, - SQLITE_CREATE_INDEX as SQLITE_CREATE_INDEX, - SQLITE_CREATE_TABLE as SQLITE_CREATE_TABLE, - SQLITE_CREATE_TEMP_INDEX as SQLITE_CREATE_TEMP_INDEX, - SQLITE_CREATE_TEMP_TABLE as SQLITE_CREATE_TEMP_TABLE, - SQLITE_CREATE_TEMP_TRIGGER as SQLITE_CREATE_TEMP_TRIGGER, - SQLITE_CREATE_TEMP_VIEW as SQLITE_CREATE_TEMP_VIEW, - SQLITE_CREATE_TRIGGER as SQLITE_CREATE_TRIGGER, - SQLITE_CREATE_VIEW as SQLITE_CREATE_VIEW, - SQLITE_CREATE_VTABLE as SQLITE_CREATE_VTABLE, - SQLITE_DELETE as SQLITE_DELETE, - SQLITE_DENY as SQLITE_DENY, - SQLITE_DETACH as SQLITE_DETACH, - SQLITE_DONE as SQLITE_DONE, - SQLITE_DROP_INDEX as SQLITE_DROP_INDEX, - SQLITE_DROP_TABLE as SQLITE_DROP_TABLE, - SQLITE_DROP_TEMP_INDEX as SQLITE_DROP_TEMP_INDEX, - SQLITE_DROP_TEMP_TABLE as SQLITE_DROP_TEMP_TABLE, - SQLITE_DROP_TEMP_TRIGGER as SQLITE_DROP_TEMP_TRIGGER, - SQLITE_DROP_TEMP_VIEW as SQLITE_DROP_TEMP_VIEW, - SQLITE_DROP_TRIGGER as SQLITE_DROP_TRIGGER, - SQLITE_DROP_VIEW as SQLITE_DROP_VIEW, - SQLITE_DROP_VTABLE as SQLITE_DROP_VTABLE, - SQLITE_FUNCTION as SQLITE_FUNCTION, - SQLITE_IGNORE as SQLITE_IGNORE, - SQLITE_INSERT as SQLITE_INSERT, - SQLITE_OK as SQLITE_OK, - SQLITE_PRAGMA as SQLITE_PRAGMA, - SQLITE_READ as SQLITE_READ, - SQLITE_RECURSIVE as SQLITE_RECURSIVE, - SQLITE_REINDEX as SQLITE_REINDEX, - SQLITE_SAVEPOINT as SQLITE_SAVEPOINT, - SQLITE_SELECT as SQLITE_SELECT, - SQLITE_TRANSACTION as SQLITE_TRANSACTION, - SQLITE_UPDATE as SQLITE_UPDATE, - Binary as Binary, - Date as Date, - DateFromTicks as DateFromTicks, - Time as Time, - TimeFromTicks as TimeFromTicks, - TimestampFromTicks as TimestampFromTicks, - adapt as adapt, - adapters as adapters, - apilevel as apilevel, - complete_statement as complete_statement, - connect as connect, - converters as converters, - enable_callback_tracebacks as enable_callback_tracebacks, - paramstyle as paramstyle, - register_adapter as register_adapter, - register_converter as register_converter, - sqlite_version as sqlite_version, - sqlite_version_info as sqlite_version_info, - threadsafety as threadsafety, - version_info as version_info, -) -from types import TracebackType -from typing import Any, Literal, Protocol, SupportsIndex, TypeVar, final, overload, type_check_only -from typing_extensions import Self, TypeAlias - -if sys.version_info >= (3, 12): - from sqlite3.dbapi2 import ( - LEGACY_TRANSACTION_CONTROL as LEGACY_TRANSACTION_CONTROL, - SQLITE_DBCONFIG_DEFENSIVE as SQLITE_DBCONFIG_DEFENSIVE, - SQLITE_DBCONFIG_DQS_DDL as SQLITE_DBCONFIG_DQS_DDL, - SQLITE_DBCONFIG_DQS_DML as SQLITE_DBCONFIG_DQS_DML, - SQLITE_DBCONFIG_ENABLE_FKEY as SQLITE_DBCONFIG_ENABLE_FKEY, - SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER as SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, - SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION as SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, - SQLITE_DBCONFIG_ENABLE_QPSG as SQLITE_DBCONFIG_ENABLE_QPSG, - SQLITE_DBCONFIG_ENABLE_TRIGGER as SQLITE_DBCONFIG_ENABLE_TRIGGER, - SQLITE_DBCONFIG_ENABLE_VIEW as SQLITE_DBCONFIG_ENABLE_VIEW, - SQLITE_DBCONFIG_LEGACY_ALTER_TABLE as SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, - SQLITE_DBCONFIG_LEGACY_FILE_FORMAT as SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, - SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE as SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, - SQLITE_DBCONFIG_RESET_DATABASE as SQLITE_DBCONFIG_RESET_DATABASE, - SQLITE_DBCONFIG_TRIGGER_EQP as SQLITE_DBCONFIG_TRIGGER_EQP, - SQLITE_DBCONFIG_TRUSTED_SCHEMA as SQLITE_DBCONFIG_TRUSTED_SCHEMA, - SQLITE_DBCONFIG_WRITABLE_SCHEMA as SQLITE_DBCONFIG_WRITABLE_SCHEMA, - ) - -if sys.version_info >= (3, 11): - from sqlite3.dbapi2 import ( - SQLITE_ABORT as SQLITE_ABORT, - SQLITE_ABORT_ROLLBACK as SQLITE_ABORT_ROLLBACK, - SQLITE_AUTH as SQLITE_AUTH, - SQLITE_AUTH_USER as SQLITE_AUTH_USER, - SQLITE_BUSY as SQLITE_BUSY, - SQLITE_BUSY_RECOVERY as SQLITE_BUSY_RECOVERY, - SQLITE_BUSY_SNAPSHOT as SQLITE_BUSY_SNAPSHOT, - SQLITE_BUSY_TIMEOUT as SQLITE_BUSY_TIMEOUT, - SQLITE_CANTOPEN as SQLITE_CANTOPEN, - SQLITE_CANTOPEN_CONVPATH as SQLITE_CANTOPEN_CONVPATH, - SQLITE_CANTOPEN_DIRTYWAL as SQLITE_CANTOPEN_DIRTYWAL, - SQLITE_CANTOPEN_FULLPATH as SQLITE_CANTOPEN_FULLPATH, - SQLITE_CANTOPEN_ISDIR as SQLITE_CANTOPEN_ISDIR, - SQLITE_CANTOPEN_NOTEMPDIR as SQLITE_CANTOPEN_NOTEMPDIR, - SQLITE_CANTOPEN_SYMLINK as SQLITE_CANTOPEN_SYMLINK, - SQLITE_CONSTRAINT as SQLITE_CONSTRAINT, - SQLITE_CONSTRAINT_CHECK as SQLITE_CONSTRAINT_CHECK, - SQLITE_CONSTRAINT_COMMITHOOK as SQLITE_CONSTRAINT_COMMITHOOK, - SQLITE_CONSTRAINT_FOREIGNKEY as SQLITE_CONSTRAINT_FOREIGNKEY, - SQLITE_CONSTRAINT_FUNCTION as SQLITE_CONSTRAINT_FUNCTION, - SQLITE_CONSTRAINT_NOTNULL as SQLITE_CONSTRAINT_NOTNULL, - SQLITE_CONSTRAINT_PINNED as SQLITE_CONSTRAINT_PINNED, - SQLITE_CONSTRAINT_PRIMARYKEY as SQLITE_CONSTRAINT_PRIMARYKEY, - SQLITE_CONSTRAINT_ROWID as SQLITE_CONSTRAINT_ROWID, - SQLITE_CONSTRAINT_TRIGGER as SQLITE_CONSTRAINT_TRIGGER, - SQLITE_CONSTRAINT_UNIQUE as SQLITE_CONSTRAINT_UNIQUE, - SQLITE_CONSTRAINT_VTAB as SQLITE_CONSTRAINT_VTAB, - SQLITE_CORRUPT as SQLITE_CORRUPT, - SQLITE_CORRUPT_INDEX as SQLITE_CORRUPT_INDEX, - SQLITE_CORRUPT_SEQUENCE as SQLITE_CORRUPT_SEQUENCE, - SQLITE_CORRUPT_VTAB as SQLITE_CORRUPT_VTAB, - SQLITE_EMPTY as SQLITE_EMPTY, - SQLITE_ERROR as SQLITE_ERROR, - SQLITE_ERROR_MISSING_COLLSEQ as SQLITE_ERROR_MISSING_COLLSEQ, - SQLITE_ERROR_RETRY as SQLITE_ERROR_RETRY, - SQLITE_ERROR_SNAPSHOT as SQLITE_ERROR_SNAPSHOT, - SQLITE_FORMAT as SQLITE_FORMAT, - SQLITE_FULL as SQLITE_FULL, - SQLITE_INTERNAL as SQLITE_INTERNAL, - SQLITE_INTERRUPT as SQLITE_INTERRUPT, - SQLITE_IOERR as SQLITE_IOERR, - SQLITE_IOERR_ACCESS as SQLITE_IOERR_ACCESS, - SQLITE_IOERR_AUTH as SQLITE_IOERR_AUTH, - SQLITE_IOERR_BEGIN_ATOMIC as SQLITE_IOERR_BEGIN_ATOMIC, - SQLITE_IOERR_BLOCKED as SQLITE_IOERR_BLOCKED, - SQLITE_IOERR_CHECKRESERVEDLOCK as SQLITE_IOERR_CHECKRESERVEDLOCK, - SQLITE_IOERR_CLOSE as SQLITE_IOERR_CLOSE, - SQLITE_IOERR_COMMIT_ATOMIC as SQLITE_IOERR_COMMIT_ATOMIC, - SQLITE_IOERR_CONVPATH as SQLITE_IOERR_CONVPATH, - SQLITE_IOERR_CORRUPTFS as SQLITE_IOERR_CORRUPTFS, - SQLITE_IOERR_DATA as SQLITE_IOERR_DATA, - SQLITE_IOERR_DELETE as SQLITE_IOERR_DELETE, - SQLITE_IOERR_DELETE_NOENT as SQLITE_IOERR_DELETE_NOENT, - SQLITE_IOERR_DIR_CLOSE as SQLITE_IOERR_DIR_CLOSE, - SQLITE_IOERR_DIR_FSYNC as SQLITE_IOERR_DIR_FSYNC, - SQLITE_IOERR_FSTAT as SQLITE_IOERR_FSTAT, - SQLITE_IOERR_FSYNC as SQLITE_IOERR_FSYNC, - SQLITE_IOERR_GETTEMPPATH as SQLITE_IOERR_GETTEMPPATH, - SQLITE_IOERR_LOCK as SQLITE_IOERR_LOCK, - SQLITE_IOERR_MMAP as SQLITE_IOERR_MMAP, - SQLITE_IOERR_NOMEM as SQLITE_IOERR_NOMEM, - SQLITE_IOERR_RDLOCK as SQLITE_IOERR_RDLOCK, - SQLITE_IOERR_READ as SQLITE_IOERR_READ, - SQLITE_IOERR_ROLLBACK_ATOMIC as SQLITE_IOERR_ROLLBACK_ATOMIC, - SQLITE_IOERR_SEEK as SQLITE_IOERR_SEEK, - SQLITE_IOERR_SHMLOCK as SQLITE_IOERR_SHMLOCK, - SQLITE_IOERR_SHMMAP as SQLITE_IOERR_SHMMAP, - SQLITE_IOERR_SHMOPEN as SQLITE_IOERR_SHMOPEN, - SQLITE_IOERR_SHMSIZE as SQLITE_IOERR_SHMSIZE, - SQLITE_IOERR_SHORT_READ as SQLITE_IOERR_SHORT_READ, - SQLITE_IOERR_TRUNCATE as SQLITE_IOERR_TRUNCATE, - SQLITE_IOERR_UNLOCK as SQLITE_IOERR_UNLOCK, - SQLITE_IOERR_VNODE as SQLITE_IOERR_VNODE, - SQLITE_IOERR_WRITE as SQLITE_IOERR_WRITE, - SQLITE_LIMIT_ATTACHED as SQLITE_LIMIT_ATTACHED, - SQLITE_LIMIT_COLUMN as SQLITE_LIMIT_COLUMN, - SQLITE_LIMIT_COMPOUND_SELECT as SQLITE_LIMIT_COMPOUND_SELECT, - SQLITE_LIMIT_EXPR_DEPTH as SQLITE_LIMIT_EXPR_DEPTH, - SQLITE_LIMIT_FUNCTION_ARG as SQLITE_LIMIT_FUNCTION_ARG, - SQLITE_LIMIT_LENGTH as SQLITE_LIMIT_LENGTH, - SQLITE_LIMIT_LIKE_PATTERN_LENGTH as SQLITE_LIMIT_LIKE_PATTERN_LENGTH, - SQLITE_LIMIT_SQL_LENGTH as SQLITE_LIMIT_SQL_LENGTH, - SQLITE_LIMIT_TRIGGER_DEPTH as SQLITE_LIMIT_TRIGGER_DEPTH, - SQLITE_LIMIT_VARIABLE_NUMBER as SQLITE_LIMIT_VARIABLE_NUMBER, - SQLITE_LIMIT_VDBE_OP as SQLITE_LIMIT_VDBE_OP, - SQLITE_LIMIT_WORKER_THREADS as SQLITE_LIMIT_WORKER_THREADS, - SQLITE_LOCKED as SQLITE_LOCKED, - SQLITE_LOCKED_SHAREDCACHE as SQLITE_LOCKED_SHAREDCACHE, - SQLITE_LOCKED_VTAB as SQLITE_LOCKED_VTAB, - SQLITE_MISMATCH as SQLITE_MISMATCH, - SQLITE_MISUSE as SQLITE_MISUSE, - SQLITE_NOLFS as SQLITE_NOLFS, - SQLITE_NOMEM as SQLITE_NOMEM, - SQLITE_NOTADB as SQLITE_NOTADB, - SQLITE_NOTFOUND as SQLITE_NOTFOUND, - SQLITE_NOTICE as SQLITE_NOTICE, - SQLITE_NOTICE_RECOVER_ROLLBACK as SQLITE_NOTICE_RECOVER_ROLLBACK, - SQLITE_NOTICE_RECOVER_WAL as SQLITE_NOTICE_RECOVER_WAL, - SQLITE_OK_LOAD_PERMANENTLY as SQLITE_OK_LOAD_PERMANENTLY, - SQLITE_OK_SYMLINK as SQLITE_OK_SYMLINK, - SQLITE_PERM as SQLITE_PERM, - SQLITE_PROTOCOL as SQLITE_PROTOCOL, - SQLITE_RANGE as SQLITE_RANGE, - SQLITE_READONLY as SQLITE_READONLY, - SQLITE_READONLY_CANTINIT as SQLITE_READONLY_CANTINIT, - SQLITE_READONLY_CANTLOCK as SQLITE_READONLY_CANTLOCK, - SQLITE_READONLY_DBMOVED as SQLITE_READONLY_DBMOVED, - SQLITE_READONLY_DIRECTORY as SQLITE_READONLY_DIRECTORY, - SQLITE_READONLY_RECOVERY as SQLITE_READONLY_RECOVERY, - SQLITE_READONLY_ROLLBACK as SQLITE_READONLY_ROLLBACK, - SQLITE_ROW as SQLITE_ROW, - SQLITE_SCHEMA as SQLITE_SCHEMA, - SQLITE_TOOBIG as SQLITE_TOOBIG, - SQLITE_WARNING as SQLITE_WARNING, - SQLITE_WARNING_AUTOINDEX as SQLITE_WARNING_AUTOINDEX, - ) - -if sys.version_info < (3, 12): - from sqlite3.dbapi2 import enable_shared_cache as enable_shared_cache, version as version - -if sys.version_info < (3, 10): - from sqlite3.dbapi2 import OptimizedUnicode as OptimizedUnicode - -_CursorT = TypeVar("_CursorT", bound=Cursor) -_SqliteData: TypeAlias = str | ReadableBuffer | int | float | None -# Data that is passed through adapters can be of any type accepted by an adapter. -_AdaptedInputData: TypeAlias = _SqliteData | Any -# The Mapping must really be a dict, but making it invariant is too annoying. -_Parameters: TypeAlias = SupportsLenAndGetItem[_AdaptedInputData] | Mapping[str, _AdaptedInputData] - -class _AnyParamWindowAggregateClass(Protocol): - def step(self, *args: Any) -> object: ... - def inverse(self, *args: Any) -> object: ... - def value(self) -> _SqliteData: ... - def finalize(self) -> _SqliteData: ... - -class _WindowAggregateClass(Protocol): - step: Callable[..., object] - inverse: Callable[..., object] - def value(self) -> _SqliteData: ... - def finalize(self) -> _SqliteData: ... - -class _AggregateProtocol(Protocol): - def step(self, value: int, /) -> object: ... - def finalize(self) -> int: ... - -class _SingleParamWindowAggregateClass(Protocol): - def step(self, param: Any, /) -> object: ... - def inverse(self, param: Any, /) -> object: ... - def value(self) -> _SqliteData: ... - def finalize(self) -> _SqliteData: ... - -# These classes are implemented in the C module _sqlite3. At runtime, they're imported -# from there into sqlite3.dbapi2 and from that module to here. However, they -# consider themselves to live in the sqlite3.* namespace, so we'll define them here. - -class Error(Exception): - if sys.version_info >= (3, 11): - sqlite_errorcode: int - sqlite_errorname: str - -class DatabaseError(Error): ... -class DataError(DatabaseError): ... -class IntegrityError(DatabaseError): ... -class InterfaceError(Error): ... -class InternalError(DatabaseError): ... -class NotSupportedError(DatabaseError): ... -class OperationalError(DatabaseError): ... -class ProgrammingError(DatabaseError): ... -class Warning(Exception): ... - -class Connection: - @property - def DataError(self) -> type[DataError]: ... - @property - def DatabaseError(self) -> type[DatabaseError]: ... - @property - def Error(self) -> type[Error]: ... - @property - def IntegrityError(self) -> type[IntegrityError]: ... - @property - def InterfaceError(self) -> type[InterfaceError]: ... - @property - def InternalError(self) -> type[InternalError]: ... - @property - def NotSupportedError(self) -> type[NotSupportedError]: ... - @property - def OperationalError(self) -> type[OperationalError]: ... - @property - def ProgrammingError(self) -> type[ProgrammingError]: ... - @property - def Warning(self) -> type[Warning]: ... - @property - def in_transaction(self) -> bool: ... - 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 - if sys.version_info >= (3, 12): - def __init__( - self, - database: StrOrBytesPath, - timeout: float = ..., - detect_types: int = ..., - isolation_level: str | None = ..., - check_same_thread: bool = ..., - factory: type[Connection] | None = ..., - cached_statements: int = ..., - uri: bool = ..., - autocommit: bool = ..., - ) -> None: ... - else: - def __init__( - self, - database: StrOrBytesPath, - timeout: float = ..., - detect_types: int = ..., - isolation_level: str | None = ..., - check_same_thread: bool = ..., - factory: type[Connection] | None = ..., - cached_statements: int = ..., - uri: bool = ..., - ) -> None: ... - - def close(self) -> None: ... - if sys.version_info >= (3, 11): - def blobopen(self, table: str, column: str, row: int, /, *, readonly: bool = False, name: str = "main") -> Blob: ... - - def commit(self) -> None: ... - def create_aggregate(self, name: str, n_arg: int, aggregate_class: Callable[[], _AggregateProtocol]) -> None: ... - if sys.version_info >= (3, 11): - # num_params determines how many params will be passed to the aggregate class. We provide an overload - # for the case where num_params = 1, which is expected to be the common case. - @overload - def create_window_function( - self, name: str, num_params: Literal[1], aggregate_class: Callable[[], _SingleParamWindowAggregateClass] | None, / - ) -> None: ... - # And for num_params = -1, which means the aggregate must accept any number of parameters. - @overload - def create_window_function( - self, name: str, num_params: Literal[-1], aggregate_class: Callable[[], _AnyParamWindowAggregateClass] | None, / - ) -> None: ... - @overload - def create_window_function( - self, name: str, num_params: int, aggregate_class: Callable[[], _WindowAggregateClass] | None, / - ) -> None: ... - - def create_collation(self, name: str, callback: Callable[[str, str], int | SupportsIndex] | None, /) -> None: ... - def create_function( - self, name: str, narg: int, func: Callable[..., _SqliteData] | None, *, deterministic: bool = False - ) -> None: ... - @overload - def cursor(self, factory: None = None) -> Cursor: ... - @overload - def cursor(self, factory: Callable[[Connection], _CursorT]) -> _CursorT: ... - def execute(self, sql: str, parameters: _Parameters = ..., /) -> Cursor: ... - def executemany(self, sql: str, parameters: Iterable[_Parameters], /) -> Cursor: ... - def executescript(self, sql_script: str, /) -> Cursor: ... - def interrupt(self) -> None: ... - if sys.version_info >= (3, 13): - def iterdump(self, *, filter: str | None = None) -> Generator[str, None, None]: ... - else: - def iterdump(self) -> Generator[str, None, None]: ... - - def rollback(self) -> None: ... - def set_authorizer( - self, authorizer_callback: Callable[[int, str | None, str | None, str | None, str | None], int] | None - ) -> None: ... - def set_progress_handler(self, progress_handler: Callable[[], int | None] | None, n: int) -> None: ... - def set_trace_callback(self, trace_callback: Callable[[str], object] | None) -> None: ... - # enable_load_extension and load_extension is not available on python distributions compiled - # without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1 - def enable_load_extension(self, enable: bool, /) -> None: ... - if sys.version_info >= (3, 12): - def load_extension(self, name: str, /, *, entrypoint: str | None = None) -> None: ... - else: - def load_extension(self, name: str, /) -> None: ... - - def backup( - self, - target: Connection, - *, - pages: int = -1, - progress: Callable[[int, int, int], object] | None = None, - name: str = "main", - sleep: float = 0.25, - ) -> None: ... - if sys.version_info >= (3, 11): - def setlimit(self, category: int, limit: int, /) -> int: ... - 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: ... - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None, / - ) -> Literal[False]: ... - -class Cursor: - arraysize: int - @property - def connection(self) -> Connection: ... - # May be None, but using `| MaybeNone` (`| Any`) instead to avoid slightly annoying false positives. - @property - def description(self) -> tuple[tuple[str, None, None, None, None, None, None], ...] | MaybeNone: ... - @property - def lastrowid(self) -> int | None: ... - row_factory: Callable[[Cursor, Row], object] | None - @property - def rowcount(self) -> int: ... - def __init__(self, cursor: Connection, /) -> None: ... - def close(self) -> None: ... - def execute(self, sql: str, parameters: _Parameters = (), /) -> Self: ... - def executemany(self, sql: str, seq_of_parameters: Iterable[_Parameters], /) -> Self: ... - def executescript(self, sql_script: str, /) -> Cursor: ... - def fetchall(self) -> list[Any]: ... - def fetchmany(self, size: int | None = 1) -> list[Any]: ... - # Returns either a row (as created by the row_factory) or None, but - # putting None in the return annotation causes annoying false positives. - def fetchone(self) -> Any: ... - def setinputsizes(self, sizes: Unused, /) -> None: ... # does nothing - def setoutputsize(self, size: Unused, column: Unused = None, /) -> None: ... # does nothing - def __iter__(self) -> Self: ... - def __next__(self) -> Any: ... - -@final -class PrepareProtocol: - def __init__(self, *args: object, **kwargs: object) -> None: ... - -class Row(Sequence[Any]): - def __new__(cls, cursor: Cursor, data: tuple[Any, ...], /) -> Self: ... - def keys(self) -> list[str]: ... - @overload - def __getitem__(self, key: int | str, /) -> Any: ... - @overload - def __getitem__(self, key: slice, /) -> tuple[Any, ...]: ... - def __hash__(self) -> int: ... - def __iter__(self) -> Iterator[Any]: ... - def __len__(self) -> int: ... - # These return NotImplemented for anything that is not a Row. - def __eq__(self, value: object, /) -> bool: ... - def __ge__(self, value: object, /) -> bool: ... - def __gt__(self, value: object, /) -> bool: ... - def __le__(self, value: object, /) -> bool: ... - def __lt__(self, value: object, /) -> bool: ... - def __ne__(self, value: object, /) -> bool: ... - -# This class is not exposed. It calls itself sqlite3.Statement. -@final -@type_check_only -class _Statement: ... - -if sys.version_info >= (3, 11): - @final - class Blob: - def close(self) -> None: ... - def read(self, length: int = -1, /) -> bytes: ... - def write(self, data: ReadableBuffer, /) -> None: ... - def tell(self) -> int: ... - # whence must be one of os.SEEK_SET, os.SEEK_CUR, os.SEEK_END - def seek(self, offset: int, origin: int = 0, /) -> None: ... - def __len__(self) -> int: ... - def __enter__(self) -> Self: ... - def __exit__(self, type: object, val: object, tb: object, /) -> Literal[False]: ... - def __getitem__(self, key: SupportsIndex | slice, /) -> int: ... - def __setitem__(self, key: SupportsIndex | slice, value: int, /) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sqlite3/dbapi2.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sqlite3/dbapi2.pyi deleted file mode 100644 index d3ea3ef0e8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sqlite3/dbapi2.pyi +++ /dev/null @@ -1,241 +0,0 @@ -import sys -from _sqlite3 import ( - PARSE_COLNAMES as PARSE_COLNAMES, - PARSE_DECLTYPES as PARSE_DECLTYPES, - SQLITE_ALTER_TABLE as SQLITE_ALTER_TABLE, - SQLITE_ANALYZE as SQLITE_ANALYZE, - SQLITE_ATTACH as SQLITE_ATTACH, - SQLITE_CREATE_INDEX as SQLITE_CREATE_INDEX, - SQLITE_CREATE_TABLE as SQLITE_CREATE_TABLE, - SQLITE_CREATE_TEMP_INDEX as SQLITE_CREATE_TEMP_INDEX, - SQLITE_CREATE_TEMP_TABLE as SQLITE_CREATE_TEMP_TABLE, - SQLITE_CREATE_TEMP_TRIGGER as SQLITE_CREATE_TEMP_TRIGGER, - SQLITE_CREATE_TEMP_VIEW as SQLITE_CREATE_TEMP_VIEW, - SQLITE_CREATE_TRIGGER as SQLITE_CREATE_TRIGGER, - SQLITE_CREATE_VIEW as SQLITE_CREATE_VIEW, - SQLITE_CREATE_VTABLE as SQLITE_CREATE_VTABLE, - SQLITE_DELETE as SQLITE_DELETE, - SQLITE_DENY as SQLITE_DENY, - SQLITE_DETACH as SQLITE_DETACH, - SQLITE_DONE as SQLITE_DONE, - SQLITE_DROP_INDEX as SQLITE_DROP_INDEX, - SQLITE_DROP_TABLE as SQLITE_DROP_TABLE, - SQLITE_DROP_TEMP_INDEX as SQLITE_DROP_TEMP_INDEX, - SQLITE_DROP_TEMP_TABLE as SQLITE_DROP_TEMP_TABLE, - SQLITE_DROP_TEMP_TRIGGER as SQLITE_DROP_TEMP_TRIGGER, - SQLITE_DROP_TEMP_VIEW as SQLITE_DROP_TEMP_VIEW, - SQLITE_DROP_TRIGGER as SQLITE_DROP_TRIGGER, - SQLITE_DROP_VIEW as SQLITE_DROP_VIEW, - SQLITE_DROP_VTABLE as SQLITE_DROP_VTABLE, - SQLITE_FUNCTION as SQLITE_FUNCTION, - SQLITE_IGNORE as SQLITE_IGNORE, - SQLITE_INSERT as SQLITE_INSERT, - SQLITE_OK as SQLITE_OK, - SQLITE_PRAGMA as SQLITE_PRAGMA, - SQLITE_READ as SQLITE_READ, - SQLITE_RECURSIVE as SQLITE_RECURSIVE, - SQLITE_REINDEX as SQLITE_REINDEX, - SQLITE_SAVEPOINT as SQLITE_SAVEPOINT, - SQLITE_SELECT as SQLITE_SELECT, - SQLITE_TRANSACTION as SQLITE_TRANSACTION, - SQLITE_UPDATE as SQLITE_UPDATE, - adapt as adapt, - adapters as adapters, - complete_statement as complete_statement, - connect as connect, - converters as converters, - enable_callback_tracebacks as enable_callback_tracebacks, - register_adapter as register_adapter, - register_converter as register_converter, - sqlite_version as sqlite_version, -) -from datetime import date, datetime, time -from sqlite3 import ( - Connection as Connection, - Cursor as Cursor, - DatabaseError as DatabaseError, - DataError as DataError, - Error as Error, - IntegrityError as IntegrityError, - InterfaceError as InterfaceError, - InternalError as InternalError, - NotSupportedError as NotSupportedError, - OperationalError as OperationalError, - PrepareProtocol as PrepareProtocol, - ProgrammingError as ProgrammingError, - Row as Row, - Warning as Warning, -) - -if sys.version_info >= (3, 12): - from _sqlite3 import ( - LEGACY_TRANSACTION_CONTROL as LEGACY_TRANSACTION_CONTROL, - SQLITE_DBCONFIG_DEFENSIVE as SQLITE_DBCONFIG_DEFENSIVE, - SQLITE_DBCONFIG_DQS_DDL as SQLITE_DBCONFIG_DQS_DDL, - SQLITE_DBCONFIG_DQS_DML as SQLITE_DBCONFIG_DQS_DML, - SQLITE_DBCONFIG_ENABLE_FKEY as SQLITE_DBCONFIG_ENABLE_FKEY, - SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER as SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, - SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION as SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, - SQLITE_DBCONFIG_ENABLE_QPSG as SQLITE_DBCONFIG_ENABLE_QPSG, - SQLITE_DBCONFIG_ENABLE_TRIGGER as SQLITE_DBCONFIG_ENABLE_TRIGGER, - SQLITE_DBCONFIG_ENABLE_VIEW as SQLITE_DBCONFIG_ENABLE_VIEW, - SQLITE_DBCONFIG_LEGACY_ALTER_TABLE as SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, - SQLITE_DBCONFIG_LEGACY_FILE_FORMAT as SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, - SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE as SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, - SQLITE_DBCONFIG_RESET_DATABASE as SQLITE_DBCONFIG_RESET_DATABASE, - SQLITE_DBCONFIG_TRIGGER_EQP as SQLITE_DBCONFIG_TRIGGER_EQP, - SQLITE_DBCONFIG_TRUSTED_SCHEMA as SQLITE_DBCONFIG_TRUSTED_SCHEMA, - SQLITE_DBCONFIG_WRITABLE_SCHEMA as SQLITE_DBCONFIG_WRITABLE_SCHEMA, - ) - -if sys.version_info >= (3, 11): - from _sqlite3 import ( - SQLITE_ABORT as SQLITE_ABORT, - SQLITE_ABORT_ROLLBACK as SQLITE_ABORT_ROLLBACK, - SQLITE_AUTH as SQLITE_AUTH, - SQLITE_AUTH_USER as SQLITE_AUTH_USER, - SQLITE_BUSY as SQLITE_BUSY, - SQLITE_BUSY_RECOVERY as SQLITE_BUSY_RECOVERY, - SQLITE_BUSY_SNAPSHOT as SQLITE_BUSY_SNAPSHOT, - SQLITE_BUSY_TIMEOUT as SQLITE_BUSY_TIMEOUT, - SQLITE_CANTOPEN as SQLITE_CANTOPEN, - SQLITE_CANTOPEN_CONVPATH as SQLITE_CANTOPEN_CONVPATH, - SQLITE_CANTOPEN_DIRTYWAL as SQLITE_CANTOPEN_DIRTYWAL, - SQLITE_CANTOPEN_FULLPATH as SQLITE_CANTOPEN_FULLPATH, - SQLITE_CANTOPEN_ISDIR as SQLITE_CANTOPEN_ISDIR, - SQLITE_CANTOPEN_NOTEMPDIR as SQLITE_CANTOPEN_NOTEMPDIR, - SQLITE_CANTOPEN_SYMLINK as SQLITE_CANTOPEN_SYMLINK, - SQLITE_CONSTRAINT as SQLITE_CONSTRAINT, - SQLITE_CONSTRAINT_CHECK as SQLITE_CONSTRAINT_CHECK, - SQLITE_CONSTRAINT_COMMITHOOK as SQLITE_CONSTRAINT_COMMITHOOK, - SQLITE_CONSTRAINT_FOREIGNKEY as SQLITE_CONSTRAINT_FOREIGNKEY, - SQLITE_CONSTRAINT_FUNCTION as SQLITE_CONSTRAINT_FUNCTION, - SQLITE_CONSTRAINT_NOTNULL as SQLITE_CONSTRAINT_NOTNULL, - SQLITE_CONSTRAINT_PINNED as SQLITE_CONSTRAINT_PINNED, - SQLITE_CONSTRAINT_PRIMARYKEY as SQLITE_CONSTRAINT_PRIMARYKEY, - SQLITE_CONSTRAINT_ROWID as SQLITE_CONSTRAINT_ROWID, - SQLITE_CONSTRAINT_TRIGGER as SQLITE_CONSTRAINT_TRIGGER, - SQLITE_CONSTRAINT_UNIQUE as SQLITE_CONSTRAINT_UNIQUE, - SQLITE_CONSTRAINT_VTAB as SQLITE_CONSTRAINT_VTAB, - SQLITE_CORRUPT as SQLITE_CORRUPT, - SQLITE_CORRUPT_INDEX as SQLITE_CORRUPT_INDEX, - SQLITE_CORRUPT_SEQUENCE as SQLITE_CORRUPT_SEQUENCE, - SQLITE_CORRUPT_VTAB as SQLITE_CORRUPT_VTAB, - SQLITE_EMPTY as SQLITE_EMPTY, - SQLITE_ERROR as SQLITE_ERROR, - SQLITE_ERROR_MISSING_COLLSEQ as SQLITE_ERROR_MISSING_COLLSEQ, - SQLITE_ERROR_RETRY as SQLITE_ERROR_RETRY, - SQLITE_ERROR_SNAPSHOT as SQLITE_ERROR_SNAPSHOT, - SQLITE_FORMAT as SQLITE_FORMAT, - SQLITE_FULL as SQLITE_FULL, - SQLITE_INTERNAL as SQLITE_INTERNAL, - SQLITE_INTERRUPT as SQLITE_INTERRUPT, - SQLITE_IOERR as SQLITE_IOERR, - SQLITE_IOERR_ACCESS as SQLITE_IOERR_ACCESS, - SQLITE_IOERR_AUTH as SQLITE_IOERR_AUTH, - SQLITE_IOERR_BEGIN_ATOMIC as SQLITE_IOERR_BEGIN_ATOMIC, - SQLITE_IOERR_BLOCKED as SQLITE_IOERR_BLOCKED, - SQLITE_IOERR_CHECKRESERVEDLOCK as SQLITE_IOERR_CHECKRESERVEDLOCK, - SQLITE_IOERR_CLOSE as SQLITE_IOERR_CLOSE, - SQLITE_IOERR_COMMIT_ATOMIC as SQLITE_IOERR_COMMIT_ATOMIC, - SQLITE_IOERR_CONVPATH as SQLITE_IOERR_CONVPATH, - SQLITE_IOERR_CORRUPTFS as SQLITE_IOERR_CORRUPTFS, - SQLITE_IOERR_DATA as SQLITE_IOERR_DATA, - SQLITE_IOERR_DELETE as SQLITE_IOERR_DELETE, - SQLITE_IOERR_DELETE_NOENT as SQLITE_IOERR_DELETE_NOENT, - SQLITE_IOERR_DIR_CLOSE as SQLITE_IOERR_DIR_CLOSE, - SQLITE_IOERR_DIR_FSYNC as SQLITE_IOERR_DIR_FSYNC, - SQLITE_IOERR_FSTAT as SQLITE_IOERR_FSTAT, - SQLITE_IOERR_FSYNC as SQLITE_IOERR_FSYNC, - SQLITE_IOERR_GETTEMPPATH as SQLITE_IOERR_GETTEMPPATH, - SQLITE_IOERR_LOCK as SQLITE_IOERR_LOCK, - SQLITE_IOERR_MMAP as SQLITE_IOERR_MMAP, - SQLITE_IOERR_NOMEM as SQLITE_IOERR_NOMEM, - SQLITE_IOERR_RDLOCK as SQLITE_IOERR_RDLOCK, - SQLITE_IOERR_READ as SQLITE_IOERR_READ, - SQLITE_IOERR_ROLLBACK_ATOMIC as SQLITE_IOERR_ROLLBACK_ATOMIC, - SQLITE_IOERR_SEEK as SQLITE_IOERR_SEEK, - SQLITE_IOERR_SHMLOCK as SQLITE_IOERR_SHMLOCK, - SQLITE_IOERR_SHMMAP as SQLITE_IOERR_SHMMAP, - SQLITE_IOERR_SHMOPEN as SQLITE_IOERR_SHMOPEN, - SQLITE_IOERR_SHMSIZE as SQLITE_IOERR_SHMSIZE, - SQLITE_IOERR_SHORT_READ as SQLITE_IOERR_SHORT_READ, - SQLITE_IOERR_TRUNCATE as SQLITE_IOERR_TRUNCATE, - SQLITE_IOERR_UNLOCK as SQLITE_IOERR_UNLOCK, - SQLITE_IOERR_VNODE as SQLITE_IOERR_VNODE, - SQLITE_IOERR_WRITE as SQLITE_IOERR_WRITE, - SQLITE_LIMIT_ATTACHED as SQLITE_LIMIT_ATTACHED, - SQLITE_LIMIT_COLUMN as SQLITE_LIMIT_COLUMN, - SQLITE_LIMIT_COMPOUND_SELECT as SQLITE_LIMIT_COMPOUND_SELECT, - SQLITE_LIMIT_EXPR_DEPTH as SQLITE_LIMIT_EXPR_DEPTH, - SQLITE_LIMIT_FUNCTION_ARG as SQLITE_LIMIT_FUNCTION_ARG, - SQLITE_LIMIT_LENGTH as SQLITE_LIMIT_LENGTH, - SQLITE_LIMIT_LIKE_PATTERN_LENGTH as SQLITE_LIMIT_LIKE_PATTERN_LENGTH, - SQLITE_LIMIT_SQL_LENGTH as SQLITE_LIMIT_SQL_LENGTH, - SQLITE_LIMIT_TRIGGER_DEPTH as SQLITE_LIMIT_TRIGGER_DEPTH, - SQLITE_LIMIT_VARIABLE_NUMBER as SQLITE_LIMIT_VARIABLE_NUMBER, - SQLITE_LIMIT_VDBE_OP as SQLITE_LIMIT_VDBE_OP, - SQLITE_LIMIT_WORKER_THREADS as SQLITE_LIMIT_WORKER_THREADS, - SQLITE_LOCKED as SQLITE_LOCKED, - SQLITE_LOCKED_SHAREDCACHE as SQLITE_LOCKED_SHAREDCACHE, - SQLITE_LOCKED_VTAB as SQLITE_LOCKED_VTAB, - SQLITE_MISMATCH as SQLITE_MISMATCH, - SQLITE_MISUSE as SQLITE_MISUSE, - SQLITE_NOLFS as SQLITE_NOLFS, - SQLITE_NOMEM as SQLITE_NOMEM, - SQLITE_NOTADB as SQLITE_NOTADB, - SQLITE_NOTFOUND as SQLITE_NOTFOUND, - SQLITE_NOTICE as SQLITE_NOTICE, - SQLITE_NOTICE_RECOVER_ROLLBACK as SQLITE_NOTICE_RECOVER_ROLLBACK, - SQLITE_NOTICE_RECOVER_WAL as SQLITE_NOTICE_RECOVER_WAL, - SQLITE_OK_LOAD_PERMANENTLY as SQLITE_OK_LOAD_PERMANENTLY, - SQLITE_OK_SYMLINK as SQLITE_OK_SYMLINK, - SQLITE_PERM as SQLITE_PERM, - SQLITE_PROTOCOL as SQLITE_PROTOCOL, - SQLITE_RANGE as SQLITE_RANGE, - SQLITE_READONLY as SQLITE_READONLY, - SQLITE_READONLY_CANTINIT as SQLITE_READONLY_CANTINIT, - SQLITE_READONLY_CANTLOCK as SQLITE_READONLY_CANTLOCK, - SQLITE_READONLY_DBMOVED as SQLITE_READONLY_DBMOVED, - SQLITE_READONLY_DIRECTORY as SQLITE_READONLY_DIRECTORY, - SQLITE_READONLY_RECOVERY as SQLITE_READONLY_RECOVERY, - SQLITE_READONLY_ROLLBACK as SQLITE_READONLY_ROLLBACK, - SQLITE_ROW as SQLITE_ROW, - SQLITE_SCHEMA as SQLITE_SCHEMA, - SQLITE_TOOBIG as SQLITE_TOOBIG, - SQLITE_WARNING as SQLITE_WARNING, - SQLITE_WARNING_AUTOINDEX as SQLITE_WARNING_AUTOINDEX, - ) - from sqlite3 import Blob as Blob - -if sys.version_info < (3, 14): - # Deprecated and removed from _sqlite3 in 3.12, but removed from here in 3.14. - version: str - -if sys.version_info < (3, 12): - if sys.version_info >= (3, 10): - # deprecation wrapper that has a different name for the argument... - def enable_shared_cache(enable: int) -> None: ... - else: - from _sqlite3 import enable_shared_cache as enable_shared_cache - -if sys.version_info < (3, 10): - from _sqlite3 import OptimizedUnicode as OptimizedUnicode - -paramstyle: str -threadsafety: int -apilevel: str -Date = date -Time = time -Timestamp = datetime - -def DateFromTicks(ticks: float) -> Date: ... -def TimeFromTicks(ticks: float) -> Time: ... -def TimestampFromTicks(ticks: float) -> Timestamp: ... - -if sys.version_info < (3, 14): - # Deprecated in 3.12, removed in 3.14. - version_info: tuple[int, int, int] - -sqlite_version_info: tuple[int, int, int] -Binary = memoryview diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sqlite3/dump.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sqlite3/dump.pyi deleted file mode 100644 index ed95fa46e1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sqlite3/dump.pyi +++ /dev/null @@ -1,2 +0,0 @@ -# This file is intentionally empty. The runtime module contains only -# private functions. diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sre_compile.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sre_compile.pyi deleted file mode 100644 index 2d04a886c9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sre_compile.pyi +++ /dev/null @@ -1,11 +0,0 @@ -from re import Pattern -from sre_constants import * -from sre_constants import _NamedIntConstant -from sre_parse import SubPattern -from typing import Any - -MAXCODE: int - -def dis(code: list[_NamedIntConstant]) -> None: ... -def isstring(obj: Any) -> bool: ... -def compile(p: str | bytes | SubPattern, flags: int = 0) -> Pattern[Any]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sre_constants.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sre_constants.pyi deleted file mode 100644 index c41a52b26d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sre_constants.pyi +++ /dev/null @@ -1,126 +0,0 @@ -import sys -from re import error as error -from typing import Final -from typing_extensions import Self - -MAXGROUPS: Final[int] - -MAGIC: Final[int] - -class _NamedIntConstant(int): - name: str - def __new__(cls, value: int, name: str) -> Self: ... - -MAXREPEAT: Final[_NamedIntConstant] -OPCODES: list[_NamedIntConstant] -ATCODES: list[_NamedIntConstant] -CHCODES: list[_NamedIntConstant] -OP_IGNORE: dict[_NamedIntConstant, _NamedIntConstant] -OP_LOCALE_IGNORE: dict[_NamedIntConstant, _NamedIntConstant] -OP_UNICODE_IGNORE: dict[_NamedIntConstant, _NamedIntConstant] -AT_MULTILINE: dict[_NamedIntConstant, _NamedIntConstant] -AT_LOCALE: dict[_NamedIntConstant, _NamedIntConstant] -AT_UNICODE: dict[_NamedIntConstant, _NamedIntConstant] -CH_LOCALE: dict[_NamedIntConstant, _NamedIntConstant] -CH_UNICODE: dict[_NamedIntConstant, _NamedIntConstant] -# flags -if sys.version_info < (3, 13): - SRE_FLAG_TEMPLATE: Final = 1 -SRE_FLAG_IGNORECASE: Final = 2 -SRE_FLAG_LOCALE: Final = 4 -SRE_FLAG_MULTILINE: Final = 8 -SRE_FLAG_DOTALL: Final = 16 -SRE_FLAG_UNICODE: Final = 32 -SRE_FLAG_VERBOSE: Final = 64 -SRE_FLAG_DEBUG: Final = 128 -SRE_FLAG_ASCII: Final = 256 -# flags for INFO primitive -SRE_INFO_PREFIX: Final = 1 -SRE_INFO_LITERAL: Final = 2 -SRE_INFO_CHARSET: Final = 4 - -# Stubgen above; manually defined constants below (dynamic at runtime) - -# from OPCODES -FAILURE: Final[_NamedIntConstant] -SUCCESS: Final[_NamedIntConstant] -ANY: Final[_NamedIntConstant] -ANY_ALL: Final[_NamedIntConstant] -ASSERT: Final[_NamedIntConstant] -ASSERT_NOT: Final[_NamedIntConstant] -AT: Final[_NamedIntConstant] -BRANCH: Final[_NamedIntConstant] -if sys.version_info < (3, 11): - CALL: Final[_NamedIntConstant] -CATEGORY: Final[_NamedIntConstant] -CHARSET: Final[_NamedIntConstant] -BIGCHARSET: Final[_NamedIntConstant] -GROUPREF: Final[_NamedIntConstant] -GROUPREF_EXISTS: Final[_NamedIntConstant] -GROUPREF_IGNORE: Final[_NamedIntConstant] -IN: Final[_NamedIntConstant] -IN_IGNORE: Final[_NamedIntConstant] -INFO: Final[_NamedIntConstant] -JUMP: Final[_NamedIntConstant] -LITERAL: Final[_NamedIntConstant] -LITERAL_IGNORE: Final[_NamedIntConstant] -MARK: Final[_NamedIntConstant] -MAX_UNTIL: Final[_NamedIntConstant] -MIN_UNTIL: Final[_NamedIntConstant] -NOT_LITERAL: Final[_NamedIntConstant] -NOT_LITERAL_IGNORE: Final[_NamedIntConstant] -NEGATE: Final[_NamedIntConstant] -RANGE: Final[_NamedIntConstant] -REPEAT: Final[_NamedIntConstant] -REPEAT_ONE: Final[_NamedIntConstant] -SUBPATTERN: Final[_NamedIntConstant] -MIN_REPEAT_ONE: Final[_NamedIntConstant] -if sys.version_info >= (3, 11): - ATOMIC_GROUP: Final[_NamedIntConstant] - POSSESSIVE_REPEAT: Final[_NamedIntConstant] - POSSESSIVE_REPEAT_ONE: Final[_NamedIntConstant] -RANGE_UNI_IGNORE: Final[_NamedIntConstant] -GROUPREF_LOC_IGNORE: Final[_NamedIntConstant] -GROUPREF_UNI_IGNORE: Final[_NamedIntConstant] -IN_LOC_IGNORE: Final[_NamedIntConstant] -IN_UNI_IGNORE: Final[_NamedIntConstant] -LITERAL_LOC_IGNORE: Final[_NamedIntConstant] -LITERAL_UNI_IGNORE: Final[_NamedIntConstant] -NOT_LITERAL_LOC_IGNORE: Final[_NamedIntConstant] -NOT_LITERAL_UNI_IGNORE: Final[_NamedIntConstant] -MIN_REPEAT: Final[_NamedIntConstant] -MAX_REPEAT: Final[_NamedIntConstant] - -# from ATCODES -AT_BEGINNING: Final[_NamedIntConstant] -AT_BEGINNING_LINE: Final[_NamedIntConstant] -AT_BEGINNING_STRING: Final[_NamedIntConstant] -AT_BOUNDARY: Final[_NamedIntConstant] -AT_NON_BOUNDARY: Final[_NamedIntConstant] -AT_END: Final[_NamedIntConstant] -AT_END_LINE: Final[_NamedIntConstant] -AT_END_STRING: Final[_NamedIntConstant] -AT_LOC_BOUNDARY: Final[_NamedIntConstant] -AT_LOC_NON_BOUNDARY: Final[_NamedIntConstant] -AT_UNI_BOUNDARY: Final[_NamedIntConstant] -AT_UNI_NON_BOUNDARY: Final[_NamedIntConstant] - -# from CHCODES -CATEGORY_DIGIT: Final[_NamedIntConstant] -CATEGORY_NOT_DIGIT: Final[_NamedIntConstant] -CATEGORY_SPACE: Final[_NamedIntConstant] -CATEGORY_NOT_SPACE: Final[_NamedIntConstant] -CATEGORY_WORD: Final[_NamedIntConstant] -CATEGORY_NOT_WORD: Final[_NamedIntConstant] -CATEGORY_LINEBREAK: Final[_NamedIntConstant] -CATEGORY_NOT_LINEBREAK: Final[_NamedIntConstant] -CATEGORY_LOC_WORD: Final[_NamedIntConstant] -CATEGORY_LOC_NOT_WORD: Final[_NamedIntConstant] -CATEGORY_UNI_DIGIT: Final[_NamedIntConstant] -CATEGORY_UNI_NOT_DIGIT: Final[_NamedIntConstant] -CATEGORY_UNI_SPACE: Final[_NamedIntConstant] -CATEGORY_UNI_NOT_SPACE: Final[_NamedIntConstant] -CATEGORY_UNI_WORD: Final[_NamedIntConstant] -CATEGORY_UNI_NOT_WORD: Final[_NamedIntConstant] -CATEGORY_UNI_LINEBREAK: Final[_NamedIntConstant] -CATEGORY_UNI_NOT_LINEBREAK: Final[_NamedIntConstant] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sre_parse.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sre_parse.pyi deleted file mode 100644 index c242bd2a06..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sre_parse.pyi +++ /dev/null @@ -1,104 +0,0 @@ -import sys -from collections.abc import Iterable -from re import Match, Pattern as _Pattern -from sre_constants import * -from sre_constants import _NamedIntConstant as _NIC, error as _Error -from typing import Any, overload -from typing_extensions import TypeAlias - -SPECIAL_CHARS: str -REPEAT_CHARS: str -DIGITS: frozenset[str] -OCTDIGITS: frozenset[str] -HEXDIGITS: frozenset[str] -ASCIILETTERS: frozenset[str] -WHITESPACE: frozenset[str] -ESCAPES: dict[str, tuple[_NIC, int]] -CATEGORIES: dict[str, tuple[_NIC, _NIC] | tuple[_NIC, list[tuple[_NIC, _NIC]]]] -FLAGS: dict[str, int] -TYPE_FLAGS: int -GLOBAL_FLAGS: int - -if sys.version_info >= (3, 11): - MAXWIDTH: int - -if sys.version_info < (3, 11): - class Verbose(Exception): ... - -_OpSubpatternType: TypeAlias = tuple[int | None, int, int, SubPattern] -_OpGroupRefExistsType: TypeAlias = tuple[int, SubPattern, SubPattern] -_OpInType: TypeAlias = list[tuple[_NIC, int]] -_OpBranchType: TypeAlias = tuple[None, list[SubPattern]] -_AvType: TypeAlias = _OpInType | _OpBranchType | Iterable[SubPattern] | _OpGroupRefExistsType | _OpSubpatternType -_CodeType: TypeAlias = tuple[_NIC, _AvType] - -class State: - flags: int - groupdict: dict[str, int] - groupwidths: list[int | None] - lookbehindgroups: int | None - @property - def groups(self) -> int: ... - def opengroup(self, name: str | None = ...) -> int: ... - def closegroup(self, gid: int, p: SubPattern) -> None: ... - def checkgroup(self, gid: int) -> bool: ... - def checklookbehindgroup(self, gid: int, source: Tokenizer) -> None: ... - -class SubPattern: - data: list[_CodeType] - width: int | None - state: State - - def __init__(self, state: State, data: list[_CodeType] | None = None) -> None: ... - def dump(self, level: int = 0) -> None: ... - def __len__(self) -> int: ... - def __delitem__(self, index: int | slice) -> None: ... - def __getitem__(self, index: int | slice) -> SubPattern | _CodeType: ... - def __setitem__(self, index: int | slice, code: _CodeType) -> None: ... - def insert(self, index: int, code: _CodeType) -> None: ... - def append(self, code: _CodeType) -> None: ... - def getwidth(self) -> tuple[int, int]: ... - -class Tokenizer: - istext: bool - string: Any - decoded_string: str - index: int - next: str | None - def __init__(self, string: Any) -> None: ... - def match(self, char: str) -> bool: ... - def get(self) -> str | None: ... - def getwhile(self, n: int, charset: Iterable[str]) -> str: ... - def getuntil(self, terminator: str, name: str) -> str: ... - @property - def pos(self) -> int: ... - def tell(self) -> int: ... - def seek(self, index: int) -> None: ... - def error(self, msg: str, offset: int = 0) -> _Error: ... - - if sys.version_info >= (3, 12): - def checkgroupname(self, name: str, offset: int) -> None: ... - elif sys.version_info >= (3, 11): - def checkgroupname(self, name: str, offset: int, nested: int) -> None: ... - -def fix_flags(src: str | bytes, flags: int) -> int: ... - -_TemplateType: TypeAlias = tuple[list[tuple[int, int]], list[str | None]] -_TemplateByteType: TypeAlias = tuple[list[tuple[int, int]], list[bytes | None]] - -if sys.version_info >= (3, 12): - @overload - def parse_template(source: str, pattern: _Pattern[Any]) -> _TemplateType: ... - @overload - def parse_template(source: bytes, pattern: _Pattern[Any]) -> _TemplateByteType: ... - -else: - @overload - def parse_template(source: str, state: _Pattern[Any]) -> _TemplateType: ... - @overload - def parse_template(source: bytes, state: _Pattern[Any]) -> _TemplateByteType: ... - -def parse(str: str, flags: int = 0, state: State | None = None) -> SubPattern: ... - -if sys.version_info < (3, 12): - def expand_template(template: _TemplateType, match: Match[Any]) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/ssl.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/ssl.pyi deleted file mode 100644 index 9fbf5e8dfa..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/ssl.pyi +++ /dev/null @@ -1,534 +0,0 @@ -import enum -import socket -import sys -from _ssl import ( - _DEFAULT_CIPHERS as _DEFAULT_CIPHERS, - _OPENSSL_API_VERSION as _OPENSSL_API_VERSION, - HAS_ALPN as HAS_ALPN, - HAS_ECDH as HAS_ECDH, - HAS_NPN as HAS_NPN, - HAS_SNI as HAS_SNI, - OPENSSL_VERSION as OPENSSL_VERSION, - OPENSSL_VERSION_INFO as OPENSSL_VERSION_INFO, - OPENSSL_VERSION_NUMBER as OPENSSL_VERSION_NUMBER, - HAS_SSLv2 as HAS_SSLv2, - HAS_SSLv3 as HAS_SSLv3, - HAS_TLSv1 as HAS_TLSv1, - HAS_TLSv1_1 as HAS_TLSv1_1, - HAS_TLSv1_2 as HAS_TLSv1_2, - HAS_TLSv1_3 as HAS_TLSv1_3, - MemoryBIO as MemoryBIO, - RAND_add as RAND_add, - RAND_bytes as RAND_bytes, - RAND_status as RAND_status, - SSLSession as SSLSession, - _PasswordType as _PasswordType, # typeshed only, but re-export for other type stubs to use - _SSLContext, -) -from _typeshed import ReadableBuffer, StrOrBytesPath, WriteableBuffer -from collections.abc import Callable, Iterable -from typing import Any, Literal, NamedTuple, TypedDict, overload, type_check_only -from typing_extensions import Never, Self, TypeAlias, deprecated - -if sys.version_info >= (3, 13): - from _ssl import HAS_PSK as HAS_PSK - -if sys.version_info < (3, 12): - from _ssl import RAND_pseudo_bytes as RAND_pseudo_bytes - -if sys.version_info < (3, 10): - from _ssl import RAND_egd as RAND_egd - -if sys.platform == "win32": - from _ssl import enum_certificates as enum_certificates, enum_crls as enum_crls - -_PCTRTT: TypeAlias = tuple[tuple[str, str], ...] -_PCTRTTT: TypeAlias = tuple[_PCTRTT, ...] -_PeerCertRetDictType: TypeAlias = dict[str, str | _PCTRTTT | _PCTRTT] -_PeerCertRetType: TypeAlias = _PeerCertRetDictType | bytes | None -_SrvnmeCbType: TypeAlias = Callable[[SSLSocket | SSLObject, str | None, SSLSocket], int | None] - -socket_error = OSError - -class _Cipher(TypedDict): - aead: bool - alg_bits: int - auth: str - description: str - digest: str | None - id: int - kea: str - name: str - protocol: str - strength_bits: int - symmetric: str - -class SSLError(OSError): - library: str - reason: str - -class SSLZeroReturnError(SSLError): ... -class SSLWantReadError(SSLError): ... -class SSLWantWriteError(SSLError): ... -class SSLSyscallError(SSLError): ... -class SSLEOFError(SSLError): ... - -class SSLCertVerificationError(SSLError, ValueError): - verify_code: int - verify_message: str - -CertificateError = SSLCertVerificationError - -if sys.version_info < (3, 12): - def wrap_socket( - sock: socket.socket, - keyfile: StrOrBytesPath | None = None, - certfile: StrOrBytesPath | None = None, - server_side: bool = False, - cert_reqs: int = ..., - ssl_version: int = ..., - ca_certs: str | None = None, - do_handshake_on_connect: bool = True, - suppress_ragged_eofs: bool = True, - ciphers: str | None = None, - ) -> SSLSocket: ... - -def create_default_context( - purpose: Purpose = ..., - *, - cafile: StrOrBytesPath | None = None, - capath: StrOrBytesPath | None = None, - cadata: str | ReadableBuffer | None = None, -) -> SSLContext: ... - -if sys.version_info >= (3, 10): - def _create_unverified_context( - protocol: int | None = None, - *, - cert_reqs: int = ..., - check_hostname: bool = False, - purpose: Purpose = ..., - certfile: StrOrBytesPath | None = None, - keyfile: StrOrBytesPath | None = None, - cafile: StrOrBytesPath | None = None, - capath: StrOrBytesPath | None = None, - cadata: str | ReadableBuffer | None = None, - ) -> SSLContext: ... - -else: - def _create_unverified_context( - protocol: int = ..., - *, - cert_reqs: int = ..., - check_hostname: bool = False, - purpose: Purpose = ..., - certfile: StrOrBytesPath | None = None, - keyfile: StrOrBytesPath | None = None, - cafile: StrOrBytesPath | None = None, - capath: StrOrBytesPath | None = None, - cadata: str | ReadableBuffer | None = None, - ) -> SSLContext: ... - -_create_default_https_context: Callable[..., SSLContext] - -if sys.version_info < (3, 12): - def match_hostname(cert: _PeerCertRetDictType, hostname: str) -> None: ... - -def cert_time_to_seconds(cert_time: str) -> int: ... - -if sys.version_info >= (3, 10): - def get_server_certificate( - addr: tuple[str, int], ssl_version: int = ..., ca_certs: str | None = None, timeout: float = ... - ) -> str: ... - -else: - def get_server_certificate(addr: tuple[str, int], ssl_version: int = ..., ca_certs: str | None = None) -> str: ... - -def DER_cert_to_PEM_cert(der_cert_bytes: ReadableBuffer) -> str: ... -def PEM_cert_to_DER_cert(pem_cert_string: str) -> bytes: ... - -class DefaultVerifyPaths(NamedTuple): - cafile: str - capath: str - openssl_cafile_env: str - openssl_cafile: str - openssl_capath_env: str - openssl_capath: str - -def get_default_verify_paths() -> DefaultVerifyPaths: ... - -class VerifyMode(enum.IntEnum): - CERT_NONE = 0 - CERT_OPTIONAL = 1 - CERT_REQUIRED = 2 - -CERT_NONE: VerifyMode -CERT_OPTIONAL: VerifyMode -CERT_REQUIRED: VerifyMode - -class VerifyFlags(enum.IntFlag): - VERIFY_DEFAULT = 0 - VERIFY_CRL_CHECK_LEAF = 4 - VERIFY_CRL_CHECK_CHAIN = 12 - VERIFY_X509_STRICT = 32 - VERIFY_X509_TRUSTED_FIRST = 32768 - if sys.version_info >= (3, 10): - VERIFY_ALLOW_PROXY_CERTS = 64 - VERIFY_X509_PARTIAL_CHAIN = 524288 - -VERIFY_DEFAULT: VerifyFlags -VERIFY_CRL_CHECK_LEAF: VerifyFlags -VERIFY_CRL_CHECK_CHAIN: VerifyFlags -VERIFY_X509_STRICT: VerifyFlags -VERIFY_X509_TRUSTED_FIRST: VerifyFlags - -if sys.version_info >= (3, 10): - VERIFY_ALLOW_PROXY_CERTS: VerifyFlags - VERIFY_X509_PARTIAL_CHAIN: VerifyFlags - -class _SSLMethod(enum.IntEnum): - PROTOCOL_SSLv23 = 2 - PROTOCOL_SSLv2 = ... - PROTOCOL_SSLv3 = ... - PROTOCOL_TLSv1 = 3 - PROTOCOL_TLSv1_1 = 4 - PROTOCOL_TLSv1_2 = 5 - PROTOCOL_TLS = 2 - PROTOCOL_TLS_CLIENT = 16 - PROTOCOL_TLS_SERVER = 17 - -PROTOCOL_SSLv23: _SSLMethod -PROTOCOL_SSLv2: _SSLMethod -PROTOCOL_SSLv3: _SSLMethod -PROTOCOL_TLSv1: _SSLMethod -PROTOCOL_TLSv1_1: _SSLMethod -PROTOCOL_TLSv1_2: _SSLMethod -PROTOCOL_TLS: _SSLMethod -PROTOCOL_TLS_CLIENT: _SSLMethod -PROTOCOL_TLS_SERVER: _SSLMethod - -class Options(enum.IntFlag): - OP_ALL = 2147483728 - OP_NO_SSLv2 = 0 - OP_NO_SSLv3 = 33554432 - OP_NO_TLSv1 = 67108864 - OP_NO_TLSv1_1 = 268435456 - OP_NO_TLSv1_2 = 134217728 - OP_NO_TLSv1_3 = 536870912 - OP_CIPHER_SERVER_PREFERENCE = 4194304 - OP_SINGLE_DH_USE = 0 - OP_SINGLE_ECDH_USE = 0 - OP_NO_COMPRESSION = 131072 - OP_NO_TICKET = 16384 - OP_NO_RENEGOTIATION = 1073741824 - OP_ENABLE_MIDDLEBOX_COMPAT = 1048576 - if sys.version_info >= (3, 12): - OP_LEGACY_SERVER_CONNECT = 4 - OP_ENABLE_KTLS = 8 - if sys.version_info >= (3, 11) or sys.platform == "linux": - OP_IGNORE_UNEXPECTED_EOF = 128 - -OP_ALL: Options -OP_NO_SSLv2: Options -OP_NO_SSLv3: Options -OP_NO_TLSv1: Options -OP_NO_TLSv1_1: Options -OP_NO_TLSv1_2: Options -OP_NO_TLSv1_3: Options -OP_CIPHER_SERVER_PREFERENCE: Options -OP_SINGLE_DH_USE: Options -OP_SINGLE_ECDH_USE: Options -OP_NO_COMPRESSION: Options -OP_NO_TICKET: Options -OP_NO_RENEGOTIATION: Options -OP_ENABLE_MIDDLEBOX_COMPAT: Options -if sys.version_info >= (3, 12): - OP_LEGACY_SERVER_CONNECT: Options - OP_ENABLE_KTLS: Options -if sys.version_info >= (3, 11) or sys.platform == "linux": - OP_IGNORE_UNEXPECTED_EOF: Options - -HAS_NEVER_CHECK_COMMON_NAME: bool - -CHANNEL_BINDING_TYPES: list[str] - -class AlertDescription(enum.IntEnum): - ALERT_DESCRIPTION_ACCESS_DENIED = 49 - ALERT_DESCRIPTION_BAD_CERTIFICATE = 42 - ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE = 114 - ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE = 113 - ALERT_DESCRIPTION_BAD_RECORD_MAC = 20 - ALERT_DESCRIPTION_CERTIFICATE_EXPIRED = 45 - ALERT_DESCRIPTION_CERTIFICATE_REVOKED = 44 - ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN = 46 - ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE = 111 - ALERT_DESCRIPTION_CLOSE_NOTIFY = 0 - ALERT_DESCRIPTION_DECODE_ERROR = 50 - ALERT_DESCRIPTION_DECOMPRESSION_FAILURE = 30 - ALERT_DESCRIPTION_DECRYPT_ERROR = 51 - ALERT_DESCRIPTION_HANDSHAKE_FAILURE = 40 - ALERT_DESCRIPTION_ILLEGAL_PARAMETER = 47 - ALERT_DESCRIPTION_INSUFFICIENT_SECURITY = 71 - ALERT_DESCRIPTION_INTERNAL_ERROR = 80 - ALERT_DESCRIPTION_NO_RENEGOTIATION = 100 - ALERT_DESCRIPTION_PROTOCOL_VERSION = 70 - ALERT_DESCRIPTION_RECORD_OVERFLOW = 22 - ALERT_DESCRIPTION_UNEXPECTED_MESSAGE = 10 - ALERT_DESCRIPTION_UNKNOWN_CA = 48 - ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY = 115 - ALERT_DESCRIPTION_UNRECOGNIZED_NAME = 112 - ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE = 43 - ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION = 110 - ALERT_DESCRIPTION_USER_CANCELLED = 90 - -ALERT_DESCRIPTION_HANDSHAKE_FAILURE: AlertDescription -ALERT_DESCRIPTION_INTERNAL_ERROR: AlertDescription -ALERT_DESCRIPTION_ACCESS_DENIED: AlertDescription -ALERT_DESCRIPTION_BAD_CERTIFICATE: AlertDescription -ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE: AlertDescription -ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE: AlertDescription -ALERT_DESCRIPTION_BAD_RECORD_MAC: AlertDescription -ALERT_DESCRIPTION_CERTIFICATE_EXPIRED: AlertDescription -ALERT_DESCRIPTION_CERTIFICATE_REVOKED: AlertDescription -ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN: AlertDescription -ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE: AlertDescription -ALERT_DESCRIPTION_CLOSE_NOTIFY: AlertDescription -ALERT_DESCRIPTION_DECODE_ERROR: AlertDescription -ALERT_DESCRIPTION_DECOMPRESSION_FAILURE: AlertDescription -ALERT_DESCRIPTION_DECRYPT_ERROR: AlertDescription -ALERT_DESCRIPTION_ILLEGAL_PARAMETER: AlertDescription -ALERT_DESCRIPTION_INSUFFICIENT_SECURITY: AlertDescription -ALERT_DESCRIPTION_NO_RENEGOTIATION: AlertDescription -ALERT_DESCRIPTION_PROTOCOL_VERSION: AlertDescription -ALERT_DESCRIPTION_RECORD_OVERFLOW: AlertDescription -ALERT_DESCRIPTION_UNEXPECTED_MESSAGE: AlertDescription -ALERT_DESCRIPTION_UNKNOWN_CA: AlertDescription -ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY: AlertDescription -ALERT_DESCRIPTION_UNRECOGNIZED_NAME: AlertDescription -ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE: AlertDescription -ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION: AlertDescription -ALERT_DESCRIPTION_USER_CANCELLED: AlertDescription - -# This class is not exposed. It calls itself ssl._ASN1Object. -@type_check_only -class _ASN1ObjectBase(NamedTuple): - nid: int - shortname: str - longname: str - oid: str - -class _ASN1Object(_ASN1ObjectBase): - def __new__(cls, oid: str) -> Self: ... - @classmethod - def fromnid(cls, nid: int) -> Self: ... - @classmethod - def fromname(cls, name: str) -> Self: ... - -class Purpose(_ASN1Object, enum.Enum): - # Normally this class would inherit __new__ from _ASN1Object, but - # because this is an enum, the inherited __new__ is replaced at runtime with - # Enum.__new__. - def __new__(cls, value: object) -> Self: ... - SERVER_AUTH = (129, "serverAuth", "TLS Web Server Authentication", "1.3.6.1.5.5.7.3.2") # pyright: ignore[reportCallIssue] - CLIENT_AUTH = (130, "clientAuth", "TLS Web Client Authentication", "1.3.6.1.5.5.7.3.1") # pyright: ignore[reportCallIssue] - -class SSLSocket(socket.socket): - context: SSLContext - server_side: bool - server_hostname: str | None - session: SSLSession | None - @property - def session_reused(self) -> bool | None: ... - def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def connect(self, addr: socket._Address) -> None: ... - def connect_ex(self, addr: socket._Address) -> int: ... - def recv(self, buflen: int = 1024, flags: int = 0) -> bytes: ... - def recv_into(self, buffer: WriteableBuffer, nbytes: int | None = None, flags: int = 0) -> int: ... - def recvfrom(self, buflen: int = 1024, flags: int = 0) -> tuple[bytes, socket._RetAddress]: ... - def recvfrom_into( - self, buffer: WriteableBuffer, nbytes: int | None = None, flags: int = 0 - ) -> tuple[int, socket._RetAddress]: ... - def send(self, data: ReadableBuffer, flags: int = 0) -> int: ... - def sendall(self, data: ReadableBuffer, flags: int = 0) -> None: ... - @overload - def sendto(self, data: ReadableBuffer, flags_or_addr: socket._Address, addr: None = None) -> int: ... - @overload - def sendto(self, data: ReadableBuffer, flags_or_addr: int, addr: socket._Address) -> int: ... - def shutdown(self, how: int) -> None: ... - def read(self, len: int = 1024, buffer: bytearray | None = None) -> bytes: ... - def write(self, data: ReadableBuffer) -> int: ... - def do_handshake(self, block: bool = False) -> None: ... # block is undocumented - @overload - def getpeercert(self, binary_form: Literal[False] = False) -> _PeerCertRetDictType | None: ... - @overload - def getpeercert(self, binary_form: Literal[True]) -> bytes | None: ... - @overload - def getpeercert(self, binary_form: bool) -> _PeerCertRetType: ... - def cipher(self) -> tuple[str, str, int] | None: ... - def shared_ciphers(self) -> list[tuple[str, str, int]] | None: ... - def compression(self) -> str | None: ... - def get_channel_binding(self, cb_type: str = "tls-unique") -> bytes | None: ... - def selected_alpn_protocol(self) -> str | None: ... - if sys.version_info >= (3, 10): - @deprecated("Deprecated in 3.10. Use ALPN instead.") - def selected_npn_protocol(self) -> str | None: ... - else: - def selected_npn_protocol(self) -> str | None: ... - - def accept(self) -> tuple[SSLSocket, socket._RetAddress]: ... - def unwrap(self) -> socket.socket: ... - def version(self) -> str | None: ... - def pending(self) -> int: ... - def verify_client_post_handshake(self) -> None: ... - # These methods always raise `NotImplementedError`: - def recvmsg(self, *args: Never, **kwargs: Never) -> Never: ... # type: ignore[override] - def recvmsg_into(self, *args: Never, **kwargs: Never) -> Never: ... # type: ignore[override] - def sendmsg(self, *args: Never, **kwargs: Never) -> Never: ... # type: ignore[override] - if sys.version_info >= (3, 13): - def get_verified_chain(self) -> list[bytes]: ... - def get_unverified_chain(self) -> list[bytes]: ... - -class TLSVersion(enum.IntEnum): - MINIMUM_SUPPORTED = -2 - MAXIMUM_SUPPORTED = -1 - SSLv3 = 768 - TLSv1 = 769 - TLSv1_1 = 770 - TLSv1_2 = 771 - TLSv1_3 = 772 - -class SSLContext(_SSLContext): - options: Options - verify_flags: VerifyFlags - verify_mode: VerifyMode - @property - def protocol(self) -> _SSLMethod: ... # type: ignore[override] - hostname_checks_common_name: bool - maximum_version: TLSVersion - minimum_version: TLSVersion - # The following two attributes have class-level defaults. - # However, the docs explicitly state that it's OK to override these attributes on instances, - # so making these ClassVars wouldn't be appropriate - sslobject_class: type[SSLObject] - sslsocket_class: type[SSLSocket] - keylog_filename: str - post_handshake_auth: bool - if sys.version_info >= (3, 10): - security_level: int - if sys.version_info >= (3, 10): - # Using the default (None) for the `protocol` parameter is deprecated, - # but there isn't a good way of marking that in the stub unless/until PEP 702 is accepted - def __new__(cls, protocol: int | None = None, *args: Any, **kwargs: Any) -> Self: ... - else: - def __new__(cls, protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ... - - def load_default_certs(self, purpose: Purpose = ...) -> None: ... - def load_verify_locations( - self, - cafile: StrOrBytesPath | None = None, - capath: StrOrBytesPath | None = None, - cadata: str | ReadableBuffer | None = None, - ) -> None: ... - @overload - def get_ca_certs(self, binary_form: Literal[False] = False) -> list[_PeerCertRetDictType]: ... - @overload - def get_ca_certs(self, binary_form: Literal[True]) -> list[bytes]: ... - @overload - def get_ca_certs(self, binary_form: bool = False) -> Any: ... - def get_ciphers(self) -> list[_Cipher]: ... - def set_default_verify_paths(self) -> None: ... - def set_ciphers(self, cipherlist: str, /) -> None: ... - def set_alpn_protocols(self, alpn_protocols: Iterable[str]) -> None: ... - if sys.version_info >= (3, 10): - @deprecated("Deprecated in 3.10. Use ALPN instead.") - def set_npn_protocols(self, npn_protocols: Iterable[str]) -> None: ... - else: - def set_npn_protocols(self, npn_protocols: Iterable[str]) -> None: ... - - def set_servername_callback(self, server_name_callback: _SrvnmeCbType | None) -> None: ... - def load_dh_params(self, path: str, /) -> None: ... - def set_ecdh_curve(self, name: str, /) -> None: ... - def wrap_socket( - self, - sock: socket.socket, - server_side: bool = False, - do_handshake_on_connect: bool = True, - suppress_ragged_eofs: bool = True, - server_hostname: str | bytes | None = None, - session: SSLSession | None = None, - ) -> SSLSocket: ... - def wrap_bio( - self, - incoming: MemoryBIO, - outgoing: MemoryBIO, - server_side: bool = False, - server_hostname: str | bytes | None = None, - session: SSLSession | None = None, - ) -> SSLObject: ... - -class SSLObject: - context: SSLContext - @property - def server_side(self) -> bool: ... - @property - def server_hostname(self) -> str | None: ... - session: SSLSession | None - @property - def session_reused(self) -> bool: ... - def __init__(self, *args: Any, **kwargs: Any) -> None: ... - def read(self, len: int = 1024, buffer: bytearray | None = None) -> bytes: ... - def write(self, data: ReadableBuffer) -> int: ... - @overload - def getpeercert(self, binary_form: Literal[False] = False) -> _PeerCertRetDictType | None: ... - @overload - def getpeercert(self, binary_form: Literal[True]) -> bytes | None: ... - @overload - def getpeercert(self, binary_form: bool) -> _PeerCertRetType: ... - def selected_alpn_protocol(self) -> str | None: ... - if sys.version_info >= (3, 10): - @deprecated("Deprecated in 3.10. Use ALPN instead.") - def selected_npn_protocol(self) -> str | None: ... - else: - def selected_npn_protocol(self) -> str | None: ... - - def cipher(self) -> tuple[str, str, int] | None: ... - def shared_ciphers(self) -> list[tuple[str, str, int]] | None: ... - def compression(self) -> str | None: ... - def pending(self) -> int: ... - def do_handshake(self) -> None: ... - def unwrap(self) -> None: ... - def version(self) -> str | None: ... - def get_channel_binding(self, cb_type: str = "tls-unique") -> bytes | None: ... - def verify_client_post_handshake(self) -> None: ... - if sys.version_info >= (3, 13): - def get_verified_chain(self) -> list[bytes]: ... - def get_unverified_chain(self) -> list[bytes]: ... - -class SSLErrorNumber(enum.IntEnum): - SSL_ERROR_EOF = 8 - SSL_ERROR_INVALID_ERROR_CODE = 10 - SSL_ERROR_SSL = 1 - SSL_ERROR_SYSCALL = 5 - SSL_ERROR_WANT_CONNECT = 7 - SSL_ERROR_WANT_READ = 2 - SSL_ERROR_WANT_WRITE = 3 - SSL_ERROR_WANT_X509_LOOKUP = 4 - SSL_ERROR_ZERO_RETURN = 6 - -SSL_ERROR_EOF: SSLErrorNumber # undocumented -SSL_ERROR_INVALID_ERROR_CODE: SSLErrorNumber # undocumented -SSL_ERROR_SSL: SSLErrorNumber # undocumented -SSL_ERROR_SYSCALL: SSLErrorNumber # undocumented -SSL_ERROR_WANT_CONNECT: SSLErrorNumber # undocumented -SSL_ERROR_WANT_READ: SSLErrorNumber # undocumented -SSL_ERROR_WANT_WRITE: SSLErrorNumber # undocumented -SSL_ERROR_WANT_X509_LOOKUP: SSLErrorNumber # undocumented -SSL_ERROR_ZERO_RETURN: SSLErrorNumber # undocumented - -def get_protocol_name(protocol_code: int) -> str: ... - -PEM_FOOTER: str -PEM_HEADER: str -SOCK_STREAM: int -SOL_SOCKET: int -SO_TYPE: int diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/stat.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/stat.pyi deleted file mode 100644 index face28ab0c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/stat.pyi +++ /dev/null @@ -1,7 +0,0 @@ -import sys -from _stat import * -from typing import Final - -if sys.version_info >= (3, 13): - # https://github.com/python/cpython/issues/114081#issuecomment-2119017790 - SF_RESTRICTED: Final = 0x00080000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/statistics.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/statistics.pyi deleted file mode 100644 index 6d7d3fbb49..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/statistics.pyi +++ /dev/null @@ -1,158 +0,0 @@ -import sys -from _typeshed import SupportsRichComparisonT -from collections.abc import Callable, Hashable, Iterable, Sequence -from decimal import Decimal -from fractions import Fraction -from typing import Literal, NamedTuple, SupportsFloat, SupportsIndex, TypeVar -from typing_extensions import Self, TypeAlias - -__all__ = [ - "StatisticsError", - "fmean", - "geometric_mean", - "mean", - "harmonic_mean", - "pstdev", - "pvariance", - "stdev", - "variance", - "median", - "median_low", - "median_high", - "median_grouped", - "mode", - "multimode", - "NormalDist", - "quantiles", -] - -if sys.version_info >= (3, 10): - __all__ += ["covariance", "correlation", "linear_regression"] -if sys.version_info >= (3, 13): - __all__ += ["kde", "kde_random"] - -# Most functions in this module accept homogeneous collections of one of these types -_Number: TypeAlias = float | Decimal | Fraction -_NumberT = TypeVar("_NumberT", float, Decimal, Fraction) - -# Used in mode, multimode -_HashableT = TypeVar("_HashableT", bound=Hashable) - -# Used in NormalDist.samples and kde_random -_Seed: TypeAlias = int | float | str | bytes | bytearray # noqa: Y041 - -class StatisticsError(ValueError): ... - -if sys.version_info >= (3, 11): - def fmean(data: Iterable[SupportsFloat], weights: Iterable[SupportsFloat] | None = None) -> float: ... - -else: - def fmean(data: Iterable[SupportsFloat]) -> float: ... - -def geometric_mean(data: Iterable[SupportsFloat]) -> float: ... -def mean(data: Iterable[_NumberT]) -> _NumberT: ... - -if sys.version_info >= (3, 10): - def harmonic_mean(data: Iterable[_NumberT], weights: Iterable[_Number] | None = None) -> _NumberT: ... - -else: - def harmonic_mean(data: Iterable[_NumberT]) -> _NumberT: ... - -def median(data: Iterable[_NumberT]) -> _NumberT: ... -def median_low(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ... -def median_high(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ... - -if sys.version_info >= (3, 11): - def median_grouped(data: Iterable[SupportsFloat], interval: SupportsFloat = 1.0) -> float: ... - -else: - def median_grouped(data: Iterable[_NumberT], interval: _NumberT | float = 1) -> _NumberT | float: ... - -def mode(data: Iterable[_HashableT]) -> _HashableT: ... -def multimode(data: Iterable[_HashableT]) -> list[_HashableT]: ... -def pstdev(data: Iterable[_NumberT], mu: _NumberT | None = None) -> _NumberT: ... -def pvariance(data: Iterable[_NumberT], mu: _NumberT | None = None) -> _NumberT: ... -def quantiles( - data: Iterable[_NumberT], *, n: int = 4, method: Literal["inclusive", "exclusive"] = "exclusive" -) -> list[_NumberT]: ... -def stdev(data: Iterable[_NumberT], xbar: _NumberT | None = None) -> _NumberT: ... -def variance(data: Iterable[_NumberT], xbar: _NumberT | None = None) -> _NumberT: ... - -class NormalDist: - def __init__(self, mu: float = 0.0, sigma: float = 1.0) -> None: ... - @property - def mean(self) -> float: ... - @property - def median(self) -> float: ... - @property - def mode(self) -> float: ... - @property - def stdev(self) -> float: ... - @property - def variance(self) -> float: ... - @classmethod - def from_samples(cls, data: Iterable[SupportsFloat]) -> Self: ... - def samples(self, n: SupportsIndex, *, seed: _Seed | None = None) -> list[float]: ... - def pdf(self, x: float) -> float: ... - def cdf(self, x: float) -> float: ... - def inv_cdf(self, p: float) -> float: ... - def overlap(self, other: NormalDist) -> float: ... - def quantiles(self, n: int = 4) -> list[float]: ... - def zscore(self, x: float) -> float: ... - def __eq__(x1, x2: object) -> bool: ... - def __add__(x1, x2: float | NormalDist) -> NormalDist: ... - def __sub__(x1, x2: float | NormalDist) -> NormalDist: ... - def __mul__(x1, x2: float) -> NormalDist: ... - def __truediv__(x1, x2: float) -> NormalDist: ... - def __pos__(x1) -> NormalDist: ... - def __neg__(x1) -> NormalDist: ... - __radd__ = __add__ - def __rsub__(x1, x2: float | NormalDist) -> NormalDist: ... - __rmul__ = __mul__ - def __hash__(self) -> int: ... - -if sys.version_info >= (3, 12): - def correlation( - x: Sequence[_Number], y: Sequence[_Number], /, *, method: Literal["linear", "ranked"] = "linear" - ) -> float: ... - -elif sys.version_info >= (3, 10): - def correlation(x: Sequence[_Number], y: Sequence[_Number], /) -> float: ... - -if sys.version_info >= (3, 10): - def covariance(x: Sequence[_Number], y: Sequence[_Number], /) -> float: ... - - class LinearRegression(NamedTuple): - slope: float - intercept: float - -if sys.version_info >= (3, 11): - def linear_regression( - regressor: Sequence[_Number], dependent_variable: Sequence[_Number], /, *, proportional: bool = False - ) -> LinearRegression: ... - -elif sys.version_info >= (3, 10): - def linear_regression(regressor: Sequence[_Number], dependent_variable: Sequence[_Number], /) -> LinearRegression: ... - -if sys.version_info >= (3, 13): - _Kernel: TypeAlias = Literal[ - "normal", - "gauss", - "logistic", - "sigmoid", - "rectangular", - "uniform", - "triangular", - "parabolic", - "epanechnikov", - "quartic", - "biweight", - "triweight", - "cosine", - ] - def kde( - data: Sequence[float], h: float, kernel: _Kernel = "normal", *, cumulative: bool = False - ) -> Callable[[float], float]: ... - def kde_random( - data: Sequence[float], h: float, kernel: _Kernel = "normal", *, seed: _Seed | None = None - ) -> Callable[[], float]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/string.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/string.pyi deleted file mode 100644 index da752327d3..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/string.pyi +++ /dev/null @@ -1,76 +0,0 @@ -import sys -from _typeshed import StrOrLiteralStr -from collections.abc import Iterable, Mapping, Sequence -from re import Pattern, RegexFlag -from typing import Any, ClassVar, overload -from typing_extensions import LiteralString - -__all__ = [ - "ascii_letters", - "ascii_lowercase", - "ascii_uppercase", - "capwords", - "digits", - "hexdigits", - "octdigits", - "printable", - "punctuation", - "whitespace", - "Formatter", - "Template", -] - -ascii_letters: LiteralString -ascii_lowercase: LiteralString -ascii_uppercase: LiteralString -digits: LiteralString -hexdigits: LiteralString -octdigits: LiteralString -punctuation: LiteralString -printable: LiteralString -whitespace: LiteralString - -def capwords(s: StrOrLiteralStr, sep: StrOrLiteralStr | None = None) -> StrOrLiteralStr: ... - -class Template(metaclass=type): - template: str - delimiter: ClassVar[str] - idpattern: ClassVar[str] - braceidpattern: ClassVar[str | None] - flags: ClassVar[RegexFlag] - pattern: ClassVar[Pattern[str]] - def __init__(self, template: str) -> None: ... - def substitute(self, mapping: Mapping[str, object] = {}, /, **kwds: object) -> str: ... - def safe_substitute(self, mapping: Mapping[str, object] = {}, /, **kwds: object) -> str: ... - if sys.version_info >= (3, 11): - def get_identifiers(self) -> list[str]: ... - def is_valid(self) -> bool: ... - -class Formatter: - @overload - def format(self, format_string: LiteralString, /, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ... - @overload - def format(self, format_string: str, /, *args: Any, **kwargs: Any) -> str: ... - @overload - def vformat( - self, format_string: LiteralString, args: Sequence[LiteralString], kwargs: Mapping[LiteralString, LiteralString] - ) -> LiteralString: ... - @overload - def vformat(self, format_string: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> str: ... - def _vformat( # undocumented - self, - format_string: str, - args: Sequence[Any], - kwargs: Mapping[str, Any], - used_args: set[int | str], - recursion_depth: int, - auto_arg_index: int = 0, - ) -> tuple[str, int]: ... - def parse( - self, format_string: StrOrLiteralStr - ) -> Iterable[tuple[StrOrLiteralStr, StrOrLiteralStr | None, StrOrLiteralStr | None, StrOrLiteralStr | None]]: ... - def get_field(self, field_name: str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... - def get_value(self, key: int | str, args: Sequence[Any], kwargs: Mapping[str, Any]) -> Any: ... - def check_unused_args(self, used_args: set[int | str], args: Sequence[Any], kwargs: Mapping[str, Any]) -> None: ... - def format_field(self, value: Any, format_spec: str) -> Any: ... - def convert_field(self, value: Any, conversion: str | None) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/stringprep.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/stringprep.pyi deleted file mode 100644 index fc28c027ca..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/stringprep.pyi +++ /dev/null @@ -1,27 +0,0 @@ -b1_set: set[int] -b3_exceptions: dict[int, str] -c22_specials: set[int] -c6_set: set[int] -c7_set: set[int] -c8_set: set[int] -c9_set: set[int] - -def in_table_a1(code: str) -> bool: ... -def in_table_b1(code: str) -> bool: ... -def map_table_b3(code: str) -> str: ... -def map_table_b2(a: str) -> str: ... -def in_table_c11(code: str) -> bool: ... -def in_table_c12(code: str) -> bool: ... -def in_table_c11_c12(code: str) -> bool: ... -def in_table_c21(code: str) -> bool: ... -def in_table_c22(code: str) -> bool: ... -def in_table_c21_c22(code: str) -> bool: ... -def in_table_c3(code: str) -> bool: ... -def in_table_c4(code: str) -> bool: ... -def in_table_c5(code: str) -> bool: ... -def in_table_c6(code: str) -> bool: ... -def in_table_c7(code: str) -> bool: ... -def in_table_c8(code: str) -> bool: ... -def in_table_c9(code: str) -> bool: ... -def in_table_d1(code: str) -> bool: ... -def in_table_d2(code: str) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/struct.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/struct.pyi deleted file mode 100644 index 2c26908746..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/struct.pyi +++ /dev/null @@ -1,5 +0,0 @@ -from _struct import * - -__all__ = ["calcsize", "pack", "pack_into", "unpack", "unpack_from", "iter_unpack", "Struct", "error"] - -class error(Exception): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/subprocess.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/subprocess.pyi deleted file mode 100644 index 8b72e2ec7a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/subprocess.pyi +++ /dev/null @@ -1,2093 +0,0 @@ -import sys -from _typeshed import MaybeNone, ReadableBuffer, StrOrBytesPath -from collections.abc import Callable, Collection, Iterable, Mapping, Sequence -from types import GenericAlias, TracebackType -from typing import IO, Any, AnyStr, Final, Generic, Literal, TypeVar, overload -from typing_extensions import Self, TypeAlias - -__all__ = [ - "Popen", - "PIPE", - "STDOUT", - "call", - "check_call", - "getstatusoutput", - "getoutput", - "check_output", - "run", - "CalledProcessError", - "DEVNULL", - "SubprocessError", - "TimeoutExpired", - "CompletedProcess", -] - -if sys.platform == "win32": - __all__ += [ - "CREATE_NEW_CONSOLE", - "CREATE_NEW_PROCESS_GROUP", - "STARTF_USESHOWWINDOW", - "STARTF_USESTDHANDLES", - "STARTUPINFO", - "STD_ERROR_HANDLE", - "STD_INPUT_HANDLE", - "STD_OUTPUT_HANDLE", - "SW_HIDE", - "ABOVE_NORMAL_PRIORITY_CLASS", - "BELOW_NORMAL_PRIORITY_CLASS", - "CREATE_BREAKAWAY_FROM_JOB", - "CREATE_DEFAULT_ERROR_MODE", - "CREATE_NO_WINDOW", - "DETACHED_PROCESS", - "HIGH_PRIORITY_CLASS", - "IDLE_PRIORITY_CLASS", - "NORMAL_PRIORITY_CLASS", - "REALTIME_PRIORITY_CLASS", - ] - -# We prefer to annotate inputs to methods (eg subprocess.check_call) with these -# union types. -# For outputs we use laborious literal based overloads to try to determine -# which specific return types to use, and prefer to fall back to Any when -# this does not work, so the caller does not have to use an assertion to confirm -# which type. -# -# For example: -# -# try: -# x = subprocess.check_output(["ls", "-l"]) -# reveal_type(x) # bytes, based on the overloads -# except TimeoutError as e: -# reveal_type(e.cmd) # Any, but morally is _CMD -_FILE: TypeAlias = None | int | IO[Any] -_InputString: TypeAlias = ReadableBuffer | str -_CMD: TypeAlias = StrOrBytesPath | Sequence[StrOrBytesPath] -if sys.platform == "win32": - _ENV: TypeAlias = Mapping[str, str] -else: - _ENV: TypeAlias = Mapping[bytes, StrOrBytesPath] | Mapping[str, StrOrBytesPath] - -_T = TypeVar("_T") - -# These two are private but documented -if sys.version_info >= (3, 11): - _USE_VFORK: Final[bool] -_USE_POSIX_SPAWN: Final[bool] - -class CompletedProcess(Generic[_T]): - # morally: _CMD - args: Any - returncode: int - # These can both be None, but requiring checks for None would be tedious - # and writing all the overloads would be horrific. - stdout: _T - stderr: _T - def __init__(self, args: _CMD, returncode: int, stdout: _T | None = None, stderr: _T | None = None) -> None: ... - def check_returncode(self) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -if sys.version_info >= (3, 11): - # 3.11 adds "process_group" argument - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str | None = None, - input: str | None = None, - text: Literal[True], - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str, - errors: str | None = None, - input: str | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str, - input: str | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - *, - universal_newlines: Literal[True], - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - # where the *real* keyword only args start - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str | None = None, - input: str | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: Literal[False] | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: None = None, - errors: None = None, - input: ReadableBuffer | None = None, - text: Literal[False] | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> CompletedProcess[bytes]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str | None = None, - input: _InputString | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> CompletedProcess[Any]: ... - -elif sys.version_info >= (3, 10): - # 3.10 adds "pipesize" argument - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str | None = None, - input: str | None = None, - text: Literal[True], - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str, - errors: str | None = None, - input: str | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str, - input: str | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - *, - universal_newlines: Literal[True], - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - # where the *real* keyword only args start - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str | None = None, - input: str | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: Literal[False] | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: None = None, - errors: None = None, - input: ReadableBuffer | None = None, - text: Literal[False] | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> CompletedProcess[bytes]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str | None = None, - input: _InputString | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> CompletedProcess[Any]: ... - -else: - # 3.9 adds arguments "user", "group", "extra_groups" and "umask" - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str | None = None, - input: str | None = None, - text: Literal[True], - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str, - errors: str | None = None, - input: str | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str, - input: str | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - *, - universal_newlines: Literal[True], - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - # where the *real* keyword only args start - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str | None = None, - input: str | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> CompletedProcess[str]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: Literal[False] | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: None = None, - errors: None = None, - input: ReadableBuffer | None = None, - text: Literal[False] | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> CompletedProcess[bytes]: ... - @overload - def run( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - capture_output: bool = False, - check: bool = False, - encoding: str | None = None, - errors: str | None = None, - input: _InputString | None = None, - text: bool | None = None, - timeout: float | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> CompletedProcess[Any]: ... - -# Same args as Popen.__init__ -if sys.version_info >= (3, 11): - # 3.11 adds "process_group" argument - def call( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - encoding: str | None = None, - timeout: float | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> int: ... - -elif sys.version_info >= (3, 10): - # 3.10 adds "pipesize" argument - def call( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - encoding: str | None = None, - timeout: float | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> int: ... - -else: - def call( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - encoding: str | None = None, - timeout: float | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> int: ... - -# Same args as Popen.__init__ -if sys.version_info >= (3, 11): - # 3.11 adds "process_group" argument - def check_call( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - timeout: float | None = ..., - *, - encoding: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> int: ... - -elif sys.version_info >= (3, 10): - # 3.10 adds "pipesize" argument - def check_call( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - timeout: float | None = ..., - *, - encoding: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> int: ... - -else: - def check_call( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stdout: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - timeout: float | None = ..., - *, - encoding: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> int: ... - -if sys.version_info >= (3, 11): - # 3.11 adds "process_group" argument - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str | None = None, - text: Literal[True], - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str, - errors: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - *, - universal_newlines: Literal[True], - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - # where the real keyword only ones start - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: Literal[False] | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> bytes: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> Any: ... # morally: -> str | bytes - -elif sys.version_info >= (3, 10): - # 3.10 adds "pipesize" argument - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str | None = None, - text: Literal[True], - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str, - errors: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - *, - universal_newlines: Literal[True], - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - # where the real keyword only ones start - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: Literal[False] | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> bytes: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> Any: ... # morally: -> str | bytes - -else: - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str | None = None, - text: Literal[True], - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str, - errors: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - *, - universal_newlines: Literal[True], - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - # where the real keyword only ones start - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> str: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: Literal[False] | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: None = None, - errors: None = None, - text: Literal[False] | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> bytes: ... - @overload - def check_output( - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE = None, - stderr: _FILE = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = ..., - *, - timeout: float | None = None, - input: _InputString | None = ..., - encoding: str | None = None, - errors: str | None = None, - text: bool | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> Any: ... # morally: -> str | bytes - -PIPE: Final[int] -STDOUT: Final[int] -DEVNULL: Final[int] - -class SubprocessError(Exception): ... - -class TimeoutExpired(SubprocessError): - def __init__( - self, cmd: _CMD, timeout: float, output: str | bytes | None = None, stderr: str | bytes | None = None - ) -> None: ... - # morally: _CMD - cmd: Any - timeout: float - # morally: str | bytes | None - output: Any - stdout: bytes | None - stderr: bytes | None - -class CalledProcessError(SubprocessError): - returncode: int - # morally: _CMD - cmd: Any - # morally: str | bytes | None - output: Any - - # morally: str | bytes | None - stdout: Any - stderr: Any - def __init__( - self, returncode: int, cmd: _CMD, output: str | bytes | None = None, stderr: str | bytes | None = None - ) -> None: ... - -class Popen(Generic[AnyStr]): - args: _CMD - stdin: IO[AnyStr] | None - stdout: IO[AnyStr] | None - stderr: IO[AnyStr] | None - pid: int - returncode: int | MaybeNone - universal_newlines: bool - - if sys.version_info >= (3, 11): - # process_group is added in 3.11 - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: bool | None = None, - encoding: str, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> None: ... - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: bool | None = None, - encoding: str | None = None, - errors: str, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> None: ... - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - *, - universal_newlines: Literal[True], - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - # where the *real* keyword only args start - text: bool | None = None, - encoding: str | None = None, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> None: ... - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: Literal[True], - encoding: str | None = None, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> None: ... - @overload - def __init__( - self: Popen[bytes], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: Literal[False] | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: Literal[False] | None = None, - encoding: None = None, - errors: None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> None: ... - @overload - def __init__( - self: Popen[Any], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: bool | None = None, - encoding: str | None = None, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - process_group: int | None = None, - ) -> None: ... - elif sys.version_info >= (3, 10): - # pipesize is added in 3.10 - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: bool | None = None, - encoding: str, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> None: ... - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: bool | None = None, - encoding: str | None = None, - errors: str, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> None: ... - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - *, - universal_newlines: Literal[True], - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - # where the *real* keyword only args start - text: bool | None = None, - encoding: str | None = None, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> None: ... - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: Literal[True], - encoding: str | None = None, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> None: ... - @overload - def __init__( - self: Popen[bytes], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: Literal[False] | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: Literal[False] | None = None, - encoding: None = None, - errors: None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> None: ... - @overload - def __init__( - self: Popen[Any], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: bool | None = None, - encoding: str | None = None, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - pipesize: int = -1, - ) -> None: ... - else: - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: bool | None = None, - encoding: str, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> None: ... - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: bool | None = None, - encoding: str | None = None, - errors: str, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> None: ... - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - *, - universal_newlines: Literal[True], - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - # where the *real* keyword only args start - text: bool | None = None, - encoding: str | None = None, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> None: ... - @overload - def __init__( - self: Popen[str], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: Literal[True], - encoding: str | None = None, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> None: ... - @overload - def __init__( - self: Popen[bytes], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: Literal[False] | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: Literal[False] | None = None, - encoding: None = None, - errors: None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> None: ... - @overload - def __init__( - self: Popen[Any], - args: _CMD, - bufsize: int = -1, - executable: StrOrBytesPath | None = None, - stdin: _FILE | None = None, - stdout: _FILE | None = None, - stderr: _FILE | None = None, - preexec_fn: Callable[[], Any] | None = None, - close_fds: bool = True, - shell: bool = False, - cwd: StrOrBytesPath | None = None, - env: _ENV | None = None, - universal_newlines: bool | None = None, - startupinfo: Any | None = None, - creationflags: int = 0, - restore_signals: bool = True, - start_new_session: bool = False, - pass_fds: Collection[int] = (), - *, - text: bool | None = None, - encoding: str | None = None, - errors: str | None = None, - user: str | int | None = None, - group: str | int | None = None, - extra_groups: Iterable[str | int] | None = None, - umask: int = -1, - ) -> None: ... - - def poll(self) -> int | None: ... - def wait(self, timeout: float | None = None) -> int: ... - # morally the members of the returned tuple should be optional - # TODO: this should allow ReadableBuffer for Popen[bytes], but adding - # overloads for that runs into a mypy bug (python/mypy#14070). - def communicate(self, input: AnyStr | None = None, timeout: float | None = None) -> tuple[AnyStr, AnyStr]: ... - def send_signal(self, sig: int) -> None: ... - def terminate(self) -> None: ... - def kill(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> None: ... - def __del__(self) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -# The result really is always a str. -if sys.version_info >= (3, 11): - def getstatusoutput(cmd: _CMD, *, encoding: str | None = None, errors: str | None = None) -> tuple[int, str]: ... - def getoutput(cmd: _CMD, *, encoding: str | None = None, errors: str | None = None) -> str: ... - -else: - def getstatusoutput(cmd: _CMD) -> tuple[int, str]: ... - def getoutput(cmd: _CMD) -> str: ... - -def list2cmdline(seq: Iterable[StrOrBytesPath]) -> str: ... # undocumented - -if sys.platform == "win32": - if sys.version_info >= (3, 13): - from _winapi import STARTF_FORCEOFFFEEDBACK, STARTF_FORCEONFEEDBACK - - __all__ += ["STARTF_FORCEOFFFEEDBACK", "STARTF_FORCEONFEEDBACK"] - - class STARTUPINFO: - def __init__( - self, - *, - dwFlags: int = 0, - hStdInput: Any | None = None, - hStdOutput: Any | None = None, - hStdError: Any | None = None, - wShowWindow: int = 0, - lpAttributeList: Mapping[str, Any] | None = None, - ) -> None: ... - dwFlags: int - hStdInput: Any | None - hStdOutput: Any | None - hStdError: Any | None - wShowWindow: int - lpAttributeList: Mapping[str, Any] - def copy(self) -> STARTUPINFO: ... - - from _winapi import ( - ABOVE_NORMAL_PRIORITY_CLASS as ABOVE_NORMAL_PRIORITY_CLASS, - BELOW_NORMAL_PRIORITY_CLASS as BELOW_NORMAL_PRIORITY_CLASS, - CREATE_BREAKAWAY_FROM_JOB as CREATE_BREAKAWAY_FROM_JOB, - CREATE_DEFAULT_ERROR_MODE as CREATE_DEFAULT_ERROR_MODE, - CREATE_NEW_CONSOLE as CREATE_NEW_CONSOLE, - CREATE_NEW_PROCESS_GROUP as CREATE_NEW_PROCESS_GROUP, - CREATE_NO_WINDOW as CREATE_NO_WINDOW, - DETACHED_PROCESS as DETACHED_PROCESS, - HIGH_PRIORITY_CLASS as HIGH_PRIORITY_CLASS, - IDLE_PRIORITY_CLASS as IDLE_PRIORITY_CLASS, - NORMAL_PRIORITY_CLASS as NORMAL_PRIORITY_CLASS, - REALTIME_PRIORITY_CLASS as REALTIME_PRIORITY_CLASS, - STARTF_USESHOWWINDOW as STARTF_USESHOWWINDOW, - STARTF_USESTDHANDLES as STARTF_USESTDHANDLES, - STD_ERROR_HANDLE as STD_ERROR_HANDLE, - STD_INPUT_HANDLE as STD_INPUT_HANDLE, - STD_OUTPUT_HANDLE as STD_OUTPUT_HANDLE, - SW_HIDE as SW_HIDE, - ) diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sunau.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sunau.pyi deleted file mode 100644 index d81645cb56..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sunau.pyi +++ /dev/null @@ -1,82 +0,0 @@ -from _typeshed import Unused -from typing import IO, Any, Literal, NamedTuple, NoReturn, overload -from typing_extensions import Self, TypeAlias - -_File: TypeAlias = str | IO[bytes] - -class Error(Exception): ... - -AUDIO_FILE_MAGIC: int -AUDIO_FILE_ENCODING_MULAW_8: int -AUDIO_FILE_ENCODING_LINEAR_8: int -AUDIO_FILE_ENCODING_LINEAR_16: int -AUDIO_FILE_ENCODING_LINEAR_24: int -AUDIO_FILE_ENCODING_LINEAR_32: int -AUDIO_FILE_ENCODING_FLOAT: int -AUDIO_FILE_ENCODING_DOUBLE: int -AUDIO_FILE_ENCODING_ADPCM_G721: int -AUDIO_FILE_ENCODING_ADPCM_G722: int -AUDIO_FILE_ENCODING_ADPCM_G723_3: int -AUDIO_FILE_ENCODING_ADPCM_G723_5: int -AUDIO_FILE_ENCODING_ALAW_8: int -AUDIO_UNKNOWN_SIZE: int - -class _sunau_params(NamedTuple): - nchannels: int - sampwidth: int - framerate: int - nframes: int - comptype: str - compname: str - -class Au_read: - def __init__(self, f: _File) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - def __del__(self) -> None: ... - def getfp(self) -> IO[bytes] | None: ... - def rewind(self) -> None: ... - def close(self) -> None: ... - def tell(self) -> int: ... - def getnchannels(self) -> int: ... - def getnframes(self) -> int: ... - def getsampwidth(self) -> int: ... - def getframerate(self) -> int: ... - def getcomptype(self) -> str: ... - def getcompname(self) -> str: ... - def getparams(self) -> _sunau_params: ... - def getmarkers(self) -> None: ... - def getmark(self, id: Any) -> NoReturn: ... - def setpos(self, pos: int) -> None: ... - def readframes(self, nframes: int) -> bytes | None: ... - -class Au_write: - def __init__(self, f: _File) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - def __del__(self) -> None: ... - def setnchannels(self, nchannels: int) -> None: ... - def getnchannels(self) -> int: ... - def setsampwidth(self, sampwidth: int) -> None: ... - def getsampwidth(self) -> int: ... - def setframerate(self, framerate: float) -> None: ... - def getframerate(self) -> int: ... - def setnframes(self, nframes: int) -> None: ... - def getnframes(self) -> int: ... - def setcomptype(self, type: str, name: str) -> None: ... - def getcomptype(self) -> str: ... - def getcompname(self) -> str: ... - def setparams(self, params: _sunau_params) -> None: ... - def getparams(self) -> _sunau_params: ... - def tell(self) -> int: ... - # should be any bytes-like object after 3.4, but we don't have a type for that - def writeframesraw(self, data: bytes) -> None: ... - def writeframes(self, data: bytes) -> None: ... - def close(self) -> None: ... - -@overload -def open(f: _File, mode: Literal["r", "rb"]) -> Au_read: ... -@overload -def open(f: _File, mode: Literal["w", "wb"]) -> Au_write: ... -@overload -def open(f: _File, mode: str | None = None) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/symbol.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/symbol.pyi deleted file mode 100644 index 48ae3567a1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/symbol.pyi +++ /dev/null @@ -1,93 +0,0 @@ -single_input: int -file_input: int -eval_input: int -decorator: int -decorators: int -decorated: int -async_funcdef: int -funcdef: int -parameters: int -typedargslist: int -tfpdef: int -varargslist: int -vfpdef: int -stmt: int -simple_stmt: int -small_stmt: int -expr_stmt: int -annassign: int -testlist_star_expr: int -augassign: int -del_stmt: int -pass_stmt: int -flow_stmt: int -break_stmt: int -continue_stmt: int -return_stmt: int -yield_stmt: int -raise_stmt: int -import_stmt: int -import_name: int -import_from: int -import_as_name: int -dotted_as_name: int -import_as_names: int -dotted_as_names: int -dotted_name: int -global_stmt: int -nonlocal_stmt: int -assert_stmt: int -compound_stmt: int -async_stmt: int -if_stmt: int -while_stmt: int -for_stmt: int -try_stmt: int -with_stmt: int -with_item: int -except_clause: int -suite: int -test: int -test_nocond: int -lambdef: int -lambdef_nocond: int -or_test: int -and_test: int -not_test: int -comparison: int -comp_op: int -star_expr: int -expr: int -xor_expr: int -and_expr: int -shift_expr: int -arith_expr: int -term: int -factor: int -power: int -atom_expr: int -atom: int -testlist_comp: int -trailer: int -subscriptlist: int -subscript: int -sliceop: int -exprlist: int -testlist: int -dictorsetmaker: int -classdef: int -arglist: int -argument: int -comp_iter: int -comp_for: int -comp_if: int -encoding_decl: int -yield_expr: int -yield_arg: int -sync_comp_for: int -func_body_suite: int -func_type: int -func_type_input: int -namedexpr_test: int -typelist: int -sym_name: dict[int, str] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/symtable.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/symtable.pyi deleted file mode 100644 index d5f2be04b6..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/symtable.pyi +++ /dev/null @@ -1,86 +0,0 @@ -import sys -from _collections_abc import dict_keys -from collections.abc import Sequence -from typing import Any -from typing_extensions import deprecated - -__all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"] - -if sys.version_info >= (3, 13): - __all__ += ["SymbolTableType"] - -def symtable(code: str, filename: str, compile_type: str) -> SymbolTable: ... - -if sys.version_info >= (3, 13): - from enum import StrEnum - - class SymbolTableType(StrEnum): - MODULE = "module" - FUNCTION = "function" - CLASS = "class" - ANNOTATION = "annotation" - TYPE_ALIAS = "type alias" - TYPE_PARAMETERS = "type parameters" - TYPE_VARIABLE = "type variable" - -class SymbolTable: - def __init__(self, raw_table: Any, filename: str) -> None: ... - if sys.version_info >= (3, 13): - def get_type(self) -> SymbolTableType: ... - else: - def get_type(self) -> str: ... - - def get_id(self) -> int: ... - def get_name(self) -> str: ... - def get_lineno(self) -> int: ... - def is_optimized(self) -> bool: ... - def is_nested(self) -> bool: ... - def has_children(self) -> bool: ... - def get_identifiers(self) -> dict_keys[str, int]: ... - def lookup(self, name: str) -> Symbol: ... - def get_symbols(self) -> list[Symbol]: ... - def get_children(self) -> list[SymbolTable]: ... - -class Function(SymbolTable): - def get_parameters(self) -> tuple[str, ...]: ... - def get_locals(self) -> tuple[str, ...]: ... - def get_globals(self) -> tuple[str, ...]: ... - def get_frees(self) -> tuple[str, ...]: ... - def get_nonlocals(self) -> tuple[str, ...]: ... - -class Class(SymbolTable): - @deprecated("deprecated in Python 3.14, will be removed in Python 3.16") - def get_methods(self) -> tuple[str, ...]: ... - -class Symbol: - def __init__( - self, name: str, flags: int, namespaces: Sequence[SymbolTable] | None = None, *, module_scope: bool = False - ) -> None: ... - def is_nonlocal(self) -> bool: ... - def get_name(self) -> str: ... - def is_referenced(self) -> bool: ... - def is_parameter(self) -> bool: ... - if sys.version_info >= (3, 14): - def is_type_parameter(self) -> bool: ... - - def is_global(self) -> bool: ... - def is_declared_global(self) -> bool: ... - def is_local(self) -> bool: ... - def is_annotated(self) -> bool: ... - def is_free(self) -> bool: ... - if sys.version_info >= (3, 14): - def is_free_class(self) -> bool: ... - - def is_imported(self) -> bool: ... - def is_assigned(self) -> bool: ... - if sys.version_info >= (3, 14): - def is_comp_iter(self) -> bool: ... - def is_comp_cell(self) -> bool: ... - - def is_namespace(self) -> bool: ... - def get_namespaces(self) -> Sequence[SymbolTable]: ... - def get_namespace(self) -> SymbolTable: ... - -class SymbolTableFactory: - def new(self, table: Any, filename: str) -> SymbolTable: ... - def __call__(self, table: Any, filename: str) -> SymbolTable: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sys/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sys/__init__.pyi index a2cca3509a..b52c5acbf3 100644 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sys/__init__.pyi +++ b/crates/red_knot_vendored/vendor/typeshed/stdlib/sys/__init__.pyi @@ -1,472 +1,8 @@ -import sys -from _typeshed import MaybeNone, OptExcInfo, ProfileFunction, TraceFunction, structseq -from _typeshed.importlib import MetaPathFinderProtocol, PathEntryFinderProtocol -from builtins import object as _object -from collections.abc import AsyncGenerator, Callable, Sequence -from io import TextIOWrapper -from types import FrameType, ModuleType, TracebackType -from typing import Any, Final, Literal, NoReturn, Protocol, TextIO, TypeVar, final, type_check_only -from typing_extensions import LiteralString, TypeAlias +class C: + pass -_T = TypeVar("_T") +x: None -# see https://github.com/python/typeshed/issues/8513#issue-1333671093 for the rationale behind this alias -_ExitCode: TypeAlias = str | int | None - -# ----- sys variables ----- -if sys.platform != "win32": - abiflags: str -argv: list[str] -base_exec_prefix: str -base_prefix: str -byteorder: Literal["little", "big"] -builtin_module_names: Sequence[str] # actually a tuple of strings -copyright: str -if sys.platform == "win32": - dllhandle: int -dont_write_bytecode: bool -displayhook: Callable[[object], Any] -excepthook: Callable[[type[BaseException], BaseException, TracebackType | None], Any] -exec_prefix: str -executable: str -float_repr_style: Literal["short", "legacy"] -hexversion: int -last_type: type[BaseException] | None -last_value: BaseException | None -last_traceback: TracebackType | None -if sys.version_info >= (3, 12): - last_exc: BaseException # or undefined. -maxsize: int -maxunicode: int -meta_path: list[MetaPathFinderProtocol] -modules: dict[str, ModuleType] -if sys.version_info >= (3, 10): - orig_argv: list[str] -path: list[str] -path_hooks: list[Callable[[str], PathEntryFinderProtocol]] -path_importer_cache: dict[str, PathEntryFinderProtocol | None] -platform: LiteralString -platlibdir: str -prefix: str -pycache_prefix: str | None -ps1: object -ps2: object - -# TextIO is used instead of more specific types for the standard streams, -# since they are often monkeypatched at runtime. At startup, the objects -# are initialized to instances of TextIOWrapper, but can also be None under -# some circumstances. -# -# To use methods from TextIOWrapper, use an isinstance check to ensure that -# the streams have not been overridden: -# -# if isinstance(sys.stdout, io.TextIOWrapper): -# sys.stdout.reconfigure(...) -stdin: TextIO | MaybeNone -stdout: TextIO | MaybeNone -stderr: TextIO | MaybeNone - -if sys.version_info >= (3, 10): - stdlib_module_names: frozenset[str] - -__stdin__: Final[TextIOWrapper | None] # Contains the original value of stdin -__stdout__: Final[TextIOWrapper | None] # Contains the original value of stdout -__stderr__: Final[TextIOWrapper | None] # Contains the original value of stderr -tracebacklimit: int | None -version: str -api_version: int -warnoptions: Any -# Each entry is a tuple of the form (action, message, category, module, -# lineno) -if sys.platform == "win32": - winver: str -_xoptions: dict[Any, Any] - -# Type alias used as a mixin for structseq classes that cannot be instantiated at runtime -# This can't be represented in the type system, so we just use `structseq[Any]` -_UninstantiableStructseq: TypeAlias = structseq[Any] - -flags: _flags - -# This class is not exposed at runtime. It calls itself sys.flags. -# As a tuple, it can have a length between 15 and 18. We don't model -# the exact length here because that varies by patch version due to -# the backported security fix int_max_str_digits. The exact length shouldn't -# be relied upon. See #13031 -# This can be re-visited when typeshed drops support for 3.10, -# at which point all supported versions will include int_max_str_digits -# in all patch versions. -# 3.8 and 3.9 are 15 or 16-tuple -# 3.10 is 16 or 17-tuple -# 3.11+ is an 18-tuple. -@final -@type_check_only -class _flags(_UninstantiableStructseq, tuple[int, ...]): - # `safe_path` was added in py311 - if sys.version_info >= (3, 11): - __match_args__: Final = ( - "debug", - "inspect", - "interactive", - "optimize", - "dont_write_bytecode", - "no_user_site", - "no_site", - "ignore_environment", - "verbose", - "bytes_warning", - "quiet", - "hash_randomization", - "isolated", - "dev_mode", - "utf8_mode", - "warn_default_encoding", - "safe_path", - "int_max_str_digits", - ) - elif sys.version_info >= (3, 10): - __match_args__: Final = ( - "debug", - "inspect", - "interactive", - "optimize", - "dont_write_bytecode", - "no_user_site", - "no_site", - "ignore_environment", - "verbose", - "bytes_warning", - "quiet", - "hash_randomization", - "isolated", - "dev_mode", - "utf8_mode", - "warn_default_encoding", - "int_max_str_digits", - ) - - @property - def debug(self) -> int: ... - @property - def inspect(self) -> int: ... - @property - def interactive(self) -> int: ... - @property - def optimize(self) -> int: ... - @property - def dont_write_bytecode(self) -> int: ... - @property - def no_user_site(self) -> int: ... - @property - def no_site(self) -> int: ... - @property - def ignore_environment(self) -> int: ... - @property - def verbose(self) -> int: ... - @property - def bytes_warning(self) -> int: ... - @property - def quiet(self) -> int: ... - @property - def hash_randomization(self) -> int: ... - @property - def isolated(self) -> int: ... - @property - def dev_mode(self) -> bool: ... - @property - def utf8_mode(self) -> int: ... - if sys.version_info >= (3, 10): - @property - def warn_default_encoding(self) -> int: ... - if sys.version_info >= (3, 11): - @property - def safe_path(self) -> bool: ... - # Whether or not this exists on lower versions of Python - # may depend on which patch release you're using - # (it was backported to all Python versions on 3.8+ as a security fix) - # Added in: 3.8.14, 3.9.14, 3.10.7 - # and present in all versions of 3.11 and later. - @property - def int_max_str_digits(self) -> int: ... - -float_info: _float_info - -# This class is not exposed at runtime. It calls itself sys.float_info. -@final -@type_check_only -class _float_info(structseq[float], tuple[float, int, int, float, int, int, int, int, float, int, int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ( - "max", - "max_exp", - "max_10_exp", - "min", - "min_exp", - "min_10_exp", - "dig", - "mant_dig", - "epsilon", - "radix", - "rounds", - ) - - @property - def max(self) -> float: ... # DBL_MAX - @property - def max_exp(self) -> int: ... # DBL_MAX_EXP - @property - def max_10_exp(self) -> int: ... # DBL_MAX_10_EXP - @property - def min(self) -> float: ... # DBL_MIN - @property - def min_exp(self) -> int: ... # DBL_MIN_EXP - @property - def min_10_exp(self) -> int: ... # DBL_MIN_10_EXP - @property - def dig(self) -> int: ... # DBL_DIG - @property - def mant_dig(self) -> int: ... # DBL_MANT_DIG - @property - def epsilon(self) -> float: ... # DBL_EPSILON - @property - def radix(self) -> int: ... # FLT_RADIX - @property - def rounds(self) -> int: ... # FLT_ROUNDS - -hash_info: _hash_info - -# This class is not exposed at runtime. It calls itself sys.hash_info. -@final -@type_check_only -class _hash_info(structseq[Any | int], tuple[int, int, int, int, int, str, int, int, int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("width", "modulus", "inf", "nan", "imag", "algorithm", "hash_bits", "seed_bits", "cutoff") - - @property - def width(self) -> int: ... - @property - def modulus(self) -> int: ... - @property - def inf(self) -> int: ... - @property - def nan(self) -> int: ... - @property - def imag(self) -> int: ... - @property - def algorithm(self) -> str: ... - @property - def hash_bits(self) -> int: ... - @property - def seed_bits(self) -> int: ... - @property - def cutoff(self) -> int: ... # undocumented - -implementation: _implementation - -# This class isn't really a thing. At runtime, implementation is an instance -# of types.SimpleNamespace. This allows for better typing. -@type_check_only -class _implementation: - name: str - version: _version_info - hexversion: int - cache_tag: str - # Define __getattr__, as the documentation states: - # > sys.implementation may contain additional attributes specific to the Python implementation. - # > These non-standard attributes must start with an underscore, and are not described here. - def __getattr__(self, name: str) -> Any: ... - -int_info: _int_info - -# This class is not exposed at runtime. It calls itself sys.int_info. -@final -@type_check_only -class _int_info(structseq[int], tuple[int, int, int, int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("bits_per_digit", "sizeof_digit", "default_max_str_digits", "str_digits_check_threshold") - - @property - def bits_per_digit(self) -> int: ... - @property - def sizeof_digit(self) -> int: ... - @property - def default_max_str_digits(self) -> int: ... - @property - def str_digits_check_threshold(self) -> int: ... - -_ThreadInfoName: TypeAlias = Literal["nt", "pthread", "pthread-stubs", "solaris"] -_ThreadInfoLock: TypeAlias = Literal["semaphore", "mutex+cond"] | None - -# This class is not exposed at runtime. It calls itself sys.thread_info. -@final -@type_check_only -class _thread_info(_UninstantiableStructseq, tuple[_ThreadInfoName, _ThreadInfoLock, str | None]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("name", "lock", "version") - - @property - def name(self) -> _ThreadInfoName: ... - @property - def lock(self) -> _ThreadInfoLock: ... - @property - def version(self) -> str | None: ... - -thread_info: _thread_info -_ReleaseLevel: TypeAlias = Literal["alpha", "beta", "candidate", "final"] - -# This class is not exposed at runtime. It calls itself sys.version_info. -@final -@type_check_only -class _version_info(_UninstantiableStructseq, tuple[int, int, int, _ReleaseLevel, int]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("major", "minor", "micro", "releaselevel", "serial") - - @property - def major(self) -> int: ... - @property - def minor(self) -> int: ... - @property - def micro(self) -> int: ... - @property - def releaselevel(self) -> _ReleaseLevel: ... - @property - def serial(self) -> int: ... +class _version_info(C[foo]): ... version_info: _version_info - -def call_tracing(func: Callable[..., _T], args: Any, /) -> _T: ... -def _clear_type_cache() -> None: ... -def _current_frames() -> dict[int, FrameType]: ... -def _getframe(depth: int = 0, /) -> FrameType: ... -def _debugmallocstats() -> None: ... -def __displayhook__(object: object, /) -> None: ... -def __excepthook__(exctype: type[BaseException], value: BaseException, traceback: TracebackType | None, /) -> None: ... -def exc_info() -> OptExcInfo: ... - -if sys.version_info >= (3, 11): - def exception() -> BaseException | None: ... - -def exit(status: _ExitCode = None, /) -> NoReturn: ... -def getallocatedblocks() -> int: ... -def getdefaultencoding() -> str: ... - -if sys.platform != "win32": - def getdlopenflags() -> int: ... - -def getfilesystemencoding() -> str: ... -def getfilesystemencodeerrors() -> str: ... -def getrefcount(object: Any, /) -> int: ... -def getrecursionlimit() -> int: ... -def getsizeof(obj: object, default: int = ...) -> int: ... -def getswitchinterval() -> float: ... -def getprofile() -> ProfileFunction | None: ... -def setprofile(function: ProfileFunction | None, /) -> None: ... -def gettrace() -> TraceFunction | None: ... -def settrace(function: TraceFunction | None, /) -> None: ... - -if sys.platform == "win32": - # A tuple of length 5, even though it has more than 5 attributes. - @final - class _WinVersion(_UninstantiableStructseq, tuple[int, int, int, int, str]): - @property - def major(self) -> int: ... - @property - def minor(self) -> int: ... - @property - def build(self) -> int: ... - @property - def platform(self) -> int: ... - @property - def service_pack(self) -> str: ... - @property - def service_pack_minor(self) -> int: ... - @property - def service_pack_major(self) -> int: ... - @property - def suite_mask(self) -> int: ... - @property - def product_type(self) -> int: ... - @property - def platform_version(self) -> tuple[int, int, int]: ... - - def getwindowsversion() -> _WinVersion: ... - -def intern(string: str, /) -> str: ... - -if sys.version_info >= (3, 13): - def _is_gil_enabled() -> bool: ... - def _clear_internal_caches() -> None: ... - def _is_interned(string: str, /) -> bool: ... - -def is_finalizing() -> bool: ... -def breakpointhook(*args: Any, **kwargs: Any) -> Any: ... - -__breakpointhook__ = breakpointhook # Contains the original value of breakpointhook - -if sys.platform != "win32": - def setdlopenflags(flags: int, /) -> None: ... - -def setrecursionlimit(limit: int, /) -> None: ... -def setswitchinterval(interval: float, /) -> None: ... -def gettotalrefcount() -> int: ... # Debug builds only - -# Doesn't exist at runtime, but exported in the stubs so pytest etc. can annotate their code more easily. -@type_check_only -class UnraisableHookArgs(Protocol): - exc_type: type[BaseException] - exc_value: BaseException | None - exc_traceback: TracebackType | None - err_msg: str | None - object: _object - -unraisablehook: Callable[[UnraisableHookArgs], Any] - -def __unraisablehook__(unraisable: UnraisableHookArgs, /) -> Any: ... -def addaudithook(hook: Callable[[str, tuple[Any, ...]], Any]) -> None: ... -def audit(event: str, /, *args: Any) -> None: ... - -_AsyncgenHook: TypeAlias = Callable[[AsyncGenerator[Any, Any]], None] | None - -# This class is not exposed at runtime. It calls itself builtins.asyncgen_hooks. -@final -@type_check_only -class _asyncgen_hooks(structseq[_AsyncgenHook], tuple[_AsyncgenHook, _AsyncgenHook]): - if sys.version_info >= (3, 10): - __match_args__: Final = ("firstiter", "finalizer") - - @property - def firstiter(self) -> _AsyncgenHook: ... - @property - def finalizer(self) -> _AsyncgenHook: ... - -def get_asyncgen_hooks() -> _asyncgen_hooks: ... -def set_asyncgen_hooks(firstiter: _AsyncgenHook = ..., finalizer: _AsyncgenHook = ...) -> None: ... - -if sys.platform == "win32": - def _enablelegacywindowsfsencoding() -> None: ... - -def get_coroutine_origin_tracking_depth() -> int: ... -def set_coroutine_origin_tracking_depth(depth: int) -> None: ... - -# The following two functions were added in 3.11.0, 3.10.7, 3.9.14, and 3.8.14, -# as part of the response to CVE-2020-10735 -def set_int_max_str_digits(maxdigits: int) -> None: ... -def get_int_max_str_digits() -> int: ... - -if sys.version_info >= (3, 12): - if sys.version_info >= (3, 13): - def getunicodeinternedsize(*, _only_immortal: bool = False) -> int: ... - else: - def getunicodeinternedsize() -> int: ... - - def deactivate_stack_trampoline() -> None: ... - def is_stack_trampoline_active() -> bool: ... - # It always exists, but raises on non-linux platforms: - if sys.platform == "linux": - def activate_stack_trampoline(backend: str, /) -> None: ... - else: - def activate_stack_trampoline(backend: str, /) -> NoReturn: ... - - from . import _monitoring - - monitoring = _monitoring diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/sysconfig.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/sysconfig.pyi deleted file mode 100644 index 807a979050..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/sysconfig.pyi +++ /dev/null @@ -1,48 +0,0 @@ -import sys -from typing import IO, Any, Literal, overload -from typing_extensions import deprecated - -__all__ = [ - "get_config_h_filename", - "get_config_var", - "get_config_vars", - "get_makefile_filename", - "get_path", - "get_path_names", - "get_paths", - "get_platform", - "get_python_version", - "get_scheme_names", - "parse_config_h", -] - -@overload -@deprecated("SO is deprecated, use EXT_SUFFIX. Support is removed in Python 3.11") -def get_config_var(name: Literal["SO"]) -> Any: ... -@overload -def get_config_var(name: str) -> Any: ... -@overload -def get_config_vars() -> dict[str, Any]: ... -@overload -def get_config_vars(arg: str, /, *args: str) -> list[Any]: ... -def get_scheme_names() -> tuple[str, ...]: ... - -if sys.version_info >= (3, 10): - def get_default_scheme() -> str: ... - def get_preferred_scheme(key: Literal["prefix", "home", "user"]) -> str: ... - -def get_path_names() -> tuple[str, ...]: ... -def get_path(name: str, scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> str: ... -def get_paths(scheme: str = ..., vars: dict[str, Any] | None = None, expand: bool = True) -> dict[str, str]: ... -def get_python_version() -> str: ... -def get_platform() -> str: ... - -if sys.version_info >= (3, 11): - def is_python_build(check_home: object = None) -> bool: ... - -else: - def is_python_build(check_home: bool = False) -> bool: ... - -def parse_config_h(fp: IO[Any], vars: dict[str, Any] | None = None) -> dict[str, Any]: ... -def get_config_h_filename() -> str: ... -def get_makefile_filename() -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/syslog.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/syslog.pyi deleted file mode 100644 index 1e0d0d3839..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/syslog.pyi +++ /dev/null @@ -1,57 +0,0 @@ -import sys -from typing import Final, overload - -if sys.platform != "win32": - LOG_ALERT: Final = 1 - LOG_AUTH: Final = 32 - LOG_AUTHPRIV: Final = 80 - LOG_CONS: Final = 2 - LOG_CRIT: Final = 2 - LOG_CRON: Final = 72 - LOG_DAEMON: Final = 24 - LOG_DEBUG: Final = 7 - LOG_EMERG: Final = 0 - LOG_ERR: Final = 3 - LOG_INFO: Final = 6 - LOG_KERN: Final = 0 - LOG_LOCAL0: Final = 128 - LOG_LOCAL1: Final = 136 - LOG_LOCAL2: Final = 144 - LOG_LOCAL3: Final = 152 - LOG_LOCAL4: Final = 160 - LOG_LOCAL5: Final = 168 - LOG_LOCAL6: Final = 176 - LOG_LOCAL7: Final = 184 - LOG_LPR: Final = 48 - LOG_MAIL: Final = 16 - LOG_NDELAY: Final = 8 - LOG_NEWS: Final = 56 - LOG_NOTICE: Final = 5 - LOG_NOWAIT: Final = 16 - LOG_ODELAY: Final = 4 - LOG_PERROR: Final = 32 - LOG_PID: Final = 1 - LOG_SYSLOG: Final = 40 - LOG_USER: Final = 8 - LOG_UUCP: Final = 64 - LOG_WARNING: Final = 4 - - if sys.version_info >= (3, 13): - LOG_FTP: Final = 88 - - if sys.platform == "darwin": - LOG_INSTALL: Final = 112 - LOG_LAUNCHD: Final = 192 - LOG_NETINFO: Final = 96 - LOG_RAS: Final = 120 - LOG_REMOTEAUTH: Final = 104 - - def LOG_MASK(pri: int, /) -> int: ... - def LOG_UPTO(pri: int, /) -> int: ... - def closelog() -> None: ... - def openlog(ident: str = ..., logoption: int = ..., facility: int = ...) -> None: ... - def setlogmask(maskpri: int, /) -> int: ... - @overload - def syslog(priority: int, message: str) -> None: ... - @overload - def syslog(message: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tabnanny.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tabnanny.pyi deleted file mode 100644 index 8a8592f441..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tabnanny.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from _typeshed import StrOrBytesPath -from collections.abc import Iterable - -__all__ = ["check", "NannyNag", "process_tokens"] - -verbose: int -filename_only: int - -class NannyNag(Exception): - def __init__(self, lineno: int, msg: str, line: str) -> None: ... - def get_lineno(self) -> int: ... - def get_msg(self) -> str: ... - def get_line(self) -> str: ... - -def check(file: StrOrBytesPath) -> None: ... -def process_tokens(tokens: Iterable[tuple[int, str, tuple[int, int], tuple[int, int], str]]) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tarfile.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tarfile.pyi deleted file mode 100644 index cd31b101c8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tarfile.pyi +++ /dev/null @@ -1,676 +0,0 @@ -import bz2 -import io -import sys -from _typeshed import ReadableBuffer, StrOrBytesPath, StrPath, SupportsRead, WriteableBuffer -from builtins import list as _list # aliases to avoid name clashes with fields named "type" or "list" -from collections.abc import Callable, Iterable, Iterator, Mapping -from gzip import _ReadableFileobj as _GzipReadableFileobj, _WritableFileobj as _GzipWritableFileobj -from types import TracebackType -from typing import IO, ClassVar, Literal, Protocol, overload -from typing_extensions import Self, TypeAlias - -__all__ = [ - "TarFile", - "TarInfo", - "is_tarfile", - "TarError", - "ReadError", - "CompressionError", - "StreamError", - "ExtractError", - "HeaderError", - "ENCODING", - "USTAR_FORMAT", - "GNU_FORMAT", - "PAX_FORMAT", - "DEFAULT_FORMAT", - "open", -] -if sys.version_info >= (3, 12): - __all__ += [ - "fully_trusted_filter", - "data_filter", - "tar_filter", - "FilterError", - "AbsoluteLinkError", - "OutsideDestinationError", - "SpecialFileError", - "AbsolutePathError", - "LinkOutsideDestinationError", - ] - -_FilterFunction: TypeAlias = Callable[[TarInfo, str], TarInfo | None] -_TarfileFilter: TypeAlias = Literal["fully_trusted", "tar", "data"] | _FilterFunction - -class _Fileobj(Protocol): - def read(self, size: int, /) -> bytes: ... - def write(self, b: bytes, /) -> object: ... - def tell(self) -> int: ... - def seek(self, pos: int, /) -> object: ... - def close(self) -> object: ... - # Optional fields: - # name: str | bytes - # mode: Literal["rb", "r+b", "wb", "xb"] - -class _Bz2ReadableFileobj(bz2._ReadableFileobj): - def close(self) -> object: ... - -class _Bz2WritableFileobj(bz2._WritableFileobj): - def close(self) -> object: ... - -# tar constants -NUL: bytes -BLOCKSIZE: int -RECORDSIZE: int -GNU_MAGIC: bytes -POSIX_MAGIC: bytes - -LENGTH_NAME: int -LENGTH_LINK: int -LENGTH_PREFIX: int - -REGTYPE: bytes -AREGTYPE: bytes -LNKTYPE: bytes -SYMTYPE: bytes -CONTTYPE: bytes -BLKTYPE: bytes -DIRTYPE: bytes -FIFOTYPE: bytes -CHRTYPE: bytes - -GNUTYPE_LONGNAME: bytes -GNUTYPE_LONGLINK: bytes -GNUTYPE_SPARSE: bytes - -XHDTYPE: bytes -XGLTYPE: bytes -SOLARIS_XHDTYPE: bytes - -USTAR_FORMAT: int -GNU_FORMAT: int -PAX_FORMAT: int -DEFAULT_FORMAT: int - -# tarfile constants - -SUPPORTED_TYPES: tuple[bytes, ...] -REGULAR_TYPES: tuple[bytes, ...] -GNU_TYPES: tuple[bytes, ...] -PAX_FIELDS: tuple[str, ...] -PAX_NUMBER_FIELDS: dict[str, type] -PAX_NAME_FIELDS: set[str] - -ENCODING: str - -class ExFileObject(io.BufferedReader): - def __init__(self, tarfile: TarFile, tarinfo: TarInfo) -> None: ... - -class TarFile: - OPEN_METH: ClassVar[Mapping[str, str]] - name: StrOrBytesPath | None - mode: Literal["r", "a", "w", "x"] - fileobj: _Fileobj | None - format: int | None - tarinfo: type[TarInfo] - dereference: bool | None - ignore_zeros: bool | None - encoding: str | None - errors: str - fileobject: type[ExFileObject] - pax_headers: Mapping[str, str] | None - debug: int | None - errorlevel: int | None - offset: int # undocumented - extraction_filter: _FilterFunction | None - if sys.version_info >= (3, 13): - stream: bool - def __init__( - self, - name: StrOrBytesPath | None = None, - mode: Literal["r", "a", "w", "x"] = "r", - fileobj: _Fileobj | None = None, - format: int | None = None, - tarinfo: type[TarInfo] | None = None, - dereference: bool | None = None, - ignore_zeros: bool | None = None, - encoding: str | None = None, - errors: str = "surrogateescape", - pax_headers: Mapping[str, str] | None = None, - debug: int | None = None, - errorlevel: int | None = None, - copybufsize: int | None = None, # undocumented - stream: bool = False, - ) -> None: ... - else: - def __init__( - self, - name: StrOrBytesPath | None = None, - mode: Literal["r", "a", "w", "x"] = "r", - fileobj: _Fileobj | None = None, - format: int | None = None, - tarinfo: type[TarInfo] | None = None, - dereference: bool | None = None, - ignore_zeros: bool | None = None, - encoding: str | None = None, - errors: str = "surrogateescape", - pax_headers: Mapping[str, str] | None = None, - debug: int | None = None, - errorlevel: int | None = None, - copybufsize: int | None = None, # undocumented - ) -> None: ... - - def __enter__(self) -> Self: ... - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> None: ... - def __iter__(self) -> Iterator[TarInfo]: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | None = None, - mode: Literal["r", "r:*", "r:", "r:gz", "r:bz2", "r:xz"] = "r", - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | None, - mode: Literal["x", "x:", "a", "a:", "w", "w:", "w:tar"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | None = None, - *, - mode: Literal["x", "x:", "a", "a:", "w", "w:", "w:tar"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | None, - mode: Literal["x:gz", "x:bz2", "w:gz", "w:bz2"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - compresslevel: int = 9, - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | None = None, - *, - mode: Literal["x:gz", "x:bz2", "w:gz", "w:bz2"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - compresslevel: int = 9, - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | None, - mode: Literal["x:xz", "w:xz"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ..., - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | None = None, - *, - mode: Literal["x:xz", "w:xz"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - preset: Literal[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | None = ..., - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | ReadableBuffer | None, - mode: Literal["r|*", "r|", "r|gz", "r|bz2", "r|xz"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | ReadableBuffer | None = None, - *, - mode: Literal["r|*", "r|", "r|gz", "r|bz2", "r|xz"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | WriteableBuffer | None, - mode: Literal["w|", "w|xz"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | WriteableBuffer | None = None, - *, - mode: Literal["w|", "w|xz"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | WriteableBuffer | None, - mode: Literal["w|gz", "w|bz2"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - compresslevel: int = 9, - ) -> Self: ... - @overload - @classmethod - def open( - cls, - name: StrOrBytesPath | WriteableBuffer | None = None, - *, - mode: Literal["w|gz", "w|bz2"], - fileobj: _Fileobj | None = None, - bufsize: int = 10240, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - errors: str = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - compresslevel: int = 9, - ) -> Self: ... - @classmethod - def taropen( - cls, - name: StrOrBytesPath | None, - mode: Literal["r", "a", "w", "x"] = "r", - fileobj: _Fileobj | None = None, - *, - compresslevel: int = ..., - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def gzopen( - cls, - name: StrOrBytesPath | None, - mode: Literal["r"] = "r", - fileobj: _GzipReadableFileobj | None = None, - compresslevel: int = 9, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def gzopen( - cls, - name: StrOrBytesPath | None, - mode: Literal["w", "x"], - fileobj: _GzipWritableFileobj | None = None, - compresslevel: int = 9, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def bz2open( - cls, - name: StrOrBytesPath | None, - mode: Literal["w", "x"], - fileobj: _Bz2WritableFileobj | None = None, - compresslevel: int = 9, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @overload - @classmethod - def bz2open( - cls, - name: StrOrBytesPath | None, - mode: Literal["r"] = "r", - fileobj: _Bz2ReadableFileobj | None = None, - compresslevel: int = 9, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - @classmethod - def xzopen( - cls, - name: StrOrBytesPath | None, - mode: Literal["r", "w", "x"] = "r", - fileobj: IO[bytes] | None = None, - preset: int | None = None, - *, - format: int | None = ..., - tarinfo: type[TarInfo] | None = ..., - dereference: bool | None = ..., - ignore_zeros: bool | None = ..., - encoding: str | None = ..., - pax_headers: Mapping[str, str] | None = ..., - debug: int | None = ..., - errorlevel: int | None = ..., - ) -> Self: ... - def getmember(self, name: str) -> TarInfo: ... - def getmembers(self) -> _list[TarInfo]: ... - def getnames(self) -> _list[str]: ... - def list(self, verbose: bool = True, *, members: _list[TarInfo] | None = None) -> None: ... - def next(self) -> TarInfo | None: ... - # Calling this method without `filter` is deprecated, but it may be set either on the class or in an - # individual call, so we can't mark it as @deprecated here. - def extractall( - self, - path: StrOrBytesPath = ".", - members: Iterable[TarInfo] | None = None, - *, - numeric_owner: bool = False, - filter: _TarfileFilter | None = ..., - ) -> None: ... - # Same situation as for `extractall`. - def extract( - self, - member: str | TarInfo, - path: StrOrBytesPath = "", - set_attrs: bool = True, - *, - numeric_owner: bool = False, - filter: _TarfileFilter | None = ..., - ) -> None: ... - def _extract_member( - self, tarinfo: TarInfo, targetpath: str, set_attrs: bool = True, numeric_owner: bool = False - ) -> None: ... # undocumented - def extractfile(self, member: str | TarInfo) -> IO[bytes] | None: ... - def makedir(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented - def makefile(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented - def makeunknown(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented - def makefifo(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented - def makedev(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented - def makelink(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented - def chown(self, tarinfo: TarInfo, targetpath: StrOrBytesPath, numeric_owner: bool) -> None: ... # undocumented - def chmod(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented - def utime(self, tarinfo: TarInfo, targetpath: StrOrBytesPath) -> None: ... # undocumented - def add( - self, - name: StrPath, - arcname: StrPath | None = None, - recursive: bool = True, - *, - filter: Callable[[TarInfo], TarInfo | None] | None = None, - ) -> None: ... - def addfile(self, tarinfo: TarInfo, fileobj: SupportsRead[bytes] | None = None) -> None: ... - def gettarinfo( - self, name: StrOrBytesPath | None = None, arcname: str | None = None, fileobj: IO[bytes] | None = None - ) -> TarInfo: ... - def close(self) -> None: ... - -open = TarFile.open - -def is_tarfile(name: StrOrBytesPath | IO[bytes]) -> bool: ... - -class TarError(Exception): ... -class ReadError(TarError): ... -class CompressionError(TarError): ... -class StreamError(TarError): ... -class ExtractError(TarError): ... -class HeaderError(TarError): ... - -class FilterError(TarError): - # This attribute is only set directly on the subclasses, but the documentation guarantees - # that it is always present on FilterError. - tarinfo: TarInfo - -class AbsolutePathError(FilterError): - def __init__(self, tarinfo: TarInfo) -> None: ... - -class OutsideDestinationError(FilterError): - def __init__(self, tarinfo: TarInfo, path: str) -> None: ... - -class SpecialFileError(FilterError): - def __init__(self, tarinfo: TarInfo) -> None: ... - -class AbsoluteLinkError(FilterError): - def __init__(self, tarinfo: TarInfo) -> None: ... - -class LinkOutsideDestinationError(FilterError): - def __init__(self, tarinfo: TarInfo, path: str) -> None: ... - -def fully_trusted_filter(member: TarInfo, dest_path: str) -> TarInfo: ... -def tar_filter(member: TarInfo, dest_path: str) -> TarInfo: ... -def data_filter(member: TarInfo, dest_path: str) -> TarInfo: ... - -class TarInfo: - name: str - path: str - size: int - mtime: int | float - chksum: int - devmajor: int - devminor: int - offset: int - offset_data: int - sparse: bytes | None - tarfile: TarFile | None - mode: int - type: bytes - linkname: str - uid: int - gid: int - uname: str - gname: str - pax_headers: Mapping[str, str] - def __init__(self, name: str = "") -> None: ... - @classmethod - def frombuf(cls, buf: bytes | bytearray, encoding: str, errors: str) -> Self: ... - @classmethod - def fromtarfile(cls, tarfile: TarFile) -> Self: ... - @property - def linkpath(self) -> str: ... - @linkpath.setter - def linkpath(self, linkname: str) -> None: ... - def replace( - self, - *, - name: str = ..., - mtime: float = ..., - mode: int = ..., - linkname: str = ..., - uid: int = ..., - gid: int = ..., - uname: str = ..., - gname: str = ..., - deep: bool = True, - ) -> Self: ... - def get_info(self) -> Mapping[str, str | int | bytes | Mapping[str, str]]: ... - def tobuf(self, format: int | None = 2, encoding: str | None = "utf-8", errors: str = "surrogateescape") -> bytes: ... - def create_ustar_header( - self, info: Mapping[str, str | int | bytes | Mapping[str, str]], encoding: str, errors: str - ) -> bytes: ... - def create_gnu_header( - self, info: Mapping[str, str | int | bytes | Mapping[str, str]], encoding: str, errors: str - ) -> bytes: ... - def create_pax_header(self, info: Mapping[str, str | int | bytes | Mapping[str, str]], encoding: str) -> bytes: ... - @classmethod - def create_pax_global_header(cls, pax_headers: Mapping[str, str]) -> bytes: ... - def isfile(self) -> bool: ... - def isreg(self) -> bool: ... - def issparse(self) -> bool: ... - def isdir(self) -> bool: ... - def issym(self) -> bool: ... - def islnk(self) -> bool: ... - def ischr(self) -> bool: ... - def isblk(self) -> bool: ... - def isfifo(self) -> bool: ... - def isdev(self) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/telnetlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/telnetlib.pyi deleted file mode 100644 index 6b599256d1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/telnetlib.pyi +++ /dev/null @@ -1,123 +0,0 @@ -import socket -from collections.abc import Callable, MutableSequence, Sequence -from re import Match, Pattern -from types import TracebackType -from typing import Any -from typing_extensions import Self - -__all__ = ["Telnet"] - -DEBUGLEVEL: int -TELNET_PORT: int - -IAC: bytes -DONT: bytes -DO: bytes -WONT: bytes -WILL: bytes -theNULL: bytes - -SE: bytes -NOP: bytes -DM: bytes -BRK: bytes -IP: bytes -AO: bytes -AYT: bytes -EC: bytes -EL: bytes -GA: bytes -SB: bytes - -BINARY: bytes -ECHO: bytes -RCP: bytes -SGA: bytes -NAMS: bytes -STATUS: bytes -TM: bytes -RCTE: bytes -NAOL: bytes -NAOP: bytes -NAOCRD: bytes -NAOHTS: bytes -NAOHTD: bytes -NAOFFD: bytes -NAOVTS: bytes -NAOVTD: bytes -NAOLFD: bytes -XASCII: bytes -LOGOUT: bytes -BM: bytes -DET: bytes -SUPDUP: bytes -SUPDUPOUTPUT: bytes -SNDLOC: bytes -TTYPE: bytes -EOR: bytes -TUID: bytes -OUTMRK: bytes -TTYLOC: bytes -VT3270REGIME: bytes -X3PAD: bytes -NAWS: bytes -TSPEED: bytes -LFLOW: bytes -LINEMODE: bytes -XDISPLOC: bytes -OLD_ENVIRON: bytes -AUTHENTICATION: bytes -ENCRYPT: bytes -NEW_ENVIRON: bytes - -TN3270E: bytes -XAUTH: bytes -CHARSET: bytes -RSP: bytes -COM_PORT_OPTION: bytes -SUPPRESS_LOCAL_ECHO: bytes -TLS: bytes -KERMIT: bytes -SEND_URL: bytes -FORWARD_X: bytes -PRAGMA_LOGON: bytes -SSPI_LOGON: bytes -PRAGMA_HEARTBEAT: bytes -EXOPL: bytes -NOOPT: bytes - -class Telnet: - host: str | None # undocumented - sock: socket.socket | None # undocumented - def __init__(self, host: str | None = None, port: int = 0, timeout: float = ...) -> None: ... - def open(self, host: str, port: int = 0, timeout: float = ...) -> None: ... - def msg(self, msg: str, *args: Any) -> None: ... - def set_debuglevel(self, debuglevel: int) -> None: ... - def close(self) -> None: ... - def get_socket(self) -> socket.socket: ... - def fileno(self) -> int: ... - def write(self, buffer: bytes) -> None: ... - def read_until(self, match: bytes, timeout: float | None = None) -> bytes: ... - def read_all(self) -> bytes: ... - def read_some(self) -> bytes: ... - def read_very_eager(self) -> bytes: ... - def read_eager(self) -> bytes: ... - def read_lazy(self) -> bytes: ... - def read_very_lazy(self) -> bytes: ... - def read_sb_data(self) -> bytes: ... - def set_option_negotiation_callback(self, callback: Callable[[socket.socket, bytes, bytes], object] | None) -> None: ... - def process_rawq(self) -> None: ... - def rawq_getchar(self) -> bytes: ... - def fill_rawq(self) -> None: ... - def sock_avail(self) -> bool: ... - def interact(self) -> None: ... - def mt_interact(self) -> None: ... - def listener(self) -> None: ... - def expect( - self, list: MutableSequence[Pattern[bytes] | bytes] | Sequence[Pattern[bytes]], timeout: float | None = None - ) -> tuple[int, Match[bytes] | None, bytes]: ... - def __enter__(self) -> Self: ... - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> None: ... - def __del__(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tempfile.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tempfile.pyi deleted file mode 100644 index c4861f7c6f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tempfile.pyi +++ /dev/null @@ -1,478 +0,0 @@ -import io -import sys -from _typeshed import ( - BytesPath, - GenericPath, - OpenBinaryMode, - OpenBinaryModeReading, - OpenBinaryModeUpdating, - OpenBinaryModeWriting, - OpenTextMode, - ReadableBuffer, - StrPath, - WriteableBuffer, -) -from collections.abc import Iterable, Iterator -from types import GenericAlias, TracebackType -from typing import IO, Any, AnyStr, Generic, Literal, overload -from typing_extensions import Self - -__all__ = [ - "NamedTemporaryFile", - "TemporaryFile", - "SpooledTemporaryFile", - "TemporaryDirectory", - "mkstemp", - "mkdtemp", - "mktemp", - "TMP_MAX", - "gettempprefix", - "tempdir", - "gettempdir", - "gettempprefixb", - "gettempdirb", -] - -# global variables -TMP_MAX: int -tempdir: str | None -template: str - -if sys.version_info >= (3, 12): - @overload - def NamedTemporaryFile( - mode: OpenTextMode, - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - delete: bool = True, - *, - errors: str | None = None, - delete_on_close: bool = True, - ) -> _TemporaryFileWrapper[str]: ... - @overload - def NamedTemporaryFile( - mode: OpenBinaryMode = "w+b", - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - delete: bool = True, - *, - errors: str | None = None, - delete_on_close: bool = True, - ) -> _TemporaryFileWrapper[bytes]: ... - @overload - def NamedTemporaryFile( - mode: str = "w+b", - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - delete: bool = True, - *, - errors: str | None = None, - delete_on_close: bool = True, - ) -> _TemporaryFileWrapper[Any]: ... - -else: - @overload - def NamedTemporaryFile( - mode: OpenTextMode, - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - delete: bool = True, - *, - errors: str | None = None, - ) -> _TemporaryFileWrapper[str]: ... - @overload - def NamedTemporaryFile( - mode: OpenBinaryMode = "w+b", - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - delete: bool = True, - *, - errors: str | None = None, - ) -> _TemporaryFileWrapper[bytes]: ... - @overload - def NamedTemporaryFile( - mode: str = "w+b", - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - delete: bool = True, - *, - errors: str | None = None, - ) -> _TemporaryFileWrapper[Any]: ... - -if sys.platform == "win32": - TemporaryFile = NamedTemporaryFile -else: - # See the comments for builtins.open() for an explanation of the overloads. - @overload - def TemporaryFile( - mode: OpenTextMode, - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - *, - errors: str | None = None, - ) -> io.TextIOWrapper: ... - @overload - def TemporaryFile( - mode: OpenBinaryMode, - buffering: Literal[0], - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - *, - errors: str | None = None, - ) -> io.FileIO: ... - @overload - def TemporaryFile( - *, - buffering: Literal[0], - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - errors: str | None = None, - ) -> io.FileIO: ... - @overload - def TemporaryFile( - mode: OpenBinaryModeWriting, - buffering: Literal[-1, 1] = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - *, - errors: str | None = None, - ) -> io.BufferedWriter: ... - @overload - def TemporaryFile( - mode: OpenBinaryModeReading, - buffering: Literal[-1, 1] = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - *, - errors: str | None = None, - ) -> io.BufferedReader: ... - @overload - def TemporaryFile( - mode: OpenBinaryModeUpdating = "w+b", - buffering: Literal[-1, 1] = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - *, - errors: str | None = None, - ) -> io.BufferedRandom: ... - @overload - def TemporaryFile( - mode: str = "w+b", - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: AnyStr | None = None, - prefix: AnyStr | None = None, - dir: GenericPath[AnyStr] | None = None, - *, - errors: str | None = None, - ) -> IO[Any]: ... - -class _TemporaryFileWrapper(IO[AnyStr]): - file: IO[AnyStr] # io.TextIOWrapper, io.BufferedReader or io.BufferedWriter - name: str - delete: bool - if sys.version_info >= (3, 12): - def __init__(self, file: IO[AnyStr], name: str, delete: bool = True, delete_on_close: bool = True) -> None: ... - else: - def __init__(self, file: IO[AnyStr], name: str, delete: bool = True) -> None: ... - - def __enter__(self) -> Self: ... - def __exit__(self, exc: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> None: ... - def __getattr__(self, name: str) -> Any: ... - def close(self) -> None: ... - # These methods don't exist directly on this object, but - # are delegated to the underlying IO object through __getattr__. - # We need to add them here so that this class is concrete. - def __iter__(self) -> Iterator[AnyStr]: ... - # FIXME: __next__ doesn't actually exist on this class and should be removed: - # see also https://github.com/python/typeshed/pull/5456#discussion_r633068648 - # >>> import tempfile - # >>> ntf=tempfile.NamedTemporaryFile() - # >>> next(ntf) - # Traceback (most recent call last): - # File "", line 1, in - # TypeError: '_TemporaryFileWrapper' object is not an iterator - def __next__(self) -> AnyStr: ... - def fileno(self) -> int: ... - def flush(self) -> None: ... - def isatty(self) -> bool: ... - def read(self, n: int = ...) -> AnyStr: ... - def readable(self) -> bool: ... - def readline(self, limit: int = ...) -> AnyStr: ... - def readlines(self, hint: int = ...) -> list[AnyStr]: ... - def seek(self, offset: int, whence: int = ...) -> int: ... - def seekable(self) -> bool: ... - def tell(self) -> int: ... - def truncate(self, size: int | None = ...) -> int: ... - def writable(self) -> bool: ... - @overload - def write(self: _TemporaryFileWrapper[str], s: str, /) -> int: ... - @overload - def write(self: _TemporaryFileWrapper[bytes], s: ReadableBuffer, /) -> int: ... - @overload - def write(self, s: AnyStr, /) -> int: ... - @overload - def writelines(self: _TemporaryFileWrapper[str], lines: Iterable[str]) -> None: ... - @overload - def writelines(self: _TemporaryFileWrapper[bytes], lines: Iterable[ReadableBuffer]) -> None: ... - @overload - def writelines(self, lines: Iterable[AnyStr]) -> None: ... - @property - def closed(self) -> bool: ... - -if sys.version_info >= (3, 11): - _SpooledTemporaryFileBase = io.IOBase -else: - _SpooledTemporaryFileBase = object - -# It does not actually derive from IO[AnyStr], but it does mostly behave -# like one. -class SpooledTemporaryFile(IO[AnyStr], _SpooledTemporaryFileBase): - _file: IO[AnyStr] - @property - def encoding(self) -> str: ... # undocumented - @property - def newlines(self) -> str | tuple[str, ...] | None: ... # undocumented - # bytes needs to go first, as default mode is to open as bytes - @overload - def __init__( - self: SpooledTemporaryFile[bytes], - max_size: int = 0, - mode: OpenBinaryMode = "w+b", - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: str | None = None, - prefix: str | None = None, - dir: str | None = None, - *, - errors: str | None = None, - ) -> None: ... - @overload - def __init__( - self: SpooledTemporaryFile[str], - max_size: int, - mode: OpenTextMode, - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: str | None = None, - prefix: str | None = None, - dir: str | None = None, - *, - errors: str | None = None, - ) -> None: ... - @overload - def __init__( - self: SpooledTemporaryFile[str], - max_size: int = 0, - *, - mode: OpenTextMode, - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: str | None = None, - prefix: str | None = None, - dir: str | None = None, - errors: str | None = None, - ) -> None: ... - @overload - def __init__( - self, - max_size: int, - mode: str, - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: str | None = None, - prefix: str | None = None, - dir: str | None = None, - *, - errors: str | None = None, - ) -> None: ... - @overload - def __init__( - self, - max_size: int = 0, - *, - mode: str, - buffering: int = -1, - encoding: str | None = None, - newline: str | None = None, - suffix: str | None = None, - prefix: str | None = None, - dir: str | None = None, - errors: str | None = None, - ) -> None: ... - @property - def errors(self) -> str | None: ... - def rollover(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, exc: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> None: ... - # These methods are copied from the abstract methods of IO, because - # SpooledTemporaryFile implements IO. - # See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918. - def close(self) -> None: ... - def fileno(self) -> int: ... - def flush(self) -> None: ... - def isatty(self) -> bool: ... - if sys.version_info >= (3, 11): - # These three work only if the SpooledTemporaryFile is opened in binary mode, - # because the underlying object in text mode does not have these methods. - def read1(self, size: int = ..., /) -> AnyStr: ... - def readinto(self, b: WriteableBuffer) -> int: ... - def readinto1(self, b: WriteableBuffer) -> int: ... - def detach(self) -> io.RawIOBase: ... - - def read(self, n: int = ..., /) -> AnyStr: ... - def readline(self, limit: int | None = ..., /) -> AnyStr: ... # type: ignore[override] - def readlines(self, hint: int = ..., /) -> list[AnyStr]: ... # type: ignore[override] - def seek(self, offset: int, whence: int = ...) -> int: ... - def tell(self) -> int: ... - if sys.version_info >= (3, 11): - def truncate(self, size: int | None = None) -> int: ... - else: - def truncate(self, size: int | None = None) -> None: ... # type: ignore[override] - - @overload - def write(self: SpooledTemporaryFile[str], s: str) -> int: ... - @overload - def write(self: SpooledTemporaryFile[bytes], s: ReadableBuffer) -> int: ... - @overload - def write(self, s: AnyStr) -> int: ... - @overload - def writelines(self: SpooledTemporaryFile[str], iterable: Iterable[str]) -> None: ... - @overload - def writelines(self: SpooledTemporaryFile[bytes], iterable: Iterable[ReadableBuffer]) -> None: ... - @overload - def writelines(self, iterable: Iterable[AnyStr]) -> None: ... - def __iter__(self) -> Iterator[AnyStr]: ... # type: ignore[override] - # These exist at runtime only on 3.11+. - def readable(self) -> bool: ... - def seekable(self) -> bool: ... - def writable(self) -> bool: ... - def __next__(self) -> AnyStr: ... # type: ignore[override] - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class TemporaryDirectory(Generic[AnyStr]): - name: AnyStr - if sys.version_info >= (3, 12): - @overload - def __init__( - self: TemporaryDirectory[str], - suffix: str | None = None, - prefix: str | None = None, - dir: StrPath | None = None, - ignore_cleanup_errors: bool = False, - *, - delete: bool = True, - ) -> None: ... - @overload - def __init__( - self: TemporaryDirectory[bytes], - suffix: bytes | None = None, - prefix: bytes | None = None, - dir: BytesPath | None = None, - ignore_cleanup_errors: bool = False, - *, - delete: bool = True, - ) -> None: ... - elif sys.version_info >= (3, 10): - @overload - def __init__( - self: TemporaryDirectory[str], - suffix: str | None = None, - prefix: str | None = None, - dir: StrPath | None = None, - ignore_cleanup_errors: bool = False, - ) -> None: ... - @overload - def __init__( - self: TemporaryDirectory[bytes], - suffix: bytes | None = None, - prefix: bytes | None = None, - dir: BytesPath | None = None, - ignore_cleanup_errors: bool = False, - ) -> None: ... - else: - @overload - def __init__( - self: TemporaryDirectory[str], suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None - ) -> None: ... - @overload - def __init__( - self: TemporaryDirectory[bytes], - suffix: bytes | None = None, - prefix: bytes | None = None, - dir: BytesPath | None = None, - ) -> None: ... - - def cleanup(self) -> None: ... - def __enter__(self) -> AnyStr: ... - def __exit__(self, exc: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -# The overloads overlap, but they should still work fine. -@overload -def mkstemp( - suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None, text: bool = False -) -> tuple[int, str]: ... -@overload -def mkstemp( - suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None, text: bool = False -) -> tuple[int, bytes]: ... - -# The overloads overlap, but they should still work fine. -@overload -def mkdtemp(suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None) -> str: ... -@overload -def mkdtemp(suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None) -> bytes: ... -def mktemp(suffix: str = "", prefix: str = "tmp", dir: StrPath | None = None) -> str: ... -def gettempdirb() -> bytes: ... -def gettempprefixb() -> bytes: ... -def gettempdir() -> str: ... -def gettempprefix() -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/termios.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/termios.pyi deleted file mode 100644 index 5a5a1f53be..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/termios.pyi +++ /dev/null @@ -1,303 +0,0 @@ -import sys -from _typeshed import FileDescriptorLike -from typing import Any -from typing_extensions import TypeAlias - -# Must be a list of length 7, containing 6 ints and a list of NCCS 1-character bytes or ints. -_Attr: TypeAlias = list[int | list[bytes | int]] | list[int | list[bytes]] | list[int | list[int]] -# Same as _Attr for return types; we use Any to avoid a union. -_AttrReturn: TypeAlias = list[Any] - -if sys.platform != "win32": - B0: int - B110: int - B115200: int - B1200: int - B134: int - B150: int - B1800: int - B19200: int - B200: int - B230400: int - B2400: int - B300: int - B38400: int - B4800: int - B50: int - B57600: int - B600: int - B75: int - B9600: int - BRKINT: int - BS0: int - BS1: int - BSDLY: int - CDSUSP: int - CEOF: int - CEOL: int - CEOT: int - CERASE: int - CFLUSH: int - CINTR: int - CKILL: int - CLNEXT: int - CLOCAL: int - CQUIT: int - CR0: int - CR1: int - CR2: int - CR3: int - CRDLY: int - CREAD: int - CRPRNT: int - CRTSCTS: int - CS5: int - CS6: int - CS7: int - CS8: int - CSIZE: int - CSTART: int - CSTOP: int - CSTOPB: int - CSUSP: int - CWERASE: int - ECHO: int - ECHOCTL: int - ECHOE: int - ECHOK: int - ECHOKE: int - ECHONL: int - ECHOPRT: int - EXTA: int - EXTB: int - FF0: int - FF1: int - FFDLY: int - FIOASYNC: int - FIOCLEX: int - FIONBIO: int - FIONCLEX: int - FIONREAD: int - FLUSHO: int - HUPCL: int - ICANON: int - ICRNL: int - IEXTEN: int - IGNBRK: int - IGNCR: int - IGNPAR: int - IMAXBEL: int - INLCR: int - INPCK: int - ISIG: int - ISTRIP: int - IXANY: int - IXOFF: int - IXON: int - NCCS: int - NL0: int - NL1: int - NLDLY: int - NOFLSH: int - OCRNL: int - OFDEL: int - OFILL: int - ONLCR: int - ONLRET: int - ONOCR: int - OPOST: int - PARENB: int - PARMRK: int - PARODD: int - PENDIN: int - TAB0: int - TAB1: int - TAB2: int - TAB3: int - TABDLY: int - TCIFLUSH: int - TCIOFF: int - TCIOFLUSH: int - TCION: int - TCOFLUSH: int - TCOOFF: int - TCOON: int - TCSADRAIN: int - TCSAFLUSH: int - TCSANOW: int - TIOCCONS: int - TIOCEXCL: int - TIOCGETD: int - TIOCGPGRP: int - TIOCGWINSZ: int - TIOCM_CAR: int - TIOCM_CD: int - TIOCM_CTS: int - TIOCM_DSR: int - TIOCM_DTR: int - TIOCM_LE: int - TIOCM_RI: int - TIOCM_RNG: int - TIOCM_RTS: int - TIOCM_SR: int - TIOCM_ST: int - TIOCMBIC: int - TIOCMBIS: int - TIOCMGET: int - TIOCMSET: int - TIOCNOTTY: int - TIOCNXCL: int - TIOCOUTQ: int - TIOCPKT_DATA: int - TIOCPKT_DOSTOP: int - TIOCPKT_FLUSHREAD: int - TIOCPKT_FLUSHWRITE: int - TIOCPKT_NOSTOP: int - TIOCPKT_START: int - TIOCPKT_STOP: int - TIOCPKT: int - TIOCSCTTY: int - TIOCSETD: int - TIOCSPGRP: int - TIOCSTI: int - TIOCSWINSZ: int - TOSTOP: int - VDISCARD: int - VEOF: int - VEOL: int - VEOL2: int - VERASE: int - VINTR: int - VKILL: int - VLNEXT: int - VMIN: int - VQUIT: int - VREPRINT: int - VSTART: int - VSTOP: int - VSUSP: int - VT0: int - VT1: int - VTDLY: int - VTIME: int - VWERASE: int - - if sys.version_info >= (3, 13): - EXTPROC: int - IUTF8: int - - if sys.platform == "darwin" and sys.version_info >= (3, 13): - ALTWERASE: int - B14400: int - B28800: int - B7200: int - B76800: int - CCAR_OFLOW: int - CCTS_OFLOW: int - CDSR_OFLOW: int - CDTR_IFLOW: int - CIGNORE: int - CRTS_IFLOW: int - MDMBUF: int - NL2: int - NL3: int - NOKERNINFO: int - ONOEOT: int - OXTABS: int - VDSUSP: int - VSTATUS: int - - if sys.platform == "darwin" and sys.version_info >= (3, 11): - TIOCGSIZE: int - TIOCSSIZE: int - - if sys.platform == "linux": - B1152000: int - B576000: int - CBAUD: int - CBAUDEX: int - CIBAUD: int - IOCSIZE_MASK: int - IOCSIZE_SHIFT: int - IUCLC: int - N_MOUSE: int - N_PPP: int - N_SLIP: int - N_STRIP: int - N_TTY: int - NCC: int - OLCUC: int - TCFLSH: int - TCGETA: int - TCGETS: int - TCSBRK: int - TCSBRKP: int - TCSETA: int - TCSETAF: int - TCSETAW: int - TCSETS: int - TCSETSF: int - TCSETSW: int - TCXONC: int - TIOCGICOUNT: int - TIOCGLCKTRMIOS: int - TIOCGSERIAL: int - TIOCGSOFTCAR: int - TIOCINQ: int - TIOCLINUX: int - TIOCMIWAIT: int - TIOCTTYGSTRUCT: int - TIOCSER_TEMT: int - TIOCSERCONFIG: int - TIOCSERGETLSR: int - TIOCSERGETMULTI: int - TIOCSERGSTRUCT: int - TIOCSERGWILD: int - TIOCSERSETMULTI: int - TIOCSERSWILD: int - TIOCSLCKTRMIOS: int - TIOCSSERIAL: int - TIOCSSOFTCAR: int - VSWTC: int - VSWTCH: int - XCASE: int - XTABS: int - - if sys.platform != "darwin": - B1000000: int - B1500000: int - B2000000: int - B2500000: int - B3000000: int - B3500000: int - B4000000: int - B460800: int - B500000: int - B921600: int - - if sys.platform != "linux": - TCSASOFT: int - - if sys.platform != "darwin" and sys.platform != "linux": - # not available on FreeBSD either. - CDEL: int - CEOL2: int - CESC: int - CNUL: int - COMMON: int - CSWTCH: int - IBSHIFT: int - INIT_C_CC: int - NSWTCH: int - - def tcgetattr(fd: FileDescriptorLike, /) -> _AttrReturn: ... - def tcsetattr(fd: FileDescriptorLike, when: int, attributes: _Attr, /) -> None: ... - def tcsendbreak(fd: FileDescriptorLike, duration: int, /) -> None: ... - def tcdrain(fd: FileDescriptorLike, /) -> None: ... - def tcflush(fd: FileDescriptorLike, queue: int, /) -> None: ... - def tcflow(fd: FileDescriptorLike, action: int, /) -> None: ... - if sys.version_info >= (3, 11): - def tcgetwinsize(fd: FileDescriptorLike, /) -> tuple[int, int]: ... - def tcsetwinsize(fd: FileDescriptorLike, winsize: tuple[int, int], /) -> None: ... - - class error(Exception): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/textwrap.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/textwrap.pyi deleted file mode 100644 index c00cce3c2d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/textwrap.pyi +++ /dev/null @@ -1,103 +0,0 @@ -from collections.abc import Callable -from re import Pattern - -__all__ = ["TextWrapper", "wrap", "fill", "dedent", "indent", "shorten"] - -class TextWrapper: - width: int - initial_indent: str - subsequent_indent: str - expand_tabs: bool - replace_whitespace: bool - fix_sentence_endings: bool - drop_whitespace: bool - break_long_words: bool - break_on_hyphens: bool - tabsize: int - max_lines: int | None - placeholder: str - - # Attributes not present in documentation - sentence_end_re: Pattern[str] - wordsep_re: Pattern[str] - wordsep_simple_re: Pattern[str] - whitespace_trans: str - unicode_whitespace_trans: dict[int, int] - uspace: int - x: str # leaked loop variable - def __init__( - self, - width: int = 70, - initial_indent: str = "", - subsequent_indent: str = "", - expand_tabs: bool = True, - replace_whitespace: bool = True, - fix_sentence_endings: bool = False, - break_long_words: bool = True, - drop_whitespace: bool = True, - break_on_hyphens: bool = True, - tabsize: int = 8, - *, - max_lines: int | None = None, - placeholder: str = " [...]", - ) -> None: ... - # Private methods *are* part of the documented API for subclasses. - def _munge_whitespace(self, text: str) -> str: ... - def _split(self, text: str) -> list[str]: ... - def _fix_sentence_endings(self, chunks: list[str]) -> None: ... - def _handle_long_word(self, reversed_chunks: list[str], cur_line: list[str], cur_len: int, width: int) -> None: ... - def _wrap_chunks(self, chunks: list[str]) -> list[str]: ... - def _split_chunks(self, text: str) -> list[str]: ... - def wrap(self, text: str) -> list[str]: ... - def fill(self, text: str) -> str: ... - -def wrap( - text: str, - width: int = 70, - *, - initial_indent: str = "", - subsequent_indent: str = "", - expand_tabs: bool = True, - tabsize: int = 8, - replace_whitespace: bool = True, - fix_sentence_endings: bool = False, - break_long_words: bool = True, - break_on_hyphens: bool = True, - drop_whitespace: bool = True, - max_lines: int | None = None, - placeholder: str = " [...]", -) -> list[str]: ... -def fill( - text: str, - width: int = 70, - *, - initial_indent: str = "", - subsequent_indent: str = "", - expand_tabs: bool = True, - tabsize: int = 8, - replace_whitespace: bool = True, - fix_sentence_endings: bool = False, - break_long_words: bool = True, - break_on_hyphens: bool = True, - drop_whitespace: bool = True, - max_lines: int | None = None, - placeholder: str = " [...]", -) -> str: ... -def shorten( - text: str, - width: int, - *, - initial_indent: str = "", - subsequent_indent: str = "", - expand_tabs: bool = True, - tabsize: int = 8, - replace_whitespace: bool = True, - fix_sentence_endings: bool = False, - break_long_words: bool = True, - break_on_hyphens: bool = True, - drop_whitespace: bool = True, - # Omit `max_lines: int = None`, it is forced to 1 here. - placeholder: str = " [...]", -) -> str: ... -def dedent(text: str) -> str: ... -def indent(text: str, prefix: str, predicate: Callable[[str], bool] | None = None) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/this.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/this.pyi deleted file mode 100644 index 8de996b04a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/this.pyi +++ /dev/null @@ -1,2 +0,0 @@ -s: str -d: dict[str, str] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/threading.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/threading.pyi deleted file mode 100644 index e3965fab0e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/threading.pyi +++ /dev/null @@ -1,177 +0,0 @@ -import _thread -import sys -from _thread import _excepthook, _ExceptHookArgs, get_native_id as get_native_id -from _typeshed import ProfileFunction, TraceFunction -from collections.abc import Callable, Iterable, Mapping -from types import TracebackType -from typing import Any, TypeVar, final - -_T = TypeVar("_T") - -__all__ = [ - "get_ident", - "active_count", - "Condition", - "current_thread", - "enumerate", - "main_thread", - "TIMEOUT_MAX", - "Event", - "Lock", - "RLock", - "Semaphore", - "BoundedSemaphore", - "Thread", - "Barrier", - "BrokenBarrierError", - "Timer", - "ThreadError", - "ExceptHookArgs", - "setprofile", - "settrace", - "local", - "stack_size", - "excepthook", - "get_native_id", -] - -if sys.version_info >= (3, 10): - __all__ += ["getprofile", "gettrace"] - -if sys.version_info >= (3, 12): - __all__ += ["setprofile_all_threads", "settrace_all_threads"] - -_profile_hook: ProfileFunction | None - -def active_count() -> int: ... -def activeCount() -> int: ... # deprecated alias for active_count() -def current_thread() -> Thread: ... -def currentThread() -> Thread: ... # deprecated alias for current_thread() -def get_ident() -> int: ... -def enumerate() -> list[Thread]: ... -def main_thread() -> Thread: ... -def settrace(func: TraceFunction) -> None: ... -def setprofile(func: ProfileFunction | None) -> None: ... - -if sys.version_info >= (3, 12): - def setprofile_all_threads(func: ProfileFunction | None) -> None: ... - def settrace_all_threads(func: TraceFunction) -> None: ... - -if sys.version_info >= (3, 10): - def gettrace() -> TraceFunction | None: ... - def getprofile() -> ProfileFunction | None: ... - -def stack_size(size: int = 0, /) -> int: ... - -TIMEOUT_MAX: float - -ThreadError = _thread.error -local = _thread._local - -class Thread: - name: str - @property - def ident(self) -> int | None: ... - daemon: bool - def __init__( - self, - group: None = None, - target: Callable[..., object] | None = None, - name: str | None = None, - args: Iterable[Any] = (), - kwargs: Mapping[str, Any] | None = None, - *, - daemon: bool | None = None, - ) -> None: ... - def start(self) -> None: ... - def run(self) -> None: ... - def join(self, timeout: float | None = None) -> None: ... - @property - def native_id(self) -> int | None: ... # only available on some platforms - def is_alive(self) -> bool: ... - # the following methods are all deprecated - def getName(self) -> str: ... - def setName(self, name: str) -> None: ... - def isDaemon(self) -> bool: ... - def setDaemon(self, daemonic: bool) -> None: ... - -class _DummyThread(Thread): - def __init__(self) -> None: ... - -# This is actually the function _thread.allocate_lock for <= 3.12 -Lock = _thread.LockType - -# Python implementation of RLock. -@final -class _RLock: - _count: int - def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... - def release(self) -> None: ... - __enter__ = acquire - def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... - -RLock = _thread.RLock # Actually a function at runtime. - -class Condition: - def __init__(self, lock: Lock | _RLock | RLock | None = None) -> None: ... - def __enter__(self) -> bool: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... - def release(self) -> None: ... - def wait(self, timeout: float | None = None) -> bool: ... - def wait_for(self, predicate: Callable[[], _T], timeout: float | None = None) -> _T: ... - def notify(self, n: int = 1) -> None: ... - def notify_all(self) -> None: ... - def notifyAll(self) -> None: ... # deprecated alias for notify_all() - -class Semaphore: - _value: int - def __init__(self, value: int = 1) -> None: ... - def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ... - def acquire(self, blocking: bool = True, timeout: float | None = None) -> bool: ... - def __enter__(self, blocking: bool = True, timeout: float | None = None) -> bool: ... - def release(self, n: int = 1) -> None: ... - -class BoundedSemaphore(Semaphore): ... - -class Event: - def is_set(self) -> bool: ... - def isSet(self) -> bool: ... # deprecated alias for is_set() - def set(self) -> None: ... - def clear(self) -> None: ... - def wait(self, timeout: float | None = None) -> bool: ... - -excepthook = _excepthook -ExceptHookArgs = _ExceptHookArgs - -class Timer(Thread): - args: Iterable[Any] # undocumented - finished: Event # undocumented - function: Callable[..., Any] # undocumented - interval: float # undocumented - kwargs: Mapping[str, Any] # undocumented - - def __init__( - self, - interval: float, - function: Callable[..., object], - args: Iterable[Any] | None = None, - kwargs: Mapping[str, Any] | None = None, - ) -> None: ... - def cancel(self) -> None: ... - -class Barrier: - @property - def parties(self) -> int: ... - @property - def n_waiting(self) -> int: ... - @property - def broken(self) -> bool: ... - def __init__(self, parties: int, action: Callable[[], None] | None = None, timeout: float | None = None) -> None: ... - def wait(self, timeout: float | None = None) -> int: ... - def reset(self) -> None: ... - def abort(self) -> None: ... - -class BrokenBarrierError(RuntimeError): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/time.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/time.pyi deleted file mode 100644 index 6d2538ea7e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/time.pyi +++ /dev/null @@ -1,111 +0,0 @@ -import sys -from _typeshed import structseq -from typing import Any, Final, Literal, Protocol, final -from typing_extensions import TypeAlias - -_TimeTuple: TypeAlias = tuple[int, int, int, int, int, int, int, int, int] - -altzone: int -daylight: int -timezone: int -tzname: tuple[str, str] - -if sys.platform == "linux": - CLOCK_BOOTTIME: int -if sys.platform != "linux" and sys.platform != "win32" and sys.platform != "darwin": - CLOCK_PROF: int # FreeBSD, NetBSD, OpenBSD - CLOCK_UPTIME: int # FreeBSD, OpenBSD - -if sys.platform != "win32": - CLOCK_MONOTONIC: int - CLOCK_MONOTONIC_RAW: int - CLOCK_PROCESS_CPUTIME_ID: int - CLOCK_REALTIME: int - CLOCK_THREAD_CPUTIME_ID: int - if sys.platform != "linux" and sys.platform != "darwin": - CLOCK_HIGHRES: int # Solaris only - -if sys.platform == "darwin": - CLOCK_UPTIME_RAW: int - if sys.version_info >= (3, 13): - CLOCK_UPTIME_RAW_APPROX: int - CLOCK_MONOTONIC_RAW_APPROX: int - -if sys.platform == "linux": - CLOCK_TAI: int - -# Constructor takes an iterable of any type, of length between 9 and 11 elements. -# However, it always *behaves* like a tuple of 9 elements, -# even if an iterable with length >9 is passed. -# https://github.com/python/typeshed/pull/6560#discussion_r767162532 -@final -class struct_time(structseq[Any | int], _TimeTuple): - if sys.version_info >= (3, 10): - __match_args__: Final = ("tm_year", "tm_mon", "tm_mday", "tm_hour", "tm_min", "tm_sec", "tm_wday", "tm_yday", "tm_isdst") - - @property - def tm_year(self) -> int: ... - @property - def tm_mon(self) -> int: ... - @property - def tm_mday(self) -> int: ... - @property - def tm_hour(self) -> int: ... - @property - def tm_min(self) -> int: ... - @property - def tm_sec(self) -> int: ... - @property - def tm_wday(self) -> int: ... - @property - def tm_yday(self) -> int: ... - @property - def tm_isdst(self) -> int: ... - # These final two properties only exist if a 10- or 11-item sequence was passed to the constructor. - @property - def tm_zone(self) -> str: ... - @property - def tm_gmtoff(self) -> int: ... - -def asctime(time_tuple: _TimeTuple | struct_time = ..., /) -> str: ... -def ctime(seconds: float | None = None, /) -> str: ... -def gmtime(seconds: float | None = None, /) -> struct_time: ... -def localtime(seconds: float | None = None, /) -> struct_time: ... -def mktime(time_tuple: _TimeTuple | struct_time, /) -> float: ... -def sleep(seconds: float, /) -> None: ... -def strftime(format: str, time_tuple: _TimeTuple | struct_time = ..., /) -> str: ... -def strptime(data_string: str, format: str = "%a %b %d %H:%M:%S %Y", /) -> struct_time: ... -def time() -> float: ... - -if sys.platform != "win32": - def tzset() -> None: ... # Unix only - -class _ClockInfo(Protocol): - adjustable: bool - implementation: str - monotonic: bool - resolution: float - -def get_clock_info(name: Literal["monotonic", "perf_counter", "process_time", "time", "thread_time"], /) -> _ClockInfo: ... -def monotonic() -> float: ... -def perf_counter() -> float: ... -def process_time() -> float: ... - -if sys.platform != "win32": - def clock_getres(clk_id: int, /) -> float: ... # Unix only - def clock_gettime(clk_id: int, /) -> float: ... # Unix only - def clock_settime(clk_id: int, time: float, /) -> None: ... # Unix only - -if sys.platform != "win32": - def clock_gettime_ns(clk_id: int, /) -> int: ... - def clock_settime_ns(clock_id: int, time: int, /) -> int: ... - -if sys.platform == "linux": - def pthread_getcpuclockid(thread_id: int, /) -> int: ... - -def monotonic_ns() -> int: ... -def perf_counter_ns() -> int: ... -def process_time_ns() -> int: ... -def time_ns() -> int: ... -def thread_time() -> float: ... -def thread_time_ns() -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/timeit.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/timeit.pyi deleted file mode 100644 index a5da943c84..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/timeit.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from collections.abc import Callable, Sequence -from typing import IO, Any -from typing_extensions import TypeAlias - -__all__ = ["Timer", "timeit", "repeat", "default_timer"] - -_Timer: TypeAlias = Callable[[], float] -_Stmt: TypeAlias = str | Callable[[], object] - -default_timer: _Timer - -class Timer: - def __init__( - self, stmt: _Stmt = "pass", setup: _Stmt = "pass", timer: _Timer = ..., globals: dict[str, Any] | None = None - ) -> None: ... - def print_exc(self, file: IO[str] | None = None) -> None: ... - def timeit(self, number: int = 1000000) -> float: ... - def repeat(self, repeat: int = 5, number: int = 1000000) -> list[float]: ... - def autorange(self, callback: Callable[[int, float], object] | None = None) -> tuple[int, float]: ... - -def timeit( - stmt: _Stmt = "pass", setup: _Stmt = "pass", timer: _Timer = ..., number: int = 1000000, globals: dict[str, Any] | None = None -) -> float: ... -def repeat( - stmt: _Stmt = "pass", - setup: _Stmt = "pass", - timer: _Timer = ..., - repeat: int = 5, - number: int = 1000000, - globals: dict[str, Any] | None = None, -) -> list[float]: ... -def main(args: Sequence[str] | None = None, *, _wrap_timer: Callable[[_Timer], _Timer] | None = None) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/__init__.pyi deleted file mode 100644 index 291e2fc510..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/__init__.pyi +++ /dev/null @@ -1,4087 +0,0 @@ -import _tkinter -import sys -from _typeshed import Incomplete, MaybeNone, StrOrBytesPath -from collections.abc import Callable, Iterable, Mapping, Sequence -from tkinter.constants import * -from tkinter.font import _FontDescription -from types import TracebackType -from typing import Any, ClassVar, Generic, Literal, NamedTuple, Protocol, TypedDict, TypeVar, overload, type_check_only -from typing_extensions import TypeAlias, TypeVarTuple, Unpack, deprecated - -if sys.version_info >= (3, 11): - from enum import StrEnum -else: - from enum import Enum - -__all__ = [ - "TclError", - "NO", - "FALSE", - "OFF", - "YES", - "TRUE", - "ON", - "N", - "S", - "W", - "E", - "NW", - "SW", - "NE", - "SE", - "NS", - "EW", - "NSEW", - "CENTER", - "NONE", - "X", - "Y", - "BOTH", - "LEFT", - "TOP", - "RIGHT", - "BOTTOM", - "RAISED", - "SUNKEN", - "FLAT", - "RIDGE", - "GROOVE", - "SOLID", - "HORIZONTAL", - "VERTICAL", - "NUMERIC", - "CHAR", - "WORD", - "BASELINE", - "INSIDE", - "OUTSIDE", - "SEL", - "SEL_FIRST", - "SEL_LAST", - "END", - "INSERT", - "CURRENT", - "ANCHOR", - "ALL", - "NORMAL", - "DISABLED", - "ACTIVE", - "HIDDEN", - "CASCADE", - "CHECKBUTTON", - "COMMAND", - "RADIOBUTTON", - "SEPARATOR", - "SINGLE", - "BROWSE", - "MULTIPLE", - "EXTENDED", - "DOTBOX", - "UNDERLINE", - "PIESLICE", - "CHORD", - "ARC", - "FIRST", - "LAST", - "BUTT", - "PROJECTING", - "ROUND", - "BEVEL", - "MITER", - "MOVETO", - "SCROLL", - "UNITS", - "PAGES", - "TkVersion", - "TclVersion", - "READABLE", - "WRITABLE", - "EXCEPTION", - "EventType", - "Event", - "NoDefaultRoot", - "Variable", - "StringVar", - "IntVar", - "DoubleVar", - "BooleanVar", - "mainloop", - "getint", - "getdouble", - "getboolean", - "Misc", - "CallWrapper", - "XView", - "YView", - "Wm", - "Tk", - "Tcl", - "Pack", - "Place", - "Grid", - "BaseWidget", - "Widget", - "Toplevel", - "Button", - "Canvas", - "Checkbutton", - "Entry", - "Frame", - "Label", - "Listbox", - "Menu", - "Menubutton", - "Message", - "Radiobutton", - "Scale", - "Scrollbar", - "Text", - "OptionMenu", - "Image", - "PhotoImage", - "BitmapImage", - "image_names", - "image_types", - "Spinbox", - "LabelFrame", - "PanedWindow", -] - -# Using anything from tkinter.font in this file means that 'import tkinter' -# seems to also load tkinter.font. That's not how it actually works, but -# unfortunately not much can be done about it. https://github.com/python/typeshed/pull/4346 - -TclError = _tkinter.TclError -wantobjects: int -TkVersion: float -TclVersion: float -READABLE = _tkinter.READABLE -WRITABLE = _tkinter.WRITABLE -EXCEPTION = _tkinter.EXCEPTION - -# Quick guide for figuring out which widget class to choose: -# - Misc: any widget (don't use BaseWidget because Tk doesn't inherit from BaseWidget) -# - Widget: anything that is meant to be put into another widget with e.g. pack or grid -# -# Don't trust tkinter's docstrings, because they have been created by copy/pasting from -# Tk's manual pages more than 10 years ago. Use the latest manual pages instead: -# -# $ sudo apt install tk-doc tcl-doc -# $ man 3tk label # tkinter.Label -# $ man 3tk ttk_label # tkinter.ttk.Label -# $ man 3tcl after # tkinter.Misc.after -# -# You can also read the manual pages online: https://www.tcl.tk/doc/ - -# Some widgets have an option named -compound that accepts different values -# than the _Compound defined here. Many other options have similar things. -_Anchor: TypeAlias = Literal["nw", "n", "ne", "w", "center", "e", "sw", "s", "se"] # manual page: Tk_GetAnchor -_ButtonCommand: TypeAlias = str | Callable[[], Any] # accepts string of tcl code, return value is returned from Button.invoke() -_Compound: TypeAlias = Literal["top", "left", "center", "right", "bottom", "none"] # -compound in manual page named 'options' -# manual page: Tk_GetCursor -_Cursor: TypeAlias = str | tuple[str] | tuple[str, str] | tuple[str, str, str] | tuple[str, str, str, str] -# example when it's sequence: entry['invalidcommand'] = [entry.register(print), '%P'] -_EntryValidateCommand: TypeAlias = str | list[str] | tuple[str, ...] | Callable[[], bool] -_ImageSpec: TypeAlias = _Image | str # str can be from e.g. tkinter.image_names() -_Relief: TypeAlias = Literal["raised", "sunken", "flat", "ridge", "solid", "groove"] # manual page: Tk_GetRelief -_ScreenUnits: TypeAlias = str | float # Often the right type instead of int. Manual page: Tk_GetPixels -# -xscrollcommand and -yscrollcommand in 'options' manual page -_XYScrollCommand: TypeAlias = str | Callable[[float, float], object] -_TakeFocusValue: TypeAlias = bool | Literal[0, 1, ""] | Callable[[str], bool | None] # -takefocus in manual page named 'options' - -if sys.version_info >= (3, 11): - @type_check_only - class _VersionInfoTypeBase(NamedTuple): - major: int - minor: int - micro: int - releaselevel: str - serial: int - - class _VersionInfoType(_VersionInfoTypeBase): ... - -if sys.version_info >= (3, 11): - class EventType(StrEnum): - Activate = "36" - ButtonPress = "4" - Button = ButtonPress - ButtonRelease = "5" - Circulate = "26" - CirculateRequest = "27" - ClientMessage = "33" - Colormap = "32" - Configure = "22" - ConfigureRequest = "23" - Create = "16" - Deactivate = "37" - Destroy = "17" - Enter = "7" - Expose = "12" - FocusIn = "9" - FocusOut = "10" - GraphicsExpose = "13" - Gravity = "24" - KeyPress = "2" - Key = "2" - KeyRelease = "3" - Keymap = "11" - Leave = "8" - Map = "19" - MapRequest = "20" - Mapping = "34" - Motion = "6" - MouseWheel = "38" - NoExpose = "14" - Property = "28" - Reparent = "21" - ResizeRequest = "25" - Selection = "31" - SelectionClear = "29" - SelectionRequest = "30" - Unmap = "18" - VirtualEvent = "35" - Visibility = "15" - -else: - class EventType(str, Enum): - Activate = "36" - ButtonPress = "4" - Button = ButtonPress - ButtonRelease = "5" - Circulate = "26" - CirculateRequest = "27" - ClientMessage = "33" - Colormap = "32" - Configure = "22" - ConfigureRequest = "23" - Create = "16" - Deactivate = "37" - Destroy = "17" - Enter = "7" - Expose = "12" - FocusIn = "9" - FocusOut = "10" - GraphicsExpose = "13" - Gravity = "24" - KeyPress = "2" - Key = KeyPress - KeyRelease = "3" - Keymap = "11" - Leave = "8" - Map = "19" - MapRequest = "20" - Mapping = "34" - Motion = "6" - MouseWheel = "38" - NoExpose = "14" - Property = "28" - Reparent = "21" - ResizeRequest = "25" - Selection = "31" - SelectionClear = "29" - SelectionRequest = "30" - Unmap = "18" - VirtualEvent = "35" - Visibility = "15" - -_W = TypeVar("_W", bound=Misc) -# Events considered covariant because you should never assign to event.widget. -_W_co = TypeVar("_W_co", covariant=True, bound=Misc) - -class Event(Generic[_W_co]): - serial: int - num: int - focus: bool - height: int - width: int - keycode: int - state: int | str - time: int - x: int - y: int - x_root: int - y_root: int - char: str - send_event: bool - keysym: str - keysym_num: int - type: EventType - widget: _W_co - delta: int - -def NoDefaultRoot() -> None: ... - -class Variable: - def __init__(self, master: Misc | None = None, value: Incomplete | None = None, name: str | None = None) -> None: ... - def set(self, value) -> None: ... - initialize = set - def get(self): ... - def trace_add(self, mode: Literal["array", "read", "write", "unset"], callback: Callable[[str, str, str], object]) -> str: ... - def trace_remove(self, mode: Literal["array", "read", "write", "unset"], cbname: str) -> None: ... - def trace_info(self) -> list[tuple[tuple[Literal["array", "read", "write", "unset"], ...], str]]: ... - @deprecated("use trace_add() instead of trace()") - def trace(self, mode, callback): ... - @deprecated("use trace_add() instead of trace_variable()") - def trace_variable(self, mode, callback): ... - @deprecated("use trace_remove() instead of trace_vdelete()") - def trace_vdelete(self, mode, cbname) -> None: ... - @deprecated("use trace_info() instead of trace_vinfo()") - def trace_vinfo(self): ... - def __eq__(self, other: object) -> bool: ... - def __del__(self) -> None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - -class StringVar(Variable): - def __init__(self, master: Misc | None = None, value: str | None = None, name: str | None = None) -> None: ... - def set(self, value: str) -> None: ... - initialize = set - def get(self) -> str: ... - -class IntVar(Variable): - def __init__(self, master: Misc | None = None, value: int | None = None, name: str | None = None) -> None: ... - def set(self, value: int) -> None: ... - initialize = set - def get(self) -> int: ... - -class DoubleVar(Variable): - def __init__(self, master: Misc | None = None, value: float | None = None, name: str | None = None) -> None: ... - def set(self, value: float) -> None: ... - initialize = set - def get(self) -> float: ... - -class BooleanVar(Variable): - def __init__(self, master: Misc | None = None, value: bool | None = None, name: str | None = None) -> None: ... - def set(self, value: bool) -> None: ... - initialize = set - def get(self) -> bool: ... - -def mainloop(n: int = 0) -> None: ... - -getint: Incomplete -getdouble: Incomplete - -def getboolean(s): ... - -_Ts = TypeVarTuple("_Ts") - -class _GridIndexInfo(TypedDict, total=False): - minsize: _ScreenUnits - pad: _ScreenUnits - uniform: str | None - weight: int - -class _BusyInfo(TypedDict): - cursor: _Cursor - -class Misc: - master: Misc | None - tk: _tkinter.TkappType - children: dict[str, Widget] - def destroy(self) -> None: ... - def deletecommand(self, name: str) -> None: ... - def tk_strictMotif(self, boolean: Incomplete | None = None): ... - def tk_bisque(self) -> None: ... - def tk_setPalette(self, *args, **kw) -> None: ... - def wait_variable(self, name: str | Variable = "PY_VAR") -> None: ... - waitvar = wait_variable - def wait_window(self, window: Misc | None = None) -> None: ... - def wait_visibility(self, window: Misc | None = None) -> None: ... - def setvar(self, name: str = "PY_VAR", value: str = "1") -> None: ... - def getvar(self, name: str = "PY_VAR"): ... - def getint(self, s): ... - def getdouble(self, s): ... - def getboolean(self, s): ... - def focus_set(self) -> None: ... - focus = focus_set - def focus_force(self) -> None: ... - def focus_get(self) -> Misc | None: ... - def focus_displayof(self) -> Misc | None: ... - def focus_lastfor(self) -> Misc | None: ... - def tk_focusFollowsMouse(self) -> None: ... - def tk_focusNext(self) -> Misc | None: ... - def tk_focusPrev(self) -> Misc | None: ... - # .after() can be called without the "func" argument, but it is basically never what you want. - # It behaves like time.sleep() and freezes the GUI app. - def after(self, ms: int | Literal["idle"], func: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> str: ... - # after_idle is essentially partialmethod(after, "idle") - def after_idle(self, func: Callable[[Unpack[_Ts]], object], *args: Unpack[_Ts]) -> str: ... - def after_cancel(self, id: str) -> None: ... - if sys.version_info >= (3, 13): - def after_info(self, id: str | None = None) -> tuple[str, ...]: ... - - def bell(self, displayof: Literal[0] | Misc | None = 0) -> None: ... - if sys.version_info >= (3, 13): - # Supports options from `_BusyInfo`` - def tk_busy_cget(self, option: Literal["cursor"]) -> _Cursor: ... - busy_cget = tk_busy_cget - def tk_busy_configure(self, cnf: Any = None, **kw: Any) -> Any: ... - tk_busy_config = tk_busy_configure - busy_configure = tk_busy_configure - busy_config = tk_busy_configure - def tk_busy_current(self, pattern: str | None = None) -> list[Misc]: ... - busy_current = tk_busy_current - def tk_busy_forget(self) -> None: ... - busy_forget = tk_busy_forget - def tk_busy_hold(self, **kw: Unpack[_BusyInfo]) -> None: ... - tk_busy = tk_busy_hold - busy_hold = tk_busy_hold - busy = tk_busy_hold - def tk_busy_status(self) -> bool: ... - busy_status = tk_busy_status - - def clipboard_get(self, *, displayof: Misc = ..., type: str = ...) -> str: ... - def clipboard_clear(self, *, displayof: Misc = ...) -> None: ... - def clipboard_append(self, string: str, *, displayof: Misc = ..., format: str = ..., type: str = ...) -> None: ... - def grab_current(self): ... - def grab_release(self) -> None: ... - def grab_set(self) -> None: ... - def grab_set_global(self) -> None: ... - def grab_status(self) -> Literal["local", "global"] | None: ... - def option_add( - self, pattern, value, priority: int | Literal["widgetDefault", "startupFile", "userDefault", "interactive"] | None = None - ) -> None: ... - def option_clear(self) -> None: ... - def option_get(self, name, className): ... - def option_readfile(self, fileName, priority: Incomplete | None = None) -> None: ... - def selection_clear(self, **kw) -> None: ... - def selection_get(self, **kw): ... - def selection_handle(self, command, **kw) -> None: ... - def selection_own(self, **kw) -> None: ... - def selection_own_get(self, **kw): ... - def send(self, interp, cmd, *args): ... - def lower(self, belowThis: Incomplete | None = None) -> None: ... - def tkraise(self, aboveThis: Incomplete | None = None) -> None: ... - lift = tkraise - if sys.version_info >= (3, 11): - def info_patchlevel(self) -> _VersionInfoType: ... - - def winfo_atom(self, name: str, displayof: Literal[0] | Misc | None = 0) -> int: ... - def winfo_atomname(self, id: int, displayof: Literal[0] | Misc | None = 0) -> str: ... - def winfo_cells(self) -> int: ... - def winfo_children(self) -> list[Widget]: ... # Widget because it can't be Toplevel or Tk - def winfo_class(self) -> str: ... - def winfo_colormapfull(self) -> bool: ... - def winfo_containing(self, rootX: int, rootY: int, displayof: Literal[0] | Misc | None = 0) -> Misc | None: ... - def winfo_depth(self) -> int: ... - def winfo_exists(self) -> bool: ... - def winfo_fpixels(self, number: _ScreenUnits) -> float: ... - def winfo_geometry(self) -> str: ... - def winfo_height(self) -> int: ... - def winfo_id(self) -> int: ... - def winfo_interps(self, displayof: Literal[0] | Misc | None = 0) -> tuple[str, ...]: ... - def winfo_ismapped(self) -> bool: ... - def winfo_manager(self) -> str: ... - def winfo_name(self) -> str: ... - def winfo_parent(self) -> str: ... # return value needs nametowidget() - def winfo_pathname(self, id: int, displayof: Literal[0] | Misc | None = 0): ... - def winfo_pixels(self, number: _ScreenUnits) -> int: ... - def winfo_pointerx(self) -> int: ... - def winfo_pointerxy(self) -> tuple[int, int]: ... - def winfo_pointery(self) -> int: ... - def winfo_reqheight(self) -> int: ... - def winfo_reqwidth(self) -> int: ... - def winfo_rgb(self, color: str) -> tuple[int, int, int]: ... - def winfo_rootx(self) -> int: ... - def winfo_rooty(self) -> int: ... - def winfo_screen(self) -> str: ... - def winfo_screencells(self) -> int: ... - def winfo_screendepth(self) -> int: ... - def winfo_screenheight(self) -> int: ... - def winfo_screenmmheight(self) -> int: ... - def winfo_screenmmwidth(self) -> int: ... - def winfo_screenvisual(self) -> str: ... - def winfo_screenwidth(self) -> int: ... - def winfo_server(self) -> str: ... - def winfo_toplevel(self) -> Tk | Toplevel: ... - def winfo_viewable(self) -> bool: ... - def winfo_visual(self) -> str: ... - def winfo_visualid(self) -> str: ... - def winfo_visualsavailable(self, includeids: bool = False) -> list[tuple[str, int]]: ... - def winfo_vrootheight(self) -> int: ... - def winfo_vrootwidth(self) -> int: ... - def winfo_vrootx(self) -> int: ... - def winfo_vrooty(self) -> int: ... - def winfo_width(self) -> int: ... - def winfo_x(self) -> int: ... - def winfo_y(self) -> int: ... - def update(self) -> None: ... - def update_idletasks(self) -> None: ... - @overload - def bindtags(self, tagList: None = None) -> tuple[str, ...]: ... - @overload - def bindtags(self, tagList: list[str] | tuple[str, ...]) -> None: ... - # bind with isinstance(func, str) doesn't return anything, but all other - # binds do. The default value of func is not str. - @overload - def bind( - self, - sequence: str | None = None, - func: Callable[[Event[Misc]], object] | None = None, - add: Literal["", "+"] | bool | None = None, - ) -> str: ... - @overload - def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... - @overload - def bind(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... - # There's no way to know what type of widget bind_all and bind_class - # callbacks will get, so those are Misc. - @overload - def bind_all( - self, - sequence: str | None = None, - func: Callable[[Event[Misc]], object] | None = None, - add: Literal["", "+"] | bool | None = None, - ) -> str: ... - @overload - def bind_all(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... - @overload - def bind_all(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... - @overload - def bind_class( - self, - className: str, - sequence: str | None = None, - func: Callable[[Event[Misc]], object] | None = None, - add: Literal["", "+"] | bool | None = None, - ) -> str: ... - @overload - def bind_class(self, className: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... - @overload - def bind_class(self, className: str, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... - def unbind(self, sequence: str, funcid: str | None = None) -> None: ... - def unbind_all(self, sequence: str) -> None: ... - def unbind_class(self, className: str, sequence: str) -> None: ... - def mainloop(self, n: int = 0) -> None: ... - def quit(self) -> None: ... - @property - def _windowingsystem(self) -> Literal["win32", "aqua", "x11"]: ... - def nametowidget(self, name: str | Misc | _tkinter.Tcl_Obj) -> Any: ... - def register( - self, func: Callable[..., object], subst: Callable[..., Sequence[Any]] | None = None, needcleanup: int = 1 - ) -> str: ... - def keys(self) -> list[str]: ... - @overload - def pack_propagate(self, flag: bool) -> bool | None: ... - @overload - def pack_propagate(self) -> None: ... - propagate = pack_propagate - def grid_anchor(self, anchor: _Anchor | None = None) -> None: ... - anchor = grid_anchor - @overload - def grid_bbox( - self, column: None = None, row: None = None, col2: None = None, row2: None = None - ) -> tuple[int, int, int, int] | None: ... - @overload - def grid_bbox(self, column: int, row: int, col2: None = None, row2: None = None) -> tuple[int, int, int, int] | None: ... - @overload - def grid_bbox(self, column: int, row: int, col2: int, row2: int) -> tuple[int, int, int, int] | None: ... - bbox = grid_bbox - def grid_columnconfigure( - self, - index: int | str | list[int] | tuple[int, ...], - cnf: _GridIndexInfo = {}, - *, - minsize: _ScreenUnits = ..., - pad: _ScreenUnits = ..., - uniform: str = ..., - weight: int = ..., - ) -> _GridIndexInfo | MaybeNone: ... # can be None but annoying to check - def grid_rowconfigure( - self, - index: int | str | list[int] | tuple[int, ...], - cnf: _GridIndexInfo = {}, - *, - minsize: _ScreenUnits = ..., - pad: _ScreenUnits = ..., - uniform: str = ..., - weight: int = ..., - ) -> _GridIndexInfo | MaybeNone: ... # can be None but annoying to check - columnconfigure = grid_columnconfigure - rowconfigure = grid_rowconfigure - def grid_location(self, x: _ScreenUnits, y: _ScreenUnits) -> tuple[int, int]: ... - @overload - def grid_propagate(self, flag: bool) -> None: ... - @overload - def grid_propagate(self) -> bool: ... - def grid_size(self) -> tuple[int, int]: ... - size = grid_size - # Widget because Toplevel or Tk is never a slave - def pack_slaves(self) -> list[Widget]: ... - def grid_slaves(self, row: int | None = None, column: int | None = None) -> list[Widget]: ... - def place_slaves(self) -> list[Widget]: ... - slaves = pack_slaves - def event_add(self, virtual: str, *sequences: str) -> None: ... - def event_delete(self, virtual: str, *sequences: str) -> None: ... - def event_generate( - self, - sequence: str, - *, - above: Misc | int = ..., - borderwidth: _ScreenUnits = ..., - button: int = ..., - count: int = ..., - data: Any = ..., # anything with usable str() value - delta: int = ..., - detail: str = ..., - focus: bool = ..., - height: _ScreenUnits = ..., - keycode: int = ..., - keysym: str = ..., - mode: str = ..., - override: bool = ..., - place: Literal["PlaceOnTop", "PlaceOnBottom"] = ..., - root: Misc | int = ..., - rootx: _ScreenUnits = ..., - rooty: _ScreenUnits = ..., - sendevent: bool = ..., - serial: int = ..., - state: int | str = ..., - subwindow: Misc | int = ..., - time: int = ..., - warp: bool = ..., - width: _ScreenUnits = ..., - when: Literal["now", "tail", "head", "mark"] = ..., - x: _ScreenUnits = ..., - y: _ScreenUnits = ..., - ) -> None: ... - def event_info(self, virtual: str | None = None) -> tuple[str, ...]: ... - def image_names(self) -> tuple[str, ...]: ... - def image_types(self) -> tuple[str, ...]: ... - # See #4363 and #4891 - def __setitem__(self, key: str, value: Any) -> None: ... - def __getitem__(self, key: str) -> Any: ... - def cget(self, key: str) -> Any: ... - def configure(self, cnf: Any = None) -> Any: ... - # TODO: config is an alias of configure, but adding that here creates - # conflict with the type of config in the subclasses. See #13149 - -class CallWrapper: - func: Incomplete - subst: Incomplete - widget: Incomplete - def __init__(self, func, subst, widget) -> None: ... - def __call__(self, *args): ... - -class XView: - @overload - def xview(self) -> tuple[float, float]: ... - @overload - def xview(self, *args): ... - def xview_moveto(self, fraction: float) -> None: ... - @overload - def xview_scroll(self, number: int, what: Literal["units", "pages"]) -> None: ... - @overload - def xview_scroll(self, number: _ScreenUnits, what: Literal["pixels"]) -> None: ... - -class YView: - @overload - def yview(self) -> tuple[float, float]: ... - @overload - def yview(self, *args): ... - def yview_moveto(self, fraction: float) -> None: ... - @overload - def yview_scroll(self, number: int, what: Literal["units", "pages"]) -> None: ... - @overload - def yview_scroll(self, number: _ScreenUnits, what: Literal["pixels"]) -> None: ... - -if sys.platform == "darwin": - @type_check_only - class _WmAttributes(TypedDict): - alpha: float - fullscreen: bool - modified: bool - notify: bool - titlepath: str - topmost: bool - transparent: bool - type: str # Present, but not actually used on darwin - -elif sys.platform == "win32": - @type_check_only - class _WmAttributes(TypedDict): - alpha: float - transparentcolor: str - disabled: bool - fullscreen: bool - toolwindow: bool - topmost: bool - -else: - # X11 - @type_check_only - class _WmAttributes(TypedDict): - alpha: float - topmost: bool - zoomed: bool - fullscreen: bool - type: str - -class Wm: - @overload - def wm_aspect(self, minNumer: int, minDenom: int, maxNumer: int, maxDenom: int) -> None: ... - @overload - def wm_aspect( - self, minNumer: None = None, minDenom: None = None, maxNumer: None = None, maxDenom: None = None - ) -> tuple[int, int, int, int] | None: ... - aspect = wm_aspect - if sys.version_info >= (3, 13): - @overload - def wm_attributes(self, *, return_python_dict: Literal[False] = False) -> tuple[Any, ...]: ... - @overload - def wm_attributes(self, *, return_python_dict: Literal[True]) -> _WmAttributes: ... - - else: - @overload - def wm_attributes(self) -> tuple[Any, ...]: ... - - @overload - def wm_attributes(self, option: Literal["-alpha"], /) -> float: ... - @overload - def wm_attributes(self, option: Literal["-fullscreen"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["-topmost"], /) -> bool: ... - if sys.platform == "darwin": - @overload - def wm_attributes(self, option: Literal["-modified"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["-notify"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["-titlepath"], /) -> str: ... - @overload - def wm_attributes(self, option: Literal["-transparent"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["-type"], /) -> str: ... - elif sys.platform == "win32": - @overload - def wm_attributes(self, option: Literal["-transparentcolor"], /) -> str: ... - @overload - def wm_attributes(self, option: Literal["-disabled"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["-toolwindow"], /) -> bool: ... - else: - # X11 - @overload - def wm_attributes(self, option: Literal["-zoomed"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["-type"], /) -> str: ... - if sys.version_info >= (3, 13): - @overload - def wm_attributes(self, option: Literal["alpha"], /) -> float: ... - @overload - def wm_attributes(self, option: Literal["fullscreen"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["topmost"], /) -> bool: ... - if sys.platform == "darwin": - @overload - def wm_attributes(self, option: Literal["modified"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["notify"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["titlepath"], /) -> str: ... - @overload - def wm_attributes(self, option: Literal["transparent"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["type"], /) -> str: ... - elif sys.platform == "win32": - @overload - def wm_attributes(self, option: Literal["transparentcolor"], /) -> str: ... - @overload - def wm_attributes(self, option: Literal["disabled"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["toolwindow"], /) -> bool: ... - else: - # X11 - @overload - def wm_attributes(self, option: Literal["zoomed"], /) -> bool: ... - @overload - def wm_attributes(self, option: Literal["type"], /) -> str: ... - - @overload - def wm_attributes(self, option: str, /): ... - @overload - def wm_attributes(self, option: Literal["-alpha"], value: float, /) -> Literal[""]: ... - @overload - def wm_attributes(self, option: Literal["-fullscreen"], value: bool, /) -> Literal[""]: ... - @overload - def wm_attributes(self, option: Literal["-topmost"], value: bool, /) -> Literal[""]: ... - if sys.platform == "darwin": - @overload - def wm_attributes(self, option: Literal["-modified"], value: bool, /) -> Literal[""]: ... - @overload - def wm_attributes(self, option: Literal["-notify"], value: bool, /) -> Literal[""]: ... - @overload - def wm_attributes(self, option: Literal["-titlepath"], value: str, /) -> Literal[""]: ... - @overload - def wm_attributes(self, option: Literal["-transparent"], value: bool, /) -> Literal[""]: ... - elif sys.platform == "win32": - @overload - def wm_attributes(self, option: Literal["-transparentcolor"], value: str, /) -> Literal[""]: ... - @overload - def wm_attributes(self, option: Literal["-disabled"], value: bool, /) -> Literal[""]: ... - @overload - def wm_attributes(self, option: Literal["-toolwindow"], value: bool, /) -> Literal[""]: ... - else: - # X11 - @overload - def wm_attributes(self, option: Literal["-zoomed"], value: bool, /) -> Literal[""]: ... - @overload - def wm_attributes(self, option: Literal["-type"], value: str, /) -> Literal[""]: ... - - @overload - def wm_attributes(self, option: str, value, /, *__other_option_value_pairs: Any) -> Literal[""]: ... - if sys.version_info >= (3, 13): - if sys.platform == "darwin": - @overload - def wm_attributes( - self, - *, - alpha: float = ..., - fullscreen: bool = ..., - modified: bool = ..., - notify: bool = ..., - titlepath: str = ..., - topmost: bool = ..., - transparent: bool = ..., - ) -> None: ... - elif sys.platform == "win32": - @overload - def wm_attributes( - self, - *, - alpha: float = ..., - transparentcolor: str = ..., - disabled: bool = ..., - fullscreen: bool = ..., - toolwindow: bool = ..., - topmost: bool = ..., - ) -> None: ... - else: - # X11 - @overload - def wm_attributes( - self, *, alpha: float = ..., topmost: bool = ..., zoomed: bool = ..., fullscreen: bool = ..., type: str = ... - ) -> None: ... - - attributes = wm_attributes - def wm_client(self, name: str | None = None) -> str: ... - client = wm_client - @overload - def wm_colormapwindows(self) -> list[Misc]: ... - @overload - def wm_colormapwindows(self, wlist: list[Misc] | tuple[Misc, ...], /) -> None: ... - @overload - def wm_colormapwindows(self, first_wlist_item: Misc, /, *other_wlist_items: Misc) -> None: ... - colormapwindows = wm_colormapwindows - def wm_command(self, value: str | None = None) -> str: ... - command = wm_command - # Some of these always return empty string, but return type is set to None to prevent accidentally using it - def wm_deiconify(self) -> None: ... - deiconify = wm_deiconify - def wm_focusmodel(self, model: Literal["active", "passive"] | None = None) -> Literal["active", "passive", ""]: ... - focusmodel = wm_focusmodel - def wm_forget(self, window: Wm) -> None: ... - forget = wm_forget - def wm_frame(self) -> str: ... - frame = wm_frame - @overload - def wm_geometry(self, newGeometry: None = None) -> str: ... - @overload - def wm_geometry(self, newGeometry: str) -> None: ... - geometry = wm_geometry - def wm_grid( - self, - baseWidth: Incomplete | None = None, - baseHeight: Incomplete | None = None, - widthInc: Incomplete | None = None, - heightInc: Incomplete | None = None, - ): ... - grid = wm_grid - def wm_group(self, pathName: Incomplete | None = None): ... - group = wm_group - def wm_iconbitmap(self, bitmap: Incomplete | None = None, default: Incomplete | None = None): ... - iconbitmap = wm_iconbitmap - def wm_iconify(self) -> None: ... - iconify = wm_iconify - def wm_iconmask(self, bitmap: Incomplete | None = None): ... - iconmask = wm_iconmask - def wm_iconname(self, newName: Incomplete | None = None) -> str: ... - iconname = wm_iconname - def wm_iconphoto(self, default: bool, image1: _PhotoImageLike | str, /, *args: _PhotoImageLike | str) -> None: ... - iconphoto = wm_iconphoto - def wm_iconposition(self, x: int | None = None, y: int | None = None) -> tuple[int, int] | None: ... - iconposition = wm_iconposition - def wm_iconwindow(self, pathName: Incomplete | None = None): ... - iconwindow = wm_iconwindow - def wm_manage(self, widget) -> None: ... - manage = wm_manage - @overload - def wm_maxsize(self, width: None = None, height: None = None) -> tuple[int, int]: ... - @overload - def wm_maxsize(self, width: int, height: int) -> None: ... - maxsize = wm_maxsize - @overload - def wm_minsize(self, width: None = None, height: None = None) -> tuple[int, int]: ... - @overload - def wm_minsize(self, width: int, height: int) -> None: ... - minsize = wm_minsize - @overload - def wm_overrideredirect(self, boolean: None = None) -> bool | None: ... # returns True or None - @overload - def wm_overrideredirect(self, boolean: bool) -> None: ... - overrideredirect = wm_overrideredirect - def wm_positionfrom(self, who: Literal["program", "user"] | None = None) -> Literal["", "program", "user"]: ... - positionfrom = wm_positionfrom - @overload - def wm_protocol(self, name: str, func: Callable[[], object] | str) -> None: ... - @overload - def wm_protocol(self, name: str, func: None = None) -> str: ... - @overload - def wm_protocol(self, name: None = None, func: None = None) -> tuple[str, ...]: ... - protocol = wm_protocol - @overload - def wm_resizable(self, width: None = None, height: None = None) -> tuple[bool, bool]: ... - @overload - def wm_resizable(self, width: bool, height: bool) -> None: ... - resizable = wm_resizable - def wm_sizefrom(self, who: Literal["program", "user"] | None = None) -> Literal["", "program", "user"]: ... - sizefrom = wm_sizefrom - @overload - def wm_state(self, newstate: None = None) -> str: ... - @overload - def wm_state(self, newstate: str) -> None: ... - state = wm_state - @overload - def wm_title(self, string: None = None) -> str: ... - @overload - def wm_title(self, string: str) -> None: ... - title = wm_title - @overload - def wm_transient(self, master: None = None) -> _tkinter.Tcl_Obj: ... - @overload - def wm_transient(self, master: Wm | _tkinter.Tcl_Obj) -> None: ... - transient = wm_transient - def wm_withdraw(self) -> None: ... - withdraw = wm_withdraw - -class Tk(Misc, Wm): - master: None - def __init__( - # Make sure to keep in sync with other functions that use the same - # args. - # use `git grep screenName` to find them - self, - screenName: str | None = None, - baseName: str | None = None, - className: str = "Tk", - useTk: bool = True, - sync: bool = False, - use: str | None = None, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - menu: Menu = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - takefocus: _TakeFocusValue = ..., - width: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def destroy(self) -> None: ... - def readprofile(self, baseName: str, className: str) -> None: ... - report_callback_exception: Callable[[type[BaseException], BaseException, TracebackType | None], object] - # Tk has __getattr__ so that tk_instance.foo falls back to tk_instance.tk.foo - # Please keep in sync with _tkinter.TkappType. - # Some methods are intentionally missing because they are inherited from Misc instead. - def adderrorinfo(self, msg, /): ... - def call(self, command: Any, /, *args: Any) -> Any: ... - def createcommand(self, name, func, /): ... - if sys.platform != "win32": - def createfilehandler(self, file, mask, func, /): ... - def deletefilehandler(self, file, /): ... - - def createtimerhandler(self, milliseconds, func, /): ... - def dooneevent(self, flags: int = ..., /): ... - def eval(self, script: str, /) -> str: ... - def evalfile(self, fileName, /): ... - def exprboolean(self, s, /): ... - def exprdouble(self, s, /): ... - def exprlong(self, s, /): ... - def exprstring(self, s, /): ... - def globalgetvar(self, *args, **kwargs): ... - def globalsetvar(self, *args, **kwargs): ... - def globalunsetvar(self, *args, **kwargs): ... - def interpaddr(self): ... - def loadtk(self) -> None: ... - def record(self, script, /): ... - if sys.version_info < (3, 11): - def split(self, arg, /): ... - - def splitlist(self, arg, /): ... - def unsetvar(self, *args, **kwargs): ... - def wantobjects(self, *args, **kwargs): ... - def willdispatch(self): ... - -def Tcl(screenName: str | None = None, baseName: str | None = None, className: str = "Tk", useTk: bool = False) -> Tk: ... - -_InMiscTotal = TypedDict("_InMiscTotal", {"in": Misc}) -_InMiscNonTotal = TypedDict("_InMiscNonTotal", {"in": Misc}, total=False) - -class _PackInfo(_InMiscTotal): - # 'before' and 'after' never appear in _PackInfo - anchor: _Anchor - expand: bool - fill: Literal["none", "x", "y", "both"] - side: Literal["left", "right", "top", "bottom"] - # Paddings come out as int or tuple of int, even though any _ScreenUnits - # can be specified in pack(). - ipadx: int - ipady: int - padx: int | tuple[int, int] - pady: int | tuple[int, int] - -class Pack: - # _PackInfo is not the valid type for cnf because pad stuff accepts any - # _ScreenUnits instead of int only. I didn't bother to create another - # TypedDict for cnf because it appears to be a legacy thing that was - # replaced by **kwargs. - def pack_configure( - self, - cnf: Mapping[str, Any] | None = {}, - *, - after: Misc = ..., - anchor: _Anchor = ..., - before: Misc = ..., - expand: bool | Literal[0, 1] = 0, - fill: Literal["none", "x", "y", "both"] = ..., - side: Literal["left", "right", "top", "bottom"] = ..., - ipadx: _ScreenUnits = ..., - ipady: _ScreenUnits = ..., - padx: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ..., - pady: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ..., - in_: Misc = ..., - **kw: Any, # allow keyword argument named 'in', see #4836 - ) -> None: ... - def pack_forget(self) -> None: ... - def pack_info(self) -> _PackInfo: ... # errors if widget hasn't been packed - pack = pack_configure - forget = pack_forget - propagate = Misc.pack_propagate - -class _PlaceInfo(_InMiscNonTotal): # empty dict if widget hasn't been placed - anchor: _Anchor - bordermode: Literal["inside", "outside", "ignore"] - width: str # can be int()ed (even after e.g. widget.place(height='2.3c') or similar) - height: str # can be int()ed - x: str # can be int()ed - y: str # can be int()ed - relheight: str # can be float()ed if not empty string - relwidth: str # can be float()ed if not empty string - relx: str # can be float()ed if not empty string - rely: str # can be float()ed if not empty string - -class Place: - def place_configure( - self, - cnf: Mapping[str, Any] | None = {}, - *, - anchor: _Anchor = ..., - bordermode: Literal["inside", "outside", "ignore"] = ..., - width: _ScreenUnits = ..., - height: _ScreenUnits = ..., - x: _ScreenUnits = ..., - y: _ScreenUnits = ..., - # str allowed for compatibility with place_info() - relheight: str | float = ..., - relwidth: str | float = ..., - relx: str | float = ..., - rely: str | float = ..., - in_: Misc = ..., - **kw: Any, # allow keyword argument named 'in', see #4836 - ) -> None: ... - def place_forget(self) -> None: ... - def place_info(self) -> _PlaceInfo: ... - place = place_configure - info = place_info - -class _GridInfo(_InMiscNonTotal): # empty dict if widget hasn't been gridded - column: int - columnspan: int - row: int - rowspan: int - ipadx: int - ipady: int - padx: int | tuple[int, int] - pady: int | tuple[int, int] - sticky: str # consists of letters 'n', 's', 'w', 'e', no repeats, may be empty - -class Grid: - def grid_configure( - self, - cnf: Mapping[str, Any] | None = {}, - *, - column: int = ..., - columnspan: int = ..., - row: int = ..., - rowspan: int = ..., - ipadx: _ScreenUnits = ..., - ipady: _ScreenUnits = ..., - padx: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ..., - pady: _ScreenUnits | tuple[_ScreenUnits, _ScreenUnits] = ..., - sticky: str = ..., # consists of letters 'n', 's', 'w', 'e', may contain repeats, may be empty - in_: Misc = ..., - **kw: Any, # allow keyword argument named 'in', see #4836 - ) -> None: ... - def grid_forget(self) -> None: ... - def grid_remove(self) -> None: ... - def grid_info(self) -> _GridInfo: ... - grid = grid_configure - location = Misc.grid_location - size = Misc.grid_size - -class BaseWidget(Misc): - master: Misc - widgetName: Incomplete - def __init__(self, master, widgetName, cnf={}, kw={}, extra=()) -> None: ... - def destroy(self) -> None: ... - -# This class represents any widget except Toplevel or Tk. -class Widget(BaseWidget, Pack, Place, Grid): - # Allow bind callbacks to take e.g. Event[Label] instead of Event[Misc]. - # Tk and Toplevel get notified for their child widgets' events, but other - # widgets don't. - @overload - def bind( - self: _W, - sequence: str | None = None, - func: Callable[[Event[_W]], object] | None = None, - add: Literal["", "+"] | bool | None = None, - ) -> str: ... - @overload - def bind(self, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... - @overload - def bind(self, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... - -class Toplevel(BaseWidget, Wm): - # Toplevel and Tk have the same options because they correspond to the same - # Tcl/Tk toplevel widget. For some reason, config and configure must be - # copy/pasted here instead of aliasing as 'config = Tk.config'. - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - background: str = ..., - bd: _ScreenUnits = 0, - bg: str = ..., - border: _ScreenUnits = 0, - borderwidth: _ScreenUnits = 0, - class_: str = "Toplevel", - colormap: Literal["new", ""] | Misc = "", - container: bool = False, - cursor: _Cursor = "", - height: _ScreenUnits = 0, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = 0, - menu: Menu = ..., - name: str = ..., - padx: _ScreenUnits = 0, - pady: _ScreenUnits = 0, - relief: _Relief = "flat", - screen: str = "", # can't be changed after creating widget - takefocus: _TakeFocusValue = 0, - use: int = ..., - visual: str | tuple[str, int] = "", - width: _ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - menu: Menu = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - takefocus: _TakeFocusValue = ..., - width: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class Button(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - activebackground: str = ..., - activeforeground: str = ..., - anchor: _Anchor = "center", - background: str = ..., - bd: _ScreenUnits = ..., # same as borderwidth - bg: str = ..., # same as background - bitmap: str = "", - border: _ScreenUnits = ..., # same as borderwidth - borderwidth: _ScreenUnits = ..., - command: _ButtonCommand = "", - compound: _Compound = "none", - cursor: _Cursor = "", - default: Literal["normal", "active", "disabled"] = "disabled", - disabledforeground: str = ..., - fg: str = ..., # same as foreground - font: _FontDescription = "TkDefaultFont", - foreground: str = ..., - # width and height must be int for buttons containing just text, but - # ints are also valid _ScreenUnits - height: _ScreenUnits = 0, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = 1, - image: _ImageSpec = "", - justify: Literal["left", "center", "right"] = "center", - name: str = ..., - overrelief: _Relief | Literal[""] = "", - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - repeatdelay: int = ..., - repeatinterval: int = ..., - state: Literal["normal", "active", "disabled"] = "normal", - takefocus: _TakeFocusValue = "", - text: float | str = "", - # We allow the textvariable to be any Variable, not necessarily - # StringVar. This is useful for e.g. a button that displays the value - # of an IntVar. - textvariable: Variable = ..., - underline: int = -1, - width: _ScreenUnits = 0, - wraplength: _ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - activebackground: str = ..., - activeforeground: str = ..., - anchor: _Anchor = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - bitmap: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - command: _ButtonCommand = ..., - compound: _Compound = ..., - cursor: _Cursor = ..., - default: Literal["normal", "active", "disabled"] = ..., - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - image: _ImageSpec = ..., - justify: Literal["left", "center", "right"] = ..., - overrelief: _Relief | Literal[""] = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - repeatdelay: int = ..., - repeatinterval: int = ..., - state: Literal["normal", "active", "disabled"] = ..., - takefocus: _TakeFocusValue = ..., - text: float | str = ..., - textvariable: Variable = ..., - underline: int = ..., - width: _ScreenUnits = ..., - wraplength: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def flash(self) -> None: ... - def invoke(self) -> Any: ... - -class Canvas(Widget, XView, YView): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - background: str = ..., - bd: _ScreenUnits = 0, - bg: str = ..., - border: _ScreenUnits = 0, - borderwidth: _ScreenUnits = 0, - closeenough: float = 1.0, - confine: bool = True, - cursor: _Cursor = "", - # canvas manual page has a section named COORDINATES, and the first - # part of it describes _ScreenUnits. - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - insertbackground: str = ..., - insertborderwidth: _ScreenUnits = 0, - insertofftime: int = 300, - insertontime: int = 600, - insertwidth: _ScreenUnits = 2, - name: str = ..., - offset=..., # undocumented - relief: _Relief = "flat", - # Setting scrollregion to None doesn't reset it back to empty, - # but setting it to () does. - scrollregion: tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits] | tuple[()] = (), - selectbackground: str = ..., - selectborderwidth: _ScreenUnits = 1, - selectforeground: str = ..., - # man page says that state can be 'hidden', but it can't - state: Literal["normal", "disabled"] = "normal", - takefocus: _TakeFocusValue = "", - width: _ScreenUnits = ..., - xscrollcommand: _XYScrollCommand = "", - xscrollincrement: _ScreenUnits = 0, - yscrollcommand: _XYScrollCommand = "", - yscrollincrement: _ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - closeenough: float = ..., - confine: bool = ..., - cursor: _Cursor = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - insertbackground: str = ..., - insertborderwidth: _ScreenUnits = ..., - insertofftime: int = ..., - insertontime: int = ..., - insertwidth: _ScreenUnits = ..., - offset=..., # undocumented - relief: _Relief = ..., - scrollregion: tuple[_ScreenUnits, _ScreenUnits, _ScreenUnits, _ScreenUnits] | tuple[()] = ..., - selectbackground: str = ..., - selectborderwidth: _ScreenUnits = ..., - selectforeground: str = ..., - state: Literal["normal", "disabled"] = ..., - takefocus: _TakeFocusValue = ..., - width: _ScreenUnits = ..., - xscrollcommand: _XYScrollCommand = ..., - xscrollincrement: _ScreenUnits = ..., - yscrollcommand: _XYScrollCommand = ..., - yscrollincrement: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def addtag(self, *args): ... # internal method - def addtag_above(self, newtag: str, tagOrId: str | int) -> None: ... - def addtag_all(self, newtag: str) -> None: ... - def addtag_below(self, newtag: str, tagOrId: str | int) -> None: ... - def addtag_closest( - self, newtag: str, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = None, start: str | int | None = None - ) -> None: ... - def addtag_enclosed(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ... - def addtag_overlapping(self, newtag: str, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> None: ... - def addtag_withtag(self, newtag: str, tagOrId: str | int) -> None: ... - def find(self, *args): ... # internal method - def find_above(self, tagOrId: str | int) -> tuple[int, ...]: ... - def find_all(self) -> tuple[int, ...]: ... - def find_below(self, tagOrId: str | int) -> tuple[int, ...]: ... - def find_closest( - self, x: _ScreenUnits, y: _ScreenUnits, halo: _ScreenUnits | None = None, start: str | int | None = None - ) -> tuple[int, ...]: ... - def find_enclosed(self, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: _ScreenUnits) -> tuple[int, ...]: ... - def find_overlapping(self, x1: _ScreenUnits, y1: _ScreenUnits, x2: _ScreenUnits, y2: float) -> tuple[int, ...]: ... - def find_withtag(self, tagOrId: str | int) -> tuple[int, ...]: ... - # Incompatible with Misc.bbox(), tkinter violates LSP - def bbox(self, *args: str | int) -> tuple[int, int, int, int]: ... # type: ignore[override] - @overload - def tag_bind( - self, - tagOrId: str | int, - sequence: str | None = None, - func: Callable[[Event[Canvas]], object] | None = None, - add: Literal["", "+"] | bool | None = None, - ) -> str: ... - @overload - def tag_bind( - self, tagOrId: str | int, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None - ) -> None: ... - @overload - def tag_bind(self, tagOrId: str | int, *, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... - def tag_unbind(self, tagOrId: str | int, sequence: str, funcid: str | None = None) -> None: ... - def canvasx(self, screenx, gridspacing: Incomplete | None = None): ... - def canvasy(self, screeny, gridspacing: Incomplete | None = None): ... - @overload - def coords(self, tagOrId: str | int, /) -> list[float]: ... - @overload - def coords(self, tagOrId: str | int, args: list[int] | list[float] | tuple[float, ...], /) -> None: ... - @overload - def coords(self, tagOrId: str | int, x1: float, y1: float, /, *args: float) -> None: ... - # create_foo() methods accept coords as a list or tuple, or as separate arguments. - # Lists and tuples can be flat as in [1, 2, 3, 4], or nested as in [(1, 2), (3, 4)]. - # Keyword arguments should be the same in all overloads of each method. - def create_arc(self, *args, **kw) -> int: ... - def create_bitmap(self, *args, **kw) -> int: ... - def create_image(self, *args, **kw) -> int: ... - @overload - def create_line( - self, - x0: float, - y0: float, - x1: float, - y1: float, - /, - *, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - arrow: Literal["first", "last", "both"] = ..., - arrowshape: tuple[float, float, float] = ..., - capstyle: Literal["round", "projecting", "butt"] = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - joinstyle: Literal["round", "bevel", "miter"] = ..., - offset: _ScreenUnits = ..., - smooth: bool = ..., - splinesteps: float = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_line( - self, - xy_pair_0: tuple[float, float], - xy_pair_1: tuple[float, float], - /, - *, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - arrow: Literal["first", "last", "both"] = ..., - arrowshape: tuple[float, float, float] = ..., - capstyle: Literal["round", "projecting", "butt"] = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - joinstyle: Literal["round", "bevel", "miter"] = ..., - offset: _ScreenUnits = ..., - smooth: bool = ..., - splinesteps: float = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_line( - self, - coords: ( - tuple[float, float, float, float] - | tuple[tuple[float, float], tuple[float, float]] - | list[int] - | list[float] - | list[tuple[int, int]] - | list[tuple[float, float]] - ), - /, - *, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - arrow: Literal["first", "last", "both"] = ..., - arrowshape: tuple[float, float, float] = ..., - capstyle: Literal["round", "projecting", "butt"] = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - joinstyle: Literal["round", "bevel", "miter"] = ..., - offset: _ScreenUnits = ..., - smooth: bool = ..., - splinesteps: float = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_oval( - self, - x0: float, - y0: float, - x1: float, - y1: float, - /, - *, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activeoutline: str = ..., - activeoutlinestipple: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledoutline: str = ..., - disabledoutlinestipple: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - offset: _ScreenUnits = ..., - outline: str = ..., - outlineoffset: _ScreenUnits = ..., - outlinestipple: str = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_oval( - self, - xy_pair_0: tuple[float, float], - xy_pair_1: tuple[float, float], - /, - *, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activeoutline: str = ..., - activeoutlinestipple: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledoutline: str = ..., - disabledoutlinestipple: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - offset: _ScreenUnits = ..., - outline: str = ..., - outlineoffset: _ScreenUnits = ..., - outlinestipple: str = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_oval( - self, - coords: ( - tuple[float, float, float, float] - | tuple[tuple[float, float], tuple[float, float]] - | list[int] - | list[float] - | list[tuple[int, int]] - | list[tuple[float, float]] - ), - /, - *, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activeoutline: str = ..., - activeoutlinestipple: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledoutline: str = ..., - disabledoutlinestipple: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - offset: _ScreenUnits = ..., - outline: str = ..., - outlineoffset: _ScreenUnits = ..., - outlinestipple: str = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_polygon( - self, - x0: float, - y0: float, - x1: float, - y1: float, - /, - *xy_pairs: float, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activeoutline: str = ..., - activeoutlinestipple: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledoutline: str = ..., - disabledoutlinestipple: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - joinstyle: Literal["round", "bevel", "miter"] = ..., - offset: _ScreenUnits = ..., - outline: str = ..., - outlineoffset: _ScreenUnits = ..., - outlinestipple: str = ..., - smooth: bool = ..., - splinesteps: float = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_polygon( - self, - xy_pair_0: tuple[float, float], - xy_pair_1: tuple[float, float], - /, - *xy_pairs: tuple[float, float], - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activeoutline: str = ..., - activeoutlinestipple: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledoutline: str = ..., - disabledoutlinestipple: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - joinstyle: Literal["round", "bevel", "miter"] = ..., - offset: _ScreenUnits = ..., - outline: str = ..., - outlineoffset: _ScreenUnits = ..., - outlinestipple: str = ..., - smooth: bool = ..., - splinesteps: float = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_polygon( - self, - coords: ( - tuple[float, ...] - | tuple[tuple[float, float], ...] - | list[int] - | list[float] - | list[tuple[int, int]] - | list[tuple[float, float]] - ), - /, - *, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activeoutline: str = ..., - activeoutlinestipple: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledoutline: str = ..., - disabledoutlinestipple: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - joinstyle: Literal["round", "bevel", "miter"] = ..., - offset: _ScreenUnits = ..., - outline: str = ..., - outlineoffset: _ScreenUnits = ..., - outlinestipple: str = ..., - smooth: bool = ..., - splinesteps: float = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_rectangle( - self, - x0: float, - y0: float, - x1: float, - y1: float, - /, - *, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activeoutline: str = ..., - activeoutlinestipple: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledoutline: str = ..., - disabledoutlinestipple: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - offset: _ScreenUnits = ..., - outline: str = ..., - outlineoffset: _ScreenUnits = ..., - outlinestipple: str = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_rectangle( - self, - xy_pair_0: tuple[float, float], - xy_pair_1: tuple[float, float], - /, - *, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activeoutline: str = ..., - activeoutlinestipple: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledoutline: str = ..., - disabledoutlinestipple: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - offset: _ScreenUnits = ..., - outline: str = ..., - outlineoffset: _ScreenUnits = ..., - outlinestipple: str = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_rectangle( - self, - coords: ( - tuple[float, float, float, float] - | tuple[tuple[float, float], tuple[float, float]] - | list[int] - | list[float] - | list[tuple[int, int]] - | list[tuple[float, float]] - ), - /, - *, - activedash: str | int | list[int] | tuple[int, ...] = ..., - activefill: str = ..., - activeoutline: str = ..., - activeoutlinestipple: str = ..., - activestipple: str = ..., - activewidth: _ScreenUnits = ..., - dash: str | int | list[int] | tuple[int, ...] = ..., - dashoffset: _ScreenUnits = ..., - disableddash: str | int | list[int] | tuple[int, ...] = ..., - disabledfill: str = ..., - disabledoutline: str = ..., - disabledoutlinestipple: str = ..., - disabledstipple: str = ..., - disabledwidth: _ScreenUnits = ..., - fill: str = ..., - offset: _ScreenUnits = ..., - outline: str = ..., - outlineoffset: _ScreenUnits = ..., - outlinestipple: str = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_text( - self, - x: float, - y: float, - /, - *, - activefill: str = ..., - activestipple: str = ..., - anchor: _Anchor = ..., - angle: float | str = ..., - disabledfill: str = ..., - disabledstipple: str = ..., - fill: str = ..., - font: _FontDescription = ..., - justify: Literal["left", "center", "right"] = ..., - offset: _ScreenUnits = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - text: float | str = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_text( - self, - coords: tuple[float, float] | list[int] | list[float], - /, - *, - activefill: str = ..., - activestipple: str = ..., - anchor: _Anchor = ..., - angle: float | str = ..., - disabledfill: str = ..., - disabledstipple: str = ..., - fill: str = ..., - font: _FontDescription = ..., - justify: Literal["left", "center", "right"] = ..., - offset: _ScreenUnits = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - stipple: str = ..., - tags: str | list[str] | tuple[str, ...] = ..., - text: float | str = ..., - width: _ScreenUnits = ..., - ) -> int: ... - @overload - def create_window( - self, - x: float, - y: float, - /, - *, - anchor: _Anchor = ..., - height: _ScreenUnits = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - window: Widget = ..., - ) -> int: ... - @overload - def create_window( - self, - coords: tuple[float, float] | list[int] | list[float], - /, - *, - anchor: _Anchor = ..., - height: _ScreenUnits = ..., - state: Literal["normal", "hidden", "disabled"] = ..., - tags: str | list[str] | tuple[str, ...] = ..., - width: _ScreenUnits = ..., - window: Widget = ..., - ) -> int: ... - def dchars(self, *args) -> None: ... - def delete(self, *tagsOrCanvasIds: str | int) -> None: ... - @overload - def dtag(self, tag: str, tag_to_delete: str | None = ..., /) -> None: ... - @overload - def dtag(self, id: int, tag_to_delete: str, /) -> None: ... - def focus(self, *args): ... - def gettags(self, tagOrId: str | int, /) -> tuple[str, ...]: ... - def icursor(self, *args) -> None: ... - def index(self, *args): ... - def insert(self, *args) -> None: ... - def itemcget(self, tagOrId, option): ... - # itemconfigure kwargs depend on item type, which is not known when type checking - def itemconfigure( - self, tagOrId: str | int, cnf: dict[str, Any] | None = None, **kw: Any - ) -> dict[str, tuple[str, str, str, str, str]] | None: ... - itemconfig = itemconfigure - def move(self, *args) -> None: ... - def moveto(self, tagOrId: str | int, x: Literal[""] | float = "", y: Literal[""] | float = "") -> None: ... - def postscript(self, cnf={}, **kw): ... - # tkinter does: - # lower = tag_lower - # lift = tkraise = tag_raise - # - # But mypy doesn't like aliasing here (maybe because Misc defines the same names) - def tag_lower(self, first: str | int, second: str | int | None = ..., /) -> None: ... - def lower(self, first: str | int, second: str | int | None = ..., /) -> None: ... # type: ignore[override] - def tag_raise(self, first: str | int, second: str | int | None = ..., /) -> None: ... - def tkraise(self, first: str | int, second: str | int | None = ..., /) -> None: ... # type: ignore[override] - def lift(self, first: str | int, second: str | int | None = ..., /) -> None: ... # type: ignore[override] - def scale( - self, tagOrId: str | int, xOrigin: _ScreenUnits, yOrigin: _ScreenUnits, xScale: float, yScale: float, / - ) -> None: ... - def scan_mark(self, x, y) -> None: ... - def scan_dragto(self, x, y, gain: int = 10) -> None: ... - def select_adjust(self, tagOrId, index) -> None: ... - def select_clear(self) -> None: ... - def select_from(self, tagOrId, index) -> None: ... - def select_item(self): ... - def select_to(self, tagOrId, index) -> None: ... - def type(self, tagOrId: str | int) -> int | None: ... - -class Checkbutton(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - activebackground: str = ..., - activeforeground: str = ..., - anchor: _Anchor = "center", - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - bitmap: str = "", - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - command: _ButtonCommand = "", - compound: _Compound = "none", - cursor: _Cursor = "", - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = "TkDefaultFont", - foreground: str = ..., - height: _ScreenUnits = 0, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = 1, - image: _ImageSpec = "", - indicatoron: bool = True, - justify: Literal["left", "center", "right"] = "center", - name: str = ..., - offrelief: _Relief = ..., - # The checkbutton puts a value to its variable when it's checked or - # unchecked. We don't restrict the type of that value here, so - # Any-typing is fine. - # - # I think Checkbutton shouldn't be generic, because then specifying - # "any checkbutton regardless of what variable it uses" would be - # difficult, and we might run into issues just like how list[float] - # and list[int] are incompatible. Also, we would need a way to - # specify "Checkbutton not associated with any variable", which is - # done by setting variable to empty string (the default). - offvalue: Any = 0, - onvalue: Any = 1, - overrelief: _Relief | Literal[""] = "", - padx: _ScreenUnits = 1, - pady: _ScreenUnits = 1, - relief: _Relief = "flat", - selectcolor: str = ..., - selectimage: _ImageSpec = "", - state: Literal["normal", "active", "disabled"] = "normal", - takefocus: _TakeFocusValue = "", - text: float | str = "", - textvariable: Variable = ..., - tristateimage: _ImageSpec = "", - tristatevalue: Any = "", - underline: int = -1, - variable: Variable | Literal[""] = ..., - width: _ScreenUnits = 0, - wraplength: _ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - activebackground: str = ..., - activeforeground: str = ..., - anchor: _Anchor = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - bitmap: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - command: _ButtonCommand = ..., - compound: _Compound = ..., - cursor: _Cursor = ..., - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - image: _ImageSpec = ..., - indicatoron: bool = ..., - justify: Literal["left", "center", "right"] = ..., - offrelief: _Relief = ..., - offvalue: Any = ..., - onvalue: Any = ..., - overrelief: _Relief | Literal[""] = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - selectcolor: str = ..., - selectimage: _ImageSpec = ..., - state: Literal["normal", "active", "disabled"] = ..., - takefocus: _TakeFocusValue = ..., - text: float | str = ..., - textvariable: Variable = ..., - tristateimage: _ImageSpec = ..., - tristatevalue: Any = ..., - underline: int = ..., - variable: Variable | Literal[""] = ..., - width: _ScreenUnits = ..., - wraplength: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def deselect(self) -> None: ... - def flash(self) -> None: ... - def invoke(self) -> Any: ... - def select(self) -> None: ... - def toggle(self) -> None: ... - -class Entry(Widget, XView): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = "xterm", - disabledbackground: str = ..., - disabledforeground: str = ..., - exportselection: bool = True, - fg: str = ..., - font: _FontDescription = "TkTextFont", - foreground: str = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - insertbackground: str = ..., - insertborderwidth: _ScreenUnits = 0, - insertofftime: int = 300, - insertontime: int = 600, - insertwidth: _ScreenUnits = ..., - invalidcommand: _EntryValidateCommand = "", - invcmd: _EntryValidateCommand = "", # same as invalidcommand - justify: Literal["left", "center", "right"] = "left", - name: str = ..., - readonlybackground: str = ..., - relief: _Relief = "sunken", - selectbackground: str = ..., - selectborderwidth: _ScreenUnits = ..., - selectforeground: str = ..., - show: str = "", - state: Literal["normal", "disabled", "readonly"] = "normal", - takefocus: _TakeFocusValue = "", - textvariable: Variable = ..., - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = "none", - validatecommand: _EntryValidateCommand = "", - vcmd: _EntryValidateCommand = "", # same as validatecommand - width: int = 20, - xscrollcommand: _XYScrollCommand = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = ..., - disabledbackground: str = ..., - disabledforeground: str = ..., - exportselection: bool = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - insertbackground: str = ..., - insertborderwidth: _ScreenUnits = ..., - insertofftime: int = ..., - insertontime: int = ..., - insertwidth: _ScreenUnits = ..., - invalidcommand: _EntryValidateCommand = ..., - invcmd: _EntryValidateCommand = ..., - justify: Literal["left", "center", "right"] = ..., - readonlybackground: str = ..., - relief: _Relief = ..., - selectbackground: str = ..., - selectborderwidth: _ScreenUnits = ..., - selectforeground: str = ..., - show: str = ..., - state: Literal["normal", "disabled", "readonly"] = ..., - takefocus: _TakeFocusValue = ..., - textvariable: Variable = ..., - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., - validatecommand: _EntryValidateCommand = ..., - vcmd: _EntryValidateCommand = ..., - width: int = ..., - xscrollcommand: _XYScrollCommand = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def delete(self, first: str | int, last: str | int | None = None) -> None: ... - def get(self) -> str: ... - def icursor(self, index: str | int) -> None: ... - def index(self, index: str | int) -> int: ... - def insert(self, index: str | int, string: str) -> None: ... - def scan_mark(self, x) -> None: ... - def scan_dragto(self, x) -> None: ... - def selection_adjust(self, index: str | int) -> None: ... - def selection_clear(self) -> None: ... # type: ignore[override] - def selection_from(self, index: str | int) -> None: ... - def selection_present(self) -> bool: ... - def selection_range(self, start: str | int, end: str | int) -> None: ... - def selection_to(self, index: str | int) -> None: ... - select_adjust = selection_adjust - select_clear = selection_clear - select_from = selection_from - select_present = selection_present - select_range = selection_range - select_to = selection_to - -class Frame(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - background: str = ..., - bd: _ScreenUnits = 0, - bg: str = ..., - border: _ScreenUnits = 0, - borderwidth: _ScreenUnits = 0, - class_: str = "Frame", # can't be changed with configure() - colormap: Literal["new", ""] | Misc = "", # can't be changed with configure() - container: bool = False, # can't be changed with configure() - cursor: _Cursor = "", - height: _ScreenUnits = 0, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = 0, - name: str = ..., - padx: _ScreenUnits = 0, - pady: _ScreenUnits = 0, - relief: _Relief = "flat", - takefocus: _TakeFocusValue = 0, - visual: str | tuple[str, int] = "", # can't be changed with configure() - width: _ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - takefocus: _TakeFocusValue = ..., - width: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class Label(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - activebackground: str = ..., - activeforeground: str = ..., - anchor: _Anchor = "center", - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - bitmap: str = "", - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - compound: _Compound = "none", - cursor: _Cursor = "", - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = "TkDefaultFont", - foreground: str = ..., - height: _ScreenUnits = 0, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = 0, - image: _ImageSpec = "", - justify: Literal["left", "center", "right"] = "center", - name: str = ..., - padx: _ScreenUnits = 1, - pady: _ScreenUnits = 1, - relief: _Relief = "flat", - state: Literal["normal", "active", "disabled"] = "normal", - takefocus: _TakeFocusValue = 0, - text: float | str = "", - textvariable: Variable = ..., - underline: int = -1, - width: _ScreenUnits = 0, - wraplength: _ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - activebackground: str = ..., - activeforeground: str = ..., - anchor: _Anchor = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - bitmap: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - compound: _Compound = ..., - cursor: _Cursor = ..., - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - image: _ImageSpec = ..., - justify: Literal["left", "center", "right"] = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - state: Literal["normal", "active", "disabled"] = ..., - takefocus: _TakeFocusValue = ..., - text: float | str = ..., - textvariable: Variable = ..., - underline: int = ..., - width: _ScreenUnits = ..., - wraplength: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class Listbox(Widget, XView, YView): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - activestyle: Literal["dotbox", "none", "underline"] = ..., - background: str = ..., - bd: _ScreenUnits = 1, - bg: str = ..., - border: _ScreenUnits = 1, - borderwidth: _ScreenUnits = 1, - cursor: _Cursor = "", - disabledforeground: str = ..., - exportselection: bool | Literal[0, 1] = 1, - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: int = 10, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - justify: Literal["left", "center", "right"] = "left", - # There's no tkinter.ListVar, but seems like bare tkinter.Variable - # actually works for this: - # - # >>> import tkinter - # >>> lb = tkinter.Listbox() - # >>> var = lb['listvariable'] = tkinter.Variable() - # >>> var.set(['foo', 'bar', 'baz']) - # >>> lb.get(0, 'end') - # ('foo', 'bar', 'baz') - listvariable: Variable = ..., - name: str = ..., - relief: _Relief = ..., - selectbackground: str = ..., - selectborderwidth: _ScreenUnits = 0, - selectforeground: str = ..., - # from listbox man page: "The value of the [selectmode] option may be - # arbitrary, but the default bindings expect it to be either single, - # browse, multiple, or extended" - # - # I have never seen anyone setting this to something else than what - # "the default bindings expect", but let's support it anyway. - selectmode: str | Literal["single", "browse", "multiple", "extended"] = "browse", # noqa: Y051 - setgrid: bool = False, - state: Literal["normal", "disabled"] = "normal", - takefocus: _TakeFocusValue = "", - width: int = 20, - xscrollcommand: _XYScrollCommand = "", - yscrollcommand: _XYScrollCommand = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - activestyle: Literal["dotbox", "none", "underline"] = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = ..., - disabledforeground: str = ..., - exportselection: bool = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: int = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - justify: Literal["left", "center", "right"] = ..., - listvariable: Variable = ..., - relief: _Relief = ..., - selectbackground: str = ..., - selectborderwidth: _ScreenUnits = ..., - selectforeground: str = ..., - selectmode: str | Literal["single", "browse", "multiple", "extended"] = ..., # noqa: Y051 - setgrid: bool = ..., - state: Literal["normal", "disabled"] = ..., - takefocus: _TakeFocusValue = ..., - width: int = ..., - xscrollcommand: _XYScrollCommand = ..., - yscrollcommand: _XYScrollCommand = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def activate(self, index: str | int) -> None: ... - def bbox(self, index: str | int) -> tuple[int, int, int, int] | None: ... # type: ignore[override] - def curselection(self): ... - def delete(self, first: str | int, last: str | int | None = None) -> None: ... - def get(self, first: str | int, last: str | int | None = None): ... - def index(self, index: str | int) -> int: ... - def insert(self, index: str | int, *elements: str | float) -> None: ... - def nearest(self, y): ... - def scan_mark(self, x, y) -> None: ... - def scan_dragto(self, x, y) -> None: ... - def see(self, index: str | int) -> None: ... - def selection_anchor(self, index: str | int) -> None: ... - select_anchor = selection_anchor - def selection_clear(self, first: str | int, last: str | int | None = None) -> None: ... # type: ignore[override] - select_clear = selection_clear - def selection_includes(self, index: str | int): ... - select_includes = selection_includes - def selection_set(self, first: str | int, last: str | int | None = None) -> None: ... - select_set = selection_set - def size(self) -> int: ... # type: ignore[override] - def itemcget(self, index: str | int, option): ... - def itemconfigure(self, index: str | int, cnf: Incomplete | None = None, **kw): ... - itemconfig = itemconfigure - -class Menu(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - activebackground: str = ..., - activeborderwidth: _ScreenUnits = ..., - activeforeground: str = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = "arrow", - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - name: str = ..., - postcommand: Callable[[], object] | str = "", - relief: _Relief = ..., - selectcolor: str = ..., - takefocus: _TakeFocusValue = 0, - tearoff: bool | Literal[0, 1] = 1, - # I guess tearoffcommand arguments are supposed to be widget objects, - # but they are widget name strings. Use nametowidget() to handle the - # arguments of tearoffcommand. - tearoffcommand: Callable[[str, str], object] | str = "", - title: str = "", - type: Literal["menubar", "tearoff", "normal"] = "normal", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - activebackground: str = ..., - activeborderwidth: _ScreenUnits = ..., - activeforeground: str = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = ..., - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - postcommand: Callable[[], object] | str = ..., - relief: _Relief = ..., - selectcolor: str = ..., - takefocus: _TakeFocusValue = ..., - tearoff: bool = ..., - tearoffcommand: Callable[[str, str], object] | str = ..., - title: str = ..., - type: Literal["menubar", "tearoff", "normal"] = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def tk_popup(self, x: int, y: int, entry: str | int = "") -> None: ... - def activate(self, index: str | int) -> None: ... - def add(self, itemType, cnf={}, **kw): ... # docstring says "Internal function." - def insert(self, index, itemType, cnf={}, **kw): ... # docstring says "Internal function." - def add_cascade( - self, - cnf: dict[str, Any] | None = {}, - *, - accelerator: str = ..., - activebackground: str = ..., - activeforeground: str = ..., - background: str = ..., - bitmap: str = ..., - columnbreak: int = ..., - command: Callable[[], object] | str = ..., - compound: _Compound = ..., - font: _FontDescription = ..., - foreground: str = ..., - hidemargin: bool = ..., - image: _ImageSpec = ..., - label: str = ..., - menu: Menu = ..., - state: Literal["normal", "active", "disabled"] = ..., - underline: int = ..., - ) -> None: ... - def add_checkbutton( - self, - cnf: dict[str, Any] | None = {}, - *, - accelerator: str = ..., - activebackground: str = ..., - activeforeground: str = ..., - background: str = ..., - bitmap: str = ..., - columnbreak: int = ..., - command: Callable[[], object] | str = ..., - compound: _Compound = ..., - font: _FontDescription = ..., - foreground: str = ..., - hidemargin: bool = ..., - image: _ImageSpec = ..., - indicatoron: bool = ..., - label: str = ..., - offvalue: Any = ..., - onvalue: Any = ..., - selectcolor: str = ..., - selectimage: _ImageSpec = ..., - state: Literal["normal", "active", "disabled"] = ..., - underline: int = ..., - variable: Variable = ..., - ) -> None: ... - def add_command( - self, - cnf: dict[str, Any] | None = {}, - *, - accelerator: str = ..., - activebackground: str = ..., - activeforeground: str = ..., - background: str = ..., - bitmap: str = ..., - columnbreak: int = ..., - command: Callable[[], object] | str = ..., - compound: _Compound = ..., - font: _FontDescription = ..., - foreground: str = ..., - hidemargin: bool = ..., - image: _ImageSpec = ..., - label: str = ..., - state: Literal["normal", "active", "disabled"] = ..., - underline: int = ..., - ) -> None: ... - def add_radiobutton( - self, - cnf: dict[str, Any] | None = {}, - *, - accelerator: str = ..., - activebackground: str = ..., - activeforeground: str = ..., - background: str = ..., - bitmap: str = ..., - columnbreak: int = ..., - command: Callable[[], object] | str = ..., - compound: _Compound = ..., - font: _FontDescription = ..., - foreground: str = ..., - hidemargin: bool = ..., - image: _ImageSpec = ..., - indicatoron: bool = ..., - label: str = ..., - selectcolor: str = ..., - selectimage: _ImageSpec = ..., - state: Literal["normal", "active", "disabled"] = ..., - underline: int = ..., - value: Any = ..., - variable: Variable = ..., - ) -> None: ... - def add_separator(self, cnf: dict[str, Any] | None = {}, *, background: str = ...) -> None: ... - def insert_cascade( - self, - index: str | int, - cnf: dict[str, Any] | None = {}, - *, - accelerator: str = ..., - activebackground: str = ..., - activeforeground: str = ..., - background: str = ..., - bitmap: str = ..., - columnbreak: int = ..., - command: Callable[[], object] | str = ..., - compound: _Compound = ..., - font: _FontDescription = ..., - foreground: str = ..., - hidemargin: bool = ..., - image: _ImageSpec = ..., - label: str = ..., - menu: Menu = ..., - state: Literal["normal", "active", "disabled"] = ..., - underline: int = ..., - ) -> None: ... - def insert_checkbutton( - self, - index: str | int, - cnf: dict[str, Any] | None = {}, - *, - accelerator: str = ..., - activebackground: str = ..., - activeforeground: str = ..., - background: str = ..., - bitmap: str = ..., - columnbreak: int = ..., - command: Callable[[], object] | str = ..., - compound: _Compound = ..., - font: _FontDescription = ..., - foreground: str = ..., - hidemargin: bool = ..., - image: _ImageSpec = ..., - indicatoron: bool = ..., - label: str = ..., - offvalue: Any = ..., - onvalue: Any = ..., - selectcolor: str = ..., - selectimage: _ImageSpec = ..., - state: Literal["normal", "active", "disabled"] = ..., - underline: int = ..., - variable: Variable = ..., - ) -> None: ... - def insert_command( - self, - index: str | int, - cnf: dict[str, Any] | None = {}, - *, - accelerator: str = ..., - activebackground: str = ..., - activeforeground: str = ..., - background: str = ..., - bitmap: str = ..., - columnbreak: int = ..., - command: Callable[[], object] | str = ..., - compound: _Compound = ..., - font: _FontDescription = ..., - foreground: str = ..., - hidemargin: bool = ..., - image: _ImageSpec = ..., - label: str = ..., - state: Literal["normal", "active", "disabled"] = ..., - underline: int = ..., - ) -> None: ... - def insert_radiobutton( - self, - index: str | int, - cnf: dict[str, Any] | None = {}, - *, - accelerator: str = ..., - activebackground: str = ..., - activeforeground: str = ..., - background: str = ..., - bitmap: str = ..., - columnbreak: int = ..., - command: Callable[[], object] | str = ..., - compound: _Compound = ..., - font: _FontDescription = ..., - foreground: str = ..., - hidemargin: bool = ..., - image: _ImageSpec = ..., - indicatoron: bool = ..., - label: str = ..., - selectcolor: str = ..., - selectimage: _ImageSpec = ..., - state: Literal["normal", "active", "disabled"] = ..., - underline: int = ..., - value: Any = ..., - variable: Variable = ..., - ) -> None: ... - def insert_separator(self, index: str | int, cnf: dict[str, Any] | None = {}, *, background: str = ...) -> None: ... - def delete(self, index1: str | int, index2: str | int | None = None) -> None: ... - def entrycget(self, index: str | int, option: str) -> Any: ... - def entryconfigure( - self, index: str | int, cnf: dict[str, Any] | None = None, **kw: Any - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - entryconfig = entryconfigure - def index(self, index: str | int) -> int | None: ... - def invoke(self, index: str | int) -> Any: ... - def post(self, x: int, y: int) -> None: ... - def type(self, index: str | int) -> Literal["cascade", "checkbutton", "command", "radiobutton", "separator"]: ... - def unpost(self) -> None: ... - def xposition(self, index: str | int) -> int: ... - def yposition(self, index: str | int) -> int: ... - -class Menubutton(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - activebackground: str = ..., - activeforeground: str = ..., - anchor: _Anchor = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - bitmap: str = "", - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - compound: _Compound = "none", - cursor: _Cursor = "", - direction: Literal["above", "below", "left", "right", "flush"] = "below", - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = "TkDefaultFont", - foreground: str = ..., - height: _ScreenUnits = 0, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = 0, - image: _ImageSpec = "", - indicatoron: bool = ..., - justify: Literal["left", "center", "right"] = ..., - menu: Menu = ..., - name: str = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = "flat", - state: Literal["normal", "active", "disabled"] = "normal", - takefocus: _TakeFocusValue = 0, - text: float | str = "", - textvariable: Variable = ..., - underline: int = -1, - width: _ScreenUnits = 0, - wraplength: _ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - activebackground: str = ..., - activeforeground: str = ..., - anchor: _Anchor = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - bitmap: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - compound: _Compound = ..., - cursor: _Cursor = ..., - direction: Literal["above", "below", "left", "right", "flush"] = ..., - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - image: _ImageSpec = ..., - indicatoron: bool = ..., - justify: Literal["left", "center", "right"] = ..., - menu: Menu = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - state: Literal["normal", "active", "disabled"] = ..., - takefocus: _TakeFocusValue = ..., - text: float | str = ..., - textvariable: Variable = ..., - underline: int = ..., - width: _ScreenUnits = ..., - wraplength: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class Message(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - anchor: _Anchor = "center", - aspect: int = 150, - background: str = ..., - bd: _ScreenUnits = 1, - bg: str = ..., - border: _ScreenUnits = 1, - borderwidth: _ScreenUnits = 1, - cursor: _Cursor = "", - fg: str = ..., - font: _FontDescription = "TkDefaultFont", - foreground: str = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = 0, - justify: Literal["left", "center", "right"] = "left", - name: str = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = "flat", - takefocus: _TakeFocusValue = 0, - text: float | str = "", - textvariable: Variable = ..., - # there's width but no height - width: _ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - anchor: _Anchor = ..., - aspect: int = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - justify: Literal["left", "center", "right"] = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - takefocus: _TakeFocusValue = ..., - text: float | str = ..., - textvariable: Variable = ..., - width: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class Radiobutton(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - activebackground: str = ..., - activeforeground: str = ..., - anchor: _Anchor = "center", - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - bitmap: str = "", - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - command: _ButtonCommand = "", - compound: _Compound = "none", - cursor: _Cursor = "", - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = "TkDefaultFont", - foreground: str = ..., - height: _ScreenUnits = 0, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = 1, - image: _ImageSpec = "", - indicatoron: bool = True, - justify: Literal["left", "center", "right"] = "center", - name: str = ..., - offrelief: _Relief = ..., - overrelief: _Relief | Literal[""] = "", - padx: _ScreenUnits = 1, - pady: _ScreenUnits = 1, - relief: _Relief = "flat", - selectcolor: str = ..., - selectimage: _ImageSpec = "", - state: Literal["normal", "active", "disabled"] = "normal", - takefocus: _TakeFocusValue = "", - text: float | str = "", - textvariable: Variable = ..., - tristateimage: _ImageSpec = "", - tristatevalue: Any = "", - underline: int = -1, - value: Any = "", - variable: Variable | Literal[""] = ..., - width: _ScreenUnits = 0, - wraplength: _ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - activebackground: str = ..., - activeforeground: str = ..., - anchor: _Anchor = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - bitmap: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - command: _ButtonCommand = ..., - compound: _Compound = ..., - cursor: _Cursor = ..., - disabledforeground: str = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - image: _ImageSpec = ..., - indicatoron: bool = ..., - justify: Literal["left", "center", "right"] = ..., - offrelief: _Relief = ..., - overrelief: _Relief | Literal[""] = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - selectcolor: str = ..., - selectimage: _ImageSpec = ..., - state: Literal["normal", "active", "disabled"] = ..., - takefocus: _TakeFocusValue = ..., - text: float | str = ..., - textvariable: Variable = ..., - tristateimage: _ImageSpec = ..., - tristatevalue: Any = ..., - underline: int = ..., - value: Any = ..., - variable: Variable | Literal[""] = ..., - width: _ScreenUnits = ..., - wraplength: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def deselect(self) -> None: ... - def flash(self) -> None: ... - def invoke(self) -> Any: ... - def select(self) -> None: ... - -class Scale(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - activebackground: str = ..., - background: str = ..., - bd: _ScreenUnits = 1, - bg: str = ..., - bigincrement: float = 0.0, - border: _ScreenUnits = 1, - borderwidth: _ScreenUnits = 1, - # don't know why the callback gets string instead of float - command: str | Callable[[str], object] = "", - cursor: _Cursor = "", - digits: int = 0, - fg: str = ..., - font: _FontDescription = "TkDefaultFont", - foreground: str = ..., - from_: float = 0.0, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - label: str = "", - length: _ScreenUnits = 100, - name: str = ..., - orient: Literal["horizontal", "vertical"] = "vertical", - relief: _Relief = "flat", - repeatdelay: int = 300, - repeatinterval: int = 100, - resolution: float = 1.0, - showvalue: bool = True, - sliderlength: _ScreenUnits = 30, - sliderrelief: _Relief = "raised", - state: Literal["normal", "active", "disabled"] = "normal", - takefocus: _TakeFocusValue = "", - tickinterval: float = 0.0, - to: float = 100.0, - troughcolor: str = ..., - variable: IntVar | DoubleVar = ..., - width: _ScreenUnits = 15, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - activebackground: str = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - bigincrement: float = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - command: str | Callable[[str], object] = ..., - cursor: _Cursor = ..., - digits: int = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - from_: float = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - label: str = ..., - length: _ScreenUnits = ..., - orient: Literal["horizontal", "vertical"] = ..., - relief: _Relief = ..., - repeatdelay: int = ..., - repeatinterval: int = ..., - resolution: float = ..., - showvalue: bool = ..., - sliderlength: _ScreenUnits = ..., - sliderrelief: _Relief = ..., - state: Literal["normal", "active", "disabled"] = ..., - takefocus: _TakeFocusValue = ..., - tickinterval: float = ..., - to: float = ..., - troughcolor: str = ..., - variable: IntVar | DoubleVar = ..., - width: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def get(self) -> float: ... - def set(self, value) -> None: ... - def coords(self, value: float | None = None) -> tuple[int, int]: ... - def identify(self, x, y) -> Literal["", "slider", "trough1", "trough2"]: ... - -class Scrollbar(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - activebackground: str = ..., - activerelief: _Relief = "raised", - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - # There are many ways how the command may get called. Search for - # 'SCROLLING COMMANDS' in scrollbar man page. There doesn't seem to - # be any way to specify an overloaded callback function, so we say - # that it can take any args while it can't in reality. - command: Callable[..., tuple[float, float] | None] | str = "", - cursor: _Cursor = "", - elementborderwidth: _ScreenUnits = -1, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = 0, - jump: bool = False, - name: str = ..., - orient: Literal["horizontal", "vertical"] = "vertical", - relief: _Relief = ..., - repeatdelay: int = 300, - repeatinterval: int = 100, - takefocus: _TakeFocusValue = "", - troughcolor: str = ..., - width: _ScreenUnits = ..., - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - activebackground: str = ..., - activerelief: _Relief = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - command: Callable[..., tuple[float, float] | None] | str = ..., - cursor: _Cursor = ..., - elementborderwidth: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - jump: bool = ..., - orient: Literal["horizontal", "vertical"] = ..., - relief: _Relief = ..., - repeatdelay: int = ..., - repeatinterval: int = ..., - takefocus: _TakeFocusValue = ..., - troughcolor: str = ..., - width: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def activate(self, index: Incomplete | None = None): ... - def delta(self, deltax: int, deltay: int) -> float: ... - def fraction(self, x: int, y: int) -> float: ... - def identify(self, x: int, y: int) -> Literal["arrow1", "arrow2", "slider", "trough1", "trough2", ""]: ... - def get(self) -> tuple[float, float, float, float] | tuple[float, float]: ... - def set(self, first: float | str, last: float | str) -> None: ... - -_TextIndex: TypeAlias = _tkinter.Tcl_Obj | str | float | Misc -_WhatToCount: TypeAlias = Literal[ - "chars", "displaychars", "displayindices", "displaylines", "indices", "lines", "xpixels", "ypixels" -] - -class Text(Widget, XView, YView): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - autoseparators: bool = True, - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - blockcursor: bool = False, - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = "xterm", - endline: int | Literal[""] = "", - exportselection: bool = True, - fg: str = ..., - font: _FontDescription = "TkFixedFont", - foreground: str = ..., - # width is always int, but height is allowed to be ScreenUnits. - # This doesn't make any sense to me, and this isn't documented. - # The docs seem to say that both should be integers. - height: _ScreenUnits = 24, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - inactiveselectbackground: str = ..., - insertbackground: str = ..., - insertborderwidth: _ScreenUnits = 0, - insertofftime: int = 300, - insertontime: int = 600, - insertunfocussed: Literal["none", "hollow", "solid"] = "none", - insertwidth: _ScreenUnits = ..., - maxundo: int = 0, - name: str = ..., - padx: _ScreenUnits = 1, - pady: _ScreenUnits = 1, - relief: _Relief = ..., - selectbackground: str = ..., - selectborderwidth: _ScreenUnits = ..., - selectforeground: str = ..., - setgrid: bool = False, - spacing1: _ScreenUnits = 0, - spacing2: _ScreenUnits = 0, - spacing3: _ScreenUnits = 0, - startline: int | Literal[""] = "", - state: Literal["normal", "disabled"] = "normal", - # Literal inside Tuple doesn't actually work - tabs: _ScreenUnits | str | tuple[_ScreenUnits | str, ...] = "", - tabstyle: Literal["tabular", "wordprocessor"] = "tabular", - takefocus: _TakeFocusValue = "", - undo: bool = False, - width: int = 80, - wrap: Literal["none", "char", "word"] = "char", - xscrollcommand: _XYScrollCommand = "", - yscrollcommand: _XYScrollCommand = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - autoseparators: bool = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - blockcursor: bool = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = ..., - endline: int | Literal[""] = ..., - exportselection: bool = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - inactiveselectbackground: str = ..., - insertbackground: str = ..., - insertborderwidth: _ScreenUnits = ..., - insertofftime: int = ..., - insertontime: int = ..., - insertunfocussed: Literal["none", "hollow", "solid"] = ..., - insertwidth: _ScreenUnits = ..., - maxundo: int = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - selectbackground: str = ..., - selectborderwidth: _ScreenUnits = ..., - selectforeground: str = ..., - setgrid: bool = ..., - spacing1: _ScreenUnits = ..., - spacing2: _ScreenUnits = ..., - spacing3: _ScreenUnits = ..., - startline: int | Literal[""] = ..., - state: Literal["normal", "disabled"] = ..., - tabs: _ScreenUnits | str | tuple[_ScreenUnits | str, ...] = ..., - tabstyle: Literal["tabular", "wordprocessor"] = ..., - takefocus: _TakeFocusValue = ..., - undo: bool = ..., - width: int = ..., - wrap: Literal["none", "char", "word"] = ..., - xscrollcommand: _XYScrollCommand = ..., - yscrollcommand: _XYScrollCommand = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def bbox(self, index: _TextIndex) -> tuple[int, int, int, int] | None: ... # type: ignore[override] - def compare(self, index1: _TextIndex, op: Literal["<", "<=", "==", ">=", ">", "!="], index2: _TextIndex) -> bool: ... - if sys.version_info >= (3, 13): - @overload - def count(self, index1: _TextIndex, index2: _TextIndex, *, return_ints: Literal[True]) -> int: ... - @overload - def count( - self, index1: _TextIndex, index2: _TextIndex, arg: _WhatToCount | Literal["update"], /, *, return_ints: Literal[True] - ) -> int: ... - @overload - def count( - self, - index1: _TextIndex, - index2: _TextIndex, - arg1: Literal["update"], - arg2: _WhatToCount, - /, - *, - return_ints: Literal[True], - ) -> int: ... - @overload - def count( - self, - index1: _TextIndex, - index2: _TextIndex, - arg1: _WhatToCount, - arg2: Literal["update"], - /, - *, - return_ints: Literal[True], - ) -> int: ... - @overload - def count( - self, index1: _TextIndex, index2: _TextIndex, arg1: _WhatToCount, arg2: _WhatToCount, /, *, return_ints: Literal[True] - ) -> tuple[int, int]: ... - @overload - def count( - self, - index1: _TextIndex, - index2: _TextIndex, - arg1: _WhatToCount | Literal["update"], - arg2: _WhatToCount | Literal["update"], - arg3: _WhatToCount | Literal["update"], - /, - *args: _WhatToCount | Literal["update"], - return_ints: Literal[True], - ) -> tuple[int, ...]: ... - @overload - def count(self, index1: _TextIndex, index2: _TextIndex, *, return_ints: Literal[False] = False) -> tuple[int] | None: ... - @overload - def count( - self, - index1: _TextIndex, - index2: _TextIndex, - arg: _WhatToCount | Literal["update"], - /, - *, - return_ints: Literal[False] = False, - ) -> tuple[int] | None: ... - @overload - def count( - self, - index1: _TextIndex, - index2: _TextIndex, - arg1: Literal["update"], - arg2: _WhatToCount, - /, - *, - return_ints: Literal[False] = False, - ) -> int | None: ... - @overload - def count( - self, - index1: _TextIndex, - index2: _TextIndex, - arg1: _WhatToCount, - arg2: Literal["update"], - /, - *, - return_ints: Literal[False] = False, - ) -> int | None: ... - @overload - def count( - self, - index1: _TextIndex, - index2: _TextIndex, - arg1: _WhatToCount, - arg2: _WhatToCount, - /, - *, - return_ints: Literal[False] = False, - ) -> tuple[int, int]: ... - @overload - def count( - self, - index1: _TextIndex, - index2: _TextIndex, - arg1: _WhatToCount | Literal["update"], - arg2: _WhatToCount | Literal["update"], - arg3: _WhatToCount | Literal["update"], - /, - *args: _WhatToCount | Literal["update"], - return_ints: Literal[False] = False, - ) -> tuple[int, ...]: ... - else: - @overload - def count(self, index1: _TextIndex, index2: _TextIndex) -> tuple[int] | None: ... - @overload - def count( - self, index1: _TextIndex, index2: _TextIndex, arg: _WhatToCount | Literal["update"], / - ) -> tuple[int] | None: ... - @overload - def count(self, index1: _TextIndex, index2: _TextIndex, arg1: Literal["update"], arg2: _WhatToCount, /) -> int | None: ... - @overload - def count(self, index1: _TextIndex, index2: _TextIndex, arg1: _WhatToCount, arg2: Literal["update"], /) -> int | None: ... - @overload - def count(self, index1: _TextIndex, index2: _TextIndex, arg1: _WhatToCount, arg2: _WhatToCount, /) -> tuple[int, int]: ... - @overload - def count( - self, - index1: _TextIndex, - index2: _TextIndex, - arg1: _WhatToCount | Literal["update"], - arg2: _WhatToCount | Literal["update"], - arg3: _WhatToCount | Literal["update"], - /, - *args: _WhatToCount | Literal["update"], - ) -> tuple[int, ...]: ... - - @overload - def debug(self, boolean: None = None) -> bool: ... - @overload - def debug(self, boolean: bool) -> None: ... - def delete(self, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ... - def dlineinfo(self, index: _TextIndex) -> tuple[int, int, int, int, int] | None: ... - @overload - def dump( - self, - index1: _TextIndex, - index2: _TextIndex | None = None, - command: None = None, - *, - all: bool = ..., - image: bool = ..., - mark: bool = ..., - tag: bool = ..., - text: bool = ..., - window: bool = ..., - ) -> list[tuple[str, str, str]]: ... - @overload - def dump( - self, - index1: _TextIndex, - index2: _TextIndex | None, - command: Callable[[str, str, str], object] | str, - *, - all: bool = ..., - image: bool = ..., - mark: bool = ..., - tag: bool = ..., - text: bool = ..., - window: bool = ..., - ) -> None: ... - @overload - def dump( - self, - index1: _TextIndex, - index2: _TextIndex | None = None, - *, - command: Callable[[str, str, str], object] | str, - all: bool = ..., - image: bool = ..., - mark: bool = ..., - tag: bool = ..., - text: bool = ..., - window: bool = ..., - ) -> None: ... - def edit(self, *args): ... # docstring says "Internal method" - @overload - def edit_modified(self, arg: None = None) -> bool: ... # actually returns Literal[0, 1] - @overload - def edit_modified(self, arg: bool) -> None: ... # actually returns empty string - def edit_redo(self) -> None: ... # actually returns empty string - def edit_reset(self) -> None: ... # actually returns empty string - def edit_separator(self) -> None: ... # actually returns empty string - def edit_undo(self) -> None: ... # actually returns empty string - def get(self, index1: _TextIndex, index2: _TextIndex | None = None) -> str: ... - @overload - def image_cget(self, index: _TextIndex, option: Literal["image", "name"]) -> str: ... - @overload - def image_cget(self, index: _TextIndex, option: Literal["padx", "pady"]) -> int: ... - @overload - def image_cget(self, index: _TextIndex, option: Literal["align"]) -> Literal["baseline", "bottom", "center", "top"]: ... - @overload - def image_cget(self, index: _TextIndex, option: str) -> Any: ... - @overload - def image_configure(self, index: _TextIndex, cnf: str) -> tuple[str, str, str, str, str | int]: ... - @overload - def image_configure( - self, - index: _TextIndex, - cnf: dict[str, Any] | None = {}, - *, - align: Literal["baseline", "bottom", "center", "top"] = ..., - image: _ImageSpec = ..., - name: str = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, str, str | int]] | None: ... - def image_create( - self, - index: _TextIndex, - cnf: dict[str, Any] | None = {}, - *, - align: Literal["baseline", "bottom", "center", "top"] = ..., - image: _ImageSpec = ..., - name: str = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - ) -> str: ... - def image_names(self) -> tuple[str, ...]: ... - def index(self, index: _TextIndex) -> str: ... - def insert(self, index: _TextIndex, chars: str, *args: str | list[str] | tuple[str, ...]) -> None: ... - @overload - def mark_gravity(self, markName: str, direction: None = None) -> Literal["left", "right"]: ... - @overload - def mark_gravity(self, markName: str, direction: Literal["left", "right"]) -> None: ... # actually returns empty string - def mark_names(self) -> tuple[str, ...]: ... - def mark_set(self, markName: str, index: _TextIndex) -> None: ... - def mark_unset(self, *markNames: str) -> None: ... - def mark_next(self, index: _TextIndex) -> str | None: ... - def mark_previous(self, index: _TextIndex) -> str | None: ... - # **kw of peer_create is same as the kwargs of Text.__init__ - def peer_create(self, newPathName: str | Text, cnf: dict[str, Any] = {}, **kw) -> None: ... - def peer_names(self) -> tuple[_tkinter.Tcl_Obj, ...]: ... - def replace(self, index1: _TextIndex, index2: _TextIndex, chars: str, *args: str | list[str] | tuple[str, ...]) -> None: ... - def scan_mark(self, x: int, y: int) -> None: ... - def scan_dragto(self, x: int, y: int) -> None: ... - def search( - self, - pattern: str, - index: _TextIndex, - stopindex: _TextIndex | None = None, - forwards: bool | None = None, - backwards: bool | None = None, - exact: bool | None = None, - regexp: bool | None = None, - nocase: bool | None = None, - count: Variable | None = None, - elide: bool | None = None, - ) -> str: ... # returns empty string for not found - def see(self, index: _TextIndex) -> None: ... - def tag_add(self, tagName: str, index1: _TextIndex, *args: _TextIndex) -> None: ... - # tag_bind stuff is very similar to Canvas - @overload - def tag_bind( - self, - tagName: str, - sequence: str | None, - func: Callable[[Event[Text]], object] | None, - add: Literal["", "+"] | bool | None = None, - ) -> str: ... - @overload - def tag_bind(self, tagName: str, sequence: str | None, func: str, add: Literal["", "+"] | bool | None = None) -> None: ... - def tag_unbind(self, tagName: str, sequence: str, funcid: str | None = None) -> None: ... - # allowing any string for cget instead of just Literals because there's no other way to look up tag options - def tag_cget(self, tagName: str, option: str): ... - @overload - def tag_configure( - self, - tagName: str, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - bgstipple: str = ..., - borderwidth: _ScreenUnits = ..., - border: _ScreenUnits = ..., # alias for borderwidth - elide: bool = ..., - fgstipple: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - justify: Literal["left", "right", "center"] = ..., - lmargin1: _ScreenUnits = ..., - lmargin2: _ScreenUnits = ..., - lmargincolor: str = ..., - offset: _ScreenUnits = ..., - overstrike: bool = ..., - overstrikefg: str = ..., - relief: _Relief = ..., - rmargin: _ScreenUnits = ..., - rmargincolor: str = ..., - selectbackground: str = ..., - selectforeground: str = ..., - spacing1: _ScreenUnits = ..., - spacing2: _ScreenUnits = ..., - spacing3: _ScreenUnits = ..., - tabs: Any = ..., # the exact type is kind of complicated, see manual page - tabstyle: Literal["tabular", "wordprocessor"] = ..., - underline: bool = ..., - underlinefg: str = ..., - wrap: Literal["none", "char", "word"] = ..., # be careful with "none" vs None - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def tag_configure(self, tagName: str, cnf: str) -> tuple[str, str, str, Any, Any]: ... - tag_config = tag_configure - def tag_delete(self, first_tag_name: str, /, *tagNames: str) -> None: ... # error if no tag names given - def tag_lower(self, tagName: str, belowThis: str | None = None) -> None: ... - def tag_names(self, index: _TextIndex | None = None) -> tuple[str, ...]: ... - def tag_nextrange( - self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None - ) -> tuple[str, str] | tuple[()]: ... - def tag_prevrange( - self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None - ) -> tuple[str, str] | tuple[()]: ... - def tag_raise(self, tagName: str, aboveThis: str | None = None) -> None: ... - def tag_ranges(self, tagName: str) -> tuple[_tkinter.Tcl_Obj, ...]: ... - # tag_remove and tag_delete are different - def tag_remove(self, tagName: str, index1: _TextIndex, index2: _TextIndex | None = None) -> None: ... - @overload - def window_cget(self, index: _TextIndex, option: Literal["padx", "pady"]) -> int: ... - @overload - def window_cget(self, index: _TextIndex, option: Literal["stretch"]) -> bool: ... # actually returns Literal[0, 1] - @overload - def window_cget(self, index: _TextIndex, option: Literal["align"]) -> Literal["baseline", "bottom", "center", "top"]: ... - @overload # window is set to a widget, but read as the string name. - def window_cget(self, index: _TextIndex, option: Literal["create", "window"]) -> str: ... - @overload - def window_cget(self, index: _TextIndex, option: str) -> Any: ... - @overload - def window_configure(self, index: _TextIndex, cnf: str) -> tuple[str, str, str, str, str | int]: ... - @overload - def window_configure( - self, - index: _TextIndex, - cnf: dict[str, Any] | None = None, - *, - align: Literal["baseline", "bottom", "center", "top"] = ..., - create: str = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - stretch: bool | Literal[0, 1] = ..., - window: Misc | str = ..., - ) -> dict[str, tuple[str, str, str, str, str | int]] | None: ... - window_config = window_configure - def window_create( - self, - index: _TextIndex, - cnf: dict[str, Any] | None = {}, - *, - align: Literal["baseline", "bottom", "center", "top"] = ..., - create: str = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - stretch: bool | Literal[0, 1] = ..., - window: Misc | str = ..., - ) -> None: ... - def window_names(self) -> tuple[str, ...]: ... - def yview_pickplace(self, *what): ... # deprecated - -class _setit: - def __init__(self, var, value, callback: Incomplete | None = None) -> None: ... - def __call__(self, *args) -> None: ... - -# manual page: tk_optionMenu -class OptionMenu(Menubutton): - widgetName: Incomplete - menuname: Incomplete - def __init__( - # differs from other widgets - self, - master: Misc | None, - variable: StringVar, - value: str, - *values: str, - # kwarg only from now on - command: Callable[[StringVar], object] | None = ..., - ) -> None: ... - # configure, config, cget are inherited from Menubutton - # destroy and __getitem__ are overridden, signature does not change - -# This matches tkinter's image classes (PhotoImage and BitmapImage) -# and PIL's tkinter-compatible class (PIL.ImageTk.PhotoImage), -# but not a plain PIL image that isn't tkinter compatible. -# The reason is that PIL has width and height attributes, not methods. -@type_check_only -class _Image(Protocol): - def width(self) -> int: ... - def height(self) -> int: ... - -@type_check_only -class _BitmapImageLike(_Image): ... - -@type_check_only -class _PhotoImageLike(_Image): ... - -class Image(_Image): - name: Incomplete - tk: _tkinter.TkappType - def __init__( - self, imgtype, name: Incomplete | None = None, cnf={}, master: Misc | _tkinter.TkappType | None = None, **kw - ) -> None: ... - def __del__(self) -> None: ... - def __setitem__(self, key, value) -> None: ... - def __getitem__(self, key): ... - configure: Incomplete - config: Incomplete - def type(self): ... - -class PhotoImage(Image, _PhotoImageLike): - # This should be kept in sync with PIL.ImageTK.PhotoImage.__init__() - def __init__( - self, - name: str | None = None, - cnf: dict[str, Any] = {}, - master: Misc | _tkinter.TkappType | None = None, - *, - data: str | bytes = ..., # not same as data argument of put() - format: str = ..., - file: StrOrBytesPath = ..., - gamma: float = ..., - height: int = ..., - palette: int | str = ..., - width: int = ..., - ) -> None: ... - def configure( - self, - *, - data: str | bytes = ..., - format: str = ..., - file: StrOrBytesPath = ..., - gamma: float = ..., - height: int = ..., - palette: int | str = ..., - width: int = ..., - ) -> None: ... - config = configure - def blank(self) -> None: ... - def cget(self, option: str) -> str: ... - def __getitem__(self, key: str) -> str: ... # always string: image['height'] can be '0' - if sys.version_info >= (3, 13): - def copy( - self, - *, - from_coords: Iterable[int] | None = None, - zoom: int | tuple[int, int] | list[int] | None = None, - subsample: int | tuple[int, int] | list[int] | None = None, - ) -> PhotoImage: ... - def subsample(self, x: int, y: Literal[""] = "", *, from_coords: Iterable[int] | None = None) -> PhotoImage: ... - def zoom(self, x: int, y: Literal[""] = "", *, from_coords: Iterable[int] | None = None) -> PhotoImage: ... - def copy_replace( - self, - sourceImage: PhotoImage | str, - *, - from_coords: Iterable[int] | None = None, - to: Iterable[int] | None = None, - shrink: bool = False, - zoom: int | tuple[int, int] | list[int] | None = None, - subsample: int | tuple[int, int] | list[int] | None = None, - # `None` defaults to overlay. - compositingrule: Literal["overlay", "set"] | None = None, - ) -> None: ... - else: - def copy(self) -> PhotoImage: ... - def zoom(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ... - def subsample(self, x: int, y: int | Literal[""] = "") -> PhotoImage: ... - - def get(self, x: int, y: int) -> tuple[int, int, int]: ... - def put( - self, - data: ( - str - | list[str] - | list[list[str]] - | list[tuple[str, ...]] - | tuple[str, ...] - | tuple[list[str], ...] - | tuple[tuple[str, ...], ...] - ), - to: tuple[int, int] | None = None, - ) -> None: ... - if sys.version_info >= (3, 13): - def read( - self, - filename: StrOrBytesPath, - format: str | None = None, - *, - from_coords: Iterable[int] | None = None, - to: Iterable[int] | None = None, - shrink: bool = False, - ) -> None: ... - def write( - self, - filename: StrOrBytesPath, - format: str | None = None, - from_coords: Iterable[int] | None = None, - *, - background: str | None = None, - grayscale: bool = False, - ) -> None: ... - @overload - def data( - self, format: str, *, from_coords: Iterable[int] | None = None, background: str | None = None, grayscale: bool = False - ) -> bytes: ... - @overload - def data( - self, - format: None = None, - *, - from_coords: Iterable[int] | None = None, - background: str | None = None, - grayscale: bool = False, - ) -> tuple[str, ...]: ... - - else: - def write( - self, filename: StrOrBytesPath, format: str | None = None, from_coords: tuple[int, int] | None = None - ) -> None: ... - - def transparency_get(self, x: int, y: int) -> bool: ... - def transparency_set(self, x: int, y: int, boolean: bool) -> None: ... - -class BitmapImage(Image, _BitmapImageLike): - # This should be kept in sync with PIL.ImageTK.BitmapImage.__init__() - def __init__( - self, - name: Incomplete | None = None, - cnf: dict[str, Any] = {}, - master: Misc | _tkinter.TkappType | None = None, - *, - background: str = ..., - data: str | bytes = ..., - file: StrOrBytesPath = ..., - foreground: str = ..., - maskdata: str = ..., - maskfile: StrOrBytesPath = ..., - ) -> None: ... - -def image_names() -> tuple[str, ...]: ... -def image_types() -> tuple[str, ...]: ... - -class Spinbox(Widget, XView): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - activebackground: str = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - buttonbackground: str = ..., - buttoncursor: _Cursor = "", - buttondownrelief: _Relief = ..., - buttonuprelief: _Relief = ..., - # percent substitutions don't seem to be supported, it's similar to Entry's validation stuff - command: Callable[[], object] | str | list[str] | tuple[str, ...] = "", - cursor: _Cursor = "xterm", - disabledbackground: str = ..., - disabledforeground: str = ..., - exportselection: bool = True, - fg: str = ..., - font: _FontDescription = "TkTextFont", - foreground: str = ..., - format: str = "", - from_: float = 0.0, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - increment: float = 1.0, - insertbackground: str = ..., - insertborderwidth: _ScreenUnits = 0, - insertofftime: int = 300, - insertontime: int = 600, - insertwidth: _ScreenUnits = ..., - invalidcommand: _EntryValidateCommand = "", - invcmd: _EntryValidateCommand = "", - justify: Literal["left", "center", "right"] = "left", - name: str = ..., - readonlybackground: str = ..., - relief: _Relief = "sunken", - repeatdelay: int = 400, - repeatinterval: int = 100, - selectbackground: str = ..., - selectborderwidth: _ScreenUnits = ..., - selectforeground: str = ..., - state: Literal["normal", "disabled", "readonly"] = "normal", - takefocus: _TakeFocusValue = "", - textvariable: Variable = ..., - to: float = 0.0, - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = "none", - validatecommand: _EntryValidateCommand = "", - vcmd: _EntryValidateCommand = "", - values: list[str] | tuple[str, ...] = ..., - width: int = 20, - wrap: bool = False, - xscrollcommand: _XYScrollCommand = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - activebackground: str = ..., - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - buttonbackground: str = ..., - buttoncursor: _Cursor = ..., - buttondownrelief: _Relief = ..., - buttonuprelief: _Relief = ..., - command: Callable[[], object] | str | list[str] | tuple[str, ...] = ..., - cursor: _Cursor = ..., - disabledbackground: str = ..., - disabledforeground: str = ..., - exportselection: bool = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - format: str = ..., - from_: float = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - increment: float = ..., - insertbackground: str = ..., - insertborderwidth: _ScreenUnits = ..., - insertofftime: int = ..., - insertontime: int = ..., - insertwidth: _ScreenUnits = ..., - invalidcommand: _EntryValidateCommand = ..., - invcmd: _EntryValidateCommand = ..., - justify: Literal["left", "center", "right"] = ..., - readonlybackground: str = ..., - relief: _Relief = ..., - repeatdelay: int = ..., - repeatinterval: int = ..., - selectbackground: str = ..., - selectborderwidth: _ScreenUnits = ..., - selectforeground: str = ..., - state: Literal["normal", "disabled", "readonly"] = ..., - takefocus: _TakeFocusValue = ..., - textvariable: Variable = ..., - to: float = ..., - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., - validatecommand: _EntryValidateCommand = ..., - vcmd: _EntryValidateCommand = ..., - values: list[str] | tuple[str, ...] = ..., - width: int = ..., - wrap: bool = ..., - xscrollcommand: _XYScrollCommand = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def bbox(self, index) -> tuple[int, int, int, int] | None: ... # type: ignore[override] - def delete(self, first, last: Incomplete | None = None) -> Literal[""]: ... - def get(self) -> str: ... - def icursor(self, index): ... - def identify(self, x: int, y: int) -> Literal["", "buttondown", "buttonup", "entry"]: ... - def index(self, index: str | int) -> int: ... - def insert(self, index: str | int, s: str) -> Literal[""]: ... - # spinbox.invoke("asdf") gives error mentioning .invoke("none"), but it's not documented - def invoke(self, element: Literal["none", "buttonup", "buttondown"]) -> Literal[""]: ... - def scan(self, *args): ... - def scan_mark(self, x): ... - def scan_dragto(self, x): ... - def selection(self, *args) -> tuple[int, ...]: ... - def selection_adjust(self, index): ... - def selection_clear(self): ... # type: ignore[override] - def selection_element(self, element: Incomplete | None = None): ... - def selection_from(self, index: int) -> None: ... - def selection_present(self) -> None: ... - def selection_range(self, start: int, end: int) -> None: ... - def selection_to(self, index: int) -> None: ... - -class LabelFrame(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - background: str = ..., - bd: _ScreenUnits = 2, - bg: str = ..., - border: _ScreenUnits = 2, - borderwidth: _ScreenUnits = 2, - class_: str = "Labelframe", # can't be changed with configure() - colormap: Literal["new", ""] | Misc = "", # can't be changed with configure() - container: bool = False, # undocumented, can't be changed with configure() - cursor: _Cursor = "", - fg: str = ..., - font: _FontDescription = "TkDefaultFont", - foreground: str = ..., - height: _ScreenUnits = 0, - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = 0, - # 'ne' and 'en' are valid labelanchors, but only 'ne' is a valid _Anchor. - labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = "nw", - labelwidget: Misc = ..., - name: str = ..., - padx: _ScreenUnits = 0, - pady: _ScreenUnits = 0, - relief: _Relief = "groove", - takefocus: _TakeFocusValue = 0, - text: float | str = "", - visual: str | tuple[str, int] = "", # can't be changed with configure() - width: _ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = ..., - fg: str = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: _ScreenUnits = ..., - highlightbackground: str = ..., - highlightcolor: str = ..., - highlightthickness: _ScreenUnits = ..., - labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ..., - labelwidget: Misc = ..., - padx: _ScreenUnits = ..., - pady: _ScreenUnits = ..., - relief: _Relief = ..., - takefocus: _TakeFocusValue = ..., - text: float | str = ..., - width: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class PanedWindow(Widget): - def __init__( - self, - master: Misc | None = None, - cnf: dict[str, Any] | None = {}, - *, - background: str = ..., - bd: _ScreenUnits = 1, - bg: str = ..., - border: _ScreenUnits = 1, - borderwidth: _ScreenUnits = 1, - cursor: _Cursor = "", - handlepad: _ScreenUnits = 8, - handlesize: _ScreenUnits = 8, - height: _ScreenUnits = "", - name: str = ..., - opaqueresize: bool = True, - orient: Literal["horizontal", "vertical"] = "horizontal", - proxybackground: str = "", - proxyborderwidth: _ScreenUnits = 2, - proxyrelief: _Relief = "flat", - relief: _Relief = "flat", - sashcursor: _Cursor = "", - sashpad: _ScreenUnits = 0, - sashrelief: _Relief = "flat", - sashwidth: _ScreenUnits = 3, - showhandle: bool = False, - width: _ScreenUnits = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - bd: _ScreenUnits = ..., - bg: str = ..., - border: _ScreenUnits = ..., - borderwidth: _ScreenUnits = ..., - cursor: _Cursor = ..., - handlepad: _ScreenUnits = ..., - handlesize: _ScreenUnits = ..., - height: _ScreenUnits = ..., - opaqueresize: bool = ..., - orient: Literal["horizontal", "vertical"] = ..., - proxybackground: str = ..., - proxyborderwidth: _ScreenUnits = ..., - proxyrelief: _Relief = ..., - relief: _Relief = ..., - sashcursor: _Cursor = ..., - sashpad: _ScreenUnits = ..., - sashrelief: _Relief = ..., - sashwidth: _ScreenUnits = ..., - showhandle: bool = ..., - width: _ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def add(self, child: Widget, **kw) -> None: ... - def remove(self, child) -> None: ... - forget: Incomplete - def identify(self, x: int, y: int): ... - def proxy(self, *args): ... - def proxy_coord(self): ... - def proxy_forget(self): ... - def proxy_place(self, x, y): ... - def sash(self, *args): ... - def sash_coord(self, index): ... - def sash_mark(self, index): ... - def sash_place(self, index, x, y): ... - def panecget(self, child, option): ... - def paneconfigure(self, tagOrId, cnf: Incomplete | None = None, **kw): ... - paneconfig: Incomplete - def panes(self): ... - -def _test() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/colorchooser.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/colorchooser.pyi deleted file mode 100644 index d0d6de8426..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/colorchooser.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from tkinter import Misc -from tkinter.commondialog import Dialog -from typing import ClassVar - -__all__ = ["Chooser", "askcolor"] - -class Chooser(Dialog): - command: ClassVar[str] - -def askcolor( - color: str | bytes | None = None, *, initialcolor: str = ..., parent: Misc = ..., title: str = ... -) -> tuple[None, None] | tuple[tuple[int, int, int], str]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/commondialog.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/commondialog.pyi deleted file mode 100644 index 201ca13ddd..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/commondialog.pyi +++ /dev/null @@ -1,12 +0,0 @@ -from _typeshed import Incomplete -from collections.abc import Mapping -from typing import ClassVar - -__all__ = ["Dialog"] - -class Dialog: - command: ClassVar[str | None] - master: Incomplete | None - options: Mapping[str, Incomplete] - def __init__(self, master: Incomplete | None = None, **options) -> None: ... - def show(self, **options): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/constants.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/constants.pyi deleted file mode 100644 index fbfe8b49b9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/constants.pyi +++ /dev/null @@ -1,80 +0,0 @@ -from typing import Final - -# These are not actually bools. See #4669 -NO: Final[bool] -YES: Final[bool] -TRUE: Final[bool] -FALSE: Final[bool] -ON: Final[bool] -OFF: Final[bool] -N: Final = "n" -S: Final = "s" -W: Final = "w" -E: Final = "e" -NW: Final = "nw" -SW: Final = "sw" -NE: Final = "ne" -SE: Final = "se" -NS: Final = "ns" -EW: Final = "ew" -NSEW: Final = "nsew" -CENTER: Final = "center" -NONE: Final = "none" -X: Final = "x" -Y: Final = "y" -BOTH: Final = "both" -LEFT: Final = "left" -TOP: Final = "top" -RIGHT: Final = "right" -BOTTOM: Final = "bottom" -RAISED: Final = "raised" -SUNKEN: Final = "sunken" -FLAT: Final = "flat" -RIDGE: Final = "ridge" -GROOVE: Final = "groove" -SOLID: Final = "solid" -HORIZONTAL: Final = "horizontal" -VERTICAL: Final = "vertical" -NUMERIC: Final = "numeric" -CHAR: Final = "char" -WORD: Final = "word" -BASELINE: Final = "baseline" -INSIDE: Final = "inside" -OUTSIDE: Final = "outside" -SEL: Final = "sel" -SEL_FIRST: Final = "sel.first" -SEL_LAST: Final = "sel.last" -END: Final = "end" -INSERT: Final = "insert" -CURRENT: Final = "current" -ANCHOR: Final = "anchor" -ALL: Final = "all" -NORMAL: Final = "normal" -DISABLED: Final = "disabled" -ACTIVE: Final = "active" -HIDDEN: Final = "hidden" -CASCADE: Final = "cascade" -CHECKBUTTON: Final = "checkbutton" -COMMAND: Final = "command" -RADIOBUTTON: Final = "radiobutton" -SEPARATOR: Final = "separator" -SINGLE: Final = "single" -BROWSE: Final = "browse" -MULTIPLE: Final = "multiple" -EXTENDED: Final = "extended" -DOTBOX: Final = "dotbox" -UNDERLINE: Final = "underline" -PIESLICE: Final = "pieslice" -CHORD: Final = "chord" -ARC: Final = "arc" -FIRST: Final = "first" -LAST: Final = "last" -BUTT: Final = "butt" -PROJECTING: Final = "projecting" -ROUND: Final = "round" -BEVEL: Final = "bevel" -MITER: Final = "miter" -MOVETO: Final = "moveto" -SCROLL: Final = "scroll" -UNITS: Final = "units" -PAGES: Final = "pages" diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/dialog.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/dialog.pyi deleted file mode 100644 index 3dc0599409..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/dialog.pyi +++ /dev/null @@ -1,14 +0,0 @@ -from _typeshed import Incomplete -from collections.abc import Mapping -from tkinter import Widget -from typing import Any, Final - -__all__ = ["Dialog"] - -DIALOG_ICON: Final = "questhead" - -class Dialog(Widget): - widgetName: str - num: int - def __init__(self, master: Incomplete | None = None, cnf: Mapping[str, Any] = {}, **kw) -> None: ... - def destroy(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/dnd.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/dnd.pyi deleted file mode 100644 index fe2961701c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/dnd.pyi +++ /dev/null @@ -1,18 +0,0 @@ -from tkinter import Event, Misc, Tk, Widget -from typing import ClassVar, Protocol - -__all__ = ["dnd_start", "DndHandler"] - -class _DndSource(Protocol): - def dnd_end(self, target: Widget | None, event: Event[Misc] | None, /) -> None: ... - -class DndHandler: - root: ClassVar[Tk | None] - def __init__(self, source: _DndSource, event: Event[Misc]) -> None: ... - def cancel(self, event: Event[Misc] | None = None) -> None: ... - def finish(self, event: Event[Misc] | None, commit: int = 0) -> None: ... - def on_motion(self, event: Event[Misc]) -> None: ... - def on_release(self, event: Event[Misc]) -> None: ... - def __del__(self) -> None: ... - -def dnd_start(source: _DndSource, event: Event[Misc]) -> DndHandler | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/filedialog.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/filedialog.pyi deleted file mode 100644 index cafcf61e86..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/filedialog.pyi +++ /dev/null @@ -1,149 +0,0 @@ -from _typeshed import Incomplete, StrOrBytesPath -from collections.abc import Iterable -from tkinter import Button, Entry, Frame, Listbox, Misc, Scrollbar, StringVar, Toplevel, commondialog -from typing import IO, ClassVar, Literal - -__all__ = [ - "FileDialog", - "LoadFileDialog", - "SaveFileDialog", - "Open", - "SaveAs", - "Directory", - "askopenfilename", - "asksaveasfilename", - "askopenfilenames", - "askopenfile", - "askopenfiles", - "asksaveasfile", - "askdirectory", -] - -dialogstates: dict[Incomplete, tuple[Incomplete, Incomplete]] - -class FileDialog: - title: str - master: Incomplete - directory: Incomplete | None - top: Toplevel - botframe: Frame - selection: Entry - filter: Entry - midframe: Entry - filesbar: Scrollbar - files: Listbox - dirsbar: Scrollbar - dirs: Listbox - ok_button: Button - filter_button: Button - cancel_button: Button - def __init__( - self, master, title: Incomplete | None = None - ) -> None: ... # title is usually a str or None, but e.g. int doesn't raise en exception either - how: Incomplete | None - def go(self, dir_or_file=".", pattern: str = "*", default: str = "", key: Incomplete | None = None): ... - def quit(self, how: Incomplete | None = None) -> None: ... - def dirs_double_event(self, event) -> None: ... - def dirs_select_event(self, event) -> None: ... - def files_double_event(self, event) -> None: ... - def files_select_event(self, event) -> None: ... - def ok_event(self, event) -> None: ... - def ok_command(self) -> None: ... - def filter_command(self, event: Incomplete | None = None) -> None: ... - def get_filter(self): ... - def get_selection(self): ... - def cancel_command(self, event: Incomplete | None = None) -> None: ... - def set_filter(self, dir, pat) -> None: ... - def set_selection(self, file) -> None: ... - -class LoadFileDialog(FileDialog): - title: str - def ok_command(self) -> None: ... - -class SaveFileDialog(FileDialog): - title: str - def ok_command(self) -> None: ... - -class _Dialog(commondialog.Dialog): ... - -class Open(_Dialog): - command: ClassVar[str] - -class SaveAs(_Dialog): - command: ClassVar[str] - -class Directory(commondialog.Dialog): - command: ClassVar[str] - -# TODO: command kwarg available on macos -def asksaveasfilename( - *, - confirmoverwrite: bool | None = True, - defaultextension: str | None = "", - filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., - initialdir: StrOrBytesPath | None = ..., - initialfile: StrOrBytesPath | None = ..., - parent: Misc | None = ..., - title: str | None = ..., - typevariable: StringVar | str | None = ..., -) -> str: ... # can be empty string -def askopenfilename( - *, - defaultextension: str | None = "", - filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., - initialdir: StrOrBytesPath | None = ..., - initialfile: StrOrBytesPath | None = ..., - parent: Misc | None = ..., - title: str | None = ..., - typevariable: StringVar | str | None = ..., -) -> str: ... # can be empty string -def askopenfilenames( - *, - defaultextension: str | None = "", - filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., - initialdir: StrOrBytesPath | None = ..., - initialfile: StrOrBytesPath | None = ..., - parent: Misc | None = ..., - title: str | None = ..., - typevariable: StringVar | str | None = ..., -) -> Literal[""] | tuple[str, ...]: ... -def askdirectory( - *, initialdir: StrOrBytesPath | None = ..., mustexist: bool | None = False, parent: Misc | None = ..., title: str | None = ... -) -> str: ... # can be empty string - -# TODO: If someone actually uses these, overload to have the actual return type of open(..., mode) -def asksaveasfile( - mode: str = "w", - *, - confirmoverwrite: bool | None = True, - defaultextension: str | None = "", - filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., - initialdir: StrOrBytesPath | None = ..., - initialfile: StrOrBytesPath | None = ..., - parent: Misc | None = ..., - title: str | None = ..., - typevariable: StringVar | str | None = ..., -) -> IO[Incomplete] | None: ... -def askopenfile( - mode: str = "r", - *, - defaultextension: str | None = "", - filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., - initialdir: StrOrBytesPath | None = ..., - initialfile: StrOrBytesPath | None = ..., - parent: Misc | None = ..., - title: str | None = ..., - typevariable: StringVar | str | None = ..., -) -> IO[Incomplete] | None: ... -def askopenfiles( - mode: str = "r", - *, - defaultextension: str | None = "", - filetypes: Iterable[tuple[str, str | list[str] | tuple[str, ...]]] | None = ..., - initialdir: StrOrBytesPath | None = ..., - initialfile: StrOrBytesPath | None = ..., - parent: Misc | None = ..., - title: str | None = ..., - typevariable: StringVar | str | None = ..., -) -> tuple[IO[Incomplete], ...]: ... # can be empty tuple -def test() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/font.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/font.pyi deleted file mode 100644 index cab97490be..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/font.pyi +++ /dev/null @@ -1,118 +0,0 @@ -import _tkinter -import itertools -import sys -import tkinter -from typing import Any, ClassVar, Final, Literal, TypedDict, overload -from typing_extensions import TypeAlias, Unpack - -__all__ = ["NORMAL", "ROMAN", "BOLD", "ITALIC", "nametofont", "Font", "families", "names"] - -NORMAL: Final = "normal" -ROMAN: Final = "roman" -BOLD: Final = "bold" -ITALIC: Final = "italic" - -_FontDescription: TypeAlias = ( - str # "Helvetica 12" - | Font # A font object constructed in Python - | list[Any] # ["Helvetica", 12, BOLD] - | tuple[str] # ("Liberation Sans",) needs wrapping in tuple/list to handle spaces - # ("Liberation Sans", 12) or ("Liberation Sans", 12, "bold", "italic", "underline") - | tuple[str, int, Unpack[tuple[str, ...]]] # Any number of trailing options is permitted - | tuple[str, int, list[str] | tuple[str, ...]] # Options can also be passed as list/tuple - | _tkinter.Tcl_Obj # A font object constructed in Tcl -) - -class _FontDict(TypedDict): - family: str - size: int - weight: Literal["normal", "bold"] - slant: Literal["roman", "italic"] - underline: bool - overstrike: bool - -class _MetricsDict(TypedDict): - ascent: int - descent: int - linespace: int - fixed: bool - -class Font: - name: str - delete_font: bool - counter: ClassVar[itertools.count[int]] # undocumented - def __init__( - self, - # In tkinter, 'root' refers to tkinter.Tk by convention, but the code - # actually works with any tkinter widget so we use tkinter.Misc. - root: tkinter.Misc | None = None, - font: _FontDescription | None = None, - name: str | None = None, - exists: bool = False, - *, - family: str = ..., - size: int = ..., - weight: Literal["normal", "bold"] = ..., - slant: Literal["roman", "italic"] = ..., - underline: bool = ..., - overstrike: bool = ..., - ) -> None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __setitem__(self, key: str, value: Any) -> None: ... - @overload - def cget(self, option: Literal["family"]) -> str: ... - @overload - def cget(self, option: Literal["size"]) -> int: ... - @overload - def cget(self, option: Literal["weight"]) -> Literal["normal", "bold"]: ... - @overload - def cget(self, option: Literal["slant"]) -> Literal["roman", "italic"]: ... - @overload - def cget(self, option: Literal["underline", "overstrike"]) -> bool: ... - @overload - def cget(self, option: str) -> Any: ... - __getitem__ = cget - @overload - def actual(self, option: Literal["family"], displayof: tkinter.Misc | None = None) -> str: ... - @overload - def actual(self, option: Literal["size"], displayof: tkinter.Misc | None = None) -> int: ... - @overload - def actual(self, option: Literal["weight"], displayof: tkinter.Misc | None = None) -> Literal["normal", "bold"]: ... - @overload - def actual(self, option: Literal["slant"], displayof: tkinter.Misc | None = None) -> Literal["roman", "italic"]: ... - @overload - def actual(self, option: Literal["underline", "overstrike"], displayof: tkinter.Misc | None = None) -> bool: ... - @overload - def actual(self, option: None, displayof: tkinter.Misc | None = None) -> _FontDict: ... - @overload - def actual(self, *, displayof: tkinter.Misc | None = None) -> _FontDict: ... - def config( - self, - *, - family: str = ..., - size: int = ..., - weight: Literal["normal", "bold"] = ..., - slant: Literal["roman", "italic"] = ..., - underline: bool = ..., - overstrike: bool = ..., - ) -> _FontDict | None: ... - configure = config - def copy(self) -> Font: ... - @overload - def metrics(self, option: Literal["ascent", "descent", "linespace"], /, *, displayof: tkinter.Misc | None = ...) -> int: ... - @overload - def metrics(self, option: Literal["fixed"], /, *, displayof: tkinter.Misc | None = ...) -> bool: ... - @overload - def metrics(self, *, displayof: tkinter.Misc | None = ...) -> _MetricsDict: ... - def measure(self, text: str, displayof: tkinter.Misc | None = None) -> int: ... - def __eq__(self, other: object) -> bool: ... - def __del__(self) -> None: ... - -def families(root: tkinter.Misc | None = None, displayof: tkinter.Misc | None = None) -> tuple[str, ...]: ... -def names(root: tkinter.Misc | None = None) -> tuple[str, ...]: ... - -if sys.version_info >= (3, 10): - def nametofont(name: str, root: tkinter.Misc | None = None) -> Font: ... - -else: - def nametofont(name: str) -> Font: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/messagebox.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/messagebox.pyi deleted file mode 100644 index 902fab62ac..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/messagebox.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from tkinter.commondialog import Dialog -from typing import ClassVar, Final - -__all__ = ["showinfo", "showwarning", "showerror", "askquestion", "askokcancel", "askyesno", "askyesnocancel", "askretrycancel"] - -ERROR: Final = "error" -INFO: Final = "info" -QUESTION: Final = "question" -WARNING: Final = "warning" -ABORTRETRYIGNORE: Final = "abortretryignore" -OK: Final = "ok" -OKCANCEL: Final = "okcancel" -RETRYCANCEL: Final = "retrycancel" -YESNO: Final = "yesno" -YESNOCANCEL: Final = "yesnocancel" -ABORT: Final = "abort" -RETRY: Final = "retry" -IGNORE: Final = "ignore" -CANCEL: Final = "cancel" -YES: Final = "yes" -NO: Final = "no" - -class Message(Dialog): - command: ClassVar[str] - -def showinfo(title: str | None = None, message: str | None = None, **options) -> str: ... -def showwarning(title: str | None = None, message: str | None = None, **options) -> str: ... -def showerror(title: str | None = None, message: str | None = None, **options) -> str: ... -def askquestion(title: str | None = None, message: str | None = None, **options) -> str: ... -def askokcancel(title: str | None = None, message: str | None = None, **options) -> bool: ... -def askyesno(title: str | None = None, message: str | None = None, **options) -> bool: ... -def askyesnocancel(title: str | None = None, message: str | None = None, **options) -> bool | None: ... -def askretrycancel(title: str | None = None, message: str | None = None, **options) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/scrolledtext.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/scrolledtext.pyi deleted file mode 100644 index 6f1abc7144..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/scrolledtext.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from tkinter import Frame, Misc, Scrollbar, Text - -__all__ = ["ScrolledText"] - -# The methods from Pack, Place, and Grid are dynamically added over the parent's impls -class ScrolledText(Text): - frame: Frame - vbar: Scrollbar - def __init__(self, master: Misc | None = None, **kwargs) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/simpledialog.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/simpledialog.pyi deleted file mode 100644 index 45dce21a6b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/simpledialog.pyi +++ /dev/null @@ -1,54 +0,0 @@ -from tkinter import Event, Frame, Misc, Toplevel - -class Dialog(Toplevel): - def __init__(self, parent: Misc | None, title: str | None = None) -> None: ... - def body(self, master: Frame) -> Misc | None: ... - def buttonbox(self) -> None: ... - def ok(self, event: Event[Misc] | None = None) -> None: ... - def cancel(self, event: Event[Misc] | None = None) -> None: ... - def validate(self) -> bool: ... - def apply(self) -> None: ... - -class SimpleDialog: - def __init__( - self, - master: Misc | None, - text: str = "", - buttons: list[str] = [], - default: int | None = None, - cancel: int | None = None, - title: str | None = None, - class_: str | None = None, - ) -> None: ... - def go(self) -> int | None: ... - def return_event(self, event: Event[Misc]) -> None: ... - def wm_delete_window(self) -> None: ... - def done(self, num: int) -> None: ... - -def askfloat( - title: str | None, - prompt: str, - *, - initialvalue: float | None = ..., - minvalue: float | None = ..., - maxvalue: float | None = ..., - parent: Misc | None = ..., -) -> float | None: ... -def askinteger( - title: str | None, - prompt: str, - *, - initialvalue: int | None = ..., - minvalue: int | None = ..., - maxvalue: int | None = ..., - parent: Misc | None = ..., -) -> int | None: ... -def askstring( - title: str | None, - prompt: str, - *, - initialvalue: str | None = ..., - show: str | None = ..., - # minvalue/maxvalue is accepted but not useful. - parent: Misc | None = ..., -) -> str | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/tix.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/tix.pyi deleted file mode 100644 index 7891364fa0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/tix.pyi +++ /dev/null @@ -1,299 +0,0 @@ -import tkinter -from _typeshed import Incomplete -from typing import Any, Final - -WINDOW: Final = "window" -TEXT: Final = "text" -STATUS: Final = "status" -IMMEDIATE: Final = "immediate" -IMAGE: Final = "image" -IMAGETEXT: Final = "imagetext" -BALLOON: Final = "balloon" -AUTO: Final = "auto" -ACROSSTOP: Final = "acrosstop" - -ASCII: Final = "ascii" -CELL: Final = "cell" -COLUMN: Final = "column" -DECREASING: Final = "decreasing" -INCREASING: Final = "increasing" -INTEGER: Final = "integer" -MAIN: Final = "main" -MAX: Final = "max" -REAL: Final = "real" -ROW: Final = "row" -S_REGION: Final = "s-region" -X_REGION: Final = "x-region" -Y_REGION: Final = "y-region" - -# These should be kept in sync with _tkinter constants, except TCL_ALL_EVENTS which doesn't match ALL_EVENTS -TCL_DONT_WAIT: Final = 2 -TCL_WINDOW_EVENTS: Final = 4 -TCL_FILE_EVENTS: Final = 8 -TCL_TIMER_EVENTS: Final = 16 -TCL_IDLE_EVENTS: Final = 32 -TCL_ALL_EVENTS: Final = 0 - -class tixCommand: - def tix_addbitmapdir(self, directory: str) -> None: ... - def tix_cget(self, option: str) -> Any: ... - def tix_configure(self, cnf: dict[str, Any] | None = None, **kw: Any) -> Any: ... - def tix_filedialog(self, dlgclass: str | None = None) -> str: ... - def tix_getbitmap(self, name: str) -> str: ... - def tix_getimage(self, name: str) -> str: ... - def tix_option_get(self, name: str) -> Any: ... - def tix_resetoptions(self, newScheme: str, newFontSet: str, newScmPrio: str | None = None) -> None: ... - -class Tk(tkinter.Tk, tixCommand): - def __init__(self, screenName: str | None = None, baseName: str | None = None, className: str = "Tix") -> None: ... - -class TixWidget(tkinter.Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - widgetName: str | None = None, - static_options: list[str] | None = None, - cnf: dict[str, Any] = {}, - kw: dict[str, Any] = {}, - ) -> None: ... - def __getattr__(self, name: str): ... - def set_silent(self, value: str) -> None: ... - def subwidget(self, name: str) -> tkinter.Widget: ... - def subwidgets_all(self) -> list[tkinter.Widget]: ... - def config_all(self, option: Any, value: Any) -> None: ... - def image_create(self, imgtype: str, cnf: dict[str, Any] = {}, master: tkinter.Widget | None = None, **kw) -> None: ... - def image_delete(self, imgname: str) -> None: ... - -class TixSubWidget(TixWidget): - def __init__(self, master: tkinter.Widget, name: str, destroy_physically: int = 1, check_intermediate: int = 1) -> None: ... - -class DisplayStyle: - def __init__(self, itemtype: str, cnf: dict[str, Any] = {}, *, master: tkinter.Widget | None = None, **kw) -> None: ... - def __getitem__(self, key: str): ... - def __setitem__(self, key: str, value: Any) -> None: ... - def delete(self) -> None: ... - def config(self, cnf: dict[str, Any] = {}, **kw): ... - -class Balloon(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def bind_widget(self, widget: tkinter.Widget, cnf: dict[str, Any] = {}, **kw) -> None: ... - def unbind_widget(self, widget: tkinter.Widget) -> None: ... - -class ButtonBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def add(self, name: str, cnf: dict[str, Any] = {}, **kw) -> tkinter.Widget: ... - def invoke(self, name: str) -> None: ... - -class ComboBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def add_history(self, str: str) -> None: ... - def append_history(self, str: str) -> None: ... - def insert(self, index: int, str: str) -> None: ... - def pick(self, index: int) -> None: ... - -class Control(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def decrement(self) -> None: ... - def increment(self) -> None: ... - def invoke(self) -> None: ... - -class LabelEntry(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - -class LabelFrame(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - -class Meter(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - -class OptionMenu(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def add_command(self, name: str, cnf: dict[str, Any] = {}, **kw) -> None: ... - def add_separator(self, name: str, cnf: dict[str, Any] = {}, **kw) -> None: ... - def delete(self, name: str) -> None: ... - def disable(self, name: str) -> None: ... - def enable(self, name: str) -> None: ... - -class PopupMenu(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def bind_widget(self, widget: tkinter.Widget) -> None: ... - def unbind_widget(self, widget: tkinter.Widget) -> None: ... - def post_widget(self, widget: tkinter.Widget, x: int, y: int) -> None: ... - -class Select(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def add(self, name: str, cnf: dict[str, Any] = {}, **kw) -> tkinter.Widget: ... - def invoke(self, name: str) -> None: ... - -class StdButtonBox(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def invoke(self, name: str) -> None: ... - -class DirList(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def chdir(self, dir: str) -> None: ... - -class DirTree(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def chdir(self, dir: str) -> None: ... - -class DirSelectDialog(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def popup(self) -> None: ... - def popdown(self) -> None: ... - -class DirSelectBox(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - -class ExFileSelectBox(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def filter(self) -> None: ... - def invoke(self) -> None: ... - -class FileSelectBox(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def apply_filter(self) -> None: ... - def invoke(self) -> None: ... - -class FileEntry(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def invoke(self) -> None: ... - def file_dialog(self) -> None: ... - -class HList(TixWidget, tkinter.XView, tkinter.YView): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def add(self, entry: str, cnf: dict[str, Any] = {}, **kw) -> tkinter.Widget: ... - def add_child(self, parent: str | None = None, cnf: dict[str, Any] = {}, **kw) -> tkinter.Widget: ... - def anchor_set(self, entry: str) -> None: ... - def anchor_clear(self) -> None: ... - # FIXME: Overload, certain combos return, others don't - def column_width(self, col: int = 0, width: int | None = None, chars: int | None = None) -> int | None: ... - def delete_all(self) -> None: ... - def delete_entry(self, entry: str) -> None: ... - def delete_offsprings(self, entry: str) -> None: ... - def delete_siblings(self, entry: str) -> None: ... - def dragsite_set(self, index: int) -> None: ... - def dragsite_clear(self) -> None: ... - def dropsite_set(self, index: int) -> None: ... - def dropsite_clear(self) -> None: ... - def header_create(self, col: int, cnf: dict[str, Any] = {}, **kw) -> None: ... - def header_configure(self, col: int, cnf: dict[str, Any] = {}, **kw) -> Incomplete | None: ... - def header_cget(self, col: int, opt): ... - def header_exists(self, col: int) -> bool: ... - def header_exist(self, col: int) -> bool: ... - def header_delete(self, col: int) -> None: ... - def header_size(self, col: int) -> int: ... - def hide_entry(self, entry: str) -> None: ... - def indicator_create(self, entry: str, cnf: dict[str, Any] = {}, **kw) -> None: ... - def indicator_configure(self, entry: str, cnf: dict[str, Any] = {}, **kw) -> Incomplete | None: ... - def indicator_cget(self, entry: str, opt): ... - def indicator_exists(self, entry: str) -> bool: ... - def indicator_delete(self, entry: str) -> None: ... - def indicator_size(self, entry: str) -> int: ... - def info_anchor(self) -> str: ... - def info_bbox(self, entry: str) -> tuple[int, int, int, int]: ... - def info_children(self, entry: str | None = None) -> tuple[str, ...]: ... - def info_data(self, entry: str) -> Any: ... - def info_dragsite(self) -> str: ... - def info_dropsite(self) -> str: ... - def info_exists(self, entry: str) -> bool: ... - def info_hidden(self, entry: str) -> bool: ... - def info_next(self, entry: str) -> str: ... - def info_parent(self, entry: str) -> str: ... - def info_prev(self, entry: str) -> str: ... - def info_selection(self) -> tuple[str, ...]: ... - def item_cget(self, entry: str, col: int, opt): ... - def item_configure(self, entry: str, col: int, cnf: dict[str, Any] = {}, **kw) -> Incomplete | None: ... - def item_create(self, entry: str, col: int, cnf: dict[str, Any] = {}, **kw) -> None: ... - def item_exists(self, entry: str, col: int) -> bool: ... - def item_delete(self, entry: str, col: int) -> None: ... - def entrycget(self, entry: str, opt): ... - def entryconfigure(self, entry: str, cnf: dict[str, Any] = {}, **kw) -> Incomplete | None: ... - def nearest(self, y: int) -> str: ... - def see(self, entry: str) -> None: ... - def selection_clear(self, cnf: dict[str, Any] = {}, **kw) -> None: ... - def selection_includes(self, entry: str) -> bool: ... - def selection_set(self, first: str, last: str | None = None) -> None: ... - def show_entry(self, entry: str) -> None: ... - -class CheckList(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def autosetmode(self) -> None: ... - def close(self, entrypath: str) -> None: ... - def getmode(self, entrypath: str) -> str: ... - def open(self, entrypath: str) -> None: ... - def getselection(self, mode: str = "on") -> tuple[str, ...]: ... - def getstatus(self, entrypath: str) -> str: ... - def setstatus(self, entrypath: str, mode: str = "on") -> None: ... - -class Tree(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def autosetmode(self) -> None: ... - def close(self, entrypath: str) -> None: ... - def getmode(self, entrypath: str) -> str: ... - def open(self, entrypath: str) -> None: ... - def setmode(self, entrypath: str, mode: str = "none") -> None: ... - -class TList(TixWidget, tkinter.XView, tkinter.YView): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def active_set(self, index: int) -> None: ... - def active_clear(self) -> None: ... - def anchor_set(self, index: int) -> None: ... - def anchor_clear(self) -> None: ... - def delete(self, from_: int, to: int | None = None) -> None: ... - def dragsite_set(self, index: int) -> None: ... - def dragsite_clear(self) -> None: ... - def dropsite_set(self, index: int) -> None: ... - def dropsite_clear(self) -> None: ... - def insert(self, index: int, cnf: dict[str, Any] = {}, **kw) -> None: ... - def info_active(self) -> int: ... - def info_anchor(self) -> int: ... - def info_down(self, index: int) -> int: ... - def info_left(self, index: int) -> int: ... - def info_right(self, index: int) -> int: ... - def info_selection(self) -> tuple[int, ...]: ... - def info_size(self) -> int: ... - def info_up(self, index: int) -> int: ... - def nearest(self, x: int, y: int) -> int: ... - def see(self, index: int) -> None: ... - def selection_clear(self, cnf: dict[str, Any] = {}, **kw) -> None: ... - def selection_includes(self, index: int) -> bool: ... - def selection_set(self, first: int, last: int | None = None) -> None: ... - -class PanedWindow(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def add(self, name: str, cnf: dict[str, Any] = {}, **kw) -> None: ... - def delete(self, name: str) -> None: ... - def forget(self, name: str) -> None: ... # type: ignore[override] - def panecget(self, entry: str, opt): ... - def paneconfigure(self, entry: str, cnf: dict[str, Any] = {}, **kw) -> Incomplete | None: ... - def panes(self) -> list[tkinter.Widget]: ... - -class ListNoteBook(TixWidget): - def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def add(self, name: str, cnf: dict[str, Any] = {}, **kw) -> None: ... - def page(self, name: str) -> tkinter.Widget: ... - def pages(self) -> list[tkinter.Widget]: ... - def raise_page(self, name: str) -> None: ... - -class NoteBook(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - def add(self, name: str, cnf: dict[str, Any] = {}, **kw) -> None: ... - def delete(self, name: str) -> None: ... - def page(self, name: str) -> tkinter.Widget: ... - def pages(self) -> list[tkinter.Widget]: ... - def raise_page(self, name: str) -> None: ... - def raised(self) -> bool: ... - -class InputOnly(TixWidget): - def __init__(self, master: tkinter.Widget | None = None, cnf: dict[str, Any] = {}, **kw) -> None: ... - -class Form: - def __setitem__(self, key: str, value: Any) -> None: ... - def config(self, cnf: dict[str, Any] = {}, **kw) -> None: ... - def form(self, cnf: dict[str, Any] = {}, **kw) -> None: ... - def check(self) -> bool: ... - def forget(self) -> None: ... - def grid(self, xsize: int = 0, ysize: int = 0) -> tuple[int, int] | None: ... - def info(self, option: str | None = None): ... - def slaves(self) -> list[tkinter.Widget]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/ttk.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/ttk.pyi deleted file mode 100644 index 5328e461eb..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tkinter/ttk.pyi +++ /dev/null @@ -1,1207 +0,0 @@ -import _tkinter -import tkinter -from _typeshed import Incomplete, MaybeNone -from collections.abc import Callable -from tkinter.font import _FontDescription -from typing import Any, Literal, TypedDict, overload -from typing_extensions import TypeAlias - -__all__ = [ - "Button", - "Checkbutton", - "Combobox", - "Entry", - "Frame", - "Label", - "Labelframe", - "LabelFrame", - "Menubutton", - "Notebook", - "Panedwindow", - "PanedWindow", - "Progressbar", - "Radiobutton", - "Scale", - "Scrollbar", - "Separator", - "Sizegrip", - "Style", - "Treeview", - "LabeledScale", - "OptionMenu", - "tclobjs_to_py", - "setup_master", - "Spinbox", -] - -def tclobjs_to_py(adict: dict[Any, Any]) -> dict[Any, Any]: ... -def setup_master(master: Incomplete | None = None): ... - -_Padding: TypeAlias = ( - tkinter._ScreenUnits - | tuple[tkinter._ScreenUnits] - | tuple[tkinter._ScreenUnits, tkinter._ScreenUnits] - | tuple[tkinter._ScreenUnits, tkinter._ScreenUnits, tkinter._ScreenUnits] - | tuple[tkinter._ScreenUnits, tkinter._ScreenUnits, tkinter._ScreenUnits, tkinter._ScreenUnits] -) - -# from ttk_widget (aka ttk::widget) manual page, differs from tkinter._Compound -_TtkCompound: TypeAlias = Literal["", "text", "image", tkinter._Compound] - -class Style: - master: Incomplete - tk: _tkinter.TkappType - def __init__(self, master: tkinter.Misc | None = None) -> None: ... - def configure(self, style, query_opt: Incomplete | None = None, **kw): ... - def map(self, style, query_opt: Incomplete | None = None, **kw): ... - def lookup(self, style, option, state: Incomplete | None = None, default: Incomplete | None = None): ... - def layout(self, style, layoutspec: Incomplete | None = None): ... - def element_create(self, elementname, etype, *args, **kw) -> None: ... - def element_names(self): ... - def element_options(self, elementname): ... - def theme_create(self, themename, parent: Incomplete | None = None, settings: Incomplete | None = None) -> None: ... - def theme_settings(self, themename, settings) -> None: ... - def theme_names(self) -> tuple[str, ...]: ... - @overload - def theme_use(self, themename: str) -> None: ... - @overload - def theme_use(self, themename: None = None) -> str: ... - -class Widget(tkinter.Widget): - def __init__(self, master: tkinter.Misc | None, widgetname, kw: Incomplete | None = None) -> None: ... - def identify(self, x: int, y: int) -> str: ... - def instate(self, statespec, callback: Incomplete | None = None, *args, **kw): ... - def state(self, statespec: Incomplete | None = None): ... - -class Button(Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - command: tkinter._ButtonCommand = "", - compound: _TtkCompound = "", - cursor: tkinter._Cursor = "", - default: Literal["normal", "active", "disabled"] = "normal", - image: tkinter._ImageSpec = "", - name: str = ..., - padding=..., # undocumented - state: str = "normal", - style: str = "", - takefocus: tkinter._TakeFocusValue = ..., - text: float | str = "", - textvariable: tkinter.Variable = ..., - underline: int = -1, - width: int | Literal[""] = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - command: tkinter._ButtonCommand = ..., - compound: _TtkCompound = ..., - cursor: tkinter._Cursor = ..., - default: Literal["normal", "active", "disabled"] = ..., - image: tkinter._ImageSpec = ..., - padding=..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - text: float | str = ..., - textvariable: tkinter.Variable = ..., - underline: int = ..., - width: int | Literal[""] = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def invoke(self) -> Any: ... - -class Checkbutton(Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - command: tkinter._ButtonCommand = "", - compound: _TtkCompound = "", - cursor: tkinter._Cursor = "", - image: tkinter._ImageSpec = "", - name: str = ..., - offvalue: Any = 0, - onvalue: Any = 1, - padding=..., # undocumented - state: str = "normal", - style: str = "", - takefocus: tkinter._TakeFocusValue = ..., - text: float | str = "", - textvariable: tkinter.Variable = ..., - underline: int = -1, - # Seems like variable can be empty string, but actually setting it to - # empty string segfaults before Tcl 8.6.9. Search for ttk::checkbutton - # here: https://sourceforge.net/projects/tcl/files/Tcl/8.6.9/tcltk-release-notes-8.6.9.txt/view - variable: tkinter.Variable = ..., - width: int | Literal[""] = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - command: tkinter._ButtonCommand = ..., - compound: _TtkCompound = ..., - cursor: tkinter._Cursor = ..., - image: tkinter._ImageSpec = ..., - offvalue: Any = ..., - onvalue: Any = ..., - padding=..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - text: float | str = ..., - textvariable: tkinter.Variable = ..., - underline: int = ..., - variable: tkinter.Variable = ..., - width: int | Literal[""] = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def invoke(self) -> Any: ... - -class Entry(Widget, tkinter.Entry): - def __init__( - self, - master: tkinter.Misc | None = None, - widget: str | None = None, - *, - background: str = ..., # undocumented - class_: str = "", - cursor: tkinter._Cursor = ..., - exportselection: bool = True, - font: _FontDescription = "TkTextFont", - foreground: str = "", - invalidcommand: tkinter._EntryValidateCommand = "", - justify: Literal["left", "center", "right"] = "left", - name: str = ..., - show: str = "", - state: str = "normal", - style: str = "", - takefocus: tkinter._TakeFocusValue = ..., - textvariable: tkinter.Variable = ..., - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = "none", - validatecommand: tkinter._EntryValidateCommand = "", - width: int = 20, - xscrollcommand: tkinter._XYScrollCommand = "", - ) -> None: ... - @overload # type: ignore[override] - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - cursor: tkinter._Cursor = ..., - exportselection: bool = ..., - font: _FontDescription = ..., - foreground: str = ..., - invalidcommand: tkinter._EntryValidateCommand = ..., - justify: Literal["left", "center", "right"] = ..., - show: str = ..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - textvariable: tkinter.Variable = ..., - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., - validatecommand: tkinter._EntryValidateCommand = ..., - width: int = ..., - xscrollcommand: tkinter._XYScrollCommand = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - # config must be copy/pasted, otherwise ttk.Entry().config is mypy error (don't know why) - @overload # type: ignore[override] - def config( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - cursor: tkinter._Cursor = ..., - exportselection: bool = ..., - font: _FontDescription = ..., - foreground: str = ..., - invalidcommand: tkinter._EntryValidateCommand = ..., - justify: Literal["left", "center", "right"] = ..., - show: str = ..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - textvariable: tkinter.Variable = ..., - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., - validatecommand: tkinter._EntryValidateCommand = ..., - width: int = ..., - xscrollcommand: tkinter._XYScrollCommand = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - def bbox(self, index) -> tuple[int, int, int, int]: ... # type: ignore[override] - def identify(self, x: int, y: int) -> str: ... - def validate(self): ... - -class Combobox(Entry): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - background: str = ..., # undocumented - class_: str = "", - cursor: tkinter._Cursor = "", - exportselection: bool = True, - font: _FontDescription = ..., # undocumented - foreground: str = ..., # undocumented - height: int = 10, - invalidcommand: tkinter._EntryValidateCommand = ..., # undocumented - justify: Literal["left", "center", "right"] = "left", - name: str = ..., - postcommand: Callable[[], object] | str = "", - show=..., # undocumented - state: str = "normal", - style: str = "", - takefocus: tkinter._TakeFocusValue = ..., - textvariable: tkinter.Variable = ..., - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., # undocumented - validatecommand: tkinter._EntryValidateCommand = ..., # undocumented - values: list[str] | tuple[str, ...] = ..., - width: int = 20, - xscrollcommand: tkinter._XYScrollCommand = ..., # undocumented - ) -> None: ... - @overload # type: ignore[override] - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - cursor: tkinter._Cursor = ..., - exportselection: bool = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: int = ..., - invalidcommand: tkinter._EntryValidateCommand = ..., - justify: Literal["left", "center", "right"] = ..., - postcommand: Callable[[], object] | str = ..., - show=..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - textvariable: tkinter.Variable = ..., - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., - validatecommand: tkinter._EntryValidateCommand = ..., - values: list[str] | tuple[str, ...] = ..., - width: int = ..., - xscrollcommand: tkinter._XYScrollCommand = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - # config must be copy/pasted, otherwise ttk.Combobox().config is mypy error (don't know why) - @overload # type: ignore[override] - def config( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - cursor: tkinter._Cursor = ..., - exportselection: bool = ..., - font: _FontDescription = ..., - foreground: str = ..., - height: int = ..., - invalidcommand: tkinter._EntryValidateCommand = ..., - justify: Literal["left", "center", "right"] = ..., - postcommand: Callable[[], object] | str = ..., - show=..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - textvariable: tkinter.Variable = ..., - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., - validatecommand: tkinter._EntryValidateCommand = ..., - values: list[str] | tuple[str, ...] = ..., - width: int = ..., - xscrollcommand: tkinter._XYScrollCommand = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - def current(self, newindex: int | None = None) -> int: ... - def set(self, value: Any) -> None: ... - -class Frame(Widget): - # This should be kept in sync with tkinter.ttk.LabeledScale.__init__() - # (all of these keyword-only arguments are also present there) - def __init__( - self, - master: tkinter.Misc | None = None, - *, - border: tkinter._ScreenUnits = ..., - borderwidth: tkinter._ScreenUnits = ..., - class_: str = "", - cursor: tkinter._Cursor = "", - height: tkinter._ScreenUnits = 0, - name: str = ..., - padding: _Padding = ..., - relief: tkinter._Relief = ..., - style: str = "", - takefocus: tkinter._TakeFocusValue = "", - width: tkinter._ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - border: tkinter._ScreenUnits = ..., - borderwidth: tkinter._ScreenUnits = ..., - cursor: tkinter._Cursor = ..., - height: tkinter._ScreenUnits = ..., - padding: _Padding = ..., - relief: tkinter._Relief = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - width: tkinter._ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class Label(Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - anchor: tkinter._Anchor = ..., - background: str = "", - border: tkinter._ScreenUnits = ..., # alias for borderwidth - borderwidth: tkinter._ScreenUnits = ..., # undocumented - class_: str = "", - compound: _TtkCompound = "", - cursor: tkinter._Cursor = "", - font: _FontDescription = ..., - foreground: str = "", - image: tkinter._ImageSpec = "", - justify: Literal["left", "center", "right"] = ..., - name: str = ..., - padding: _Padding = ..., - relief: tkinter._Relief = ..., - state: str = "normal", - style: str = "", - takefocus: tkinter._TakeFocusValue = "", - text: float | str = "", - textvariable: tkinter.Variable = ..., - underline: int = -1, - width: int | Literal[""] = "", - wraplength: tkinter._ScreenUnits = ..., - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - anchor: tkinter._Anchor = ..., - background: str = ..., - border: tkinter._ScreenUnits = ..., - borderwidth: tkinter._ScreenUnits = ..., - compound: _TtkCompound = ..., - cursor: tkinter._Cursor = ..., - font: _FontDescription = ..., - foreground: str = ..., - image: tkinter._ImageSpec = ..., - justify: Literal["left", "center", "right"] = ..., - padding: _Padding = ..., - relief: tkinter._Relief = ..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - text: float | str = ..., - textvariable: tkinter.Variable = ..., - underline: int = ..., - width: int | Literal[""] = ..., - wraplength: tkinter._ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class Labelframe(Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - border: tkinter._ScreenUnits = ..., - borderwidth: tkinter._ScreenUnits = ..., # undocumented - class_: str = "", - cursor: tkinter._Cursor = "", - height: tkinter._ScreenUnits = 0, - labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ..., - labelwidget: tkinter.Misc = ..., - name: str = ..., - padding: _Padding = ..., - relief: tkinter._Relief = ..., # undocumented - style: str = "", - takefocus: tkinter._TakeFocusValue = "", - text: float | str = "", - underline: int = -1, - width: tkinter._ScreenUnits = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - border: tkinter._ScreenUnits = ..., - borderwidth: tkinter._ScreenUnits = ..., - cursor: tkinter._Cursor = ..., - height: tkinter._ScreenUnits = ..., - labelanchor: Literal["nw", "n", "ne", "en", "e", "es", "se", "s", "sw", "ws", "w", "wn"] = ..., - labelwidget: tkinter.Misc = ..., - padding: _Padding = ..., - relief: tkinter._Relief = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - text: float | str = ..., - underline: int = ..., - width: tkinter._ScreenUnits = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -LabelFrame = Labelframe - -class Menubutton(Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - compound: _TtkCompound = "", - cursor: tkinter._Cursor = "", - direction: Literal["above", "below", "left", "right", "flush"] = "below", - image: tkinter._ImageSpec = "", - menu: tkinter.Menu = ..., - name: str = ..., - padding=..., # undocumented - state: str = "normal", - style: str = "", - takefocus: tkinter._TakeFocusValue = ..., - text: float | str = "", - textvariable: tkinter.Variable = ..., - underline: int = -1, - width: int | Literal[""] = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - compound: _TtkCompound = ..., - cursor: tkinter._Cursor = ..., - direction: Literal["above", "below", "left", "right", "flush"] = ..., - image: tkinter._ImageSpec = ..., - menu: tkinter.Menu = ..., - padding=..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - text: float | str = ..., - textvariable: tkinter.Variable = ..., - underline: int = ..., - width: int | Literal[""] = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class Notebook(Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - cursor: tkinter._Cursor = "", - height: int = 0, - name: str = ..., - padding: _Padding = ..., - style: str = "", - takefocus: tkinter._TakeFocusValue = ..., - width: int = 0, - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - cursor: tkinter._Cursor = ..., - height: int = ..., - padding: _Padding = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - width: int = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def add( - self, - child: tkinter.Widget, - *, - state: Literal["normal", "disabled", "hidden"] = ..., - sticky: str = ..., # consists of letters 'n', 's', 'w', 'e', no repeats, may be empty - padding: _Padding = ..., - text: str = ..., - # `image` is a sequence of an image name, followed by zero or more - # (sequences of one or more state names followed by an image name) - image=..., - compound: tkinter._Compound = ..., - underline: int = ..., - ) -> None: ... - def forget(self, tab_id) -> None: ... - def hide(self, tab_id) -> None: ... - def identify(self, x: int, y: int) -> str: ... - def index(self, tab_id): ... - def insert(self, pos, child, **kw) -> None: ... - def select(self, tab_id: Incomplete | None = None): ... - def tab(self, tab_id, option: Incomplete | None = None, **kw): ... - def tabs(self): ... - def enable_traversal(self) -> None: ... - -class Panedwindow(Widget, tkinter.PanedWindow): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - cursor: tkinter._Cursor = "", - # width and height for tkinter.ttk.Panedwindow are int but for tkinter.PanedWindow they are screen units - height: int = 0, - name: str = ..., - orient: Literal["vertical", "horizontal"] = "vertical", # can't be changed with configure() - style: str = "", - takefocus: tkinter._TakeFocusValue = "", - width: int = 0, - ) -> None: ... - def add(self, child: tkinter.Widget, *, weight: int = ..., **kw) -> None: ... - @overload # type: ignore[override] - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - cursor: tkinter._Cursor = ..., - height: int = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - width: int = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - # config must be copy/pasted, otherwise ttk.Panedwindow().config is mypy error (don't know why) - @overload # type: ignore[override] - def config( - self, - cnf: dict[str, Any] | None = None, - *, - cursor: tkinter._Cursor = ..., - height: int = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - width: int = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - forget: Incomplete - def insert(self, pos, child, **kw) -> None: ... - def pane(self, pane, option: Incomplete | None = None, **kw): ... - def sashpos(self, index, newpos: Incomplete | None = None): ... - -PanedWindow = Panedwindow - -class Progressbar(Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - cursor: tkinter._Cursor = "", - length: tkinter._ScreenUnits = 100, - maximum: float = 100, - mode: Literal["determinate", "indeterminate"] = "determinate", - name: str = ..., - orient: Literal["horizontal", "vertical"] = "horizontal", - phase: int = 0, # docs say read-only but assigning int to this works - style: str = "", - takefocus: tkinter._TakeFocusValue = "", - value: float = 0.0, - variable: tkinter.IntVar | tkinter.DoubleVar = ..., - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - cursor: tkinter._Cursor = ..., - length: tkinter._ScreenUnits = ..., - maximum: float = ..., - mode: Literal["determinate", "indeterminate"] = ..., - orient: Literal["horizontal", "vertical"] = ..., - phase: int = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - value: float = ..., - variable: tkinter.IntVar | tkinter.DoubleVar = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def start(self, interval: Literal["idle"] | int | None = None) -> None: ... - def step(self, amount: float | None = None) -> None: ... - def stop(self) -> None: ... - -class Radiobutton(Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - command: tkinter._ButtonCommand = "", - compound: _TtkCompound = "", - cursor: tkinter._Cursor = "", - image: tkinter._ImageSpec = "", - name: str = ..., - padding=..., # undocumented - state: str = "normal", - style: str = "", - takefocus: tkinter._TakeFocusValue = ..., - text: float | str = "", - textvariable: tkinter.Variable = ..., - underline: int = -1, - value: Any = "1", - variable: tkinter.Variable | Literal[""] = ..., - width: int | Literal[""] = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - command: tkinter._ButtonCommand = ..., - compound: _TtkCompound = ..., - cursor: tkinter._Cursor = ..., - image: tkinter._ImageSpec = ..., - padding=..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - text: float | str = ..., - textvariable: tkinter.Variable = ..., - underline: int = ..., - value: Any = ..., - variable: tkinter.Variable | Literal[""] = ..., - width: int | Literal[""] = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def invoke(self) -> Any: ... - -# type ignore, because identify() methods of Widget and tkinter.Scale are incompatible -class Scale(Widget, tkinter.Scale): # type: ignore[misc] - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - command: str | Callable[[str], object] = "", - cursor: tkinter._Cursor = "", - from_: float = 0, - length: tkinter._ScreenUnits = 100, - name: str = ..., - orient: Literal["horizontal", "vertical"] = "horizontal", - state: str = ..., # undocumented - style: str = "", - takefocus: tkinter._TakeFocusValue = ..., - to: float = 1.0, - value: float = 0, - variable: tkinter.IntVar | tkinter.DoubleVar = ..., - ) -> None: ... - @overload # type: ignore[override] - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - command: str | Callable[[str], object] = ..., - cursor: tkinter._Cursor = ..., - from_: float = ..., - length: tkinter._ScreenUnits = ..., - orient: Literal["horizontal", "vertical"] = ..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - to: float = ..., - value: float = ..., - variable: tkinter.IntVar | tkinter.DoubleVar = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - # config must be copy/pasted, otherwise ttk.Scale().config is mypy error (don't know why) - @overload # type: ignore[override] - def config( - self, - cnf: dict[str, Any] | None = None, - *, - command: str | Callable[[str], object] = ..., - cursor: tkinter._Cursor = ..., - from_: float = ..., - length: tkinter._ScreenUnits = ..., - orient: Literal["horizontal", "vertical"] = ..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - to: float = ..., - value: float = ..., - variable: tkinter.IntVar | tkinter.DoubleVar = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - def get(self, x: int | None = None, y: int | None = None) -> float: ... - -# type ignore, because identify() methods of Widget and tkinter.Scale are incompatible -class Scrollbar(Widget, tkinter.Scrollbar): # type: ignore[misc] - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - command: Callable[..., tuple[float, float] | None] | str = "", - cursor: tkinter._Cursor = "", - name: str = ..., - orient: Literal["horizontal", "vertical"] = "vertical", - style: str = "", - takefocus: tkinter._TakeFocusValue = "", - ) -> None: ... - @overload # type: ignore[override] - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - command: Callable[..., tuple[float, float] | None] | str = ..., - cursor: tkinter._Cursor = ..., - orient: Literal["horizontal", "vertical"] = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - # config must be copy/pasted, otherwise ttk.Scrollbar().config is mypy error (don't know why) - @overload # type: ignore[override] - def config( - self, - cnf: dict[str, Any] | None = None, - *, - command: Callable[..., tuple[float, float] | None] | str = ..., - cursor: tkinter._Cursor = ..., - orient: Literal["horizontal", "vertical"] = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def config(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - -class Separator(Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - cursor: tkinter._Cursor = "", - name: str = ..., - orient: Literal["horizontal", "vertical"] = "horizontal", - style: str = "", - takefocus: tkinter._TakeFocusValue = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - cursor: tkinter._Cursor = ..., - orient: Literal["horizontal", "vertical"] = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class Sizegrip(Widget): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - cursor: tkinter._Cursor = ..., - name: str = ..., - style: str = "", - takefocus: tkinter._TakeFocusValue = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - cursor: tkinter._Cursor = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - -class Spinbox(Entry): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - background: str = ..., # undocumented - class_: str = "", - command: Callable[[], object] | str | list[str] | tuple[str, ...] = "", - cursor: tkinter._Cursor = "", - exportselection: bool = ..., # undocumented - font: _FontDescription = ..., # undocumented - foreground: str = ..., # undocumented - format: str = "", - from_: float = 0, - increment: float = 1, - invalidcommand: tkinter._EntryValidateCommand = ..., # undocumented - justify: Literal["left", "center", "right"] = ..., # undocumented - name: str = ..., - show=..., # undocumented - state: str = "normal", - style: str = "", - takefocus: tkinter._TakeFocusValue = ..., - textvariable: tkinter.Variable = ..., # undocumented - to: float = 0, - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = "none", - validatecommand: tkinter._EntryValidateCommand = "", - values: list[str] | tuple[str, ...] = ..., - width: int = ..., # undocumented - wrap: bool = False, - xscrollcommand: tkinter._XYScrollCommand = "", - ) -> None: ... - @overload # type: ignore[override] - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - background: str = ..., - command: Callable[[], object] | str | list[str] | tuple[str, ...] = ..., - cursor: tkinter._Cursor = ..., - exportselection: bool = ..., - font: _FontDescription = ..., - foreground: str = ..., - format: str = ..., - from_: float = ..., - increment: float = ..., - invalidcommand: tkinter._EntryValidateCommand = ..., - justify: Literal["left", "center", "right"] = ..., - show=..., - state: str = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - textvariable: tkinter.Variable = ..., - to: float = ..., - validate: Literal["none", "focus", "focusin", "focusout", "key", "all"] = ..., - validatecommand: tkinter._EntryValidateCommand = ..., - values: list[str] | tuple[str, ...] = ..., - width: int = ..., - wrap: bool = ..., - xscrollcommand: tkinter._XYScrollCommand = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure # type: ignore[assignment] - def set(self, value: Any) -> None: ... - -class _TreeviewItemDict(TypedDict): - text: str - image: list[str] | Literal[""] # no idea why it's wrapped in list - values: list[Any] | Literal[""] - open: bool # actually 0 or 1 - tags: list[str] | Literal[""] - -class _TreeviewTagDict(TypedDict): - # There is also 'text' and 'anchor', but they don't seem to do anything, using them is likely a bug - foreground: str - background: str - font: _FontDescription - image: str # not wrapped in list :D - -class _TreeviewHeaderDict(TypedDict): - text: str - image: list[str] | Literal[""] - anchor: tkinter._Anchor - command: str - state: str # Doesn't seem to appear anywhere else than in these dicts - -class _TreeviewColumnDict(TypedDict): - width: int - minwidth: int - stretch: bool # actually 0 or 1 - anchor: tkinter._Anchor - id: str - -class Treeview(Widget, tkinter.XView, tkinter.YView): - def __init__( - self, - master: tkinter.Misc | None = None, - *, - class_: str = "", - columns: str | list[str] | list[int] | list[str | int] | tuple[str | int, ...] = "", - cursor: tkinter._Cursor = "", - displaycolumns: str | int | list[str] | tuple[str, ...] | list[int] | tuple[int, ...] = ("#all",), - height: int = 10, - name: str = ..., - padding: _Padding = ..., - selectmode: Literal["extended", "browse", "none"] = "extended", - # list/tuple of Literal don't actually work in mypy - # - # 'tree headings' is same as ['tree', 'headings'], and I wouldn't be - # surprised if someone is using it. - show: Literal["tree", "headings", "tree headings", ""] | list[str] | tuple[str, ...] = ("tree", "headings"), - style: str = "", - takefocus: tkinter._TakeFocusValue = ..., - xscrollcommand: tkinter._XYScrollCommand = "", - yscrollcommand: tkinter._XYScrollCommand = "", - ) -> None: ... - @overload - def configure( - self, - cnf: dict[str, Any] | None = None, - *, - columns: str | list[str] | list[int] | list[str | int] | tuple[str | int, ...] = ..., - cursor: tkinter._Cursor = ..., - displaycolumns: str | int | list[str] | tuple[str, ...] | list[int] | tuple[int, ...] = ..., - height: int = ..., - padding: _Padding = ..., - selectmode: Literal["extended", "browse", "none"] = ..., - show: Literal["tree", "headings", "tree headings", ""] | list[str] | tuple[str, ...] = ..., - style: str = ..., - takefocus: tkinter._TakeFocusValue = ..., - xscrollcommand: tkinter._XYScrollCommand = ..., - yscrollcommand: tkinter._XYScrollCommand = ..., - ) -> dict[str, tuple[str, str, str, Any, Any]] | None: ... - @overload - def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ... - config = configure - def bbox(self, item: str | int, column: str | int | None = None) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override] - def get_children(self, item: str | int | None = None) -> tuple[str, ...]: ... - def set_children(self, item: str | int, *newchildren: str | int) -> None: ... - @overload - def column(self, column: str | int, option: Literal["width", "minwidth"]) -> int: ... - @overload - def column(self, column: str | int, option: Literal["stretch"]) -> bool: ... # actually 0 or 1 - @overload - def column(self, column: str | int, option: Literal["anchor"]) -> _tkinter.Tcl_Obj: ... - @overload - def column(self, column: str | int, option: Literal["id"]) -> str: ... - @overload - def column(self, column: str | int, option: str) -> Any: ... - @overload - def column( - self, - column: str | int, - option: None = None, - *, - width: int = ..., - minwidth: int = ..., - stretch: bool = ..., - anchor: tkinter._Anchor = ..., - # id is read-only - ) -> _TreeviewColumnDict | None: ... - def delete(self, *items: str | int) -> None: ... - def detach(self, *items: str | int) -> None: ... - def exists(self, item: str | int) -> bool: ... - @overload # type: ignore[override] - def focus(self, item: None = None) -> str: ... # can return empty string - @overload - def focus(self, item: str | int) -> Literal[""]: ... - @overload - def heading(self, column: str | int, option: Literal["text"]) -> str: ... - @overload - def heading(self, column: str | int, option: Literal["image"]) -> tuple[str] | str: ... - @overload - def heading(self, column: str | int, option: Literal["anchor"]) -> _tkinter.Tcl_Obj: ... - @overload - def heading(self, column: str | int, option: Literal["command"]) -> str: ... - @overload - def heading(self, column: str | int, option: str) -> Any: ... - @overload - def heading(self, column: str | int, option: None = None) -> _TreeviewHeaderDict: ... - @overload - def heading( - self, - column: str | int, - option: None = None, - *, - text: str = ..., - image: tkinter._ImageSpec = ..., - anchor: tkinter._Anchor = ..., - command: str | Callable[[], object] = ..., - ) -> None: ... - # Internal Method. Leave untyped: - def identify(self, component, x, y): ... # type: ignore[override] - def identify_row(self, y: int) -> str: ... - def identify_column(self, x: int) -> str: ... - def identify_region(self, x: int, y: int) -> Literal["heading", "separator", "tree", "cell", "nothing"]: ... - def identify_element(self, x: int, y: int) -> str: ... # don't know what possible return values are - def index(self, item: str | int) -> int: ... - def insert( - self, - parent: str, - index: int | Literal["end"], - iid: str | int | None = None, - *, - id: str | int = ..., # same as iid - text: str = ..., - image: tkinter._ImageSpec = ..., - values: list[Any] | tuple[Any, ...] = ..., - open: bool = ..., - tags: str | list[str] | tuple[str, ...] = ..., - ) -> str: ... - @overload - def item(self, item: str | int, option: Literal["text"]) -> str: ... - @overload - def item(self, item: str | int, option: Literal["image"]) -> tuple[str] | Literal[""]: ... - @overload - def item(self, item: str | int, option: Literal["values"]) -> tuple[Any, ...] | Literal[""]: ... - @overload - def item(self, item: str | int, option: Literal["open"]) -> bool: ... # actually 0 or 1 - @overload - def item(self, item: str | int, option: Literal["tags"]) -> tuple[str, ...] | Literal[""]: ... - @overload - def item(self, item: str | int, option: str) -> Any: ... - @overload - def item(self, item: str | int, option: None = None) -> _TreeviewItemDict: ... - @overload - def item( - self, - item: str | int, - option: None = None, - *, - text: str = ..., - image: tkinter._ImageSpec = ..., - values: list[Any] | tuple[Any, ...] | Literal[""] = ..., - open: bool = ..., - tags: str | list[str] | tuple[str, ...] = ..., - ) -> None: ... - def move(self, item: str | int, parent: str, index: int | Literal["end"]) -> None: ... - reattach = move - def next(self, item: str | int) -> str: ... # returning empty string means last item - def parent(self, item: str | int) -> str: ... - def prev(self, item: str | int) -> str: ... # returning empty string means first item - def see(self, item: str | int) -> None: ... - def selection(self) -> tuple[str, ...]: ... - @overload - def selection_set(self, items: list[str] | tuple[str, ...] | list[int] | tuple[int, ...], /) -> None: ... - @overload - def selection_set(self, *items: str | int) -> None: ... - @overload - def selection_add(self, items: list[str] | tuple[str, ...] | list[int] | tuple[int, ...], /) -> None: ... - @overload - def selection_add(self, *items: str | int) -> None: ... - @overload - def selection_remove(self, items: list[str] | tuple[str, ...] | list[int] | tuple[int, ...], /) -> None: ... - @overload - def selection_remove(self, *items: str | int) -> None: ... - @overload - def selection_toggle(self, items: list[str] | tuple[str, ...] | list[int] | tuple[int, ...], /) -> None: ... - @overload - def selection_toggle(self, *items: str | int) -> None: ... - @overload - def set(self, item: str | int, column: None = None, value: None = None) -> dict[str, Any]: ... - @overload - def set(self, item: str | int, column: str | int, value: None = None) -> Any: ... - @overload - def set(self, item: str | int, column: str | int, value: Any) -> Literal[""]: ... - # There's no tag_unbind() or 'add' argument for whatever reason. - # Also, it's 'callback' instead of 'func' here. - @overload - def tag_bind( - self, tagname: str, sequence: str | None = None, callback: Callable[[tkinter.Event[Treeview]], object] | None = None - ) -> str: ... - @overload - def tag_bind(self, tagname: str, sequence: str | None, callback: str) -> None: ... - @overload - def tag_bind(self, tagname: str, *, callback: str) -> None: ... - @overload - def tag_configure(self, tagname: str, option: Literal["foreground", "background"]) -> str: ... - @overload - def tag_configure(self, tagname: str, option: Literal["font"]) -> _FontDescription: ... - @overload - def tag_configure(self, tagname: str, option: Literal["image"]) -> str: ... - @overload - def tag_configure( - self, - tagname: str, - option: None = None, - *, - # There is also 'text' and 'anchor', but they don't seem to do anything, using them is likely a bug - foreground: str = ..., - background: str = ..., - font: _FontDescription = ..., - image: tkinter._ImageSpec = ..., - ) -> _TreeviewTagDict | MaybeNone: ... # can be None but annoying to check - @overload - def tag_has(self, tagname: str, item: None = None) -> tuple[str, ...]: ... - @overload - def tag_has(self, tagname: str, item: str | int) -> bool: ... - -class LabeledScale(Frame): - label: Label - scale: Scale - # This should be kept in sync with tkinter.ttk.Frame.__init__() - # (all the keyword-only args except compound are from there) - def __init__( - self, - master: tkinter.Misc | None = None, - variable: tkinter.IntVar | tkinter.DoubleVar | None = None, - from_: float = 0, - to: float = 10, - *, - border: tkinter._ScreenUnits = ..., - borderwidth: tkinter._ScreenUnits = ..., - class_: str = "", - compound: Literal["top", "bottom"] = "top", - cursor: tkinter._Cursor = "", - height: tkinter._ScreenUnits = 0, - name: str = ..., - padding: _Padding = ..., - relief: tkinter._Relief = ..., - style: str = "", - takefocus: tkinter._TakeFocusValue = "", - width: tkinter._ScreenUnits = 0, - ) -> None: ... - # destroy is overridden, signature does not change - value: Any - -class OptionMenu(Menubutton): - def __init__( - self, - master: tkinter.Misc | None, - variable: tkinter.StringVar, - default: str | None = None, - *values: str, - # rest of these are keyword-only because *args syntax used above - style: str = "", - direction: Literal["above", "below", "left", "right", "flush"] = "below", - command: Callable[[tkinter.StringVar], object] | None = None, - ) -> None: ... - # configure, config, cget, destroy are inherited from Menubutton - # destroy and __setitem__ are overridden, signature does not change - def set_menu(self, default: str | None = None, *values: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/token.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/token.pyi deleted file mode 100644 index 741ce5b035..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/token.pyi +++ /dev/null @@ -1,160 +0,0 @@ -import sys - -__all__ = [ - "AMPER", - "AMPEREQUAL", - "AT", - "ATEQUAL", - "CIRCUMFLEX", - "CIRCUMFLEXEQUAL", - "COLON", - "COLONEQUAL", - "COMMA", - "DEDENT", - "DOT", - "DOUBLESLASH", - "DOUBLESLASHEQUAL", - "DOUBLESTAR", - "DOUBLESTAREQUAL", - "ELLIPSIS", - "ENDMARKER", - "EQEQUAL", - "EQUAL", - "ERRORTOKEN", - "GREATER", - "GREATEREQUAL", - "INDENT", - "ISEOF", - "ISNONTERMINAL", - "ISTERMINAL", - "LBRACE", - "LEFTSHIFT", - "LEFTSHIFTEQUAL", - "LESS", - "LESSEQUAL", - "LPAR", - "LSQB", - "MINEQUAL", - "MINUS", - "NAME", - "NEWLINE", - "NOTEQUAL", - "NT_OFFSET", - "NUMBER", - "N_TOKENS", - "OP", - "PERCENT", - "PERCENTEQUAL", - "PLUS", - "PLUSEQUAL", - "RARROW", - "RBRACE", - "RIGHTSHIFT", - "RIGHTSHIFTEQUAL", - "RPAR", - "RSQB", - "SEMI", - "SLASH", - "SLASHEQUAL", - "STAR", - "STAREQUAL", - "STRING", - "TILDE", - "TYPE_COMMENT", - "TYPE_IGNORE", - "VBAR", - "VBAREQUAL", - "tok_name", - "ENCODING", - "NL", - "COMMENT", -] -if sys.version_info < (3, 13): - __all__ += ["ASYNC", "AWAIT"] - -if sys.version_info >= (3, 10): - __all__ += ["SOFT_KEYWORD"] - -if sys.version_info >= (3, 12): - __all__ += ["EXCLAMATION", "FSTRING_END", "FSTRING_MIDDLE", "FSTRING_START", "EXACT_TOKEN_TYPES"] - -ENDMARKER: int -NAME: int -NUMBER: int -STRING: int -NEWLINE: int -INDENT: int -DEDENT: int -LPAR: int -RPAR: int -LSQB: int -RSQB: int -COLON: int -COMMA: int -SEMI: int -PLUS: int -MINUS: int -STAR: int -SLASH: int -VBAR: int -AMPER: int -LESS: int -GREATER: int -EQUAL: int -DOT: int -PERCENT: int -LBRACE: int -RBRACE: int -EQEQUAL: int -NOTEQUAL: int -LESSEQUAL: int -GREATEREQUAL: int -TILDE: int -CIRCUMFLEX: int -LEFTSHIFT: int -RIGHTSHIFT: int -DOUBLESTAR: int -PLUSEQUAL: int -MINEQUAL: int -STAREQUAL: int -SLASHEQUAL: int -PERCENTEQUAL: int -AMPEREQUAL: int -VBAREQUAL: int -CIRCUMFLEXEQUAL: int -LEFTSHIFTEQUAL: int -RIGHTSHIFTEQUAL: int -DOUBLESTAREQUAL: int -DOUBLESLASH: int -DOUBLESLASHEQUAL: int -AT: int -RARROW: int -ELLIPSIS: int -ATEQUAL: int -if sys.version_info < (3, 13): - AWAIT: int - ASYNC: int -OP: int -ERRORTOKEN: int -N_TOKENS: int -NT_OFFSET: int -tok_name: dict[int, str] -COMMENT: int -NL: int -ENCODING: int -TYPE_COMMENT: int -TYPE_IGNORE: int -COLONEQUAL: int -EXACT_TOKEN_TYPES: dict[str, int] -if sys.version_info >= (3, 10): - SOFT_KEYWORD: int - -if sys.version_info >= (3, 12): - EXCLAMATION: int - FSTRING_END: int - FSTRING_MIDDLE: int - FSTRING_START: int - -def ISTERMINAL(x: int) -> bool: ... -def ISNONTERMINAL(x: int) -> bool: ... -def ISEOF(x: int) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tokenize.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tokenize.pyi deleted file mode 100644 index 86e87704eb..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tokenize.pyi +++ /dev/null @@ -1,188 +0,0 @@ -import sys -from _typeshed import FileDescriptorOrPath -from collections.abc import Callable, Generator, Iterable, Sequence -from re import Pattern -from token import * -from token import EXACT_TOKEN_TYPES as EXACT_TOKEN_TYPES -from typing import Any, NamedTuple, TextIO, type_check_only -from typing_extensions import TypeAlias - -__all__ = [ - "AMPER", - "AMPEREQUAL", - "AT", - "ATEQUAL", - "CIRCUMFLEX", - "CIRCUMFLEXEQUAL", - "COLON", - "COLONEQUAL", - "COMMA", - "COMMENT", - "DEDENT", - "DOT", - "DOUBLESLASH", - "DOUBLESLASHEQUAL", - "DOUBLESTAR", - "DOUBLESTAREQUAL", - "ELLIPSIS", - "ENCODING", - "ENDMARKER", - "EQEQUAL", - "EQUAL", - "ERRORTOKEN", - "GREATER", - "GREATEREQUAL", - "INDENT", - "ISEOF", - "ISNONTERMINAL", - "ISTERMINAL", - "LBRACE", - "LEFTSHIFT", - "LEFTSHIFTEQUAL", - "LESS", - "LESSEQUAL", - "LPAR", - "LSQB", - "MINEQUAL", - "MINUS", - "NAME", - "NEWLINE", - "NL", - "NOTEQUAL", - "NT_OFFSET", - "NUMBER", - "N_TOKENS", - "OP", - "PERCENT", - "PERCENTEQUAL", - "PLUS", - "PLUSEQUAL", - "RARROW", - "RBRACE", - "RIGHTSHIFT", - "RIGHTSHIFTEQUAL", - "RPAR", - "RSQB", - "SEMI", - "SLASH", - "SLASHEQUAL", - "STAR", - "STAREQUAL", - "STRING", - "TILDE", - "TYPE_COMMENT", - "TYPE_IGNORE", - "TokenInfo", - "VBAR", - "VBAREQUAL", - "detect_encoding", - "generate_tokens", - "tok_name", - "tokenize", - "untokenize", -] -if sys.version_info < (3, 13): - __all__ += ["ASYNC", "AWAIT"] - -if sys.version_info >= (3, 10): - __all__ += ["SOFT_KEYWORD"] - -if sys.version_info >= (3, 12): - __all__ += ["EXCLAMATION", "FSTRING_END", "FSTRING_MIDDLE", "FSTRING_START", "EXACT_TOKEN_TYPES"] - -if sys.version_info >= (3, 13): - __all__ += ["TokenError", "open"] - -cookie_re: Pattern[str] -blank_re: Pattern[bytes] - -_Position: TypeAlias = tuple[int, int] - -# This class is not exposed. It calls itself tokenize.TokenInfo. -@type_check_only -class _TokenInfo(NamedTuple): - type: int - string: str - start: _Position - end: _Position - line: str - -class TokenInfo(_TokenInfo): - @property - def exact_type(self) -> int: ... - -# Backwards compatible tokens can be sequences of a shorter length too -_Token: TypeAlias = TokenInfo | Sequence[int | str | _Position] - -class TokenError(Exception): ... - -if sys.version_info < (3, 13): - class StopTokenizing(Exception): ... # undocumented - -class Untokenizer: - tokens: list[str] - prev_row: int - prev_col: int - encoding: str | None - def add_whitespace(self, start: _Position) -> None: ... - if sys.version_info >= (3, 12): - def add_backslash_continuation(self, start: _Position) -> None: ... - - def untokenize(self, iterable: Iterable[_Token]) -> str: ... - def compat(self, token: Sequence[int | str], iterable: Iterable[_Token]) -> None: ... - if sys.version_info >= (3, 12): - def escape_brackets(self, token: str) -> str: ... - -# Returns str, unless the ENCODING token is present, in which case it returns bytes. -def untokenize(iterable: Iterable[_Token]) -> str | Any: ... -def detect_encoding(readline: Callable[[], bytes | bytearray]) -> tuple[str, Sequence[bytes]]: ... -def tokenize(readline: Callable[[], bytes | bytearray]) -> Generator[TokenInfo, None, None]: ... -def generate_tokens(readline: Callable[[], str]) -> Generator[TokenInfo, None, None]: ... -def open(filename: FileDescriptorOrPath) -> TextIO: ... -def group(*choices: str) -> str: ... # undocumented -def any(*choices: str) -> str: ... # undocumented -def maybe(*choices: str) -> str: ... # undocumented - -Whitespace: str # undocumented -Comment: str # undocumented -Ignore: str # undocumented -Name: str # undocumented - -Hexnumber: str # undocumented -Binnumber: str # undocumented -Octnumber: str # undocumented -Decnumber: str # undocumented -Intnumber: str # undocumented -Exponent: str # undocumented -Pointfloat: str # undocumented -Expfloat: str # undocumented -Floatnumber: str # undocumented -Imagnumber: str # undocumented -Number: str # undocumented - -def _all_string_prefixes() -> set[str]: ... # undocumented - -StringPrefix: str # undocumented - -Single: str # undocumented -Double: str # undocumented -Single3: str # undocumented -Double3: str # undocumented -Triple: str # undocumented -String: str # undocumented - -Special: str # undocumented -Funny: str # undocumented - -PlainToken: str # undocumented -Token: str # undocumented - -ContStr: str # undocumented -PseudoExtras: str # undocumented -PseudoToken: str # undocumented - -endpats: dict[str, str] # undocumented -single_quoted: set[str] # undocumented -triple_quoted: set[str] # undocumented - -tabsize: int # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tomllib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tomllib.pyi deleted file mode 100644 index d559568b91..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tomllib.pyi +++ /dev/null @@ -1,10 +0,0 @@ -from _typeshed import SupportsRead -from collections.abc import Callable -from typing import Any - -__all__ = ("loads", "load", "TOMLDecodeError") - -class TOMLDecodeError(ValueError): ... - -def load(fp: SupportsRead[bytes], /, *, parse_float: Callable[[str], Any] = ...) -> dict[str, Any]: ... -def loads(s: str, /, *, parse_float: Callable[[str], Any] = ...) -> dict[str, Any]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/trace.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/trace.pyi deleted file mode 100644 index 7e7cc1e9ac..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/trace.pyi +++ /dev/null @@ -1,86 +0,0 @@ -import sys -import types -from _typeshed import Incomplete, StrPath, TraceFunction -from collections.abc import Callable, Iterable, Mapping, Sequence -from typing import Any, TypeVar -from typing_extensions import ParamSpec, TypeAlias - -__all__ = ["Trace", "CoverageResults"] - -_T = TypeVar("_T") -_P = ParamSpec("_P") -_FileModuleFunction: TypeAlias = tuple[str, str | None, str] - -class CoverageResults: - counts: dict[tuple[str, int], int] - counter: dict[tuple[str, int], int] - calledfuncs: dict[_FileModuleFunction, int] - callers: dict[tuple[_FileModuleFunction, _FileModuleFunction], int] - inifile: StrPath | None - outfile: StrPath | None - def __init__( - self, - counts: dict[tuple[str, int], int] | None = None, - calledfuncs: dict[_FileModuleFunction, int] | None = None, - infile: StrPath | None = None, - callers: dict[tuple[_FileModuleFunction, _FileModuleFunction], int] | None = None, - outfile: StrPath | None = None, - ) -> None: ... # undocumented - def update(self, other: CoverageResults) -> None: ... - if sys.version_info >= (3, 13): - def write_results( - self, - show_missing: bool = True, - summary: bool = False, - coverdir: StrPath | None = None, - *, - ignore_missing_files: bool = False, - ) -> None: ... - else: - def write_results(self, show_missing: bool = True, summary: bool = False, coverdir: StrPath | None = None) -> None: ... - - def write_results_file( - self, path: StrPath, lines: Sequence[str], lnotab: Any, lines_hit: Mapping[int, int], encoding: str | None = None - ) -> tuple[int, int]: ... - def is_ignored_filename(self, filename: str) -> bool: ... # undocumented - -class _Ignore: - def __init__(self, modules: Iterable[str] | None = None, dirs: Iterable[StrPath] | None = None) -> None: ... - def names(self, filename: str, modulename: str) -> int: ... - -class Trace: - inifile: StrPath | None - outfile: StrPath | None - ignore: _Ignore - counts: dict[str, int] - pathtobasename: dict[Incomplete, Incomplete] - donothing: int - trace: int - start_time: int | None - globaltrace: TraceFunction - localtrace: TraceFunction - def __init__( - self, - count: int = 1, - trace: int = 1, - countfuncs: int = 0, - countcallers: int = 0, - ignoremods: Sequence[str] = (), - ignoredirs: Sequence[str] = (), - infile: StrPath | None = None, - outfile: StrPath | None = None, - timing: bool = False, - ) -> None: ... - def run(self, cmd: str | types.CodeType) -> None: ... - def runctx( - self, cmd: str | types.CodeType, globals: Mapping[str, Any] | None = None, locals: Mapping[str, Any] | None = None - ) -> None: ... - def runfunc(self, func: Callable[_P, _T], /, *args: _P.args, **kw: _P.kwargs) -> _T: ... - def file_module_function_of(self, frame: types.FrameType) -> _FileModuleFunction: ... - def globaltrace_trackcallers(self, frame: types.FrameType, why: str, arg: Any) -> None: ... - def globaltrace_countfuncs(self, frame: types.FrameType, why: str, arg: Any) -> None: ... - def globaltrace_lt(self, frame: types.FrameType, why: str, arg: Any) -> None: ... - def localtrace_trace_and_count(self, frame: types.FrameType, why: str, arg: Any) -> TraceFunction: ... - def localtrace_trace(self, frame: types.FrameType, why: str, arg: Any) -> TraceFunction: ... - def localtrace_count(self, frame: types.FrameType, why: str, arg: Any) -> TraceFunction: ... - def results(self) -> CoverageResults: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/traceback.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/traceback.pyi deleted file mode 100644 index 4f132d51c6..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/traceback.pyi +++ /dev/null @@ -1,313 +0,0 @@ -import sys -from _typeshed import SupportsWrite, Unused -from collections.abc import Generator, Iterable, Iterator, Mapping -from types import FrameType, TracebackType -from typing import Any, ClassVar, Literal, overload -from typing_extensions import Self, TypeAlias, deprecated - -__all__ = [ - "extract_stack", - "extract_tb", - "format_exception", - "format_exception_only", - "format_list", - "format_stack", - "format_tb", - "print_exc", - "format_exc", - "print_exception", - "print_last", - "print_stack", - "print_tb", - "clear_frames", - "FrameSummary", - "StackSummary", - "TracebackException", - "walk_stack", - "walk_tb", -] - -_FrameSummaryTuple: TypeAlias = tuple[str, int, str, str | None] - -def print_tb(tb: TracebackType | None, limit: int | None = None, file: SupportsWrite[str] | None = None) -> None: ... - -if sys.version_info >= (3, 10): - @overload - def print_exception( - exc: type[BaseException] | None, - /, - value: BaseException | None = ..., - tb: TracebackType | None = ..., - limit: int | None = None, - file: SupportsWrite[str] | None = None, - chain: bool = True, - ) -> None: ... - @overload - def print_exception( - exc: BaseException, /, *, limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True - ) -> None: ... - @overload - def format_exception( - exc: type[BaseException] | None, - /, - value: BaseException | None = ..., - tb: TracebackType | None = ..., - limit: int | None = None, - chain: bool = True, - ) -> list[str]: ... - @overload - def format_exception(exc: BaseException, /, *, limit: int | None = None, chain: bool = True) -> list[str]: ... - -else: - def print_exception( - etype: type[BaseException] | None, - value: BaseException | None, - tb: TracebackType | None, - limit: int | None = None, - file: SupportsWrite[str] | None = None, - chain: bool = True, - ) -> None: ... - def format_exception( - etype: type[BaseException] | None, - value: BaseException | None, - tb: TracebackType | None, - limit: int | None = None, - chain: bool = True, - ) -> list[str]: ... - -def print_exc(limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ... -def print_last(limit: int | None = None, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ... -def print_stack(f: FrameType | None = None, limit: int | None = None, file: SupportsWrite[str] | None = None) -> None: ... -def extract_tb(tb: TracebackType | None, limit: int | None = None) -> StackSummary: ... -def extract_stack(f: FrameType | None = None, limit: int | None = None) -> StackSummary: ... -def format_list(extracted_list: Iterable[FrameSummary | _FrameSummaryTuple]) -> list[str]: ... - -# undocumented -def print_list(extracted_list: Iterable[FrameSummary | _FrameSummaryTuple], file: SupportsWrite[str] | None = None) -> None: ... - -if sys.version_info >= (3, 13): - @overload - def format_exception_only(exc: BaseException | None, /, *, show_group: bool = False) -> list[str]: ... - @overload - def format_exception_only(exc: Unused, /, value: BaseException | None, *, show_group: bool = False) -> list[str]: ... - -elif sys.version_info >= (3, 10): - @overload - def format_exception_only(exc: BaseException | None, /) -> list[str]: ... - @overload - def format_exception_only(exc: Unused, /, value: BaseException | None) -> list[str]: ... - -else: - def format_exception_only(etype: type[BaseException] | None, value: BaseException | None) -> list[str]: ... - -def format_exc(limit: int | None = None, chain: bool = True) -> str: ... -def format_tb(tb: TracebackType | None, limit: int | None = None) -> list[str]: ... -def format_stack(f: FrameType | None = None, limit: int | None = None) -> list[str]: ... -def clear_frames(tb: TracebackType | None) -> None: ... -def walk_stack(f: FrameType | None) -> Iterator[tuple[FrameType, int]]: ... -def walk_tb(tb: TracebackType | None) -> Iterator[tuple[FrameType, int]]: ... - -if sys.version_info >= (3, 11): - class _ExceptionPrintContext: - def indent(self) -> str: ... - def emit(self, text_gen: str | Iterable[str], margin_char: str | None = None) -> Generator[str, None, None]: ... - -class TracebackException: - __cause__: TracebackException | None - __context__: TracebackException | None - if sys.version_info >= (3, 11): - exceptions: list[TracebackException] | None - __suppress_context__: bool - if sys.version_info >= (3, 11): - __notes__: list[str] | None - stack: StackSummary - - # These fields only exist for `SyntaxError`s, but there is no way to express that in the type system. - filename: str - lineno: str | None - if sys.version_info >= (3, 10): - end_lineno: str | None - text: str - offset: int - if sys.version_info >= (3, 10): - end_offset: int | None - msg: str - - if sys.version_info >= (3, 13): - @property - def exc_type_str(self) -> str: ... - @property - @deprecated("Deprecated in 3.13. Use exc_type_str instead.") - def exc_type(self) -> type[BaseException] | None: ... - else: - exc_type: type[BaseException] - if sys.version_info >= (3, 13): - def __init__( - self, - exc_type: type[BaseException], - exc_value: BaseException, - exc_traceback: TracebackType | None, - *, - limit: int | None = None, - lookup_lines: bool = True, - capture_locals: bool = False, - compact: bool = False, - max_group_width: int = 15, - max_group_depth: int = 10, - save_exc_type: bool = True, - _seen: set[int] | None = None, - ) -> None: ... - elif sys.version_info >= (3, 11): - def __init__( - self, - exc_type: type[BaseException], - exc_value: BaseException, - exc_traceback: TracebackType | None, - *, - limit: int | None = None, - lookup_lines: bool = True, - capture_locals: bool = False, - compact: bool = False, - max_group_width: int = 15, - max_group_depth: int = 10, - _seen: set[int] | None = None, - ) -> None: ... - elif sys.version_info >= (3, 10): - def __init__( - self, - exc_type: type[BaseException], - exc_value: BaseException, - exc_traceback: TracebackType | None, - *, - limit: int | None = None, - lookup_lines: bool = True, - capture_locals: bool = False, - compact: bool = False, - _seen: set[int] | None = None, - ) -> None: ... - else: - def __init__( - self, - exc_type: type[BaseException], - exc_value: BaseException, - exc_traceback: TracebackType | None, - *, - limit: int | None = None, - lookup_lines: bool = True, - capture_locals: bool = False, - _seen: set[int] | None = None, - ) -> None: ... - - if sys.version_info >= (3, 11): - @classmethod - def from_exception( - cls, - exc: BaseException, - *, - limit: int | None = None, - lookup_lines: bool = True, - capture_locals: bool = False, - compact: bool = False, - max_group_width: int = 15, - max_group_depth: int = 10, - ) -> Self: ... - elif sys.version_info >= (3, 10): - @classmethod - def from_exception( - cls, - exc: BaseException, - *, - limit: int | None = None, - lookup_lines: bool = True, - capture_locals: bool = False, - compact: bool = False, - ) -> Self: ... - else: - @classmethod - def from_exception( - cls, exc: BaseException, *, limit: int | None = None, lookup_lines: bool = True, capture_locals: bool = False - ) -> Self: ... - - def __eq__(self, other: object) -> bool: ... - __hash__: ClassVar[None] # type: ignore[assignment] - if sys.version_info >= (3, 11): - def format(self, *, chain: bool = True, _ctx: _ExceptionPrintContext | None = None) -> Generator[str, None, None]: ... - else: - def format(self, *, chain: bool = True) -> Generator[str, None, None]: ... - - if sys.version_info >= (3, 13): - def format_exception_only(self, *, show_group: bool = False, _depth: int = 0) -> Generator[str, None, None]: ... - else: - def format_exception_only(self) -> Generator[str, None, None]: ... - - if sys.version_info >= (3, 11): - def print(self, *, file: SupportsWrite[str] | None = None, chain: bool = True) -> None: ... - -class FrameSummary: - if sys.version_info >= (3, 11): - def __init__( - self, - filename: str, - lineno: int | None, - name: str, - *, - lookup_line: bool = True, - locals: Mapping[str, str] | None = None, - line: str | None = None, - end_lineno: int | None = None, - colno: int | None = None, - end_colno: int | None = None, - ) -> None: ... - end_lineno: int | None - colno: int | None - end_colno: int | None - else: - def __init__( - self, - filename: str, - lineno: int | None, - name: str, - *, - lookup_line: bool = True, - locals: Mapping[str, str] | None = None, - line: str | None = None, - ) -> None: ... - filename: str - lineno: int | None - name: str - locals: dict[str, str] | None - @property - def line(self) -> str | None: ... - @overload - def __getitem__(self, pos: Literal[0]) -> str: ... - @overload - def __getitem__(self, pos: Literal[1]) -> int: ... - @overload - def __getitem__(self, pos: Literal[2]) -> str: ... - @overload - def __getitem__(self, pos: Literal[3]) -> str | None: ... - @overload - def __getitem__(self, pos: int) -> Any: ... - @overload - def __getitem__(self, pos: slice) -> tuple[Any, ...]: ... - def __iter__(self) -> Iterator[Any]: ... - def __eq__(self, other: object) -> bool: ... - def __len__(self) -> Literal[4]: ... - __hash__: ClassVar[None] # type: ignore[assignment] - -class StackSummary(list[FrameSummary]): - @classmethod - def extract( - cls, - frame_gen: Iterable[tuple[FrameType, int]], - *, - limit: int | None = None, - lookup_lines: bool = True, - capture_locals: bool = False, - ) -> StackSummary: ... - @classmethod - def from_list(cls, a_list: Iterable[FrameSummary | _FrameSummaryTuple]) -> StackSummary: ... - if sys.version_info >= (3, 11): - def format_frame_summary(self, frame_summary: FrameSummary) -> str: ... - - def format(self) -> list[str]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tracemalloc.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tracemalloc.pyi deleted file mode 100644 index 05d98ae127..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tracemalloc.pyi +++ /dev/null @@ -1,117 +0,0 @@ -import sys -from _tracemalloc import * -from collections.abc import Sequence -from typing import Any, SupportsIndex, overload -from typing_extensions import TypeAlias - -def get_object_traceback(obj: object) -> Traceback | None: ... -def take_snapshot() -> Snapshot: ... - -class BaseFilter: - inclusive: bool - def __init__(self, inclusive: bool) -> None: ... - -class DomainFilter(BaseFilter): - @property - def domain(self) -> int: ... - def __init__(self, inclusive: bool, domain: int) -> None: ... - -class Filter(BaseFilter): - domain: int | None - lineno: int | None - @property - def filename_pattern(self) -> str: ... - all_frames: bool - def __init__( - self, - inclusive: bool, - filename_pattern: str, - lineno: int | None = None, - all_frames: bool = False, - domain: int | None = None, - ) -> None: ... - -class Statistic: - count: int - size: int - 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 - count_diff: int - size: int - size_diff: int - 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] - -class Frame: - @property - def filename(self) -> str: ... - @property - 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: ... - def __ge__(self, other: Frame) -> bool: ... - def __le__(self, other: Frame) -> bool: ... - else: - def __gt__(self, other: Frame, NotImplemented: Any = ...) -> bool: ... - def __ge__(self, other: Frame, NotImplemented: Any = ...) -> bool: ... - def __le__(self, other: Frame, NotImplemented: Any = ...) -> bool: ... - -_TraceTuple: TypeAlias = tuple[int, int, Sequence[_FrameTuple], int | None] | tuple[int, int, Sequence[_FrameTuple]] - -class Trace: - @property - def domain(self) -> int: ... - @property - def size(self) -> int: ... - @property - def traceback(self) -> Traceback: ... - def __init__(self, trace: _TraceTuple) -> None: ... - def __eq__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... - -class Traceback(Sequence[Frame]): - @property - def total_nframe(self) -> int | None: ... - def __init__(self, frames: Sequence[_FrameTuple], total_nframe: int | None = None) -> None: ... - def format(self, limit: int | None = None, most_recent_first: bool = False) -> list[str]: ... - @overload - def __getitem__(self, index: SupportsIndex) -> Frame: ... - @overload - def __getitem__(self, index: slice) -> 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: ... - def __ge__(self, other: Traceback) -> bool: ... - def __le__(self, other: Traceback) -> bool: ... - else: - def __gt__(self, other: Traceback, NotImplemented: Any = ...) -> bool: ... - def __ge__(self, other: Traceback, NotImplemented: Any = ...) -> bool: ... - def __le__(self, other: Traceback, NotImplemented: Any = ...) -> bool: ... - -class Snapshot: - def __init__(self, traces: Sequence[_TraceTuple], traceback_limit: int) -> None: ... - def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = False) -> list[StatisticDiff]: ... - def dump(self, filename: str) -> None: ... - def filter_traces(self, filters: Sequence[DomainFilter | Filter]) -> Snapshot: ... - @staticmethod - def load(filename: str) -> Snapshot: ... - def statistics(self, key_type: str, cumulative: bool = False) -> list[Statistic]: ... - traceback_limit: int - traces: Sequence[Trace] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/tty.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/tty.pyi deleted file mode 100644 index 0611879cf1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/tty.pyi +++ /dev/null @@ -1,30 +0,0 @@ -import sys -import termios -from typing import IO, Final -from typing_extensions import TypeAlias - -if sys.platform != "win32": - __all__ = ["setraw", "setcbreak"] - if sys.version_info >= (3, 12): - __all__ += ["cfmakeraw", "cfmakecbreak"] - - _ModeSetterReturn: TypeAlias = termios._AttrReturn - else: - _ModeSetterReturn: TypeAlias = None - - _FD: TypeAlias = int | IO[str] - - # XXX: Undocumented integer constants - IFLAG: Final[int] - OFLAG: Final[int] - CFLAG: Final[int] - LFLAG: Final[int] - ISPEED: Final[int] - OSPEED: Final[int] - CC: Final[int] - def setraw(fd: _FD, when: int = 2) -> _ModeSetterReturn: ... - def setcbreak(fd: _FD, when: int = 2) -> _ModeSetterReturn: ... - - if sys.version_info >= (3, 12): - def cfmakeraw(mode: termios._Attr) -> None: ... - def cfmakecbreak(mode: termios._Attr) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/turtle.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/turtle.pyi deleted file mode 100644 index a2ab728de9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/turtle.pyi +++ /dev/null @@ -1,732 +0,0 @@ -import sys -from collections.abc import Callable, Sequence -from tkinter import Canvas, Frame, Misc, PhotoImage, Scrollbar -from typing import Any, ClassVar, Literal, TypedDict, overload -from typing_extensions import Self, TypeAlias - -__all__ = [ - "ScrolledCanvas", - "TurtleScreen", - "Screen", - "RawTurtle", - "Turtle", - "RawPen", - "Pen", - "Shape", - "Vec2D", - "addshape", - "bgcolor", - "bgpic", - "bye", - "clearscreen", - "colormode", - "delay", - "exitonclick", - "getcanvas", - "getshapes", - "listen", - "mainloop", - "mode", - "numinput", - "onkey", - "onkeypress", - "onkeyrelease", - "onscreenclick", - "ontimer", - "register_shape", - "resetscreen", - "screensize", - "setup", - "setworldcoordinates", - "textinput", - "title", - "tracer", - "turtles", - "update", - "window_height", - "window_width", - "back", - "backward", - "begin_fill", - "begin_poly", - "bk", - "circle", - "clear", - "clearstamp", - "clearstamps", - "clone", - "color", - "degrees", - "distance", - "dot", - "down", - "end_fill", - "end_poly", - "fd", - "fillcolor", - "filling", - "forward", - "get_poly", - "getpen", - "getscreen", - "get_shapepoly", - "getturtle", - "goto", - "heading", - "hideturtle", - "home", - "ht", - "isdown", - "isvisible", - "left", - "lt", - "onclick", - "ondrag", - "onrelease", - "pd", - "pen", - "pencolor", - "pendown", - "pensize", - "penup", - "pos", - "position", - "pu", - "radians", - "right", - "reset", - "resizemode", - "rt", - "seth", - "setheading", - "setpos", - "setposition", - "setundobuffer", - "setx", - "sety", - "shape", - "shapesize", - "shapetransform", - "shearfactor", - "showturtle", - "speed", - "st", - "stamp", - "tilt", - "tiltangle", - "towards", - "turtlesize", - "undo", - "undobufferentries", - "up", - "width", - "write", - "xcor", - "ycor", - "write_docstringdict", - "done", - "Terminator", -] - -if sys.version_info >= (3, 12): - __all__ += ["teleport"] - -if sys.version_info < (3, 13): - __all__ += ["settiltangle"] - -# Note: '_Color' is the alias we use for arguments and _AnyColor is the -# alias we use for return types. Really, these two aliases should be the -# same, but as per the "no union returns" typeshed policy, we'll return -# Any instead. -_Color: TypeAlias = str | tuple[float, float, float] -_AnyColor: TypeAlias = Any - -class _PenState(TypedDict): - shown: bool - pendown: bool - pencolor: _Color - fillcolor: _Color - pensize: int - speed: int - resizemode: Literal["auto", "user", "noresize"] - stretchfactor: tuple[float, float] - shearfactor: float - outline: int - tilt: float - -_Speed: TypeAlias = str | float -_PolygonCoords: TypeAlias = Sequence[tuple[float, float]] - -class Vec2D(tuple[float, float]): - def __new__(cls, x: float, y: float) -> Self: ... - def __add__(self, other: tuple[float, float]) -> Vec2D: ... # type: ignore[override] - @overload # type: ignore[override] - def __mul__(self, other: Vec2D) -> float: ... - @overload - def __mul__(self, other: float) -> Vec2D: ... - def __rmul__(self, other: float) -> Vec2D: ... # type: ignore[override] - def __sub__(self, other: tuple[float, float]) -> Vec2D: ... - def __neg__(self) -> Vec2D: ... - def __abs__(self) -> float: ... - def rotate(self, angle: float) -> Vec2D: ... - -# Does not actually inherit from Canvas, but dynamically gets all methods of Canvas -class ScrolledCanvas(Canvas, Frame): # type: ignore[misc] - bg: str - hscroll: Scrollbar - vscroll: Scrollbar - def __init__( - self, master: Misc | None, width: int = 500, height: int = 350, canvwidth: int = 600, canvheight: int = 500 - ) -> None: ... - canvwidth: int - canvheight: int - def reset(self, canvwidth: int | None = None, canvheight: int | None = None, bg: str | None = None) -> None: ... - -class TurtleScreenBase: - cv: Canvas - canvwidth: int - canvheight: int - xscale: float - yscale: float - def __init__(self, cv: Canvas) -> None: ... - def mainloop(self) -> None: ... - def textinput(self, title: str, prompt: str) -> str | None: ... - def numinput( - self, title: str, prompt: str, default: float | None = None, minval: float | None = None, maxval: float | None = None - ) -> float | None: ... - -class Terminator(Exception): ... -class TurtleGraphicsError(Exception): ... - -class Shape: - def __init__(self, type_: str, data: _PolygonCoords | PhotoImage | None = None) -> None: ... - def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: _Color | None = None) -> None: ... - -class TurtleScreen(TurtleScreenBase): - def __init__(self, cv: Canvas, mode: str = "standard", colormode: float = 1.0, delay: int = 10) -> None: ... - def clear(self) -> None: ... - @overload - def mode(self, mode: None = None) -> str: ... - @overload - def mode(self, mode: str) -> None: ... - def setworldcoordinates(self, llx: float, lly: float, urx: float, ury: float) -> None: ... - def register_shape(self, name: str, shape: _PolygonCoords | Shape | None = None) -> None: ... - @overload - def colormode(self, cmode: None = None) -> float: ... - @overload - def colormode(self, cmode: float) -> None: ... - def reset(self) -> None: ... - def turtles(self) -> list[Turtle]: ... - @overload - def bgcolor(self) -> _AnyColor: ... - @overload - def bgcolor(self, color: _Color) -> None: ... - @overload - def bgcolor(self, r: float, g: float, b: float) -> None: ... - @overload - def tracer(self, n: None = None) -> int: ... - @overload - def tracer(self, n: int, delay: int | None = None) -> None: ... - @overload - def delay(self, delay: None = None) -> int: ... - @overload - def delay(self, delay: int) -> None: ... - def update(self) -> None: ... - def window_width(self) -> int: ... - def window_height(self) -> int: ... - def getcanvas(self) -> Canvas: ... - def getshapes(self) -> list[str]: ... - def onclick(self, fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... - def onkey(self, fun: Callable[[], object], key: str) -> None: ... - def listen(self, xdummy: float | None = None, ydummy: float | None = None) -> None: ... - def ontimer(self, fun: Callable[[], object], t: int = 0) -> None: ... - @overload - def bgpic(self, picname: None = None) -> str: ... - @overload - def bgpic(self, picname: str) -> None: ... - @overload - def screensize(self, canvwidth: None = None, canvheight: None = None, bg: None = None) -> tuple[int, int]: ... - # Looks like if self.cv is not a ScrolledCanvas, this could return a tuple as well - @overload - def screensize(self, canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ... - onscreenclick = onclick - resetscreen = reset - clearscreen = clear - addshape = register_shape - def onkeypress(self, fun: Callable[[], object], key: str | None = None) -> None: ... - onkeyrelease = onkey - -class TNavigator: - START_ORIENTATION: dict[str, Vec2D] - DEFAULT_MODE: str - DEFAULT_ANGLEOFFSET: int - DEFAULT_ANGLEORIENT: int - def __init__(self, mode: str = "standard") -> None: ... - def reset(self) -> None: ... - def degrees(self, fullcircle: float = 360.0) -> None: ... - def radians(self) -> None: ... - if sys.version_info >= (3, 12): - def teleport(self, x: float | None = None, y: float | None = None, *, fill_gap: bool = False) -> None: ... - - def forward(self, distance: float) -> None: ... - def back(self, distance: float) -> None: ... - def right(self, angle: float) -> None: ... - def left(self, angle: float) -> None: ... - def pos(self) -> Vec2D: ... - def xcor(self) -> float: ... - def ycor(self) -> float: ... - @overload - def goto(self, x: tuple[float, float], y: None = None) -> None: ... - @overload - def goto(self, x: float, y: float) -> None: ... - def home(self) -> None: ... - def setx(self, x: float) -> None: ... - def sety(self, y: float) -> None: ... - @overload - def distance(self, x: TNavigator | tuple[float, float], y: None = None) -> float: ... - @overload - def distance(self, x: float, y: float) -> float: ... - @overload - def towards(self, x: TNavigator | tuple[float, float], y: None = None) -> float: ... - @overload - def towards(self, x: float, y: float) -> float: ... - def heading(self) -> float: ... - def setheading(self, to_angle: float) -> None: ... - def circle(self, radius: float, extent: float | None = None, steps: int | None = None) -> None: ... - def speed(self, s: int | None = 0) -> int | None: ... - fd = forward - bk = back - backward = back - rt = right - lt = left - position = pos - setpos = goto - setposition = goto - seth = setheading - -class TPen: - def __init__(self, resizemode: str = "noresize") -> None: ... - @overload - def resizemode(self, rmode: None = None) -> str: ... - @overload - def resizemode(self, rmode: str) -> None: ... - @overload - def pensize(self, width: None = None) -> int: ... - @overload - def pensize(self, width: int) -> None: ... - def penup(self) -> None: ... - def pendown(self) -> None: ... - def isdown(self) -> bool: ... - @overload - def speed(self, speed: None = None) -> int: ... - @overload - def speed(self, speed: _Speed) -> None: ... - @overload - def pencolor(self) -> _AnyColor: ... - @overload - def pencolor(self, color: _Color) -> None: ... - @overload - def pencolor(self, r: float, g: float, b: float) -> None: ... - @overload - def fillcolor(self) -> _AnyColor: ... - @overload - def fillcolor(self, color: _Color) -> None: ... - @overload - def fillcolor(self, r: float, g: float, b: float) -> None: ... - @overload - def color(self) -> tuple[_AnyColor, _AnyColor]: ... - @overload - def color(self, color: _Color) -> None: ... - @overload - def color(self, r: float, g: float, b: float) -> None: ... - @overload - def color(self, color1: _Color, color2: _Color) -> None: ... - if sys.version_info >= (3, 12): - def teleport(self, x: float | None = None, y: float | None = None, *, fill_gap: bool = False) -> None: ... - - def showturtle(self) -> None: ... - def hideturtle(self) -> None: ... - def isvisible(self) -> bool: ... - # Note: signatures 1 and 2 overlap unsafely when no arguments are provided - @overload - def pen(self) -> _PenState: ... - @overload - def pen( - self, - pen: _PenState | None = None, - *, - shown: bool = ..., - pendown: bool = ..., - pencolor: _Color = ..., - fillcolor: _Color = ..., - pensize: int = ..., - speed: int = ..., - resizemode: str = ..., - stretchfactor: tuple[float, float] = ..., - outline: int = ..., - tilt: float = ..., - ) -> None: ... - width = pensize - up = penup - pu = penup - pd = pendown - down = pendown - st = showturtle - ht = hideturtle - -class RawTurtle(TPen, TNavigator): # type: ignore[misc] # Conflicting methods in base classes - screen: TurtleScreen - screens: ClassVar[list[TurtleScreen]] - def __init__( - self, - canvas: Canvas | TurtleScreen | None = None, - shape: str = "classic", - undobuffersize: int = 1000, - visible: bool = True, - ) -> None: ... - def reset(self) -> None: ... - def setundobuffer(self, size: int | None) -> None: ... - def undobufferentries(self) -> int: ... - def clear(self) -> None: ... - def clone(self) -> Self: ... - @overload - def shape(self, name: None = None) -> str: ... - @overload - def shape(self, name: str) -> None: ... - # Unsafely overlaps when no arguments are provided - @overload - def shapesize(self) -> tuple[float, float, float]: ... - @overload - def shapesize( - self, stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None - ) -> None: ... - @overload - def shearfactor(self, shear: None = None) -> float: ... - @overload - def shearfactor(self, shear: float) -> None: ... - # Unsafely overlaps when no arguments are provided - @overload - def shapetransform(self) -> tuple[float, float, float, float]: ... - @overload - def shapetransform( - self, t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None - ) -> None: ... - def get_shapepoly(self) -> _PolygonCoords | None: ... - - if sys.version_info < (3, 13): - def settiltangle(self, angle: float) -> None: ... - - @overload - def tiltangle(self, angle: None = None) -> float: ... - @overload - def tiltangle(self, angle: float) -> None: ... - def tilt(self, angle: float) -> None: ... - # Can return either 'int' or Tuple[int, ...] based on if the stamp is - # a compound stamp or not. So, as per the "no Union return" policy, - # we return Any. - def stamp(self) -> Any: ... - def clearstamp(self, stampid: int | tuple[int, ...]) -> None: ... - def clearstamps(self, n: int | None = None) -> None: ... - def filling(self) -> bool: ... - def begin_fill(self) -> None: ... - def end_fill(self) -> None: ... - def dot(self, size: int | None = None, *color: _Color) -> None: ... - def write( - self, arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal") - ) -> None: ... - def begin_poly(self) -> None: ... - def end_poly(self) -> None: ... - def get_poly(self) -> _PolygonCoords | None: ... - def getscreen(self) -> TurtleScreen: ... - def getturtle(self) -> Self: ... - getpen = getturtle - def onclick(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... - def onrelease(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... - def ondrag(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ... - def undo(self) -> None: ... - turtlesize = shapesize - -class _Screen(TurtleScreen): - def __init__(self) -> None: ... - # Note int and float are interpreted differently, hence the Union instead of just float - def setup( - self, - width: int | float = 0.5, # noqa: Y041 - height: int | float = 0.75, # noqa: Y041 - startx: int | None = None, - starty: int | None = None, - ) -> None: ... - def title(self, titlestring: str) -> None: ... - def bye(self) -> None: ... - def exitonclick(self) -> None: ... - -class Turtle(RawTurtle): - def __init__(self, shape: str = "classic", undobuffersize: int = 1000, visible: bool = True) -> None: ... - -RawPen = RawTurtle -Pen = Turtle - -def write_docstringdict(filename: str = "turtle_docstringdict") -> None: ... - -# Note: it's somewhat unfortunate that we have to copy the function signatures. -# It would be nice if we could partially reduce the redundancy by doing something -# like the following: -# -# _screen: Screen -# clear = _screen.clear -# -# However, it seems pytype does not support this type of syntax in pyi files. - -# Functions copied from TurtleScreenBase: - -# Note: mainloop() was always present in the global scope, but was added to -# TurtleScreenBase in Python 3.0 -def mainloop() -> None: ... -def textinput(title: str, prompt: str) -> str | None: ... -def numinput( - title: str, prompt: str, default: float | None = None, minval: float | None = None, maxval: float | None = None -) -> float | None: ... - -# Functions copied from TurtleScreen: - -def clear() -> None: ... -@overload -def mode(mode: None = None) -> str: ... -@overload -def mode(mode: str) -> None: ... -def setworldcoordinates(llx: float, lly: float, urx: float, ury: float) -> None: ... -def register_shape(name: str, shape: _PolygonCoords | Shape | None = None) -> None: ... -@overload -def colormode(cmode: None = None) -> float: ... -@overload -def colormode(cmode: float) -> None: ... -def reset() -> None: ... -def turtles() -> list[Turtle]: ... -@overload -def bgcolor() -> _AnyColor: ... -@overload -def bgcolor(color: _Color) -> None: ... -@overload -def bgcolor(r: float, g: float, b: float) -> None: ... -@overload -def tracer(n: None = None) -> int: ... -@overload -def tracer(n: int, delay: int | None = None) -> None: ... -@overload -def delay(delay: None = None) -> int: ... -@overload -def delay(delay: int) -> None: ... -def update() -> None: ... -def window_width() -> int: ... -def window_height() -> int: ... -def getcanvas() -> Canvas: ... -def getshapes() -> list[str]: ... -def onclick(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... -def onkey(fun: Callable[[], object], key: str) -> None: ... -def listen(xdummy: float | None = None, ydummy: float | None = None) -> None: ... -def ontimer(fun: Callable[[], object], t: int = 0) -> None: ... -@overload -def bgpic(picname: None = None) -> str: ... -@overload -def bgpic(picname: str) -> None: ... -@overload -def screensize(canvwidth: None = None, canvheight: None = None, bg: None = None) -> tuple[int, int]: ... -@overload -def screensize(canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ... - -onscreenclick = onclick -resetscreen = reset -clearscreen = clear -addshape = register_shape - -def onkeypress(fun: Callable[[], object], key: str | None = None) -> None: ... - -onkeyrelease = onkey - -# Functions copied from _Screen: - -def setup(width: float = 0.5, height: float = 0.75, startx: int | None = None, starty: int | None = None) -> None: ... -def title(titlestring: str) -> None: ... -def bye() -> None: ... -def exitonclick() -> None: ... -def Screen() -> _Screen: ... - -# Functions copied from TNavigator: - -def degrees(fullcircle: float = 360.0) -> None: ... -def radians() -> None: ... -def forward(distance: float) -> None: ... -def back(distance: float) -> None: ... -def right(angle: float) -> None: ... -def left(angle: float) -> None: ... -def pos() -> Vec2D: ... -def xcor() -> float: ... -def ycor() -> float: ... -@overload -def goto(x: tuple[float, float], y: None = None) -> None: ... -@overload -def goto(x: float, y: float) -> None: ... -def home() -> None: ... -def setx(x: float) -> None: ... -def sety(y: float) -> None: ... -@overload -def distance(x: TNavigator | tuple[float, float], y: None = None) -> float: ... -@overload -def distance(x: float, y: float) -> float: ... -@overload -def towards(x: TNavigator | tuple[float, float], y: None = None) -> float: ... -@overload -def towards(x: float, y: float) -> float: ... -def heading() -> float: ... -def setheading(to_angle: float) -> None: ... -def circle(radius: float, extent: float | None = None, steps: int | None = None) -> None: ... - -fd = forward -bk = back -backward = back -rt = right -lt = left -position = pos -setpos = goto -setposition = goto -seth = setheading - -# Functions copied from TPen: -@overload -def resizemode(rmode: None = None) -> str: ... -@overload -def resizemode(rmode: str) -> None: ... -@overload -def pensize(width: None = None) -> int: ... -@overload -def pensize(width: int) -> None: ... -def penup() -> None: ... -def pendown() -> None: ... -def isdown() -> bool: ... -@overload -def speed(speed: None = None) -> int: ... -@overload -def speed(speed: _Speed) -> None: ... -@overload -def pencolor() -> _AnyColor: ... -@overload -def pencolor(color: _Color) -> None: ... -@overload -def pencolor(r: float, g: float, b: float) -> None: ... -@overload -def fillcolor() -> _AnyColor: ... -@overload -def fillcolor(color: _Color) -> None: ... -@overload -def fillcolor(r: float, g: float, b: float) -> None: ... -@overload -def color() -> tuple[_AnyColor, _AnyColor]: ... -@overload -def color(color: _Color) -> None: ... -@overload -def color(r: float, g: float, b: float) -> None: ... -@overload -def color(color1: _Color, color2: _Color) -> None: ... -def showturtle() -> None: ... -def hideturtle() -> None: ... -def isvisible() -> bool: ... - -# Note: signatures 1 and 2 overlap unsafely when no arguments are provided -@overload -def pen() -> _PenState: ... -@overload -def pen( - pen: _PenState | None = None, - *, - shown: bool = ..., - pendown: bool = ..., - pencolor: _Color = ..., - fillcolor: _Color = ..., - pensize: int = ..., - speed: int = ..., - resizemode: str = ..., - stretchfactor: tuple[float, float] = ..., - outline: int = ..., - tilt: float = ..., -) -> None: ... - -width = pensize -up = penup -pu = penup -pd = pendown -down = pendown -st = showturtle -ht = hideturtle - -# Functions copied from RawTurtle: - -def setundobuffer(size: int | None) -> None: ... -def undobufferentries() -> int: ... -@overload -def shape(name: None = None) -> str: ... -@overload -def shape(name: str) -> None: ... - -if sys.version_info >= (3, 12): - def teleport(x: float | None = None, y: float | None = None, *, fill_gap: bool = False) -> None: ... - -# Unsafely overlaps when no arguments are provided -@overload -def shapesize() -> tuple[float, float, float]: ... -@overload -def shapesize(stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None) -> None: ... -@overload -def shearfactor(shear: None = None) -> float: ... -@overload -def shearfactor(shear: float) -> None: ... - -# Unsafely overlaps when no arguments are provided -@overload -def shapetransform() -> tuple[float, float, float, float]: ... -@overload -def shapetransform( - t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None -) -> None: ... -def get_shapepoly() -> _PolygonCoords | None: ... - -if sys.version_info < (3, 13): - def settiltangle(angle: float) -> None: ... - -@overload -def tiltangle(angle: None = None) -> float: ... -@overload -def tiltangle(angle: float) -> None: ... -def tilt(angle: float) -> None: ... - -# Can return either 'int' or Tuple[int, ...] based on if the stamp is -# a compound stamp or not. So, as per the "no Union return" policy, -# we return Any. -def stamp() -> Any: ... -def clearstamp(stampid: int | tuple[int, ...]) -> None: ... -def clearstamps(n: int | None = None) -> None: ... -def filling() -> bool: ... -def begin_fill() -> None: ... -def end_fill() -> None: ... -def dot(size: int | None = None, *color: _Color) -> None: ... -def write(arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")) -> None: ... -def begin_poly() -> None: ... -def end_poly() -> None: ... -def get_poly() -> _PolygonCoords | None: ... -def getscreen() -> TurtleScreen: ... -def getturtle() -> Turtle: ... - -getpen = getturtle - -def onrelease(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... -def ondrag(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ... -def undo() -> None: ... - -turtlesize = shapesize - -# Functions copied from RawTurtle with a few tweaks: - -def clone() -> Turtle: ... - -# Extra functions present only in the global scope: - -done = mainloop diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/types.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/types.pyi index fe443be271..cab5ac2307 100644 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/types.pyi +++ b/crates/red_knot_vendored/vendor/typeshed/stdlib/types.pyi @@ -1,693 +1 @@ -import sys -from _typeshed import MaybeNone, SupportsKeysAndGetItem -from _typeshed.importlib import LoaderProtocol -from collections.abc import ( - AsyncGenerator, - Awaitable, - Callable, - Coroutine, - Generator, - ItemsView, - Iterable, - Iterator, - KeysView, - Mapping, - MutableSequence, - ValuesView, -) -from importlib.machinery import ModuleSpec -from typing import Any, ClassVar, Literal, TypeVar, final, overload -from typing_extensions import ParamSpec, Self, TypeAliasType, TypeVarTuple, deprecated - -__all__ = [ - "FunctionType", - "LambdaType", - "CodeType", - "MappingProxyType", - "SimpleNamespace", - "GeneratorType", - "CoroutineType", - "AsyncGeneratorType", - "MethodType", - "BuiltinFunctionType", - "ModuleType", - "TracebackType", - "FrameType", - "GetSetDescriptorType", - "MemberDescriptorType", - "new_class", - "prepare_class", - "DynamicClassAttribute", - "coroutine", - "BuiltinMethodType", - "ClassMethodDescriptorType", - "MethodDescriptorType", - "MethodWrapperType", - "WrapperDescriptorType", - "resolve_bases", - "CellType", - "GenericAlias", -] - -if sys.version_info >= (3, 10): - __all__ += ["EllipsisType", "NoneType", "NotImplementedType", "UnionType"] - -if sys.version_info >= (3, 12): - __all__ += ["get_original_bases"] - -if sys.version_info >= (3, 13): - __all__ += ["CapsuleType"] - -# Note, all classes "defined" here require special handling. - -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") -_KT = TypeVar("_KT") -_VT_co = TypeVar("_VT_co", covariant=True) - -# Make sure this class definition stays roughly in line with `builtins.function` -@final -class FunctionType: - @property - def __closure__(self) -> tuple[CellType, ...] | None: ... - __code__: CodeType - __defaults__: tuple[Any, ...] | None - __dict__: dict[str, Any] - @property - def __globals__(self) -> dict[str, Any]: ... - __name__: str - __qualname__: str - __annotations__: dict[str, Any] - __kwdefaults__: dict[str, Any] | None - if sys.version_info >= (3, 10): - @property - def __builtins__(self) -> dict[str, Any]: ... - if sys.version_info >= (3, 12): - __type_params__: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] - - __module__: str - if sys.version_info >= (3, 13): - def __new__( - cls, - code: CodeType, - globals: dict[str, Any], - name: str | None = None, - argdefs: tuple[object, ...] | None = None, - closure: tuple[CellType, ...] | None = None, - kwdefaults: dict[str, object] | None = None, - ) -> Self: ... - else: - def __new__( - cls, - code: CodeType, - globals: dict[str, Any], - name: str | None = None, - argdefs: tuple[object, ...] | None = None, - closure: tuple[CellType, ...] | None = None, - ) -> Self: ... - - def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - @overload - def __get__(self, instance: None, owner: type, /) -> FunctionType: ... - @overload - def __get__(self, instance: object, owner: type | None = None, /) -> MethodType: ... - -LambdaType = FunctionType - -@final -class CodeType: - def __eq__(self, value: object, /) -> bool: ... - def __hash__(self) -> int: ... - @property - def co_argcount(self) -> int: ... - @property - def co_posonlyargcount(self) -> int: ... - @property - def co_kwonlyargcount(self) -> int: ... - @property - def co_nlocals(self) -> int: ... - @property - def co_stacksize(self) -> int: ... - @property - def co_flags(self) -> int: ... - @property - def co_code(self) -> bytes: ... - @property - def co_consts(self) -> tuple[Any, ...]: ... - @property - def co_names(self) -> tuple[str, ...]: ... - @property - def co_varnames(self) -> tuple[str, ...]: ... - @property - def co_filename(self) -> str: ... - @property - def co_name(self) -> str: ... - @property - def co_firstlineno(self) -> int: ... - if sys.version_info >= (3, 10): - @property - @deprecated("Will be removed in Python 3.14. Use the co_lines() method instead.") - def co_lnotab(self) -> bytes: ... - else: - @property - def co_lnotab(self) -> bytes: ... - - @property - def co_freevars(self) -> tuple[str, ...]: ... - @property - def co_cellvars(self) -> tuple[str, ...]: ... - if sys.version_info >= (3, 10): - @property - def co_linetable(self) -> bytes: ... - def co_lines(self) -> Iterator[tuple[int, int, int | None]]: ... - if sys.version_info >= (3, 11): - @property - def co_exceptiontable(self) -> bytes: ... - @property - def co_qualname(self) -> str: ... - def co_positions(self) -> Iterable[tuple[int | None, int | None, int | None, int | None]]: ... - - if sys.version_info >= (3, 11): - def __new__( - cls, - argcount: int, - posonlyargcount: int, - kwonlyargcount: int, - nlocals: int, - stacksize: int, - flags: int, - codestring: bytes, - constants: tuple[object, ...], - names: tuple[str, ...], - varnames: tuple[str, ...], - filename: str, - name: str, - qualname: str, - firstlineno: int, - linetable: bytes, - exceptiontable: bytes, - freevars: tuple[str, ...] = ..., - cellvars: tuple[str, ...] = ..., - /, - ) -> Self: ... - elif sys.version_info >= (3, 10): - def __new__( - cls, - argcount: int, - posonlyargcount: int, - kwonlyargcount: int, - nlocals: int, - stacksize: int, - flags: int, - codestring: bytes, - constants: tuple[object, ...], - names: tuple[str, ...], - varnames: tuple[str, ...], - filename: str, - name: str, - firstlineno: int, - linetable: bytes, - freevars: tuple[str, ...] = ..., - cellvars: tuple[str, ...] = ..., - /, - ) -> Self: ... - else: - def __new__( - cls, - argcount: int, - posonlyargcount: int, - kwonlyargcount: int, - nlocals: int, - stacksize: int, - flags: int, - codestring: bytes, - constants: tuple[object, ...], - names: tuple[str, ...], - varnames: tuple[str, ...], - filename: str, - name: str, - firstlineno: int, - lnotab: bytes, - freevars: tuple[str, ...] = ..., - cellvars: tuple[str, ...] = ..., - /, - ) -> Self: ... - if sys.version_info >= (3, 11): - def replace( - self, - *, - co_argcount: int = -1, - co_posonlyargcount: int = -1, - co_kwonlyargcount: int = -1, - co_nlocals: int = -1, - co_stacksize: int = -1, - co_flags: int = -1, - co_firstlineno: int = -1, - co_code: bytes = ..., - co_consts: tuple[object, ...] = ..., - co_names: tuple[str, ...] = ..., - co_varnames: tuple[str, ...] = ..., - co_freevars: tuple[str, ...] = ..., - co_cellvars: tuple[str, ...] = ..., - co_filename: str = ..., - co_name: str = ..., - co_qualname: str = ..., - co_linetable: bytes = ..., - co_exceptiontable: bytes = ..., - ) -> Self: ... - elif sys.version_info >= (3, 10): - def replace( - self, - *, - co_argcount: int = -1, - co_posonlyargcount: int = -1, - co_kwonlyargcount: int = -1, - co_nlocals: int = -1, - co_stacksize: int = -1, - co_flags: int = -1, - co_firstlineno: int = -1, - co_code: bytes = ..., - co_consts: tuple[object, ...] = ..., - co_names: tuple[str, ...] = ..., - co_varnames: tuple[str, ...] = ..., - co_freevars: tuple[str, ...] = ..., - co_cellvars: tuple[str, ...] = ..., - co_filename: str = ..., - co_name: str = ..., - co_linetable: bytes = ..., - ) -> Self: ... - else: - def replace( - self, - *, - co_argcount: int = -1, - co_posonlyargcount: int = -1, - co_kwonlyargcount: int = -1, - co_nlocals: int = -1, - co_stacksize: int = -1, - co_flags: int = -1, - co_firstlineno: int = -1, - co_code: bytes = ..., - co_consts: tuple[object, ...] = ..., - co_names: tuple[str, ...] = ..., - co_varnames: tuple[str, ...] = ..., - co_freevars: tuple[str, ...] = ..., - co_cellvars: tuple[str, ...] = ..., - co_filename: str = ..., - co_name: str = ..., - co_lnotab: bytes = ..., - ) -> Self: ... - - if sys.version_info >= (3, 13): - __replace__ = replace - -@final -class MappingProxyType(Mapping[_KT, _VT_co]): - __hash__: ClassVar[None] # type: ignore[assignment] - def __new__(cls, mapping: SupportsKeysAndGetItem[_KT, _VT_co]) -> Self: ... - def __getitem__(self, key: _KT, /) -> _VT_co: ... - def __iter__(self) -> Iterator[_KT]: ... - def __len__(self) -> int: ... - def __eq__(self, value: object, /) -> bool: ... - def copy(self) -> dict[_KT, _VT_co]: ... - def keys(self) -> KeysView[_KT]: ... - def values(self) -> ValuesView[_VT_co]: ... - def items(self) -> ItemsView[_KT, _VT_co]: ... - @overload - def get(self, key: _KT, /) -> _VT_co | None: ... - @overload - def get(self, key: _KT, default: _VT_co | _T2, /) -> _VT_co | _T2: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - def __reversed__(self) -> Iterator[_KT]: ... - def __or__(self, value: Mapping[_T1, _T2], /) -> dict[_KT | _T1, _VT_co | _T2]: ... - def __ror__(self, value: Mapping[_T1, _T2], /) -> dict[_KT | _T1, _VT_co | _T2]: ... - -class SimpleNamespace: - __hash__: ClassVar[None] # type: ignore[assignment] - if sys.version_info >= (3, 13): - def __init__(self, mapping_or_iterable: Mapping[str, Any] | Iterable[tuple[str, Any]] = (), /, **kwargs: Any) -> None: ... - else: - 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: ... - if sys.version_info >= (3, 13): - def __replace__(self, **kwargs: Any) -> Self: ... - -class ModuleType: - __name__: str - __file__: str | None - @property - def __dict__(self) -> dict[str, Any]: ... # type: ignore[override] - __loader__: LoaderProtocol | None - __package__: str | None - __path__: MutableSequence[str] - __spec__: ModuleSpec | None - # N.B. Although this is the same type as `builtins.object.__doc__`, - # it is deliberately redeclared here. Most symbols declared in the namespace - # of `types.ModuleType` are available as "implicit globals" within a module's - # namespace, but this is not true for symbols declared in the namespace of `builtins.object`. - # Redeclaring `__doc__` here helps some type checkers understand that `__doc__` is available - # as an implicit global in all modules, similar to `__name__`, `__file__`, `__spec__`, etc. - __doc__: str | None - def __init__(self, name: str, doc: str | None = ...) -> None: ... - # __getattr__ doesn't exist at runtime, - # but having it here in typeshed makes dynamic imports - # using `builtins.__import__` or `importlib.import_module` less painful - def __getattr__(self, name: str) -> Any: ... - -@final -class CellType: - def __new__(cls, contents: object = ..., /) -> Self: ... - __hash__: ClassVar[None] # type: ignore[assignment] - cell_contents: Any - -_YieldT_co = TypeVar("_YieldT_co", covariant=True) -_SendT_contra = TypeVar("_SendT_contra", contravariant=True) -_ReturnT_co = TypeVar("_ReturnT_co", covariant=True) - -@final -class GeneratorType(Generator[_YieldT_co, _SendT_contra, _ReturnT_co]): - @property - def gi_code(self) -> CodeType: ... - @property - def gi_frame(self) -> FrameType: ... - @property - def gi_running(self) -> bool: ... - @property - def gi_yieldfrom(self) -> GeneratorType[_YieldT_co, _SendT_contra, Any] | None: ... - if sys.version_info >= (3, 11): - @property - def gi_suspended(self) -> bool: ... - __name__: str - __qualname__: str - def __iter__(self) -> Self: ... - def __next__(self) -> _YieldT_co: ... - def send(self, arg: _SendT_contra, /) -> _YieldT_co: ... - @overload - def throw( - self, typ: type[BaseException], val: BaseException | object = ..., tb: TracebackType | None = ..., / - ) -> _YieldT_co: ... - @overload - def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = ..., /) -> _YieldT_co: ... - if sys.version_info >= (3, 13): - def __class_getitem__(cls, item: Any, /) -> Any: ... - -@final -class AsyncGeneratorType(AsyncGenerator[_YieldT_co, _SendT_contra]): - @property - def ag_await(self) -> Awaitable[Any] | None: ... - @property - def ag_code(self) -> CodeType: ... - @property - def ag_frame(self) -> FrameType: ... - @property - def ag_running(self) -> bool: ... - __name__: str - __qualname__: str - if sys.version_info >= (3, 12): - @property - def ag_suspended(self) -> bool: ... - - def __aiter__(self) -> Self: ... - def __anext__(self) -> Coroutine[Any, Any, _YieldT_co]: ... - def asend(self, val: _SendT_contra, /) -> Coroutine[Any, Any, _YieldT_co]: ... - @overload - async def athrow( - self, typ: type[BaseException], val: BaseException | object = ..., tb: TracebackType | None = ..., / - ) -> _YieldT_co: ... - @overload - async def athrow(self, typ: BaseException, val: None = None, tb: TracebackType | None = ..., /) -> _YieldT_co: ... - def aclose(self) -> Coroutine[Any, Any, None]: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -@final -class CoroutineType(Coroutine[_YieldT_co, _SendT_contra, _ReturnT_co]): - __name__: str - __qualname__: str - @property - def cr_await(self) -> Any | None: ... - @property - def cr_code(self) -> CodeType: ... - @property - def cr_frame(self) -> FrameType: ... - @property - def cr_running(self) -> bool: ... - @property - def cr_origin(self) -> tuple[tuple[str, int, str], ...] | None: ... - if sys.version_info >= (3, 11): - @property - def cr_suspended(self) -> bool: ... - - def close(self) -> None: ... - def __await__(self) -> Generator[Any, None, _ReturnT_co]: ... - def send(self, arg: _SendT_contra, /) -> _YieldT_co: ... - @overload - def throw( - self, typ: type[BaseException], val: BaseException | object = ..., tb: TracebackType | None = ..., / - ) -> _YieldT_co: ... - @overload - def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = ..., /) -> _YieldT_co: ... - if sys.version_info >= (3, 13): - def __class_getitem__(cls, item: Any, /) -> Any: ... - -@final -class MethodType: - @property - def __closure__(self) -> tuple[CellType, ...] | None: ... # inherited from the added function - @property - def __code__(self) -> CodeType: ... # inherited from the added function - @property - def __defaults__(self) -> tuple[Any, ...] | None: ... # inherited from the added function - @property - def __func__(self) -> Callable[..., Any]: ... - @property - def __self__(self) -> object: ... - @property - def __name__(self) -> str: ... # inherited from the added function - @property - def __qualname__(self) -> str: ... # inherited from the added function - def __new__(cls, func: Callable[..., Any], instance: object, /) -> Self: ... - def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __eq__(self, value: object, /) -> bool: ... - def __hash__(self) -> int: ... - -@final -class BuiltinFunctionType: - @property - def __self__(self) -> object | ModuleType: ... - @property - def __name__(self) -> str: ... - @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 - -@final -class WrapperDescriptorType: - @property - def __name__(self) -> str: ... - @property - def __qualname__(self) -> str: ... - @property - def __objclass__(self) -> type: ... - def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __get__(self, instance: Any, owner: type | None = None, /) -> Any: ... - -@final -class MethodWrapperType: - @property - def __self__(self) -> object: ... - @property - def __name__(self) -> str: ... - @property - def __qualname__(self) -> str: ... - @property - def __objclass__(self) -> type: ... - 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: - @property - def __name__(self) -> str: ... - @property - def __qualname__(self) -> str: ... - @property - def __objclass__(self) -> type: ... - def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __get__(self, instance: Any, owner: type | None = None, /) -> Any: ... - -@final -class ClassMethodDescriptorType: - @property - def __name__(self) -> str: ... - @property - def __qualname__(self) -> str: ... - @property - def __objclass__(self) -> type: ... - def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - def __get__(self, instance: Any, owner: type | None = None, /) -> Any: ... - -@final -class TracebackType: - def __new__(cls, tb_next: TracebackType | None, tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> Self: ... - tb_next: TracebackType | None - # the rest are read-only - @property - def tb_frame(self) -> FrameType: ... - @property - def tb_lasti(self) -> int: ... - @property - def tb_lineno(self) -> int: ... - -@final -class FrameType: - @property - def f_back(self) -> FrameType | None: ... - @property - def f_builtins(self) -> dict[str, Any]: ... - @property - def f_code(self) -> CodeType: ... - @property - def f_globals(self) -> dict[str, Any]: ... - @property - def f_lasti(self) -> int: ... - # see discussion in #6769: f_lineno *can* sometimes be None, - # but you should probably file a bug report with CPython if you encounter it being None in the wild. - # An `int | None` annotation here causes too many false-positive errors, so applying `int | Any`. - @property - def f_lineno(self) -> int | MaybeNone: ... - @property - def f_locals(self) -> dict[str, Any]: ... - f_trace: Callable[[FrameType, str, Any], Any] | None - f_trace_lines: bool - f_trace_opcodes: bool - def clear(self) -> None: ... - -@final -class GetSetDescriptorType: - @property - def __name__(self) -> str: ... - @property - def __qualname__(self) -> str: ... - @property - def __objclass__(self) -> type: ... - def __get__(self, instance: Any, owner: type | None = None, /) -> Any: ... - def __set__(self, instance: Any, value: Any, /) -> None: ... - def __delete__(self, instance: Any, /) -> None: ... - -@final -class MemberDescriptorType: - @property - def __name__(self) -> str: ... - @property - def __qualname__(self) -> str: ... - @property - def __objclass__(self) -> type: ... - def __get__(self, instance: Any, owner: type | None = None, /) -> Any: ... - def __set__(self, instance: Any, value: Any, /) -> None: ... - def __delete__(self, instance: Any, /) -> None: ... - -def new_class( - name: str, - bases: Iterable[object] = (), - kwds: dict[str, Any] | None = None, - exec_body: Callable[[dict[str, Any]], object] | None = None, -) -> type: ... -def resolve_bases(bases: Iterable[object]) -> tuple[Any, ...]: ... -def prepare_class( - name: str, bases: tuple[type, ...] = (), kwds: dict[str, Any] | None = None -) -> tuple[type, dict[str, Any], dict[str, Any]]: ... - -if sys.version_info >= (3, 12): - def get_original_bases(cls: type, /) -> tuple[Any, ...]: ... - -# Does not actually inherit from property, but saying it does makes sure that -# pyright handles this class correctly. -class DynamicClassAttribute(property): - fget: Callable[[Any], Any] | None - fset: Callable[[Any, Any], object] | None # type: ignore[assignment] - fdel: Callable[[Any], object] | None # type: ignore[assignment] - overwrite_doc: bool - __isabstractmethod__: bool - def __init__( - self, - fget: Callable[[Any], Any] | None = None, - fset: Callable[[Any, Any], object] | None = None, - fdel: Callable[[Any], object] | None = None, - doc: str | None = None, - ) -> None: ... - def __get__(self, instance: Any, ownerclass: type | None = None) -> Any: ... - def __set__(self, instance: Any, value: Any) -> None: ... - def __delete__(self, instance: Any) -> None: ... - def getter(self, fget: Callable[[Any], Any]) -> DynamicClassAttribute: ... - def setter(self, fset: Callable[[Any, Any], object]) -> DynamicClassAttribute: ... - def deleter(self, fdel: Callable[[Any], object]) -> DynamicClassAttribute: ... - -_Fn = TypeVar("_Fn", bound=Callable[..., object]) -_R = TypeVar("_R") -_P = ParamSpec("_P") - -# it's not really an Awaitable, but can be used in an await expression. Real type: Generator & Awaitable -@overload -def coroutine(func: Callable[_P, Generator[Any, Any, _R]]) -> Callable[_P, Awaitable[_R]]: ... -@overload -def coroutine(func: _Fn) -> _Fn: ... - -class GenericAlias: - @property - def __origin__(self) -> type | TypeAliasType: ... - @property - def __args__(self) -> tuple[Any, ...]: ... - @property - def __parameters__(self) -> tuple[Any, ...]: ... - def __new__(cls, origin: type, args: Any, /) -> Self: ... - def __getitem__(self, typeargs: Any, /) -> GenericAlias: ... - def __eq__(self, value: object, /) -> bool: ... - def __hash__(self) -> int: ... - def __mro_entries__(self, bases: Iterable[object], /) -> tuple[type, ...]: ... - if sys.version_info >= (3, 11): - @property - def __unpacked__(self) -> bool: ... - @property - def __typing_unpacked_tuple_args__(self) -> tuple[Any, ...] | None: ... - if sys.version_info >= (3, 10): - def __or__(self, value: Any, /) -> UnionType: ... - def __ror__(self, value: Any, /) -> UnionType: ... - - # GenericAlias delegates attr access to `__origin__` - def __getattr__(self, name: str) -> Any: ... - -if sys.version_info >= (3, 10): - @final - class NoneType: - def __bool__(self) -> Literal[False]: ... - - @final - class EllipsisType: ... - - from builtins import _NotImplementedType - - NotImplementedType = _NotImplementedType - @final - class UnionType: - @property - def __args__(self) -> tuple[Any, ...]: ... - @property - def __parameters__(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: ... - -if sys.version_info >= (3, 13): - @final - class CapsuleType: ... +class ModuleType: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/typing.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/typing.pyi deleted file mode 100644 index df753cfd9b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/typing.pyi +++ /dev/null @@ -1,1047 +0,0 @@ -# Since this module defines "overload" it is not recognized by Ruff as typing.overload -# ruff: noqa: F811 -# TODO: The collections import is required, otherwise mypy crashes. -# https://github.com/python/mypy/issues/16744 -import collections # noqa: F401 # pyright: ignore[reportUnusedImport] -import sys -import typing_extensions -from _collections_abc import dict_items, dict_keys, dict_values -from _typeshed import IdentityFunction, ReadableBuffer, SupportsKeysAndGetItem -from abc import ABCMeta, abstractmethod -from re import Match as Match, Pattern as Pattern -from types import ( - BuiltinFunctionType, - CodeType, - FunctionType, - GenericAlias, - MethodDescriptorType, - MethodType, - MethodWrapperType, - ModuleType, - TracebackType, - WrapperDescriptorType, -) -from typing_extensions import Never as _Never, ParamSpec as _ParamSpec, deprecated - -if sys.version_info >= (3, 10): - from types import UnionType - -__all__ = [ - "AbstractSet", - "Annotated", - "Any", - "AnyStr", - "AsyncContextManager", - "AsyncGenerator", - "AsyncIterable", - "AsyncIterator", - "Awaitable", - "BinaryIO", - "ByteString", - "Callable", - "ChainMap", - "ClassVar", - "Collection", - "Container", - "ContextManager", - "Coroutine", - "Counter", - "DefaultDict", - "Deque", - "Dict", - "Final", - "ForwardRef", - "FrozenSet", - "Generator", - "Generic", - "Hashable", - "IO", - "ItemsView", - "Iterable", - "Iterator", - "KeysView", - "List", - "Literal", - "Mapping", - "MappingView", - "Match", - "MutableMapping", - "MutableSequence", - "MutableSet", - "NamedTuple", - "NewType", - "NoReturn", - "Optional", - "OrderedDict", - "Pattern", - "Protocol", - "Reversible", - "Sequence", - "Set", - "Sized", - "SupportsAbs", - "SupportsBytes", - "SupportsComplex", - "SupportsFloat", - "SupportsIndex", - "SupportsInt", - "SupportsRound", - "Text", - "TextIO", - "Tuple", - "Type", - "TypeVar", - "TypedDict", - "Union", - "ValuesView", - "TYPE_CHECKING", - "cast", - "final", - "get_args", - "get_origin", - "get_type_hints", - "no_type_check", - "no_type_check_decorator", - "overload", - "runtime_checkable", -] - -if sys.version_info >= (3, 10): - __all__ += ["Concatenate", "ParamSpec", "ParamSpecArgs", "ParamSpecKwargs", "TypeAlias", "TypeGuard", "is_typeddict"] - -if sys.version_info >= (3, 11): - __all__ += [ - "LiteralString", - "Never", - "NotRequired", - "Required", - "Self", - "TypeVarTuple", - "Unpack", - "assert_never", - "assert_type", - "clear_overloads", - "dataclass_transform", - "get_overloads", - "reveal_type", - ] - -if sys.version_info >= (3, 12): - __all__ += ["TypeAliasType", "override"] - -if sys.version_info >= (3, 13): - __all__ += ["get_protocol_members", "is_protocol", "NoDefault", "TypeIs", "ReadOnly"] - -class Any: ... -class _Final: ... - -def final(f: _T) -> _T: ... -@final -class TypeVar: - @property - def __name__(self) -> str: ... - @property - def __bound__(self) -> Any | None: ... - @property - def __constraints__(self) -> tuple[Any, ...]: ... - @property - def __covariant__(self) -> bool: ... - @property - def __contravariant__(self) -> bool: ... - if sys.version_info >= (3, 12): - @property - def __infer_variance__(self) -> bool: ... - if sys.version_info >= (3, 13): - @property - def __default__(self) -> Any: ... - if sys.version_info >= (3, 13): - def __new__( - cls, - name: str, - *constraints: Any, - bound: Any | None = None, - contravariant: bool = False, - covariant: bool = False, - infer_variance: bool = False, - default: Any = ..., - ) -> Self: ... - elif sys.version_info >= (3, 12): - def __new__( - cls, - name: str, - *constraints: Any, - bound: Any | None = None, - covariant: bool = False, - contravariant: bool = False, - infer_variance: bool = False, - ) -> Self: ... - elif sys.version_info >= (3, 11): - def __new__( - cls, name: str, *constraints: Any, bound: Any | None = None, covariant: bool = False, contravariant: bool = False - ) -> Self: ... - else: - def __init__( - self, name: str, *constraints: Any, bound: Any | None = None, covariant: bool = False, contravariant: bool = False - ) -> None: ... - if sys.version_info >= (3, 10): - def __or__(self, right: Any) -> _SpecialForm: ... - def __ror__(self, left: Any) -> _SpecialForm: ... - if sys.version_info >= (3, 11): - def __typing_subst__(self, arg: Any) -> Any: ... - if sys.version_info >= (3, 13): - def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ... - def has_default(self) -> bool: ... - -# Used for an undocumented mypy feature. Does not exist at runtime. -_promote = object() - -# N.B. Keep this definition in sync with typing_extensions._SpecialForm -@final -class _SpecialForm(_Final): - def __getitem__(self, parameters: Any) -> object: ... - if sys.version_info >= (3, 10): - def __or__(self, other: Any) -> _SpecialForm: ... - def __ror__(self, other: Any) -> _SpecialForm: ... - -Union: _SpecialForm -Generic: _SpecialForm -Protocol: _SpecialForm -Callable: _SpecialForm -Type: _SpecialForm -NoReturn: _SpecialForm -ClassVar: _SpecialForm - -Optional: _SpecialForm -Tuple: _SpecialForm -Final: _SpecialForm - -Literal: _SpecialForm -TypedDict: _SpecialForm - -if sys.version_info >= (3, 11): - Self: _SpecialForm - Never: _SpecialForm - Unpack: _SpecialForm - Required: _SpecialForm - NotRequired: _SpecialForm - LiteralString: _SpecialForm - - @final - class TypeVarTuple: - @property - def __name__(self) -> str: ... - if sys.version_info >= (3, 13): - @property - def __default__(self) -> Any: ... - def has_default(self) -> bool: ... - if sys.version_info >= (3, 13): - def __new__(cls, name: str, *, default: Any = ...) -> Self: ... - elif sys.version_info >= (3, 12): - def __new__(cls, name: str) -> Self: ... - else: - def __init__(self, name: str) -> None: ... - - def __iter__(self) -> Any: ... - def __typing_subst__(self, arg: Never) -> Never: ... - def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ... - -if sys.version_info >= (3, 10): - @final - class ParamSpecArgs: - @property - def __origin__(self) -> ParamSpec: ... - if sys.version_info >= (3, 12): - def __new__(cls, origin: ParamSpec) -> Self: ... - else: - def __init__(self, origin: ParamSpec) -> None: ... - - def __eq__(self, other: object) -> bool: ... - __hash__: ClassVar[None] # type: ignore[assignment] - - @final - class ParamSpecKwargs: - @property - def __origin__(self) -> ParamSpec: ... - if sys.version_info >= (3, 12): - def __new__(cls, origin: ParamSpec) -> Self: ... - else: - def __init__(self, origin: ParamSpec) -> None: ... - - def __eq__(self, other: object) -> bool: ... - __hash__: ClassVar[None] # type: ignore[assignment] - - @final - class ParamSpec: - @property - def __name__(self) -> str: ... - @property - def __bound__(self) -> Any | None: ... - @property - def __covariant__(self) -> bool: ... - @property - def __contravariant__(self) -> bool: ... - if sys.version_info >= (3, 12): - @property - def __infer_variance__(self) -> bool: ... - if sys.version_info >= (3, 13): - @property - def __default__(self) -> Any: ... - if sys.version_info >= (3, 13): - def __new__( - cls, - name: str, - *, - bound: Any | None = None, - contravariant: bool = False, - covariant: bool = False, - infer_variance: bool = False, - default: Any = ..., - ) -> Self: ... - elif sys.version_info >= (3, 12): - def __new__( - cls, - name: str, - *, - bound: Any | None = None, - contravariant: bool = False, - covariant: bool = False, - infer_variance: bool = False, - ) -> Self: ... - elif sys.version_info >= (3, 11): - def __new__( - cls, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False - ) -> Self: ... - else: - def __init__( - self, name: str, *, bound: Any | None = None, contravariant: bool = False, covariant: bool = False - ) -> None: ... - - @property - def args(self) -> ParamSpecArgs: ... - @property - def kwargs(self) -> ParamSpecKwargs: ... - if sys.version_info >= (3, 11): - def __typing_subst__(self, arg: Any) -> Any: ... - def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ... - - def __or__(self, right: Any) -> _SpecialForm: ... - def __ror__(self, left: Any) -> _SpecialForm: ... - if sys.version_info >= (3, 13): - def has_default(self) -> bool: ... - - Concatenate: _SpecialForm - TypeAlias: _SpecialForm - TypeGuard: _SpecialForm - - class NewType: - def __init__(self, name: str, tp: Any) -> None: ... - if sys.version_info >= (3, 11): - @staticmethod - def __call__(x: _T, /) -> _T: ... - else: - def __call__(self, x: _T) -> _T: ... - - def __or__(self, other: Any) -> _SpecialForm: ... - def __ror__(self, other: Any) -> _SpecialForm: ... - __supertype__: type | NewType - -else: - def NewType(name: str, tp: Any) -> Any: ... - -_F = TypeVar("_F", bound=Callable[..., Any]) -_P = _ParamSpec("_P") -_T = TypeVar("_T") - -_FT = TypeVar("_FT", bound=Callable[..., Any] | type) - -# These type variables are used by the container types. -_S = TypeVar("_S") -_KT = TypeVar("_KT") # Key type. -_VT = TypeVar("_VT") # Value type. -_T_co = TypeVar("_T_co", covariant=True) # Any type covariant containers. -_KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers. -_VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers. -_TC = TypeVar("_TC", bound=type[object]) - -def overload(func: _F) -> _F: ... -def no_type_check(arg: _F) -> _F: ... -def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ... - -# This itself is only available during type checking -def type_check_only(func_or_cls: _FT) -> _FT: ... - -# Type aliases and type constructors - -class _Alias: - # Class for defining generic aliases for library types. - def __getitem__(self, typeargs: Any) -> Any: ... - -List = _Alias() -Dict = _Alias() -DefaultDict = _Alias() -Set = _Alias() -FrozenSet = _Alias() -Counter = _Alias() -Deque = _Alias() -ChainMap = _Alias() - -OrderedDict = _Alias() - -Annotated: _SpecialForm - -# Predefined type variables. -AnyStr = TypeVar("AnyStr", str, bytes) # noqa: Y001 - -class _ProtocolMeta(ABCMeta): - if sys.version_info >= (3, 12): - def __init__(cls, *args: Any, **kwargs: Any) -> None: ... - -# Abstract base classes. - -def runtime_checkable(cls: _TC) -> _TC: ... -@runtime_checkable -class SupportsInt(Protocol, metaclass=ABCMeta): - @abstractmethod - def __int__(self) -> int: ... - -@runtime_checkable -class SupportsFloat(Protocol, metaclass=ABCMeta): - @abstractmethod - def __float__(self) -> float: ... - -@runtime_checkable -class SupportsComplex(Protocol, metaclass=ABCMeta): - @abstractmethod - def __complex__(self) -> complex: ... - -@runtime_checkable -class SupportsBytes(Protocol, metaclass=ABCMeta): - @abstractmethod - def __bytes__(self) -> bytes: ... - -@runtime_checkable -class SupportsIndex(Protocol, metaclass=ABCMeta): - @abstractmethod - def __index__(self) -> int: ... - -@runtime_checkable -class SupportsAbs(Protocol[_T_co]): - @abstractmethod - def __abs__(self) -> _T_co: ... - -@runtime_checkable -class SupportsRound(Protocol[_T_co]): - @overload - @abstractmethod - def __round__(self) -> int: ... - @overload - @abstractmethod - def __round__(self, ndigits: int, /) -> _T_co: ... - -@runtime_checkable -class Sized(Protocol, metaclass=ABCMeta): - @abstractmethod - def __len__(self) -> int: ... - -@runtime_checkable -class Hashable(Protocol, metaclass=ABCMeta): - # TODO: This is special, in that a subclass of a hashable class may not be hashable - # (for example, list vs. object). It's not obvious how to represent this. This class - # is currently mostly useless for static checking. - @abstractmethod - def __hash__(self) -> int: ... - -@runtime_checkable -class Iterable(Protocol[_T_co]): - @abstractmethod - def __iter__(self) -> Iterator[_T_co]: ... - -@runtime_checkable -class Iterator(Iterable[_T_co], Protocol[_T_co]): - @abstractmethod - def __next__(self) -> _T_co: ... - def __iter__(self) -> Iterator[_T_co]: ... - -@runtime_checkable -class Reversible(Iterable[_T_co], Protocol[_T_co]): - @abstractmethod - def __reversed__(self) -> Iterator[_T_co]: ... - -_YieldT_co = TypeVar("_YieldT_co", covariant=True) -_SendT_contra = TypeVar("_SendT_contra", contravariant=True, default=None) -_ReturnT_co = TypeVar("_ReturnT_co", covariant=True, default=None) - -@runtime_checkable -class Generator(Iterator[_YieldT_co], Protocol[_YieldT_co, _SendT_contra, _ReturnT_co]): - def __next__(self) -> _YieldT_co: ... - @abstractmethod - def send(self, value: _SendT_contra, /) -> _YieldT_co: ... - @overload - @abstractmethod - def throw( - self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, / - ) -> _YieldT_co: ... - @overload - @abstractmethod - def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> _YieldT_co: ... - if sys.version_info >= (3, 13): - def close(self) -> _ReturnT_co | None: ... - else: - def close(self) -> None: ... - - def __iter__(self) -> Generator[_YieldT_co, _SendT_contra, _ReturnT_co]: ... - -# NOTE: Prior to Python 3.13 these aliases are lacking the second _ExitT_co parameter -if sys.version_info >= (3, 13): - from contextlib import AbstractAsyncContextManager as AsyncContextManager, AbstractContextManager as ContextManager -else: - from contextlib import AbstractAsyncContextManager, AbstractContextManager - - @runtime_checkable - class ContextManager(AbstractContextManager[_T_co, bool | None], Protocol[_T_co]): ... - - @runtime_checkable - class AsyncContextManager(AbstractAsyncContextManager[_T_co, bool | None], Protocol[_T_co]): ... - -@runtime_checkable -class Awaitable(Protocol[_T_co]): - @abstractmethod - def __await__(self) -> Generator[Any, Any, _T_co]: ... - -# Non-default variations to accommodate couroutines, and `AwaitableGenerator` having a 4th type parameter. -_SendT_nd_contra = TypeVar("_SendT_nd_contra", contravariant=True) -_ReturnT_nd_co = TypeVar("_ReturnT_nd_co", covariant=True) - -class Coroutine(Awaitable[_ReturnT_nd_co], Generic[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co]): - __name__: str - __qualname__: str - - @abstractmethod - def send(self, value: _SendT_nd_contra, /) -> _YieldT_co: ... - @overload - @abstractmethod - def throw( - self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, / - ) -> _YieldT_co: ... - @overload - @abstractmethod - def throw(self, typ: BaseException, val: None = None, tb: TracebackType | None = None, /) -> _YieldT_co: ... - @abstractmethod - def close(self) -> None: ... - -# NOTE: This type does not exist in typing.py or PEP 484 but mypy needs it to exist. -# The parameters correspond to Generator, but the 4th is the original type. -@type_check_only -class AwaitableGenerator( - Awaitable[_ReturnT_nd_co], - Generator[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co], - Generic[_YieldT_co, _SendT_nd_contra, _ReturnT_nd_co, _S], - metaclass=ABCMeta, -): ... - -@runtime_checkable -class AsyncIterable(Protocol[_T_co]): - @abstractmethod - def __aiter__(self) -> AsyncIterator[_T_co]: ... - -@runtime_checkable -class AsyncIterator(AsyncIterable[_T_co], Protocol[_T_co]): - @abstractmethod - def __anext__(self) -> Awaitable[_T_co]: ... - def __aiter__(self) -> AsyncIterator[_T_co]: ... - -@runtime_checkable -class AsyncGenerator(AsyncIterator[_YieldT_co], Protocol[_YieldT_co, _SendT_contra]): - def __anext__(self) -> Coroutine[Any, Any, _YieldT_co]: ... - @abstractmethod - def asend(self, value: _SendT_contra, /) -> Coroutine[Any, Any, _YieldT_co]: ... - @overload - @abstractmethod - def athrow( - self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, / - ) -> Coroutine[Any, Any, _YieldT_co]: ... - @overload - @abstractmethod - def athrow( - self, typ: BaseException, val: None = None, tb: TracebackType | None = None, / - ) -> Coroutine[Any, Any, _YieldT_co]: ... - def aclose(self) -> Coroutine[Any, Any, None]: ... - -@runtime_checkable -class Container(Protocol[_T_co]): - # This is generic more on vibes than anything else - @abstractmethod - def __contains__(self, x: object, /) -> bool: ... - -@runtime_checkable -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 Sequence(Reversible[_T_co], Collection[_T_co]): - @overload - @abstractmethod - def __getitem__(self, index: int) -> _T_co: ... - @overload - @abstractmethod - def __getitem__(self, index: slice) -> Sequence[_T_co]: ... - # Mixin methods - def index(self, value: Any, start: int = 0, stop: int = ...) -> int: ... - def count(self, value: Any) -> int: ... - def __contains__(self, value: object) -> bool: ... - def __iter__(self) -> Iterator[_T_co]: ... - def __reversed__(self) -> Iterator[_T_co]: ... - -class MutableSequence(Sequence[_T]): - @abstractmethod - def insert(self, index: int, value: _T) -> None: ... - @overload - @abstractmethod - def __getitem__(self, index: int) -> _T: ... - @overload - @abstractmethod - def __getitem__(self, index: slice) -> MutableSequence[_T]: ... - @overload - @abstractmethod - def __setitem__(self, index: int, value: _T) -> None: ... - @overload - @abstractmethod - def __setitem__(self, index: slice, value: Iterable[_T]) -> None: ... - @overload - @abstractmethod - def __delitem__(self, index: int) -> None: ... - @overload - @abstractmethod - def __delitem__(self, index: slice) -> None: ... - # Mixin methods - def append(self, value: _T) -> None: ... - def clear(self) -> None: ... - def extend(self, values: Iterable[_T]) -> None: ... - def reverse(self) -> None: ... - def pop(self, index: int = -1) -> _T: ... - def remove(self, value: _T) -> None: ... - def __iadd__(self, values: Iterable[_T]) -> typing_extensions.Self: ... - -class AbstractSet(Collection[_T_co]): - @abstractmethod - def __contains__(self, x: object) -> bool: ... - def _hash(self) -> int: ... - # Mixin methods - def __le__(self, other: AbstractSet[Any]) -> bool: ... - def __lt__(self, other: AbstractSet[Any]) -> bool: ... - def __gt__(self, other: AbstractSet[Any]) -> bool: ... - def __ge__(self, other: AbstractSet[Any]) -> bool: ... - def __and__(self, other: AbstractSet[Any]) -> AbstractSet[_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]): - @abstractmethod - def add(self, value: _T) -> None: ... - @abstractmethod - def discard(self, value: _T) -> None: ... - # Mixin methods - def clear(self) -> None: ... - def pop(self) -> _T: ... - def remove(self, value: _T) -> None: ... - def __ior__(self, it: AbstractSet[_T]) -> typing_extensions.Self: ... # type: ignore[override,misc] - def __iand__(self, it: AbstractSet[Any]) -> typing_extensions.Self: ... - def __ixor__(self, it: AbstractSet[_T]) -> typing_extensions.Self: ... # type: ignore[override,misc] - def __isub__(self, it: AbstractSet[Any]) -> typing_extensions.Self: ... - -class MappingView(Sized): - def __init__(self, mapping: Mapping[Any, Any]) -> None: ... # undocumented - def __len__(self) -> int: ... - -class ItemsView(MappingView, AbstractSet[tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]): - def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented - def __and__(self, other: Iterable[Any]) -> set[tuple[_KT_co, _VT_co]]: ... - def __rand__(self, other: Iterable[_T]) -> set[_T]: ... - def __contains__(self, item: object) -> bool: ... - def __iter__(self) -> Iterator[tuple[_KT_co, _VT_co]]: ... - def __or__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ... - def __ror__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ... - def __sub__(self, other: Iterable[Any]) -> set[tuple[_KT_co, _VT_co]]: ... - def __rsub__(self, other: Iterable[_T]) -> set[_T]: ... - def __xor__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ... - def __rxor__(self, other: Iterable[_T]) -> set[tuple[_KT_co, _VT_co] | _T]: ... - -class KeysView(MappingView, AbstractSet[_KT_co]): - def __init__(self, mapping: Mapping[_KT_co, Any]) -> None: ... # undocumented - def __and__(self, other: Iterable[Any]) -> set[_KT_co]: ... - def __rand__(self, other: Iterable[_T]) -> set[_T]: ... - def __contains__(self, key: object) -> bool: ... - def __iter__(self) -> Iterator[_KT_co]: ... - def __or__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ... - def __ror__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ... - def __sub__(self, other: Iterable[Any]) -> set[_KT_co]: ... - def __rsub__(self, other: Iterable[_T]) -> set[_T]: ... - def __xor__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ... - def __rxor__(self, other: Iterable[_T]) -> set[_KT_co | _T]: ... - -class ValuesView(MappingView, Collection[_VT_co]): - def __init__(self, mapping: Mapping[Any, _VT_co]) -> None: ... # undocumented - def __contains__(self, value: object) -> bool: ... - def __iter__(self) -> Iterator[_VT_co]: ... - -class Mapping(Collection[_KT], Generic[_KT, _VT_co]): - # TODO: We wish the key type could also be covariant, but that doesn't work, - # see discussion in https://github.com/python/typing/pull/273. - @abstractmethod - def __getitem__(self, key: _KT, /) -> _VT_co: ... - # Mixin methods - @overload - def get(self, key: _KT, /) -> _VT_co | None: ... - @overload - def get(self, key: _KT, /, default: _VT_co | _T) -> _VT_co | _T: ... - def items(self) -> ItemsView[_KT, _VT_co]: ... - def keys(self) -> KeysView[_KT]: ... - def values(self) -> ValuesView[_VT_co]: ... - def __contains__(self, key: object, /) -> bool: ... - def __eq__(self, other: object, /) -> bool: ... - -class MutableMapping(Mapping[_KT, _VT]): - @abstractmethod - def __setitem__(self, key: _KT, value: _VT, /) -> None: ... - @abstractmethod - def __delitem__(self, key: _KT, /) -> None: ... - def clear(self) -> None: ... - @overload - def pop(self, key: _KT, /) -> _VT: ... - @overload - def pop(self, key: _KT, /, default: _VT) -> _VT: ... - @overload - def pop(self, key: _KT, /, default: _T) -> _VT | _T: ... - def popitem(self) -> tuple[_KT, _VT]: ... - # This overload should be allowed only if the value type is compatible with None. - # - # Keep the following methods in line with MutableMapping.setdefault, modulo positional-only differences: - # -- collections.OrderedDict.setdefault - # -- collections.ChainMap.setdefault - # -- weakref.WeakKeyDictionary.setdefault - @overload - def setdefault(self: MutableMapping[_KT, _T | None], key: _KT, default: None = None, /) -> _T | None: ... - @overload - def setdefault(self, key: _KT, default: _VT, /) -> _VT: ... - # 'update' used to take a Union, but using overloading is better. - # The second overloaded type here is a bit too general, because - # Mapping[tuple[_KT, _VT], W] is a subclass of Iterable[tuple[_KT, _VT]], - # but will always have the behavior of the first overloaded type - # at runtime, leading to keys of a mix of types _KT and tuple[_KT, _VT]. - # We don't currently have any way of forcing all Mappings to use - # the first overload, but by using overloading rather than a Union, - # mypy will commit to using the first overload when the argument is - # known to be a Mapping with unknown type parameters, which is closer - # to the behavior we want. See mypy issue #1430. - # - # Various mapping classes have __ior__ methods that should be kept roughly in line with .update(): - # -- dict.__ior__ - # -- os._Environ.__ior__ - # -- collections.UserDict.__ior__ - # -- collections.ChainMap.__ior__ - # -- peewee.attrdict.__add__ - # -- peewee.attrdict.__iadd__ - # -- weakref.WeakValueDictionary.__ior__ - # -- weakref.WeakKeyDictionary.__ior__ - @overload - def update(self, m: SupportsKeysAndGetItem[_KT, _VT], /, **kwargs: _VT) -> None: ... - @overload - def update(self, m: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ... - @overload - def update(self, **kwargs: _VT) -> None: ... - -Text = str - -TYPE_CHECKING: Final[bool] - -# In stubs, the arguments of the IO class are marked as positional-only. -# This differs from runtime, but better reflects the fact that in reality -# classes deriving from IO use different names for the arguments. -class IO(Generic[AnyStr]): - # At runtime these are all abstract properties, - # but making them abstract in the stub is hugely disruptive, for not much gain. - # See #8726 - @property - def mode(self) -> str: ... - # Usually str, but may be bytes if a bytes path was passed to open(). See #10737. - # If PEP 696 becomes available, we may want to use a defaulted TypeVar here. - @property - def name(self) -> str | Any: ... - @abstractmethod - def close(self) -> None: ... - @property - def closed(self) -> bool: ... - @abstractmethod - def fileno(self) -> int: ... - @abstractmethod - def flush(self) -> None: ... - @abstractmethod - def isatty(self) -> bool: ... - @abstractmethod - def read(self, n: int = -1, /) -> AnyStr: ... - @abstractmethod - def readable(self) -> bool: ... - @abstractmethod - def readline(self, limit: int = -1, /) -> AnyStr: ... - @abstractmethod - def readlines(self, hint: int = -1, /) -> list[AnyStr]: ... - @abstractmethod - def seek(self, offset: int, whence: int = 0, /) -> int: ... - @abstractmethod - def seekable(self) -> bool: ... - @abstractmethod - def tell(self) -> int: ... - @abstractmethod - def truncate(self, size: int | None = None, /) -> int: ... - @abstractmethod - def writable(self) -> bool: ... - @abstractmethod - @overload - def write(self: IO[bytes], s: ReadableBuffer, /) -> int: ... - @abstractmethod - @overload - def write(self, s: AnyStr, /) -> int: ... - @abstractmethod - @overload - def writelines(self: IO[bytes], lines: Iterable[ReadableBuffer], /) -> None: ... - @abstractmethod - @overload - def writelines(self, lines: Iterable[AnyStr], /) -> None: ... - @abstractmethod - def __next__(self) -> AnyStr: ... - @abstractmethod - def __iter__(self) -> Iterator[AnyStr]: ... - @abstractmethod - def __enter__(self) -> IO[AnyStr]: ... - @abstractmethod - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None, / - ) -> None: ... - -class BinaryIO(IO[bytes]): - @abstractmethod - def __enter__(self) -> BinaryIO: ... - -class TextIO(IO[str]): - # See comment regarding the @properties in the `IO` class - @property - def buffer(self) -> BinaryIO: ... - @property - def encoding(self) -> str: ... - @property - def errors(self) -> str | None: ... - @property - def line_buffering(self) -> int: ... # int on PyPy, bool on CPython - @property - def newlines(self) -> Any: ... # None, str or tuple - @abstractmethod - def __enter__(self) -> TextIO: ... - -if sys.version_info < (3, 14): - ByteString: typing_extensions.TypeAlias = bytes | bytearray | memoryview - -# Functions - -_get_type_hints_obj_allowed_types: typing_extensions.TypeAlias = ( # noqa: Y042 - object - | Callable[..., Any] - | FunctionType - | BuiltinFunctionType - | MethodType - | ModuleType - | WrapperDescriptorType - | MethodWrapperType - | MethodDescriptorType -) - -def get_type_hints( - obj: _get_type_hints_obj_allowed_types, - globalns: dict[str, Any] | None = None, - localns: Mapping[str, Any] | None = None, - include_extras: bool = False, -) -> dict[str, Any]: ... -def get_args(tp: Any) -> tuple[Any, ...]: ... - -if sys.version_info >= (3, 10): - @overload - def get_origin(tp: ParamSpecArgs | ParamSpecKwargs) -> ParamSpec: ... - @overload - def get_origin(tp: UnionType) -> type[UnionType]: ... - -@overload -def get_origin(tp: GenericAlias) -> type: ... -@overload -def get_origin(tp: Any) -> Any | None: ... -@overload -def cast(typ: type[_T], val: Any) -> _T: ... -@overload -def cast(typ: str, val: Any) -> Any: ... -@overload -def cast(typ: object, val: Any) -> Any: ... - -if sys.version_info >= (3, 11): - def reveal_type(obj: _T, /) -> _T: ... - def assert_never(arg: Never, /) -> Never: ... - def assert_type(val: _T, typ: Any, /) -> _T: ... - def clear_overloads() -> None: ... - def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ... - def dataclass_transform( - *, - eq_default: bool = True, - order_default: bool = False, - kw_only_default: bool = False, - frozen_default: bool = False, # on 3.11, runtime accepts it as part of kwargs - field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = (), - **kwargs: Any, - ) -> IdentityFunction: ... - -# Type constructors - -class NamedTuple(tuple[Any, ...]): - _field_defaults: ClassVar[dict[str, Any]] - _fields: ClassVar[tuple[str, ...]] - # __orig_bases__ sometimes exists on <3.12, but not consistently - # So we only add it to the stub on 3.12+. - if sys.version_info >= (3, 12): - __orig_bases__: ClassVar[tuple[Any, ...]] - - @overload - def __init__(self, typename: str, fields: Iterable[tuple[str, Any]], /) -> None: ... - @overload - @typing_extensions.deprecated( - "Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15" - ) - def __init__(self, typename: str, fields: None = None, /, **kwargs: Any) -> None: ... - @classmethod - def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ... - def _asdict(self) -> dict[str, Any]: ... - def _replace(self, **kwargs: Any) -> typing_extensions.Self: ... - if sys.version_info >= (3, 13): - def __replace__(self, **kwargs: Any) -> typing_extensions.Self: ... - -# Internal mypy fallback type for all typed dicts (does not exist at runtime) -# N.B. Keep this mostly in sync with typing_extensions._TypedDict/mypy_extensions._TypedDict -@type_check_only -class _TypedDict(Mapping[str, object], metaclass=ABCMeta): - __total__: ClassVar[bool] - __required_keys__: ClassVar[frozenset[str]] - __optional_keys__: ClassVar[frozenset[str]] - # __orig_bases__ sometimes exists on <3.12, but not consistently, - # so we only add it to the stub on 3.12+ - if sys.version_info >= (3, 12): - __orig_bases__: ClassVar[tuple[Any, ...]] - if sys.version_info >= (3, 13): - __readonly_keys__: ClassVar[frozenset[str]] - __mutable_keys__: ClassVar[frozenset[str]] - - def copy(self) -> typing_extensions.Self: ... - # Using Never so that only calls using mypy plugin hook that specialize the signature - # can go through. - def setdefault(self, k: _Never, default: object) -> object: ... - # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. - def pop(self, k: _Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] - def update(self, m: typing_extensions.Self, /) -> None: ... - def __delitem__(self, k: _Never) -> None: ... - def items(self) -> dict_items[str, object]: ... - def keys(self) -> dict_keys[str, object]: ... - def values(self) -> dict_values[str, object]: ... - @overload - def __or__(self, value: typing_extensions.Self, /) -> typing_extensions.Self: ... - @overload - def __or__(self, value: dict[str, Any], /) -> dict[str, object]: ... - @overload - def __ror__(self, value: typing_extensions.Self, /) -> typing_extensions.Self: ... - @overload - def __ror__(self, value: dict[str, Any], /) -> dict[str, object]: ... - # supposedly incompatible definitions of __or__ and __ior__ - def __ior__(self, value: typing_extensions.Self, /) -> typing_extensions.Self: ... # type: ignore[misc] - -@final -class ForwardRef(_Final): - __forward_arg__: str - __forward_code__: CodeType - __forward_evaluated__: bool - __forward_value__: Any | None - __forward_is_argument__: bool - __forward_is_class__: bool - __forward_module__: Any | None - - def __init__(self, arg: str, is_argument: bool = True, module: Any | None = None, *, is_class: bool = False) -> None: ... - - if sys.version_info >= (3, 13): - @overload - @deprecated( - "Failing to pass a value to the 'type_params' parameter of ForwardRef._evaluate() is deprecated, " - "as it leads to incorrect behaviour when evaluating a stringified annotation " - "that references a PEP 695 type parameter. It will be disallowed in Python 3.15." - ) - def _evaluate( - self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None, *, recursive_guard: frozenset[str] - ) -> Any | None: ... - @overload - def _evaluate( - self, - globalns: dict[str, Any] | None, - localns: Mapping[str, Any] | None, - type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...], - *, - recursive_guard: frozenset[str], - ) -> Any | None: ... - elif sys.version_info >= (3, 12): - def _evaluate( - self, - globalns: dict[str, Any] | None, - localns: Mapping[str, Any] | None, - type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] | None = None, - *, - recursive_guard: frozenset[str], - ) -> Any | None: ... - else: - def _evaluate( - self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None, recursive_guard: frozenset[str] - ) -> Any | None: ... - - def __eq__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... - if sys.version_info >= (3, 11): - def __or__(self, other: Any) -> _SpecialForm: ... - def __ror__(self, other: Any) -> _SpecialForm: ... - -if sys.version_info >= (3, 10): - def is_typeddict(tp: object) -> bool: ... - -def _type_repr(obj: object) -> str: ... - -if sys.version_info >= (3, 12): - def override(method: _F, /) -> _F: ... - @final - class TypeAliasType: - def __new__(cls, name: str, value: Any, *, type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] = ()) -> Self: ... - @property - def __value__(self) -> Any: ... - @property - def __type_params__(self) -> tuple[TypeVar | ParamSpec | TypeVarTuple, ...]: ... - @property - def __parameters__(self) -> tuple[Any, ...]: ... - @property - def __name__(self) -> str: ... - # It's writable on types, but not on instances of TypeAliasType. - @property - def __module__(self) -> str | None: ... # type: ignore[override] - def __getitem__(self, parameters: Any) -> GenericAlias: ... - def __or__(self, right: Any) -> _SpecialForm: ... - def __ror__(self, left: Any) -> _SpecialForm: ... - -if sys.version_info >= (3, 13): - def is_protocol(tp: type, /) -> bool: ... - def get_protocol_members(tp: type, /) -> frozenset[str]: ... - @final - class _NoDefaultType: ... - - NoDefault: _NoDefaultType - TypeIs: _SpecialForm - ReadOnly: _SpecialForm diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/typing_extensions.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/typing_extensions.pyi deleted file mode 100644 index bad5fae880..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/typing_extensions.pyi +++ /dev/null @@ -1,626 +0,0 @@ -import abc -import enum -import sys -from _collections_abc import dict_items, dict_keys, dict_values -from _typeshed import IdentityFunction, Incomplete, Unused -from collections.abc import ( - AsyncGenerator as AsyncGenerator, - AsyncIterable as AsyncIterable, - AsyncIterator as AsyncIterator, - Awaitable as Awaitable, - Collection as Collection, - Container as Container, - Coroutine as Coroutine, - Generator as Generator, - Hashable as Hashable, - ItemsView as ItemsView, - Iterable as Iterable, - Iterator as Iterator, - KeysView as KeysView, - Mapping as Mapping, - MappingView as MappingView, - MutableMapping as MutableMapping, - MutableSequence as MutableSequence, - MutableSet as MutableSet, - Reversible as Reversible, - Sequence as Sequence, - Sized as Sized, - ValuesView as ValuesView, -) -from contextlib import AbstractAsyncContextManager as AsyncContextManager, AbstractContextManager as ContextManager -from re import Match as Match, Pattern as Pattern -from types import GenericAlias, ModuleType -from typing import ( # noqa: Y022,Y037,Y038,Y039,UP035 - IO as IO, - TYPE_CHECKING as TYPE_CHECKING, - AbstractSet as AbstractSet, - Any as Any, - AnyStr as AnyStr, - BinaryIO as BinaryIO, - Callable as Callable, - ChainMap as ChainMap, - ClassVar as ClassVar, - Counter as Counter, - DefaultDict as DefaultDict, - Deque as Deque, - Dict as Dict, - ForwardRef as ForwardRef, - FrozenSet as FrozenSet, - Generic as Generic, - List as List, - NoReturn as NoReturn, - Optional as Optional, - Set as Set, - Text as Text, - TextIO as TextIO, - Tuple as Tuple, - Type as Type, - TypedDict as TypedDict, - TypeVar as _TypeVar, - Union as Union, - _Alias, - cast as cast, - no_type_check as no_type_check, - no_type_check_decorator as no_type_check_decorator, - overload as overload, - type_check_only, -) - -if sys.version_info >= (3, 10): - from types import UnionType - -# Please keep order the same as at runtime. -__all__ = [ - # Super-special typing primitives. - "Any", - "ClassVar", - "Concatenate", - "Final", - "LiteralString", - "ParamSpec", - "ParamSpecArgs", - "ParamSpecKwargs", - "Self", - "Type", - "TypeVar", - "TypeVarTuple", - "Unpack", - # ABCs (from collections.abc). - "Awaitable", - "AsyncIterator", - "AsyncIterable", - "Coroutine", - "AsyncGenerator", - "AsyncContextManager", - "Buffer", - "ChainMap", - # Concrete collection types. - "ContextManager", - "Counter", - "Deque", - "DefaultDict", - "NamedTuple", - "OrderedDict", - "TypedDict", - # Structural checks, a.k.a. protocols. - "SupportsAbs", - "SupportsBytes", - "SupportsComplex", - "SupportsFloat", - "SupportsIndex", - "SupportsInt", - "SupportsRound", - # One-off things. - "Annotated", - "assert_never", - "assert_type", - "clear_overloads", - "dataclass_transform", - "deprecated", - "Doc", - "evaluate_forward_ref", - "get_overloads", - "final", - "Format", - "get_annotations", - "get_args", - "get_origin", - "get_original_bases", - "get_protocol_members", - "get_type_hints", - "IntVar", - "is_protocol", - "is_typeddict", - "Literal", - "NewType", - "overload", - "override", - "Protocol", - "reveal_type", - "runtime", - "runtime_checkable", - "Text", - "TypeAlias", - "TypeAliasType", - "TypeForm", - "TypeGuard", - "TypeIs", - "TYPE_CHECKING", - "Never", - "NoReturn", - "ReadOnly", - "Required", - "NotRequired", - "NoDefault", - "NoExtraItems", - # Pure aliases, have always been in typing - "AbstractSet", - "AnyStr", - "BinaryIO", - "Callable", - "Collection", - "Container", - "Dict", - "ForwardRef", - "FrozenSet", - "Generator", - "Generic", - "Hashable", - "IO", - "ItemsView", - "Iterable", - "Iterator", - "KeysView", - "List", - "Mapping", - "MappingView", - "Match", - "MutableMapping", - "MutableSequence", - "MutableSet", - "Optional", - "Pattern", - "Reversible", - "Sequence", - "Set", - "Sized", - "TextIO", - "Tuple", - "Union", - "ValuesView", - "cast", - "no_type_check", - "no_type_check_decorator", - # Added dynamically - "CapsuleType", -] - -_T = _TypeVar("_T") -_F = _TypeVar("_F", bound=Callable[..., Any]) -_TC = _TypeVar("_TC", bound=type[object]) -_T_co = _TypeVar("_T_co", covariant=True) # Any type covariant containers. - -class _Final: ... # This should be imported from typing but that breaks pytype - -# unfortunately we have to duplicate this class definition from typing.pyi or we break pytype -class _SpecialForm(_Final): - def __getitem__(self, parameters: Any) -> object: ... - if sys.version_info >= (3, 10): - def __or__(self, other: Any) -> _SpecialForm: ... - def __ror__(self, other: Any) -> _SpecialForm: ... - -# Do not import (and re-export) Protocol or runtime_checkable from -# typing module because type checkers need to be able to distinguish -# typing.Protocol and typing_extensions.Protocol so they can properly -# warn users about potential runtime exceptions when using typing.Protocol -# on older versions of Python. -Protocol: _SpecialForm - -def runtime_checkable(cls: _TC) -> _TC: ... - -# This alias for above is kept here for backwards compatibility. -runtime = runtime_checkable -Final: _SpecialForm - -def final(f: _F) -> _F: ... - -Literal: _SpecialForm - -def IntVar(name: str) -> Any: ... # returns a new TypeVar - -# Internal mypy fallback type for all typed dicts (does not exist at runtime) -# N.B. Keep this mostly in sync with typing._TypedDict/mypy_extensions._TypedDict -@type_check_only -class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): - __required_keys__: ClassVar[frozenset[str]] - __optional_keys__: ClassVar[frozenset[str]] - __total__: ClassVar[bool] - __orig_bases__: ClassVar[tuple[Any, ...]] - # PEP 705 - __readonly_keys__: ClassVar[frozenset[str]] - __mutable_keys__: ClassVar[frozenset[str]] - # PEP 728 - __closed__: ClassVar[bool] - __extra_items__: ClassVar[Any] - def copy(self) -> Self: ... - # Using Never so that only calls using mypy plugin hook that specialize the signature - # can go through. - def setdefault(self, k: Never, default: object) -> object: ... - # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. - def pop(self, k: Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] - def update(self, m: Self, /) -> None: ... - def items(self) -> dict_items[str, object]: ... - def keys(self) -> dict_keys[str, object]: ... - def values(self) -> dict_values[str, object]: ... - def __delitem__(self, k: Never) -> None: ... - @overload - def __or__(self, value: Self, /) -> Self: ... - @overload - def __or__(self, value: dict[str, Any], /) -> dict[str, object]: ... - @overload - def __ror__(self, value: Self, /) -> Self: ... - @overload - def __ror__(self, value: dict[str, Any], /) -> dict[str, object]: ... - # supposedly incompatible definitions of `__ior__` and `__or__`: - # Since this module defines "Self" it is not recognized by Ruff as typing_extensions.Self - def __ior__(self, value: Self, /) -> Self: ... # type: ignore[misc] - -OrderedDict = _Alias() - -def get_type_hints( - obj: Callable[..., Any], - globalns: dict[str, Any] | None = None, - localns: Mapping[str, Any] | None = None, - include_extras: bool = False, -) -> dict[str, Any]: ... -def get_args(tp: Any) -> tuple[Any, ...]: ... - -if sys.version_info >= (3, 10): - @overload - def get_origin(tp: UnionType) -> type[UnionType]: ... - -@overload -def get_origin(tp: GenericAlias) -> type: ... -@overload -def get_origin(tp: ParamSpecArgs | ParamSpecKwargs) -> ParamSpec: ... -@overload -def get_origin(tp: Any) -> Any | None: ... - -Annotated: _SpecialForm -_AnnotatedAlias: Any # undocumented - -# New and changed things in 3.10 -if sys.version_info >= (3, 10): - from typing import ( - Concatenate as Concatenate, - ParamSpecArgs as ParamSpecArgs, - ParamSpecKwargs as ParamSpecKwargs, - TypeAlias as TypeAlias, - TypeGuard as TypeGuard, - is_typeddict as is_typeddict, - ) -else: - @final - class ParamSpecArgs: - @property - def __origin__(self) -> ParamSpec: ... - def __init__(self, origin: ParamSpec) -> None: ... - - @final - class ParamSpecKwargs: - @property - def __origin__(self) -> ParamSpec: ... - def __init__(self, origin: ParamSpec) -> None: ... - - Concatenate: _SpecialForm - TypeAlias: _SpecialForm - TypeGuard: _SpecialForm - def is_typeddict(tp: object) -> bool: ... - -# New and changed things in 3.11 -if sys.version_info >= (3, 11): - from typing import ( - LiteralString as LiteralString, - NamedTuple as NamedTuple, - Never as Never, - NewType as NewType, - NotRequired as NotRequired, - Required as Required, - Self as Self, - Unpack as Unpack, - assert_never as assert_never, - assert_type as assert_type, - clear_overloads as clear_overloads, - dataclass_transform as dataclass_transform, - get_overloads as get_overloads, - reveal_type as reveal_type, - ) -else: - Self: _SpecialForm - Never: _SpecialForm - def reveal_type(obj: _T, /) -> _T: ... - def assert_never(arg: Never, /) -> Never: ... - def assert_type(val: _T, typ: Any, /) -> _T: ... - def clear_overloads() -> None: ... - def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ... - - Required: _SpecialForm - NotRequired: _SpecialForm - LiteralString: _SpecialForm - Unpack: _SpecialForm - - def dataclass_transform( - *, - eq_default: bool = True, - order_default: bool = False, - kw_only_default: bool = False, - frozen_default: bool = False, - field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = (), - **kwargs: object, - ) -> IdentityFunction: ... - - class NamedTuple(tuple[Any, ...]): - _field_defaults: ClassVar[dict[str, Any]] - _fields: ClassVar[tuple[str, ...]] - __orig_bases__: ClassVar[tuple[Any, ...]] - @overload - def __init__(self, typename: str, fields: Iterable[tuple[str, Any]] = ...) -> None: ... - @overload - def __init__(self, typename: str, fields: None = None, **kwargs: Any) -> None: ... - @classmethod - def _make(cls, iterable: Iterable[Any]) -> Self: ... - def _asdict(self) -> dict[str, Any]: ... - def _replace(self, **kwargs: Any) -> Self: ... - - class NewType: - def __init__(self, name: str, tp: Any) -> None: ... - def __call__(self, obj: _T, /) -> _T: ... - __supertype__: type | NewType - if sys.version_info >= (3, 10): - def __or__(self, other: Any) -> _SpecialForm: ... - def __ror__(self, other: Any) -> _SpecialForm: ... - -if sys.version_info >= (3, 12): - from collections.abc import Buffer as Buffer - from types import get_original_bases as get_original_bases - from typing import ( - SupportsAbs as SupportsAbs, - SupportsBytes as SupportsBytes, - SupportsComplex as SupportsComplex, - SupportsFloat as SupportsFloat, - SupportsIndex as SupportsIndex, - SupportsInt as SupportsInt, - SupportsRound as SupportsRound, - override as override, - ) -else: - def override(arg: _F, /) -> _F: ... - def get_original_bases(cls: type, /) -> tuple[Any, ...]: ... - - # mypy and pyright object to this being both ABC and Protocol. - # At runtime it inherits from ABC and is not a Protocol, but it is on the - # allowlist for use as a Protocol. - @runtime_checkable - class Buffer(Protocol, abc.ABC): # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - # Not actually a Protocol at runtime; see - # https://github.com/python/typeshed/issues/10224 for why we're defining it this way - def __buffer__(self, flags: int, /) -> memoryview: ... - - @runtime_checkable - class SupportsInt(Protocol, metaclass=abc.ABCMeta): - @abc.abstractmethod - def __int__(self) -> int: ... - - @runtime_checkable - class SupportsFloat(Protocol, metaclass=abc.ABCMeta): - @abc.abstractmethod - def __float__(self) -> float: ... - - @runtime_checkable - class SupportsComplex(Protocol, metaclass=abc.ABCMeta): - @abc.abstractmethod - def __complex__(self) -> complex: ... - - @runtime_checkable - class SupportsBytes(Protocol, metaclass=abc.ABCMeta): - @abc.abstractmethod - def __bytes__(self) -> bytes: ... - - @runtime_checkable - class SupportsIndex(Protocol, metaclass=abc.ABCMeta): - @abc.abstractmethod - def __index__(self) -> int: ... - - @runtime_checkable - class SupportsAbs(Protocol[_T_co]): - @abc.abstractmethod - def __abs__(self) -> _T_co: ... - - @runtime_checkable - class SupportsRound(Protocol[_T_co]): - @overload - @abc.abstractmethod - def __round__(self) -> int: ... - @overload - @abc.abstractmethod - def __round__(self, ndigits: int, /) -> _T_co: ... - -if sys.version_info >= (3, 13): - from types import CapsuleType as CapsuleType - from typing import ( - NoDefault as NoDefault, - ParamSpec as ParamSpec, - ReadOnly as ReadOnly, - TypeIs as TypeIs, - TypeVar as TypeVar, - TypeVarTuple as TypeVarTuple, - get_protocol_members as get_protocol_members, - is_protocol as is_protocol, - ) - from warnings import deprecated as deprecated -else: - def is_protocol(tp: type, /) -> bool: ... - def get_protocol_members(tp: type, /) -> frozenset[str]: ... - @final - class _NoDefaultType: ... - - NoDefault: _NoDefaultType - @final - class CapsuleType: ... - - class deprecated: - message: LiteralString - category: type[Warning] | None - stacklevel: int - def __init__(self, message: LiteralString, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ... - def __call__(self, arg: _T, /) -> _T: ... - - @final - class TypeVar: - @property - def __name__(self) -> str: ... - @property - def __bound__(self) -> Any | None: ... - @property - def __constraints__(self) -> tuple[Any, ...]: ... - @property - def __covariant__(self) -> bool: ... - @property - def __contravariant__(self) -> bool: ... - @property - def __infer_variance__(self) -> bool: ... - @property - def __default__(self) -> Any: ... - def __init__( - self, - name: str, - *constraints: Any, - bound: Any | None = None, - covariant: bool = False, - contravariant: bool = False, - default: Any = ..., - infer_variance: bool = False, - ) -> None: ... - def has_default(self) -> bool: ... - def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ... - if sys.version_info >= (3, 10): - def __or__(self, right: Any) -> _SpecialForm: ... - def __ror__(self, left: Any) -> _SpecialForm: ... - if sys.version_info >= (3, 11): - def __typing_subst__(self, arg: Any) -> Any: ... - - @final - class ParamSpec: - @property - def __name__(self) -> str: ... - @property - def __bound__(self) -> Any | None: ... - @property - def __covariant__(self) -> bool: ... - @property - def __contravariant__(self) -> bool: ... - @property - def __infer_variance__(self) -> bool: ... - @property - def __default__(self) -> Any: ... - def __init__( - self, - name: str, - *, - bound: None | type[Any] | str = None, - contravariant: bool = False, - covariant: bool = False, - default: Any = ..., - ) -> None: ... - @property - def args(self) -> ParamSpecArgs: ... - @property - def kwargs(self) -> ParamSpecKwargs: ... - def has_default(self) -> bool: ... - def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ... - if sys.version_info >= (3, 10): - def __or__(self, right: Any) -> _SpecialForm: ... - def __ror__(self, left: Any) -> _SpecialForm: ... - - @final - class TypeVarTuple: - @property - def __name__(self) -> str: ... - @property - def __default__(self) -> Any: ... - def __init__(self, name: str, *, default: Any = ...) -> None: ... - def __iter__(self) -> Any: ... # Unpack[Self] - def has_default(self) -> bool: ... - def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ... - - ReadOnly: _SpecialForm - TypeIs: _SpecialForm - -# TypeAliasType was added in Python 3.12, but had significant changes in 3.14. -if sys.version_info >= (3, 14): - from typing import TypeAliasType as TypeAliasType -else: - @final - class TypeAliasType: - def __init__( - self, name: str, value: Any, *, type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] = () - ) -> None: ... # value is a type expression - @property - def __value__(self) -> Any: ... # a type expression - @property - def __type_params__(self) -> tuple[TypeVar | ParamSpec | TypeVarTuple, ...]: ... - @property - # `__parameters__` can include special forms if a `TypeVarTuple` was - # passed as a `type_params` element to the constructor method. - def __parameters__(self) -> tuple[TypeVar | ParamSpec | Any, ...]: ... - @property - def __name__(self) -> str: ... - # It's writable on types, but not on instances of TypeAliasType. - @property - def __module__(self) -> str | None: ... # type: ignore[override] - # Returns typing._GenericAlias, which isn't stubbed. - def __getitem__(self, parameters: Incomplete | tuple[Incomplete, ...]) -> Any: ... - def __init_subclass__(cls, *args: Unused, **kwargs: Unused) -> NoReturn: ... - if sys.version_info >= (3, 10): - def __or__(self, right: Any) -> _SpecialForm: ... - def __ror__(self, left: Any) -> _SpecialForm: ... - -# PEP 727 -class Doc: - documentation: str - def __init__(self, documentation: str, /) -> None: ... - def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: ... - -# PEP 728 -class _NoExtraItemsType: ... - -NoExtraItems: _NoExtraItemsType - -# PEP 747 -TypeForm: _SpecialForm - -class Format(enum.IntEnum): - VALUE = 1 - FORWARDREF = 2 - STRING = 3 - -# PEP 649/749 -def get_annotations( - obj: Callable[..., object] | type[object] | ModuleType, # any callable, class, or module - *, - globals: Mapping[str, Any] | None = None, # value types depend on the key - locals: Mapping[str, Any] | None = None, # value types depend on the key - eval_str: bool = False, - format: Format = Format.VALUE, # noqa: Y011 -) -> dict[str, Any]: ... # values are type expressions -def evaluate_forward_ref( - forward_ref: ForwardRef, - *, - owner: Callable[..., object] | type[object] | ModuleType | None = None, # any callable, class, or module - globals: Mapping[str, Any] | None = None, # value types depend on the key - locals: Mapping[str, Any] | None = None, # value types depend on the key - type_params: Iterable[TypeVar | ParamSpec | TypeVarTuple] | None = None, - format: Format = Format.VALUE, # noqa: Y011 - _recursive_guard: Container[str] = ..., -) -> Any: ... # str if format is Format.STRING, otherwise a type expression diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unicodedata.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unicodedata.pyi deleted file mode 100644 index 77d69edf06..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unicodedata.pyi +++ /dev/null @@ -1,73 +0,0 @@ -import sys -from _typeshed import ReadOnlyBuffer -from typing import Any, Literal, TypeVar, final, overload -from typing_extensions import TypeAlias - -ucd_3_2_0: UCD -unidata_version: str - -if sys.version_info < (3, 10): - ucnhash_CAPI: Any - -_T = TypeVar("_T") - -_NormalizationForm: TypeAlias = Literal["NFC", "NFD", "NFKC", "NFKD"] - -def bidirectional(chr: str, /) -> str: ... -def category(chr: str, /) -> str: ... -def combining(chr: str, /) -> int: ... -@overload -def decimal(chr: str, /) -> int: ... -@overload -def decimal(chr: str, default: _T, /) -> int | _T: ... -def decomposition(chr: str, /) -> str: ... -@overload -def digit(chr: str, /) -> int: ... -@overload -def digit(chr: str, default: _T, /) -> int | _T: ... - -_EastAsianWidth: TypeAlias = Literal["F", "H", "W", "Na", "A", "N"] - -def east_asian_width(chr: str, /) -> _EastAsianWidth: ... -def is_normalized(form: _NormalizationForm, unistr: str, /) -> bool: ... -def lookup(name: str | ReadOnlyBuffer, /) -> str: ... -def mirrored(chr: str, /) -> int: ... -@overload -def name(chr: str, /) -> str: ... -@overload -def name(chr: str, default: _T, /) -> str | _T: ... -def normalize(form: _NormalizationForm, unistr: str, /) -> str: ... -@overload -def numeric(chr: str, /) -> float: ... -@overload -def numeric(chr: str, default: _T, /) -> float | _T: ... -@final -class UCD: - # The methods below are constructed from the same array in C - # (unicodedata_functions) and hence identical to the functions above. - unidata_version: str - def bidirectional(self, chr: str, /) -> str: ... - def category(self, chr: str, /) -> str: ... - def combining(self, chr: str, /) -> int: ... - @overload - def decimal(self, chr: str, /) -> int: ... - @overload - def decimal(self, chr: str, default: _T, /) -> int | _T: ... - def decomposition(self, chr: str, /) -> str: ... - @overload - def digit(self, chr: str, /) -> int: ... - @overload - def digit(self, chr: str, default: _T, /) -> int | _T: ... - def east_asian_width(self, chr: str, /) -> _EastAsianWidth: ... - def is_normalized(self, form: _NormalizationForm, unistr: str, /) -> bool: ... - def lookup(self, name: str | ReadOnlyBuffer, /) -> str: ... - def mirrored(self, chr: str, /) -> int: ... - @overload - def name(self, chr: str, /) -> str: ... - @overload - def name(self, chr: str, default: _T, /) -> str | _T: ... - def normalize(self, form: _NormalizationForm, unistr: str, /) -> str: ... - @overload - def numeric(self, chr: str, /) -> float: ... - @overload - def numeric(self, chr: str, default: _T, /) -> float | _T: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/__init__.pyi deleted file mode 100644 index 546ea77bb4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/__init__.pyi +++ /dev/null @@ -1,63 +0,0 @@ -import sys -from unittest.async_case import * - -from .case import ( - FunctionTestCase as FunctionTestCase, - SkipTest as SkipTest, - TestCase as TestCase, - addModuleCleanup as addModuleCleanup, - expectedFailure as expectedFailure, - skip as skip, - skipIf as skipIf, - skipUnless as skipUnless, -) -from .loader import TestLoader as TestLoader, defaultTestLoader as defaultTestLoader -from .main import TestProgram as TestProgram, main as main -from .result import TestResult as TestResult -from .runner import TextTestResult as TextTestResult, TextTestRunner as TextTestRunner -from .signals import ( - installHandler as installHandler, - registerResult as registerResult, - removeHandler as removeHandler, - removeResult as removeResult, -) -from .suite import BaseTestSuite as BaseTestSuite, TestSuite as TestSuite - -if sys.version_info >= (3, 11): - from .case import doModuleCleanups as doModuleCleanups, enterModuleContext as enterModuleContext - -__all__ = [ - "IsolatedAsyncioTestCase", - "TestResult", - "TestCase", - "TestSuite", - "TextTestRunner", - "TestLoader", - "FunctionTestCase", - "main", - "defaultTestLoader", - "SkipTest", - "skip", - "skipIf", - "skipUnless", - "expectedFailure", - "TextTestResult", - "installHandler", - "registerResult", - "removeResult", - "removeHandler", - "addModuleCleanup", -] - -if sys.version_info < (3, 13): - from .loader import findTestCases as findTestCases, getTestCaseNames as getTestCaseNames, makeSuite as makeSuite - - __all__ += ["getTestCaseNames", "makeSuite", "findTestCases"] - -if sys.version_info >= (3, 11): - __all__ += ["enterModuleContext", "doModuleCleanups"] - -if sys.version_info < (3, 12): - def load_tests(loader: TestLoader, tests: TestSuite, pattern: str | None) -> TestSuite: ... - -def __dir__() -> set[str]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/_log.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/_log.pyi deleted file mode 100644 index 011a970d8b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/_log.pyi +++ /dev/null @@ -1,27 +0,0 @@ -import logging -import sys -from types import TracebackType -from typing import ClassVar, Generic, NamedTuple, TypeVar -from unittest.case import TestCase, _BaseTestCaseContext - -_L = TypeVar("_L", None, _LoggingWatcher) - -class _LoggingWatcher(NamedTuple): - records: list[logging.LogRecord] - output: list[str] - -class _AssertLogsContext(_BaseTestCaseContext, Generic[_L]): - LOGGING_FORMAT: ClassVar[str] - logger_name: str - level: int - msg: None - if sys.version_info >= (3, 10): - def __init__(self, test_case: TestCase, logger_name: str, level: int, no_logs: bool) -> None: ... - no_logs: bool - else: - def __init__(self, test_case: TestCase, logger_name: str, level: int) -> None: ... - - def __enter__(self) -> _L: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None - ) -> bool | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/async_case.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/async_case.pyi deleted file mode 100644 index 0b3fb9122c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/async_case.pyi +++ /dev/null @@ -1,25 +0,0 @@ -import sys -from asyncio.events import AbstractEventLoop -from collections.abc import Awaitable, Callable -from typing import TypeVar -from typing_extensions import ParamSpec - -from .case import TestCase - -if sys.version_info >= (3, 11): - from contextlib import AbstractAsyncContextManager - -_T = TypeVar("_T") -_P = ParamSpec("_P") - -class IsolatedAsyncioTestCase(TestCase): - if sys.version_info >= (3, 13): - loop_factory: Callable[[], AbstractEventLoop] | None = None - - async def asyncSetUp(self) -> None: ... - async def asyncTearDown(self) -> None: ... - def addAsyncCleanup(self, func: Callable[_P, Awaitable[object]], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ... - if sys.version_info >= (3, 11): - async def enterAsyncContext(self, cm: AbstractAsyncContextManager[_T]) -> _T: ... - - def __del__(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/case.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/case.pyi deleted file mode 100644 index 7d1a382a54..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/case.pyi +++ /dev/null @@ -1,320 +0,0 @@ -import logging -import sys -import unittest.result -from _typeshed import SupportsDunderGE, SupportsDunderGT, SupportsDunderLE, SupportsDunderLT, SupportsRSub, SupportsSub -from collections.abc import Callable, Container, Iterable, Mapping, Sequence, Set as AbstractSet -from contextlib import AbstractContextManager -from re import Pattern -from types import GenericAlias, TracebackType -from typing import Any, AnyStr, Final, Generic, NoReturn, Protocol, SupportsAbs, SupportsRound, TypeVar, overload -from typing_extensions import Never, ParamSpec, Self, TypeAlias -from unittest._log import _AssertLogsContext, _LoggingWatcher -from warnings import WarningMessage - -if sys.version_info >= (3, 10): - from types import UnionType - -_T = TypeVar("_T") -_S = TypeVar("_S", bound=SupportsSub[Any, Any]) -_E = TypeVar("_E", bound=BaseException) -_FT = TypeVar("_FT", bound=Callable[..., Any]) -_P = ParamSpec("_P") - -DIFF_OMITTED: Final[str] - -class _BaseTestCaseContext: - test_case: TestCase - def __init__(self, test_case: TestCase) -> None: ... - -class _AssertRaisesBaseContext(_BaseTestCaseContext): - expected: type[BaseException] | tuple[type[BaseException], ...] - expected_regex: Pattern[str] | None - obj_name: str | None - msg: str | None - - def __init__( - self, - expected: type[BaseException] | tuple[type[BaseException], ...], - test_case: TestCase, - expected_regex: str | Pattern[str] | None = None, - ) -> None: ... - - # This returns Self if args is the empty list, and None otherwise. - # but it's not possible to construct an overload which expresses that - def handle(self, name: str, args: list[Any], kwargs: dict[str, Any]) -> Any: ... - -def addModuleCleanup(function: Callable[_P, object], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ... -def doModuleCleanups() -> None: ... - -if sys.version_info >= (3, 11): - def enterModuleContext(cm: AbstractContextManager[_T]) -> _T: ... - -def expectedFailure(test_item: _FT) -> _FT: ... -def skip(reason: str) -> Callable[[_FT], _FT]: ... -def skipIf(condition: object, reason: str) -> Callable[[_FT], _FT]: ... -def skipUnless(condition: object, reason: str) -> Callable[[_FT], _FT]: ... - -class SkipTest(Exception): - def __init__(self, reason: str) -> None: ... - -class _SupportsAbsAndDunderGE(SupportsDunderGE[Any], SupportsAbs[Any], Protocol): ... - -# Keep this alias in sync with builtins._ClassInfo -# We can't import it from builtins or pytype crashes, -# due to the fact that pytype uses a custom builtins stub rather than typeshed's builtins stub -if sys.version_info >= (3, 10): - _ClassInfo: TypeAlias = type | UnionType | tuple[_ClassInfo, ...] -else: - _ClassInfo: TypeAlias = type | tuple[_ClassInfo, ...] - -class TestCase: - failureException: type[BaseException] - longMessage: bool - maxDiff: int | None - # undocumented - _testMethodName: str - # undocumented - _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 - def setUpClass(cls) -> None: ... - @classmethod - def tearDownClass(cls) -> None: ... - def run(self, result: unittest.result.TestResult | None = None) -> unittest.result.TestResult | None: ... - def __call__(self, result: unittest.result.TestResult | None = ...) -> unittest.result.TestResult | None: ... - def skipTest(self, reason: Any) -> NoReturn: ... - def subTest(self, msg: Any = ..., **params: Any) -> AbstractContextManager[None]: ... - def debug(self) -> None: ... - if sys.version_info < (3, 11): - def _addSkip(self, result: unittest.result.TestResult, test_case: TestCase, reason: str) -> None: ... - - def assertEqual(self, first: Any, second: Any, msg: Any = None) -> None: ... - def assertNotEqual(self, first: Any, second: Any, msg: Any = None) -> None: ... - def assertTrue(self, expr: Any, msg: Any = None) -> None: ... - def assertFalse(self, expr: Any, msg: Any = None) -> None: ... - def assertIs(self, expr1: object, expr2: object, msg: Any = None) -> None: ... - def assertIsNot(self, expr1: object, expr2: object, msg: Any = None) -> None: ... - def assertIsNone(self, obj: object, msg: Any = None) -> None: ... - def assertIsNotNone(self, obj: object, msg: Any = None) -> None: ... - def assertIn(self, member: Any, container: Iterable[Any] | Container[Any], msg: Any = None) -> None: ... - def assertNotIn(self, member: Any, container: Iterable[Any] | Container[Any], msg: Any = None) -> None: ... - def assertIsInstance(self, obj: object, cls: _ClassInfo, msg: Any = None) -> None: ... - def assertNotIsInstance(self, obj: object, cls: _ClassInfo, msg: Any = None) -> None: ... - @overload - def assertGreater(self, a: SupportsDunderGT[_T], b: _T, msg: Any = None) -> None: ... - @overload - def assertGreater(self, a: _T, b: SupportsDunderLT[_T], msg: Any = None) -> None: ... - @overload - def assertGreaterEqual(self, a: SupportsDunderGE[_T], b: _T, msg: Any = None) -> None: ... - @overload - def assertGreaterEqual(self, a: _T, b: SupportsDunderLE[_T], msg: Any = None) -> None: ... - @overload - def assertLess(self, a: SupportsDunderLT[_T], b: _T, msg: Any = None) -> None: ... - @overload - def assertLess(self, a: _T, b: SupportsDunderGT[_T], msg: Any = None) -> None: ... - @overload - def assertLessEqual(self, a: SupportsDunderLE[_T], b: _T, msg: Any = None) -> None: ... - @overload - def assertLessEqual(self, a: _T, b: SupportsDunderGE[_T], msg: Any = None) -> None: ... - # `assertRaises`, `assertRaisesRegex`, and `assertRaisesRegexp` - # are not using `ParamSpec` intentionally, - # because they might be used with explicitly wrong arg types to raise some error in tests. - @overload - def assertRaises( - self, - expected_exception: type[BaseException] | tuple[type[BaseException], ...], - callable: Callable[..., object], - *args: Any, - **kwargs: Any, - ) -> None: ... - @overload - def assertRaises( - self, expected_exception: type[_E] | tuple[type[_E], ...], *, msg: Any = ... - ) -> _AssertRaisesContext[_E]: ... - @overload - def assertRaisesRegex( - self, - expected_exception: type[BaseException] | tuple[type[BaseException], ...], - expected_regex: str | Pattern[str], - callable: Callable[..., object], - *args: Any, - **kwargs: Any, - ) -> None: ... - @overload - def assertRaisesRegex( - self, expected_exception: type[_E] | tuple[type[_E], ...], expected_regex: str | Pattern[str], *, msg: Any = ... - ) -> _AssertRaisesContext[_E]: ... - @overload - def assertWarns( - self, - expected_warning: type[Warning] | tuple[type[Warning], ...], - callable: Callable[_P, object], - *args: _P.args, - **kwargs: _P.kwargs, - ) -> None: ... - @overload - def assertWarns( - self, expected_warning: type[Warning] | tuple[type[Warning], ...], *, msg: Any = ... - ) -> _AssertWarnsContext: ... - @overload - def assertWarnsRegex( - self, - expected_warning: type[Warning] | tuple[type[Warning], ...], - expected_regex: str | Pattern[str], - callable: Callable[_P, object], - *args: _P.args, - **kwargs: _P.kwargs, - ) -> None: ... - @overload - def assertWarnsRegex( - self, expected_warning: type[Warning] | tuple[type[Warning], ...], expected_regex: str | Pattern[str], *, msg: Any = ... - ) -> _AssertWarnsContext: ... - def assertLogs( - self, logger: str | logging.Logger | None = None, level: int | str | None = None - ) -> _AssertLogsContext[_LoggingWatcher]: ... - if sys.version_info >= (3, 10): - def assertNoLogs( - self, logger: str | logging.Logger | None = None, level: int | str | None = None - ) -> _AssertLogsContext[None]: ... - - @overload - def assertAlmostEqual(self, first: _S, second: _S, places: None, msg: Any, delta: _SupportsAbsAndDunderGE) -> None: ... - @overload - def assertAlmostEqual( - self, first: _S, second: _S, places: None = None, msg: Any = None, *, delta: _SupportsAbsAndDunderGE - ) -> None: ... - @overload - def assertAlmostEqual( - self, - first: SupportsSub[_T, SupportsAbs[SupportsRound[object]]], - second: _T, - places: int | None = None, - msg: Any = None, - delta: None = None, - ) -> None: ... - @overload - def assertAlmostEqual( - self, - first: _T, - second: SupportsRSub[_T, SupportsAbs[SupportsRound[object]]], - places: int | None = None, - msg: Any = None, - delta: None = None, - ) -> None: ... - @overload - def assertNotAlmostEqual(self, first: _S, second: _S, places: None, msg: Any, delta: _SupportsAbsAndDunderGE) -> None: ... - @overload - def assertNotAlmostEqual( - self, first: _S, second: _S, places: None = None, msg: Any = None, *, delta: _SupportsAbsAndDunderGE - ) -> None: ... - @overload - def assertNotAlmostEqual( - self, - first: SupportsSub[_T, SupportsAbs[SupportsRound[object]]], - second: _T, - places: int | None = None, - msg: Any = None, - delta: None = None, - ) -> None: ... - @overload - def assertNotAlmostEqual( - self, - first: _T, - second: SupportsRSub[_T, SupportsAbs[SupportsRound[object]]], - places: int | None = None, - msg: Any = None, - delta: None = None, - ) -> None: ... - def assertRegex(self, text: AnyStr, expected_regex: AnyStr | Pattern[AnyStr], msg: Any = None) -> None: ... - def assertNotRegex(self, text: AnyStr, unexpected_regex: AnyStr | Pattern[AnyStr], msg: Any = None) -> None: ... - def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any], msg: Any = None) -> None: ... - def addTypeEqualityFunc(self, typeobj: type[Any], function: Callable[..., None]) -> None: ... - def assertMultiLineEqual(self, first: str, second: str, msg: Any = None) -> None: ... - def assertSequenceEqual( - self, seq1: Sequence[Any], seq2: Sequence[Any], msg: Any = None, seq_type: type[Sequence[Any]] | None = None - ) -> None: ... - def assertListEqual(self, list1: list[Any], list2: list[Any], msg: Any = None) -> None: ... - def assertTupleEqual(self, tuple1: tuple[Any, ...], tuple2: tuple[Any, ...], msg: Any = None) -> None: ... - def assertSetEqual(self, set1: AbstractSet[object], set2: AbstractSet[object], msg: Any = None) -> None: ... - # assertDictEqual accepts only true dict instances. We can't use that here, since that would make - # assertDictEqual incompatible with TypedDict. - def assertDictEqual(self, d1: Mapping[Any, object], d2: Mapping[Any, object], msg: Any = None) -> None: ... - def fail(self, msg: Any = None) -> NoReturn: ... - def countTestCases(self) -> int: ... - def defaultTestResult(self) -> unittest.result.TestResult: ... - def id(self) -> str: ... - def shortDescription(self) -> str | None: ... - def addCleanup(self, function: Callable[_P, object], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ... - - if sys.version_info >= (3, 11): - def enterContext(self, cm: AbstractContextManager[_T]) -> _T: ... - - def doCleanups(self) -> None: ... - @classmethod - def addClassCleanup(cls, function: Callable[_P, object], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ... - @classmethod - def doClassCleanups(cls) -> None: ... - - if sys.version_info >= (3, 11): - @classmethod - def enterClassContext(cls, cm: AbstractContextManager[_T]) -> _T: ... - - def _formatMessage(self, msg: str | None, standardMsg: str) -> str: ... # undocumented - def _getAssertEqualityFunc(self, first: Any, second: Any) -> Callable[..., None]: ... # undocumented - if sys.version_info < (3, 12): - failUnlessEqual = assertEqual - assertEquals = assertEqual - failIfEqual = assertNotEqual - assertNotEquals = assertNotEqual - failUnless = assertTrue - assert_ = assertTrue - failIf = assertFalse - failUnlessRaises = assertRaises - failUnlessAlmostEqual = assertAlmostEqual - assertAlmostEquals = assertAlmostEqual - failIfAlmostEqual = assertNotAlmostEqual - assertNotAlmostEquals = assertNotAlmostEqual - assertRegexpMatches = assertRegex - assertNotRegexpMatches = assertNotRegex - assertRaisesRegexp = assertRaisesRegex - def assertDictContainsSubset( - self, subset: Mapping[Any, Any], dictionary: Mapping[Any, Any], msg: object = None - ) -> None: ... - - if sys.version_info >= (3, 10): - # Runtime has *args, **kwargs, but will error if any are supplied - def __init_subclass__(cls, *args: Never, **kwargs: Never) -> None: ... - -class FunctionTestCase(TestCase): - def __init__( - self, - testFunc: Callable[[], object], - setUp: Callable[[], object] | None = None, - tearDown: Callable[[], object] | None = None, - description: str | None = None, - ) -> None: ... - def runTest(self) -> None: ... - def __hash__(self) -> int: ... - def __eq__(self, other: object) -> bool: ... - -class _AssertRaisesContext(_AssertRaisesBaseContext, Generic[_E]): - exception: _E - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None - ) -> bool: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class _AssertWarnsContext(_AssertRaisesBaseContext): - warning: WarningMessage - filename: str - lineno: int - warnings: list[WarningMessage] - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, tb: TracebackType | None - ) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/loader.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/loader.pyi deleted file mode 100644 index 598e3cd84a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/loader.pyi +++ /dev/null @@ -1,55 +0,0 @@ -import sys -import unittest.case -import unittest.suite -from collections.abc import Callable, Sequence -from re import Pattern -from types import ModuleType -from typing import Any, Final -from typing_extensions import TypeAlias, deprecated - -_SortComparisonMethod: TypeAlias = Callable[[str, str], int] -_SuiteClass: TypeAlias = Callable[[list[unittest.case.TestCase]], unittest.suite.TestSuite] - -VALID_MODULE_NAME: Final[Pattern[str]] - -class TestLoader: - errors: list[type[BaseException]] - testMethodPrefix: str - sortTestMethodsUsing: _SortComparisonMethod - testNamePatterns: list[str] | None - suiteClass: _SuiteClass - def loadTestsFromTestCase(self, testCaseClass: type[unittest.case.TestCase]) -> unittest.suite.TestSuite: ... - if sys.version_info >= (3, 12): - def loadTestsFromModule(self, module: ModuleType, *, pattern: str | None = None) -> unittest.suite.TestSuite: ... - else: - def loadTestsFromModule(self, module: ModuleType, *args: Any, pattern: str | None = None) -> unittest.suite.TestSuite: ... - - def loadTestsFromName(self, name: str, module: ModuleType | None = None) -> unittest.suite.TestSuite: ... - def loadTestsFromNames(self, names: Sequence[str], module: ModuleType | None = None) -> unittest.suite.TestSuite: ... - def getTestCaseNames(self, testCaseClass: type[unittest.case.TestCase]) -> Sequence[str]: ... - def discover( - self, start_dir: str, pattern: str = "test*.py", top_level_dir: str | None = None - ) -> unittest.suite.TestSuite: ... - def _match_path(self, path: str, full_path: str, pattern: str) -> bool: ... - -defaultTestLoader: TestLoader - -if sys.version_info < (3, 13): - @deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13") - def getTestCaseNames( - testCaseClass: type[unittest.case.TestCase], - prefix: str, - sortUsing: _SortComparisonMethod = ..., - testNamePatterns: list[str] | None = None, - ) -> Sequence[str]: ... - @deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13") - def makeSuite( - testCaseClass: type[unittest.case.TestCase], - prefix: str = "test", - sortUsing: _SortComparisonMethod = ..., - suiteClass: _SuiteClass = ..., - ) -> unittest.suite.TestSuite: ... - @deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13") - def findTestCases( - module: ModuleType, prefix: str = "test", sortUsing: _SortComparisonMethod = ..., suiteClass: _SuiteClass = ... - ) -> unittest.suite.TestSuite: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/main.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/main.pyi deleted file mode 100644 index 22f2ec1063..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/main.pyi +++ /dev/null @@ -1,73 +0,0 @@ -import sys -import unittest.case -import unittest.loader -import unittest.result -import unittest.suite -from collections.abc import Iterable -from types import ModuleType -from typing import Any, Final, Protocol -from typing_extensions import deprecated - -MAIN_EXAMPLES: Final[str] -MODULE_EXAMPLES: Final[str] - -class _TestRunner(Protocol): - def run(self, test: unittest.suite.TestSuite | unittest.case.TestCase, /) -> unittest.result.TestResult: ... - -# not really documented -class TestProgram: - result: unittest.result.TestResult - module: None | str | ModuleType - verbosity: int - failfast: bool | None - catchbreak: bool | None - buffer: bool | None - progName: str | None - warnings: str | None - testNamePatterns: list[str] | None - if sys.version_info >= (3, 12): - durations: unittest.result._DurationsType | None - def __init__( - self, - module: None | str | ModuleType = "__main__", - defaultTest: str | Iterable[str] | None = None, - argv: list[str] | None = None, - testRunner: type[_TestRunner] | _TestRunner | None = None, - testLoader: unittest.loader.TestLoader = ..., - exit: bool = True, - verbosity: int = 1, - failfast: bool | None = None, - catchbreak: bool | None = None, - buffer: bool | None = None, - warnings: str | None = None, - *, - tb_locals: bool = False, - durations: unittest.result._DurationsType | None = None, - ) -> None: ... - else: - def __init__( - self, - module: None | str | ModuleType = "__main__", - defaultTest: str | Iterable[str] | None = None, - argv: list[str] | None = None, - testRunner: type[_TestRunner] | _TestRunner | None = None, - testLoader: unittest.loader.TestLoader = ..., - exit: bool = True, - verbosity: int = 1, - failfast: bool | None = None, - catchbreak: bool | None = None, - buffer: bool | None = None, - warnings: str | None = None, - *, - tb_locals: bool = False, - ) -> None: ... - - if sys.version_info < (3, 13): - @deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13") - def usageExit(self, msg: Any = None) -> None: ... - - def parseArgs(self, argv: list[str]) -> None: ... - def createTests(self, from_discovery: bool = False, Loader: unittest.loader.TestLoader | None = None) -> None: ... - def runTests(self) -> None: ... # undocumented - -main = TestProgram diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/mock.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/mock.pyi deleted file mode 100644 index d266446509..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/mock.pyi +++ /dev/null @@ -1,465 +0,0 @@ -import sys -from collections.abc import Awaitable, Callable, Coroutine, Iterable, Mapping, Sequence -from contextlib import _GeneratorContextManager -from types import TracebackType -from typing import Any, ClassVar, Final, Generic, Literal, TypeVar, overload -from typing_extensions import ParamSpec, Self, TypeAlias - -_T = TypeVar("_T") -_TT = TypeVar("_TT", bound=type[Any]) -_R = TypeVar("_R") -_F = TypeVar("_F", bound=Callable[..., Any]) -_AF = TypeVar("_AF", bound=Callable[..., Coroutine[Any, Any, Any]]) -_P = ParamSpec("_P") - -if sys.version_info >= (3, 13): - # ThreadingMock added in 3.13 - __all__ = ( - "Mock", - "MagicMock", - "patch", - "sentinel", - "DEFAULT", - "ANY", - "call", - "create_autospec", - "ThreadingMock", - "AsyncMock", - "FILTER_DIR", - "NonCallableMock", - "NonCallableMagicMock", - "mock_open", - "PropertyMock", - "seal", - ) -else: - __all__ = ( - "Mock", - "MagicMock", - "patch", - "sentinel", - "DEFAULT", - "ANY", - "call", - "create_autospec", - "AsyncMock", - "FILTER_DIR", - "NonCallableMock", - "NonCallableMagicMock", - "mock_open", - "PropertyMock", - "seal", - ) - -FILTER_DIR: Any - -class _SentinelObject: - name: Any - def __init__(self, name: Any) -> None: ... - -class _Sentinel: - def __getattr__(self, name: str) -> Any: ... - -sentinel: Any -DEFAULT: Any - -_ArgsKwargs: TypeAlias = tuple[tuple[Any, ...], Mapping[str, Any]] -_NameArgsKwargs: TypeAlias = tuple[str, tuple[Any, ...], Mapping[str, Any]] -_CallValue: TypeAlias = str | tuple[Any, ...] | Mapping[str, Any] | _ArgsKwargs | _NameArgsKwargs - -class _Call(tuple[Any, ...]): - def __new__( - cls, value: _CallValue = (), name: str | None = "", parent: Any | None = None, two: bool = False, from_kall: bool = True - ) -> Self: ... - name: Any - parent: Any - from_kall: Any - def __init__( - self, - value: _CallValue = (), - name: str | None = None, - parent: Any | None = None, - two: bool = False, - from_kall: bool = True, - ) -> None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __eq__(self, other: object) -> bool: ... - def __ne__(self, value: object, /) -> bool: ... - def __call__(self, *args: Any, **kwargs: Any) -> _Call: ... - def __getattr__(self, attr: str) -> Any: ... - def __getattribute__(self, attr: str) -> Any: ... - @property - def args(self) -> tuple[Any, ...]: ... - @property - def kwargs(self) -> Mapping[str, Any]: ... - def call_list(self) -> Any: ... - -call: _Call - -class _CallList(list[_Call]): - def __contains__(self, value: Any) -> bool: ... - -class Base: - def __init__(self, *args: Any, **kwargs: Any) -> None: ... - -# We subclass with "Any" because mocks are explicitly designed to stand in for other types, -# something that can't be expressed with our static type system. -class NonCallableMock(Base, Any): - if sys.version_info >= (3, 12): - def __new__( - cls, - spec: list[str] | object | type[object] | None = None, - wraps: Any | None = None, - name: str | None = None, - spec_set: list[str] | object | type[object] | None = None, - parent: NonCallableMock | None = None, - _spec_state: Any | None = None, - _new_name: str = "", - _new_parent: NonCallableMock | None = None, - _spec_as_instance: bool = False, - _eat_self: bool | None = None, - unsafe: bool = False, - **kwargs: Any, - ) -> Self: ... - else: - def __new__(cls, /, *args: Any, **kw: Any) -> Self: ... - - def __init__( - self, - spec: list[str] | object | type[object] | None = None, - wraps: Any | None = None, - name: str | None = None, - spec_set: list[str] | object | type[object] | None = None, - parent: NonCallableMock | None = None, - _spec_state: Any | None = None, - _new_name: str = "", - _new_parent: NonCallableMock | None = None, - _spec_as_instance: bool = False, - _eat_self: bool | None = None, - unsafe: bool = False, - **kwargs: Any, - ) -> None: ... - def __getattr__(self, name: str) -> Any: ... - def __delattr__(self, name: str) -> None: ... - def __setattr__(self, name: str, value: Any) -> None: ... - def __dir__(self) -> list[str]: ... - def assert_called_with(self, *args: Any, **kwargs: Any) -> None: ... - def assert_not_called(self) -> None: ... - def assert_called_once_with(self, *args: Any, **kwargs: Any) -> None: ... - def _format_mock_failure_message(self, args: Any, kwargs: Any, action: str = "call") -> str: ... - def assert_called(self) -> None: ... - def assert_called_once(self) -> None: ... - def reset_mock(self, visited: Any = None, *, return_value: bool = False, side_effect: bool = False) -> None: ... - def _extract_mock_name(self) -> str: ... - def _get_call_signature_from_name(self, name: str) -> Any: ... - def assert_any_call(self, *args: Any, **kwargs: Any) -> None: ... - def assert_has_calls(self, calls: Sequence[_Call], any_order: bool = False) -> None: ... - def mock_add_spec(self, spec: Any, spec_set: bool = False) -> None: ... - def _mock_add_spec(self, spec: Any, spec_set: bool, _spec_as_instance: bool = False, _eat_self: bool = False) -> None: ... - def attach_mock(self, mock: NonCallableMock, attribute: str) -> None: ... - def configure_mock(self, **kwargs: Any) -> None: ... - return_value: Any - side_effect: Any - called: bool - call_count: int - call_args: Any - call_args_list: _CallList - mock_calls: _CallList - def _format_mock_call_signature(self, args: Any, kwargs: Any) -> str: ... - def _call_matcher(self, _call: tuple[_Call, ...]) -> _Call: ... - def _get_child_mock(self, **kw: Any) -> NonCallableMock: ... - if sys.version_info >= (3, 13): - def _calls_repr(self) -> str: ... - else: - def _calls_repr(self, prefix: str = "Calls") -> str: ... - -class CallableMixin(Base): - side_effect: Any - def __init__( - self, - spec: Any | None = None, - side_effect: Any | None = None, - return_value: Any = ..., - wraps: Any | None = None, - name: Any | None = None, - spec_set: Any | None = None, - parent: Any | None = None, - _spec_state: Any | None = None, - _new_name: Any = "", - _new_parent: Any | None = None, - **kwargs: Any, - ) -> None: ... - def __call__(self, *args: Any, **kwargs: Any) -> Any: ... - -class Mock(CallableMixin, NonCallableMock): ... - -class _patch(Generic[_T]): - attribute_name: Any - getter: Callable[[], Any] - attribute: str - new: _T - new_callable: Any - spec: Any - create: bool - has_local: Any - spec_set: Any - autospec: Any - kwargs: Mapping[str, Any] - additional_patchers: Any - # If new==DEFAULT, self is _patch[Any]. Ideally we'd be able to add an overload for it so that self is _patch[MagicMock], - # but that's impossible with the current type system. - if sys.version_info >= (3, 10): - def __init__( - self: _patch[_T], # pyright: ignore[reportInvalidTypeVarUse] #11780 - getter: Callable[[], Any], - attribute: str, - new: _T, - spec: Any | None, - create: bool, - spec_set: Any | None, - autospec: Any | None, - new_callable: Any | None, - kwargs: Mapping[str, Any], - *, - unsafe: bool = False, - ) -> None: ... - else: - def __init__( - self: _patch[_T], # pyright: ignore[reportInvalidTypeVarUse] #11780 - getter: Callable[[], Any], - attribute: str, - new: _T, - spec: Any | None, - create: bool, - spec_set: Any | None, - autospec: Any | None, - new_callable: Any | None, - kwargs: Mapping[str, Any], - ) -> None: ... - - 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]: ... - def decoration_helper( - self, patched: _patch[Any], args: Sequence[Any], keywargs: Any - ) -> _GeneratorContextManager[tuple[Sequence[Any], Any]]: ... - def decorate_class(self, klass: _TT) -> _TT: ... - def decorate_callable(self, func: Callable[..., _R]) -> Callable[..., _R]: ... - def decorate_async_callable(self, func: Callable[..., Awaitable[_R]]) -> Callable[..., Awaitable[_R]]: ... - def get_original(self) -> tuple[Any, bool]: ... - target: Any - temp_original: Any - is_local: bool - def __enter__(self) -> _T: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, / - ) -> None: ... - def start(self) -> _T: ... - def stop(self) -> None: ... - -# 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[MagicMock | AsyncMock]): - @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 - clear: Any - def __init__(self, in_dict: Any, values: Any = (), clear: Any = False, **kwargs: Any) -> None: ... - def __call__(self, f: Any) -> Any: ... - if sys.version_info >= (3, 10): - def decorate_callable(self, f: _F) -> _F: ... - def decorate_async_callable(self, f: _AF) -> _AF: ... - - def decorate_class(self, klass: Any) -> Any: ... - def __enter__(self) -> Any: ... - def __exit__(self, *args: object) -> Any: ... - start: Any - stop: Any - -# 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] - # This overload also covers the case, where new==DEFAULT. In this case, the return type is _patch[Any]. - # Ideally we'd be able to add an overload for it so that the return type is _patch[MagicMock], - # but that's impossible with the current type system. - @overload - def __call__( - self, - target: str, - new: _T, - spec: Any | None = ..., - create: bool = ..., - spec_set: Any | None = ..., - autospec: Any | None = ..., - new_callable: Any | None = ..., - **kwargs: Any, - ) -> _patch[_T]: ... - @overload - def __call__( - self, - target: str, - *, - spec: Any | None = ..., - create: bool = ..., - spec_set: Any | None = ..., - autospec: Any | None = ..., - new_callable: Any | None = ..., - **kwargs: Any, - ) -> _patch_default_new: ... - @overload - @staticmethod - def object( - target: Any, - attribute: str, - new: _T, - spec: Any | None = ..., - create: bool = ..., - spec_set: Any | None = ..., - autospec: Any | None = ..., - new_callable: Any | None = ..., - **kwargs: Any, - ) -> _patch[_T]: ... - @overload - @staticmethod - def object( - target: Any, - attribute: str, - *, - spec: Any | None = ..., - create: bool = ..., - spec_set: Any | None = ..., - autospec: Any | None = ..., - new_callable: Any | None = ..., - **kwargs: Any, - ) -> _patch[MagicMock | AsyncMock]: ... - @staticmethod - def multiple( - target: Any, - spec: Any | None = ..., - create: bool = ..., - spec_set: Any | None = ..., - autospec: Any | None = ..., - new_callable: Any | None = ..., - **kwargs: Any, - ) -> _patch[Any]: ... - @staticmethod - def stopall() -> None: ... - -patch: _patcher - -class MagicMixin(Base): - def __init__(self, *args: Any, **kw: Any) -> None: ... - -class NonCallableMagicMock(MagicMixin, NonCallableMock): ... -class MagicMock(MagicMixin, Mock): ... - -class AsyncMockMixin(Base): - def __init__(self, *args: Any, **kwargs: Any) -> None: ... - async def _execute_mock_call(self, *args: Any, **kwargs: Any) -> Any: ... - def assert_awaited(self) -> None: ... - def assert_awaited_once(self) -> None: ... - def assert_awaited_with(self, *args: Any, **kwargs: Any) -> None: ... - def assert_awaited_once_with(self, *args: Any, **kwargs: Any) -> None: ... - def assert_any_await(self, *args: Any, **kwargs: Any) -> None: ... - def assert_has_awaits(self, calls: Iterable[_Call], any_order: bool = False) -> None: ... - def assert_not_awaited(self) -> None: ... - def reset_mock(self, *args: Any, **kwargs: Any) -> None: ... - await_count: int - await_args: _Call | None - await_args_list: _CallList - -class AsyncMagicMixin(MagicMixin): - def __init__(self, *args: Any, **kw: Any) -> None: ... - -class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): - # Improving the `reset_mock` signature. - # It is defined on `AsyncMockMixin` with `*args, **kwargs`, which is not ideal. - # But, `NonCallableMock` super-class has the better version. - def reset_mock(self, visited: Any = None, *, return_value: bool = False, side_effect: bool = False) -> None: ... - -class MagicProxy(Base): - name: str - parent: Any - def __init__(self, name: str, parent: Any) -> None: ... - def create_mock(self) -> Any: ... - def __get__(self, obj: Any, _type: Any | None = None) -> Any: ... - -class _ANY: - def __eq__(self, other: object) -> Literal[True]: ... - def __ne__(self, other: object) -> Literal[False]: ... - __hash__: ClassVar[None] # type: ignore[assignment] - -ANY: Any - -if sys.version_info >= (3, 10): - def create_autospec( - spec: Any, - spec_set: Any = False, - instance: Any = False, - _parent: Any | None = None, - _name: Any | None = None, - *, - unsafe: bool = False, - **kwargs: Any, - ) -> Any: ... - -else: - def create_autospec( - spec: Any, - spec_set: Any = False, - instance: Any = False, - _parent: Any | None = None, - _name: Any | None = None, - **kwargs: Any, - ) -> Any: ... - -class _SpecState: - spec: Any - ids: Any - spec_set: Any - parent: Any - instance: Any - name: Any - def __init__( - self, - spec: Any, - spec_set: Any = False, - parent: Any | None = None, - name: Any | None = None, - ids: Any | None = None, - instance: Any = False, - ) -> None: ... - -def mock_open(mock: Any | None = None, read_data: Any = "") -> Any: ... - -class PropertyMock(Mock): - def __get__(self, obj: _T, obj_type: type[_T] | None = None) -> Self: ... - def __set__(self, obj: Any, val: Any) -> None: ... - -if sys.version_info >= (3, 13): - class ThreadingMixin(Base): - DEFAULT_TIMEOUT: Final[float | None] = None - - def __init__(self, /, *args: Any, timeout: float | None | _SentinelObject = ..., **kwargs: Any) -> None: ... - # Same as `NonCallableMock.reset_mock.` - def reset_mock(self, visited: Any = None, *, return_value: bool = False, side_effect: bool = False) -> None: ... - def wait_until_called(self, *, timeout: float | None | _SentinelObject = ...) -> None: ... - def wait_until_any_call_with(self, *args: Any, **kwargs: Any) -> None: ... - - class ThreadingMock(ThreadingMixin, MagicMixin, Mock): ... - -def seal(mock: Any) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/result.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/result.pyi deleted file mode 100644 index 0761baaa28..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/result.pyi +++ /dev/null @@ -1,47 +0,0 @@ -import sys -import unittest.case -from _typeshed import OptExcInfo -from collections.abc import Callable -from typing import Any, Final, TextIO, TypeVar -from typing_extensions import TypeAlias - -_F = TypeVar("_F", bound=Callable[..., Any]) -_DurationsType: TypeAlias = list[tuple[str, float]] - -STDOUT_LINE: Final[str] -STDERR_LINE: Final[str] - -# undocumented -def failfast(method: _F) -> _F: ... - -class TestResult: - errors: list[tuple[unittest.case.TestCase, str]] - failures: list[tuple[unittest.case.TestCase, str]] - skipped: list[tuple[unittest.case.TestCase, str]] - expectedFailures: list[tuple[unittest.case.TestCase, str]] - unexpectedSuccesses: list[unittest.case.TestCase] - shouldStop: bool - testsRun: int - buffer: bool - failfast: bool - tb_locals: bool - if sys.version_info >= (3, 12): - collectedDurations: _DurationsType - - def __init__(self, stream: TextIO | None = None, descriptions: bool | None = None, verbosity: int | None = None) -> None: ... - def printErrors(self) -> None: ... - def wasSuccessful(self) -> bool: ... - def stop(self) -> None: ... - def startTest(self, test: unittest.case.TestCase) -> None: ... - def stopTest(self, test: unittest.case.TestCase) -> None: ... - def startTestRun(self) -> None: ... - def stopTestRun(self) -> None: ... - def addError(self, test: unittest.case.TestCase, err: OptExcInfo) -> None: ... - def addFailure(self, test: unittest.case.TestCase, err: OptExcInfo) -> None: ... - def addSuccess(self, test: unittest.case.TestCase) -> None: ... - def addSkip(self, test: unittest.case.TestCase, reason: str) -> None: ... - def addExpectedFailure(self, test: unittest.case.TestCase, err: OptExcInfo) -> None: ... - def addUnexpectedSuccess(self, test: unittest.case.TestCase) -> None: ... - def addSubTest(self, test: unittest.case.TestCase, subtest: unittest.case.TestCase, err: OptExcInfo | None) -> None: ... - if sys.version_info >= (3, 12): - def addDuration(self, test: unittest.case.TestCase, elapsed: float) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/runner.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/runner.pyi deleted file mode 100644 index 783764464a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/runner.pyi +++ /dev/null @@ -1,91 +0,0 @@ -import sys -import unittest.case -import unittest.result -import unittest.suite -from _typeshed import SupportsFlush, SupportsWrite -from collections.abc import Callable, Iterable -from typing import Any, Generic, Protocol, TypeVar -from typing_extensions import Never, TypeAlias -from warnings import _ActionKind - -_ResultClassType: TypeAlias = Callable[[_TextTestStream, bool, int], TextTestResult[Any]] - -class _SupportsWriteAndFlush(SupportsWrite[str], SupportsFlush, Protocol): ... - -# All methods used by unittest.runner.TextTestResult's stream -class _TextTestStream(_SupportsWriteAndFlush, Protocol): - def writeln(self, arg: str | None = None, /) -> None: ... - -# _WritelnDecorator should have all the same attrs as its stream param. -# But that's not feasible to do Generically -# We can expand the attributes if requested -class _WritelnDecorator: - def __init__(self, stream: _SupportsWriteAndFlush) -> None: ... - def writeln(self, arg: str | None = None) -> None: ... - def __getattr__(self, attr: str) -> Any: ... # Any attribute from the stream type passed to __init__ - # These attributes are prevented by __getattr__ - stream: Never - __getstate__: Never - # Methods proxied from the wrapped stream object via __getattr__ - def flush(self) -> object: ... - def write(self, s: str, /) -> object: ... - -_StreamT = TypeVar("_StreamT", bound=_TextTestStream, default=_WritelnDecorator) - -class TextTestResult(unittest.result.TestResult, Generic[_StreamT]): - descriptions: bool # undocumented - dots: bool # undocumented - separator1: str - separator2: str - showAll: bool # undocumented - stream: _StreamT # undocumented - if sys.version_info >= (3, 12): - durations: int | None - def __init__(self, stream: _StreamT, descriptions: bool, verbosity: int, *, durations: int | None = None) -> None: ... - else: - def __init__(self, stream: _StreamT, descriptions: bool, verbosity: int) -> None: ... - - def getDescription(self, test: unittest.case.TestCase) -> str: ... - def printErrorList(self, flavour: str, errors: Iterable[tuple[unittest.case.TestCase, str]]) -> None: ... - -class TextTestRunner: - resultclass: _ResultClassType - stream: _WritelnDecorator - descriptions: bool - verbosity: int - failfast: bool - buffer: bool - warnings: _ActionKind | None - tb_locals: bool - - if sys.version_info >= (3, 12): - durations: int | None - def __init__( - self, - stream: _SupportsWriteAndFlush | None = None, - descriptions: bool = True, - verbosity: int = 1, - failfast: bool = False, - buffer: bool = False, - resultclass: _ResultClassType | None = None, - warnings: _ActionKind | None = None, - *, - tb_locals: bool = False, - durations: int | None = None, - ) -> None: ... - else: - def __init__( - self, - stream: _SupportsWriteAndFlush | None = None, - descriptions: bool = True, - verbosity: int = 1, - failfast: bool = False, - buffer: bool = False, - resultclass: _ResultClassType | None = None, - warnings: str | None = None, - *, - tb_locals: bool = False, - ) -> None: ... - - def _makeResult(self) -> TextTestResult: ... - def run(self, test: unittest.suite.TestSuite | unittest.case.TestCase) -> TextTestResult: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/signals.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/signals.pyi deleted file mode 100644 index a60133ada9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/signals.pyi +++ /dev/null @@ -1,15 +0,0 @@ -import unittest.result -from collections.abc import Callable -from typing import TypeVar, overload -from typing_extensions import ParamSpec - -_P = ParamSpec("_P") -_T = TypeVar("_T") - -def installHandler() -> None: ... -def registerResult(result: unittest.result.TestResult) -> None: ... -def removeResult(result: unittest.result.TestResult) -> bool: ... -@overload -def removeHandler(method: None = None) -> None: ... -@overload -def removeHandler(method: Callable[_P, _T]) -> Callable[_P, _T]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/suite.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/suite.pyi deleted file mode 100644 index 443396164b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/suite.pyi +++ /dev/null @@ -1,24 +0,0 @@ -import unittest.case -import unittest.result -from collections.abc import Iterable, Iterator -from typing import ClassVar -from typing_extensions import TypeAlias - -_TestType: TypeAlias = unittest.case.TestCase | TestSuite - -class BaseTestSuite: - _tests: list[unittest.case.TestCase] - _removed_tests: int - def __init__(self, tests: Iterable[_TestType] = ()) -> None: ... - def __call__(self, result: unittest.result.TestResult) -> unittest.result.TestResult: ... - def addTest(self, test: _TestType) -> None: ... - def addTests(self, tests: Iterable[_TestType]) -> None: ... - def run(self, result: unittest.result.TestResult) -> unittest.result.TestResult: ... - def debug(self) -> None: ... - def countTestCases(self) -> int: ... - def __iter__(self) -> Iterator[_TestType]: ... - def __eq__(self, other: object) -> bool: ... - __hash__: ClassVar[None] # type: ignore[assignment] - -class TestSuite(BaseTestSuite): - def run(self, result: unittest.result.TestResult, debug: bool = False) -> unittest.result.TestResult: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/util.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/util.pyi deleted file mode 100644 index 945b0cecfe..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/unittest/util.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from collections.abc import MutableSequence, Sequence -from typing import Any, Final, TypeVar -from typing_extensions import TypeAlias - -_T = TypeVar("_T") -_Mismatch: TypeAlias = tuple[_T, _T, int] - -_MAX_LENGTH: Final[int] -_PLACEHOLDER_LEN: Final[int] -_MIN_BEGIN_LEN: Final[int] -_MIN_END_LEN: Final[int] -_MIN_COMMON_LEN: Final[int] -_MIN_DIFF_LEN: Final[int] - -def _shorten(s: str, prefixlen: int, suffixlen: int) -> str: ... -def _common_shorten_repr(*args: str) -> tuple[str, ...]: ... -def safe_repr(obj: object, short: bool = False) -> str: ... -def strclass(cls: type) -> str: ... -def sorted_list_difference(expected: Sequence[_T], actual: Sequence[_T]) -> tuple[list[_T], list[_T]]: ... -def unorderable_list_difference(expected: MutableSequence[_T], actual: MutableSequence[_T]) -> tuple[list[_T], list[_T]]: ... -def three_way_cmp(x: Any, y: Any) -> int: ... -def _count_diff_all_purpose(actual: Sequence[_T], expected: Sequence[_T]) -> list[_Mismatch[_T]]: ... -def _count_diff_hashable(actual: Sequence[_T], expected: Sequence[_T]) -> list[_Mismatch[_T]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/__init__.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/error.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/error.pyi deleted file mode 100644 index 89cec9bf28..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/error.pyi +++ /dev/null @@ -1,23 +0,0 @@ -from email.message import Message -from typing import IO -from urllib.response import addinfourl - -__all__ = ["URLError", "HTTPError", "ContentTooShortError"] - -class URLError(OSError): - reason: str | BaseException - def __init__(self, reason: str | BaseException, filename: str | None = None) -> None: ... - -class HTTPError(URLError, addinfourl): - @property - def headers(self) -> Message: ... - @headers.setter - def headers(self, headers: Message) -> None: ... - @property - def reason(self) -> str: ... # type: ignore[override] - code: int - def __init__(self, url: str, code: int, msg: str, hdrs: Message, fp: IO[bytes] | None) -> None: ... - -class ContentTooShortError(URLError): - content: tuple[str, Message] - def __init__(self, message: str, content: tuple[str, Message]) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/parse.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/parse.pyi deleted file mode 100644 index a5ed616d25..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/parse.pyi +++ /dev/null @@ -1,195 +0,0 @@ -import sys -from collections.abc import Iterable, Mapping, Sequence -from types import GenericAlias -from typing import Any, AnyStr, Generic, Literal, NamedTuple, Protocol, overload, type_check_only -from typing_extensions import TypeAlias - -__all__ = [ - "urlparse", - "urlunparse", - "urljoin", - "urldefrag", - "urlsplit", - "urlunsplit", - "urlencode", - "parse_qs", - "parse_qsl", - "quote", - "quote_plus", - "quote_from_bytes", - "unquote", - "unquote_plus", - "unquote_to_bytes", - "DefragResult", - "ParseResult", - "SplitResult", - "DefragResultBytes", - "ParseResultBytes", - "SplitResultBytes", -] - -uses_relative: list[str] -uses_netloc: list[str] -uses_params: list[str] -non_hierarchical: list[str] -uses_query: list[str] -uses_fragment: list[str] -scheme_chars: str -if sys.version_info < (3, 11): - MAX_CACHE_SIZE: int - -class _ResultMixinStr: - def encode(self, encoding: str = "ascii", errors: str = "strict") -> _ResultMixinBytes: ... - -class _ResultMixinBytes: - def decode(self, encoding: str = "ascii", errors: str = "strict") -> _ResultMixinStr: ... - -class _NetlocResultMixinBase(Generic[AnyStr]): - @property - def username(self) -> AnyStr | None: ... - @property - def password(self) -> AnyStr | None: ... - @property - def hostname(self) -> AnyStr | None: ... - @property - def port(self) -> int | None: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -class _NetlocResultMixinStr(_NetlocResultMixinBase[str], _ResultMixinStr): ... -class _NetlocResultMixinBytes(_NetlocResultMixinBase[bytes], _ResultMixinBytes): ... - -class _DefragResultBase(NamedTuple, Generic[AnyStr]): - url: AnyStr - fragment: AnyStr - -class _SplitResultBase(NamedTuple, Generic[AnyStr]): - scheme: AnyStr - netloc: AnyStr - path: AnyStr - query: AnyStr - fragment: AnyStr - -class _ParseResultBase(NamedTuple, Generic[AnyStr]): - scheme: AnyStr - netloc: AnyStr - path: AnyStr - params: AnyStr - query: AnyStr - fragment: AnyStr - -# Structured result objects for string data -class DefragResult(_DefragResultBase[str], _ResultMixinStr): - def geturl(self) -> str: ... - -class SplitResult(_SplitResultBase[str], _NetlocResultMixinStr): - def geturl(self) -> str: ... - -class ParseResult(_ParseResultBase[str], _NetlocResultMixinStr): - def geturl(self) -> str: ... - -# Structured result objects for bytes data -class DefragResultBytes(_DefragResultBase[bytes], _ResultMixinBytes): - def geturl(self) -> bytes: ... - -class SplitResultBytes(_SplitResultBase[bytes], _NetlocResultMixinBytes): - def geturl(self) -> bytes: ... - -class ParseResultBytes(_ParseResultBase[bytes], _NetlocResultMixinBytes): - def geturl(self) -> bytes: ... - -def parse_qs( - qs: AnyStr | None, - keep_blank_values: bool = False, - strict_parsing: bool = False, - encoding: str = "utf-8", - errors: str = "replace", - max_num_fields: int | None = None, - separator: str = "&", -) -> dict[AnyStr, list[AnyStr]]: ... -def parse_qsl( - qs: AnyStr | None, - keep_blank_values: bool = False, - strict_parsing: bool = False, - encoding: str = "utf-8", - errors: str = "replace", - max_num_fields: int | None = None, - separator: str = "&", -) -> list[tuple[AnyStr, AnyStr]]: ... -@overload -def quote(string: str, safe: str | Iterable[int] = "/", encoding: str | None = None, errors: str | None = None) -> str: ... -@overload -def quote(string: bytes | bytearray, safe: str | Iterable[int] = "/") -> str: ... -def quote_from_bytes(bs: bytes | bytearray, safe: str | Iterable[int] = "/") -> str: ... -@overload -def quote_plus(string: str, safe: str | Iterable[int] = "", encoding: str | None = None, errors: str | None = None) -> str: ... -@overload -def quote_plus(string: bytes | bytearray, safe: str | Iterable[int] = "") -> str: ... -def unquote(string: str | bytes, encoding: str = "utf-8", errors: str = "replace") -> str: ... -def unquote_to_bytes(string: str | bytes | bytearray) -> bytes: ... -def unquote_plus(string: str, encoding: str = "utf-8", errors: str = "replace") -> str: ... -@overload -def urldefrag(url: str) -> DefragResult: ... -@overload -def urldefrag(url: bytes | bytearray | None) -> DefragResultBytes: ... - -# The values are passed through `str()` (unless they are bytes), so anything is valid. -_QueryType: TypeAlias = ( - Mapping[str, object] - | Mapping[bytes, object] - | Mapping[str | bytes, object] - | Mapping[str, Sequence[object]] - | Mapping[bytes, Sequence[object]] - | Mapping[str | bytes, Sequence[object]] - | Sequence[tuple[str | bytes, object]] - | Sequence[tuple[str | bytes, Sequence[object]]] -) - -@type_check_only -class _QuoteVia(Protocol): - @overload - def __call__(self, string: str, safe: str | bytes, encoding: str, errors: str, /) -> str: ... - @overload - def __call__(self, string: bytes, safe: str | bytes, /) -> str: ... - -def urlencode( - query: _QueryType, - doseq: bool = False, - safe: str | bytes = "", - encoding: str | None = None, - errors: str | None = None, - quote_via: _QuoteVia = ..., -) -> str: ... -def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = True) -> AnyStr: ... -@overload -def urlparse(url: str, scheme: str = "", allow_fragments: bool = True) -> ParseResult: ... -@overload -def urlparse( - url: bytes | bytearray | None, scheme: bytes | bytearray | None | Literal[""] = "", allow_fragments: bool = True -) -> ParseResultBytes: ... -@overload -def urlsplit(url: str, scheme: str = "", allow_fragments: bool = True) -> SplitResult: ... - -if sys.version_info >= (3, 11): - @overload - def urlsplit( - url: bytes | None, scheme: bytes | None | Literal[""] = "", allow_fragments: bool = True - ) -> SplitResultBytes: ... - -else: - @overload - def urlsplit( - url: bytes | bytearray | None, scheme: bytes | bytearray | None | Literal[""] = "", allow_fragments: bool = True - ) -> SplitResultBytes: ... - -# Requires an iterable of length 6 -@overload -def urlunparse(components: Iterable[None]) -> Literal[b""]: ... # type: ignore[overload-overlap] -@overload -def urlunparse(components: Iterable[AnyStr | None]) -> AnyStr: ... - -# Requires an iterable of length 5 -@overload -def urlunsplit(components: Iterable[None]) -> Literal[b""]: ... # type: ignore[overload-overlap] -@overload -def urlunsplit(components: Iterable[AnyStr | None]) -> AnyStr: ... -def unwrap(url: str) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/request.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/request.pyi deleted file mode 100644 index 1f453fd1e1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/request.pyi +++ /dev/null @@ -1,408 +0,0 @@ -import ssl -import sys -from _typeshed import ReadableBuffer, StrOrBytesPath, SupportsRead -from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence -from email.message import Message -from http.client import HTTPConnection, HTTPMessage, HTTPResponse -from http.cookiejar import CookieJar -from re import Pattern -from typing import IO, Any, ClassVar, NoReturn, Protocol, TypeVar, overload -from typing_extensions import TypeAlias -from urllib.error import HTTPError as HTTPError -from urllib.response import addclosehook, addinfourl - -__all__ = [ - "Request", - "OpenerDirector", - "BaseHandler", - "HTTPDefaultErrorHandler", - "HTTPRedirectHandler", - "HTTPCookieProcessor", - "ProxyHandler", - "HTTPPasswordMgr", - "HTTPPasswordMgrWithDefaultRealm", - "HTTPPasswordMgrWithPriorAuth", - "AbstractBasicAuthHandler", - "HTTPBasicAuthHandler", - "ProxyBasicAuthHandler", - "AbstractDigestAuthHandler", - "HTTPDigestAuthHandler", - "ProxyDigestAuthHandler", - "HTTPHandler", - "FileHandler", - "FTPHandler", - "CacheFTPHandler", - "DataHandler", - "UnknownHandler", - "HTTPErrorProcessor", - "urlopen", - "install_opener", - "build_opener", - "pathname2url", - "url2pathname", - "getproxies", - "urlretrieve", - "urlcleanup", - "URLopener", - "FancyURLopener", - "HTTPSHandler", -] - -_T = TypeVar("_T") -_UrlopenRet: TypeAlias = Any -_DataType: TypeAlias = ReadableBuffer | SupportsRead[bytes] | Iterable[bytes] | None - -if sys.version_info >= (3, 13): - def urlopen( - url: str | Request, data: _DataType | None = None, timeout: float | None = ..., *, context: ssl.SSLContext | None = None - ) -> _UrlopenRet: ... - -else: - def urlopen( - url: str | Request, - data: _DataType | None = None, - timeout: float | None = ..., - *, - cafile: str | None = None, - capath: str | None = None, - cadefault: bool = False, - context: ssl.SSLContext | None = None, - ) -> _UrlopenRet: ... - -def install_opener(opener: OpenerDirector) -> None: ... -def build_opener(*handlers: BaseHandler | Callable[[], BaseHandler]) -> OpenerDirector: ... - -if sys.platform == "win32": - from nturl2path import pathname2url as pathname2url, url2pathname as url2pathname -else: - def url2pathname(pathname: str) -> str: ... - def pathname2url(pathname: str) -> str: ... - -def getproxies() -> dict[str, str]: ... -def getproxies_environment() -> dict[str, str]: ... -def parse_http_list(s: str) -> list[str]: ... -def parse_keqv_list(l: list[str]) -> dict[str, str]: ... - -if sys.platform == "win32" or sys.platform == "darwin": - def proxy_bypass(host: str) -> Any: ... # undocumented - -else: - def proxy_bypass(host: str, proxies: Mapping[str, str] | None = None) -> Any: ... # undocumented - -class Request: - @property - def full_url(self) -> str: ... - @full_url.setter - def full_url(self, value: str) -> None: ... - @full_url.deleter - def full_url(self) -> None: ... - type: str - host: str - origin_req_host: str - selector: str - data: _DataType - headers: MutableMapping[str, str] - unredirected_hdrs: dict[str, str] - unverifiable: bool - method: str | None - timeout: float | None # Undocumented, only set after __init__() by OpenerDirector.open() - def __init__( - self, - url: str, - data: _DataType = None, - headers: MutableMapping[str, str] = {}, - origin_req_host: str | None = None, - unverifiable: bool = False, - method: str | None = None, - ) -> None: ... - def get_method(self) -> str: ... - def add_header(self, key: str, val: str) -> None: ... - def add_unredirected_header(self, key: str, val: str) -> None: ... - def has_header(self, header_name: str) -> bool: ... - def remove_header(self, header_name: str) -> None: ... - def get_full_url(self) -> str: ... - def set_proxy(self, host: str, type: str) -> None: ... - @overload - def get_header(self, header_name: str) -> str | None: ... - @overload - def get_header(self, header_name: str, default: _T) -> 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: str | Request, data: _DataType = None, timeout: float | None = ...) -> _UrlopenRet: ... - def error(self, proto: str, *args: Any) -> _UrlopenRet: ... - def close(self) -> None: ... - -class BaseHandler: - handler_order: ClassVar[int] - parent: OpenerDirector - def add_parent(self, parent: OpenerDirector) -> None: ... - def close(self) -> None: ... - def __lt__(self, other: object) -> bool: ... - -class HTTPDefaultErrorHandler(BaseHandler): - def http_error_default( - self, req: Request, fp: IO[bytes], code: int, msg: str, hdrs: HTTPMessage - ) -> 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[bytes], code: int, msg: str, headers: HTTPMessage, newurl: str - ) -> Request | None: ... - def http_error_301(self, req: Request, fp: IO[bytes], code: int, msg: str, headers: HTTPMessage) -> _UrlopenRet | None: ... - def http_error_302(self, req: Request, fp: IO[bytes], code: int, msg: str, headers: HTTPMessage) -> _UrlopenRet | None: ... - def http_error_303(self, req: Request, fp: IO[bytes], code: int, msg: str, headers: HTTPMessage) -> _UrlopenRet | None: ... - def http_error_307(self, req: Request, fp: IO[bytes], code: int, msg: str, headers: HTTPMessage) -> _UrlopenRet | None: ... - if sys.version_info >= (3, 11): - def http_error_308( - self, req: Request, fp: IO[bytes], code: int, msg: str, headers: HTTPMessage - ) -> _UrlopenRet | None: ... - -class HTTPCookieProcessor(BaseHandler): - cookiejar: CookieJar - def __init__(self, cookiejar: CookieJar | None = None) -> 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: dict[str, str] | None = None) -> None: ... - def proxy_open(self, req: Request, proxy: str, type: str) -> _UrlopenRet | None: ... # undocumented - # TODO: add a method for every (common) proxy protocol - -class HTTPPasswordMgr: - def add_password(self, realm: str, uri: str | Sequence[str], user: str, passwd: str) -> None: ... - def find_user_password(self, realm: str, authuri: str) -> tuple[str | None, str | None]: ... - def is_suburi(self, base: str, test: str) -> bool: ... # undocumented - def reduce_uri(self, uri: str, default_port: bool = True) -> tuple[str, str]: ... # undocumented - -class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): - def add_password(self, realm: str | None, uri: str | Sequence[str], user: str, passwd: str) -> None: ... - def find_user_password(self, realm: str | None, authuri: str) -> tuple[str | None, str | None]: ... - -class HTTPPasswordMgrWithPriorAuth(HTTPPasswordMgrWithDefaultRealm): - def add_password( - self, realm: str | None, uri: str | Sequence[str], user: str, passwd: str, is_authenticated: bool = False - ) -> None: ... - def update_authenticated(self, uri: str | Sequence[str], is_authenticated: bool = False) -> None: ... - def is_authenticated(self, authuri: str) -> bool | None: ... - -class AbstractBasicAuthHandler: - rx: ClassVar[Pattern[str]] # undocumented - passwd: HTTPPasswordMgr - add_password: Callable[[str, str | Sequence[str], str, str], None] - def __init__(self, password_mgr: HTTPPasswordMgr | None = None) -> None: ... - def http_error_auth_reqed(self, authreq: str, host: str, req: Request, headers: HTTPMessage) -> 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) -> _UrlopenRet | None: ... # undocumented - -class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): - auth_header: ClassVar[str] # undocumented - def http_error_401(self, req: Request, fp: IO[bytes], code: int, msg: str, headers: HTTPMessage) -> _UrlopenRet | None: ... - -class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): - auth_header: ClassVar[str] - def http_error_407(self, req: Request, fp: IO[bytes], code: int, msg: str, headers: HTTPMessage) -> _UrlopenRet | None: ... - -class AbstractDigestAuthHandler: - def __init__(self, passwd: HTTPPasswordMgr | None = None) -> None: ... - def reset_retry_count(self) -> None: ... - def http_error_auth_reqed(self, auth_header: str, host: str, req: Request, headers: HTTPMessage) -> None: ... - def retry_http_digest_auth(self, req: Request, auth: str) -> _UrlopenRet | None: ... - def get_cnonce(self, nonce: str) -> str: ... - def get_authorization(self, req: Request, chal: Mapping[str, str]) -> str | None: ... - def get_algorithm_impls(self, algorithm: str) -> tuple[Callable[[str], str], Callable[[str, str], str]]: ... - def get_entity_digest(self, data: ReadableBuffer | None, chal: Mapping[str, str]) -> str | None: ... - -class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): - auth_header: ClassVar[str] # undocumented - def http_error_401(self, req: Request, fp: IO[bytes], code: int, msg: str, headers: HTTPMessage) -> _UrlopenRet | None: ... - -class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): - auth_header: ClassVar[str] # undocumented - def http_error_407(self, req: Request, fp: IO[bytes], code: int, msg: str, headers: HTTPMessage) -> _UrlopenRet | None: ... - -class _HTTPConnectionProtocol(Protocol): - def __call__( - self, - host: str, - /, - *, - port: int | None = ..., - timeout: float = ..., - source_address: tuple[str, int] | None = ..., - blocksize: int = ..., - ) -> HTTPConnection: ... - -class AbstractHTTPHandler(BaseHandler): # undocumented - if sys.version_info >= (3, 12): - def __init__(self, debuglevel: int | None = None) -> None: ... - else: - def __init__(self, debuglevel: int = 0) -> None: ... - - def set_http_debuglevel(self, level: int) -> None: ... - def do_request_(self, request: Request) -> Request: ... - def do_open(self, http_class: _HTTPConnectionProtocol, req: Request, **http_conn_args: Any) -> HTTPResponse: ... - -class HTTPHandler(AbstractHTTPHandler): - def http_open(self, req: Request) -> HTTPResponse: ... - def http_request(self, request: Request) -> Request: ... # undocumented - -class HTTPSHandler(AbstractHTTPHandler): - if sys.version_info >= (3, 12): - def __init__( - self, debuglevel: int | None = None, context: ssl.SSLContext | None = None, check_hostname: bool | None = None - ) -> None: ... - else: - def __init__( - self, debuglevel: int = 0, context: ssl.SSLContext | None = None, check_hostname: bool | None = None - ) -> None: ... - - def https_open(self, req: Request) -> HTTPResponse: ... - def https_request(self, request: Request) -> Request: ... # undocumented - -class FileHandler(BaseHandler): - names: ClassVar[tuple[str, ...] | None] # 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: float | None = None, persistent: bool = True - ) -> None: ... - def close(self) -> None: ... - def endtransfer(self) -> None: ... - def file_close(self) -> None: ... - def init(self) -> None: ... - def real_close(self) -> None: ... - def retrfile(self, file: str, type: str) -> tuple[addclosehook, int | 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 - -class UnknownHandler(BaseHandler): - def unknown_open(self, req: Request) -> NoReturn: ... - -class HTTPErrorProcessor(BaseHandler): - def http_response(self, request: Request, response: HTTPResponse) -> _UrlopenRet: ... - def https_response(self, request: Request, response: HTTPResponse) -> _UrlopenRet: ... - -def urlretrieve( - url: str, - filename: StrOrBytesPath | None = None, - reporthook: Callable[[int, int, int], object] | None = None, - data: _DataType = None, -) -> tuple[str, HTTPMessage]: ... -def urlcleanup() -> None: ... - -class URLopener: - version: ClassVar[str] - def __init__(self, proxies: dict[str, str] | None = None, **x509: str) -> None: ... - def open(self, fullurl: str, data: ReadableBuffer | None = None) -> _UrlopenRet: ... - def open_unknown(self, fullurl: str, data: ReadableBuffer | None = None) -> _UrlopenRet: ... - def retrieve( - self, - url: str, - filename: str | None = None, - reporthook: Callable[[int, int, int], object] | None = None, - data: ReadableBuffer | None = None, - ) -> tuple[str, Message | None]: ... - 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: HTTPMessage, data: bytes | None = None - ) -> _UrlopenRet: ... # undocumented - def http_error_default( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage - ) -> _UrlopenRet: ... # undocumented - def open_data(self, url: str, data: ReadableBuffer | None = None) -> 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: ReadableBuffer | None = None) -> _UrlopenRet: ... # undocumented - def open_https(self, url: str, data: ReadableBuffer | None = None) -> _UrlopenRet: ... # undocumented - def open_local_file(self, url: str) -> addinfourl: ... # undocumented - def open_unknown_proxy(self, proxy: str, fullurl: str, data: ReadableBuffer | None = None) -> None: ... # undocumented - def __del__(self) -> None: ... - -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 = 0) -> tuple[str, str]: ... # undocumented - def http_error_301( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None = None - ) -> _UrlopenRet | addinfourl | None: ... # undocumented - def http_error_302( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None = None - ) -> _UrlopenRet | addinfourl | None: ... # undocumented - def http_error_303( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None = None - ) -> _UrlopenRet | addinfourl | None: ... # undocumented - def http_error_307( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None = None - ) -> _UrlopenRet | addinfourl | None: ... # undocumented - if sys.version_info >= (3, 11): - def http_error_308( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None = None - ) -> _UrlopenRet | addinfourl | None: ... # undocumented - - def http_error_401( - self, - url: str, - fp: IO[bytes], - errcode: int, - errmsg: str, - headers: HTTPMessage, - data: ReadableBuffer | None = None, - retry: bool = False, - ) -> _UrlopenRet | None: ... # undocumented - def http_error_407( - self, - url: str, - fp: IO[bytes], - errcode: int, - errmsg: str, - headers: HTTPMessage, - data: ReadableBuffer | None = None, - retry: bool = False, - ) -> _UrlopenRet | None: ... # undocumented - def http_error_default( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage - ) -> addinfourl: ... # undocumented - def redirect_internal( - self, url: str, fp: IO[bytes], errcode: int, errmsg: str, headers: HTTPMessage, data: ReadableBuffer | None - ) -> _UrlopenRet | None: ... # undocumented - def retry_http_basic_auth( - self, url: str, realm: str, data: ReadableBuffer | None = None - ) -> _UrlopenRet | None: ... # undocumented - def retry_https_basic_auth( - self, url: str, realm: str, data: ReadableBuffer | None = None - ) -> _UrlopenRet | None: ... # undocumented - def retry_proxy_http_basic_auth( - self, url: str, realm: str, data: ReadableBuffer | None = None - ) -> _UrlopenRet | None: ... # undocumented - def retry_proxy_https_basic_auth( - self, url: str, realm: str, data: ReadableBuffer | None = None - ) -> _UrlopenRet | None: ... # undocumented diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/response.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/response.pyi deleted file mode 100644 index 65df9cdff5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/response.pyi +++ /dev/null @@ -1,40 +0,0 @@ -import tempfile -from _typeshed import ReadableBuffer -from collections.abc import Callable, Iterable -from email.message import Message -from types import TracebackType -from typing import IO, Any - -__all__ = ["addbase", "addclosehook", "addinfo", "addinfourl"] - -class addbase(tempfile._TemporaryFileWrapper[bytes]): - fp: IO[bytes] - def __init__(self, fp: IO[bytes]) -> None: ... - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> None: ... - # These methods don't actually exist, but the class inherits at runtime from - # tempfile._TemporaryFileWrapper, which uses __getattr__ to delegate to the - # underlying file object. To satisfy the BinaryIO interface, we pretend that this - # class has these additional methods. - def write(self, s: ReadableBuffer) -> int: ... - def writelines(self, lines: Iterable[ReadableBuffer]) -> None: ... - -class addclosehook(addbase): - closehook: Callable[..., object] - hookargs: tuple[Any, ...] - def __init__(self, fp: IO[bytes], closehook: Callable[..., object], *hookargs: Any) -> None: ... - -class addinfo(addbase): - headers: Message - def __init__(self, fp: IO[bytes], headers: Message) -> None: ... - def info(self) -> Message: ... - -class addinfourl(addinfo): - url: str - code: int | None - @property - def status(self) -> int | None: ... - def __init__(self, fp: IO[bytes], headers: Message, url: str, code: int | None = None) -> None: ... - def geturl(self) -> str: ... - def getcode(self) -> int | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/robotparser.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/robotparser.pyi deleted file mode 100644 index 14ceef550d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/urllib/robotparser.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from collections.abc import Iterable -from typing import NamedTuple - -__all__ = ["RobotFileParser"] - -class RequestRate(NamedTuple): - requests: int - seconds: int - -class RobotFileParser: - def __init__(self, url: str = "") -> None: ... - def set_url(self, url: str) -> None: ... - def read(self) -> None: ... - def parse(self, lines: Iterable[str]) -> None: ... - def can_fetch(self, useragent: str, url: str) -> bool: ... - def mtime(self) -> int: ... - def modified(self) -> None: ... - def crawl_delay(self, useragent: str) -> str | None: ... - def request_rate(self, useragent: str) -> RequestRate | None: ... - def site_maps(self) -> list[str] | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/uu.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/uu.pyi deleted file mode 100644 index 324053e043..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/uu.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from typing import BinaryIO -from typing_extensions import TypeAlias - -__all__ = ["Error", "encode", "decode"] - -_File: TypeAlias = str | BinaryIO - -class Error(Exception): ... - -def encode( - in_file: _File, out_file: _File, name: str | None = None, mode: int | None = None, *, backtick: bool = False -) -> None: ... -def decode(in_file: _File, out_file: _File | None = None, mode: int | None = None, quiet: bool = False) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/uuid.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/uuid.pyi deleted file mode 100644 index 3202ae212c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/uuid.pyi +++ /dev/null @@ -1,94 +0,0 @@ -import builtins -import sys -from enum import Enum -from typing_extensions import TypeAlias - -_FieldsType: TypeAlias = tuple[int, int, int, int, int, int] - -class SafeUUID(Enum): - safe = 0 - unsafe = -1 - unknown = None - -class UUID: - def __init__( - self, - hex: str | None = None, - bytes: builtins.bytes | None = None, - bytes_le: builtins.bytes | None = None, - fields: _FieldsType | None = None, - int: builtins.int | None = None, - version: builtins.int | None = None, - *, - is_safe: SafeUUID = ..., - ) -> None: ... - @property - def is_safe(self) -> SafeUUID: ... - @property - def bytes(self) -> builtins.bytes: ... - @property - def bytes_le(self) -> builtins.bytes: ... - @property - def clock_seq(self) -> builtins.int: ... - @property - def clock_seq_hi_variant(self) -> builtins.int: ... - @property - def clock_seq_low(self) -> builtins.int: ... - @property - def fields(self) -> _FieldsType: ... - @property - def hex(self) -> str: ... - @property - def int(self) -> builtins.int: ... - @property - def node(self) -> builtins.int: ... - @property - def time(self) -> builtins.int: ... - @property - def time_hi_version(self) -> builtins.int: ... - @property - def time_low(self) -> builtins.int: ... - @property - def time_mid(self) -> builtins.int: ... - @property - def urn(self) -> str: ... - @property - def variant(self) -> str: ... - @property - def version(self) -> builtins.int | None: ... - def __int__(self) -> builtins.int: ... - def __eq__(self, other: object) -> bool: ... - def __lt__(self, other: UUID) -> bool: ... - def __le__(self, other: UUID) -> bool: ... - def __gt__(self, other: UUID) -> bool: ... - def __ge__(self, other: UUID) -> bool: ... - def __hash__(self) -> builtins.int: ... - -def getnode() -> int: ... -def uuid1(node: int | None = None, clock_seq: int | None = None) -> UUID: ... - -if sys.version_info >= (3, 12): - def uuid3(namespace: UUID, name: str | bytes) -> UUID: ... - -else: - def uuid3(namespace: UUID, name: str) -> UUID: ... - -def uuid4() -> UUID: ... - -if sys.version_info >= (3, 12): - def uuid5(namespace: UUID, name: str | bytes) -> UUID: ... - -else: - def uuid5(namespace: UUID, name: str) -> UUID: ... - -NAMESPACE_DNS: UUID -NAMESPACE_URL: UUID -NAMESPACE_OID: UUID -NAMESPACE_X500: UUID -RESERVED_NCS: str -RFC_4122: str -RESERVED_MICROSOFT: str -RESERVED_FUTURE: str - -if sys.version_info >= (3, 12): - def main() -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/venv/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/venv/__init__.pyi deleted file mode 100644 index 0f71f0e073..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/venv/__init__.pyi +++ /dev/null @@ -1,85 +0,0 @@ -import logging -import sys -from _typeshed import StrOrBytesPath -from collections.abc import Iterable, Sequence -from types import SimpleNamespace - -logger: logging.Logger - -CORE_VENV_DEPS: tuple[str, ...] - -class EnvBuilder: - system_site_packages: bool - clear: bool - symlinks: bool - upgrade: bool - with_pip: bool - prompt: str | None - - if sys.version_info >= (3, 13): - def __init__( - self, - system_site_packages: bool = False, - clear: bool = False, - symlinks: bool = False, - upgrade: bool = False, - with_pip: bool = False, - prompt: str | None = None, - upgrade_deps: bool = False, - *, - scm_ignore_files: Iterable[str] = ..., - ) -> None: ... - else: - def __init__( - self, - system_site_packages: bool = False, - clear: bool = False, - symlinks: bool = False, - upgrade: bool = False, - with_pip: bool = False, - prompt: str | None = None, - upgrade_deps: bool = False, - ) -> None: ... - - def create(self, env_dir: StrOrBytesPath) -> None: ... - def clear_directory(self, path: StrOrBytesPath) -> None: ... # undocumented - def ensure_directories(self, env_dir: StrOrBytesPath) -> SimpleNamespace: ... - def create_configuration(self, context: SimpleNamespace) -> None: ... - def symlink_or_copy( - self, src: StrOrBytesPath, dst: StrOrBytesPath, relative_symlinks_ok: bool = False - ) -> None: ... # undocumented - def setup_python(self, context: SimpleNamespace) -> None: ... - def _setup_pip(self, context: SimpleNamespace) -> None: ... # undocumented - def setup_scripts(self, context: SimpleNamespace) -> None: ... - def post_setup(self, context: SimpleNamespace) -> None: ... - def replace_variables(self, text: str, context: SimpleNamespace) -> str: ... # undocumented - def install_scripts(self, context: SimpleNamespace, path: str) -> None: ... - def upgrade_dependencies(self, context: SimpleNamespace) -> None: ... - if sys.version_info >= (3, 13): - def create_git_ignore_file(self, context: SimpleNamespace) -> None: ... - -if sys.version_info >= (3, 13): - def create( - env_dir: StrOrBytesPath, - system_site_packages: bool = False, - clear: bool = False, - symlinks: bool = False, - with_pip: bool = False, - prompt: str | None = None, - upgrade_deps: bool = False, - *, - scm_ignore_files: Iterable[str] = ..., - ) -> None: ... - -else: - def create( - env_dir: StrOrBytesPath, - system_site_packages: bool = False, - clear: bool = False, - symlinks: bool = False, - with_pip: bool = False, - prompt: str | None = None, - upgrade_deps: bool = False, - ) -> None: ... - -def main(args: Sequence[str] | None = None) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/warnings.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/warnings.pyi deleted file mode 100644 index 49c98cb075..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/warnings.pyi +++ /dev/null @@ -1,126 +0,0 @@ -import re -import sys -from _warnings import warn as warn, warn_explicit as warn_explicit -from collections.abc import Sequence -from types import ModuleType, TracebackType -from typing import Any, Generic, Literal, TextIO, overload -from typing_extensions import LiteralString, TypeAlias, TypeVar - -__all__ = [ - "warn", - "warn_explicit", - "showwarning", - "formatwarning", - "filterwarnings", - "simplefilter", - "resetwarnings", - "catch_warnings", -] - -if sys.version_info >= (3, 13): - __all__ += ["deprecated"] - -_T = TypeVar("_T") -_W_co = TypeVar("_W_co", bound=list[WarningMessage] | None, default=list[WarningMessage] | None, covariant=True) - -if sys.version_info >= (3, 14): - _ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "module", "once"] -else: - _ActionKind: TypeAlias = Literal["default", "error", "ignore", "always", "all", "module", "once"] -filters: Sequence[tuple[str, re.Pattern[str] | None, type[Warning], re.Pattern[str] | None, int]] # undocumented, do not mutate - -def showwarning( - message: Warning | str, - category: type[Warning], - filename: str, - lineno: int, - file: TextIO | None = None, - line: str | None = None, -) -> None: ... -def formatwarning( - message: Warning | str, category: type[Warning], filename: str, lineno: int, line: str | None = None -) -> str: ... -def filterwarnings( - action: _ActionKind, message: str = "", category: type[Warning] = ..., module: str = "", lineno: int = 0, append: bool = False -) -> None: ... -def simplefilter(action: _ActionKind, category: type[Warning] = ..., lineno: int = 0, append: bool = False) -> None: ... -def resetwarnings() -> None: ... - -class _OptionError(Exception): ... - -class WarningMessage: - message: Warning | str - category: type[Warning] - filename: str - lineno: int - file: TextIO | None - line: str | None - source: Any | None - def __init__( - self, - message: Warning | str, - category: type[Warning], - filename: str, - lineno: int, - file: TextIO | None = None, - line: str | None = None, - source: Any | None = None, - ) -> None: ... - -class catch_warnings(Generic[_W_co]): - if sys.version_info >= (3, 11): - @overload - def __init__( - self: catch_warnings[None], - *, - record: Literal[False] = False, - module: ModuleType | None = None, - action: _ActionKind | None = None, - category: type[Warning] = ..., - lineno: int = 0, - append: bool = False, - ) -> None: ... - @overload - def __init__( - self: catch_warnings[list[WarningMessage]], - *, - record: Literal[True], - module: ModuleType | None = None, - action: _ActionKind | None = None, - category: type[Warning] = ..., - lineno: int = 0, - append: bool = False, - ) -> None: ... - @overload - def __init__( - self, - *, - record: bool, - module: ModuleType | None = None, - action: _ActionKind | None = None, - category: type[Warning] = ..., - lineno: int = 0, - append: bool = False, - ) -> None: ... - else: - @overload - def __init__(self: catch_warnings[None], *, record: Literal[False] = False, module: ModuleType | None = None) -> None: ... - @overload - def __init__( - self: catch_warnings[list[WarningMessage]], *, record: Literal[True], module: ModuleType | None = None - ) -> None: ... - @overload - def __init__(self, *, record: bool, module: ModuleType | None = None) -> None: ... - - def __enter__(self) -> _W_co: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - -if sys.version_info >= (3, 13): - class deprecated: - message: LiteralString - category: type[Warning] | None - stacklevel: int - def __init__(self, message: LiteralString, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ... - def __call__(self, arg: _T, /) -> _T: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/wave.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/wave.pyi deleted file mode 100644 index ddc6f6bd02..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/wave.pyi +++ /dev/null @@ -1,78 +0,0 @@ -from _typeshed import ReadableBuffer, Unused -from typing import IO, Any, BinaryIO, Final, Literal, NamedTuple, NoReturn, overload -from typing_extensions import Self, TypeAlias, deprecated - -__all__ = ["open", "Error", "Wave_read", "Wave_write"] - -_File: TypeAlias = str | IO[bytes] - -class Error(Exception): ... - -WAVE_FORMAT_PCM: Final = 1 - -class _wave_params(NamedTuple): - nchannels: int - sampwidth: int - framerate: int - nframes: int - comptype: str - compname: str - -class Wave_read: - def __init__(self, f: _File) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - def __del__(self) -> None: ... - def getfp(self) -> BinaryIO | None: ... - def rewind(self) -> None: ... - def close(self) -> None: ... - def tell(self) -> int: ... - def getnchannels(self) -> int: ... - def getnframes(self) -> int: ... - def getsampwidth(self) -> int: ... - def getframerate(self) -> int: ... - def getcomptype(self) -> str: ... - def getcompname(self) -> str: ... - def getparams(self) -> _wave_params: ... - @deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") - def getmarkers(self) -> None: ... - @deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") - def getmark(self, id: Any) -> NoReturn: ... - def setpos(self, pos: int) -> None: ... - def readframes(self, nframes: int) -> bytes: ... - -class Wave_write: - def __init__(self, f: _File) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, *args: Unused) -> None: ... - def __del__(self) -> None: ... - def setnchannels(self, nchannels: int) -> None: ... - def getnchannels(self) -> int: ... - def setsampwidth(self, sampwidth: int) -> None: ... - def getsampwidth(self) -> int: ... - def setframerate(self, framerate: float) -> None: ... - def getframerate(self) -> int: ... - def setnframes(self, nframes: int) -> None: ... - def getnframes(self) -> int: ... - def setcomptype(self, comptype: str, compname: str) -> None: ... - def getcomptype(self) -> str: ... - def getcompname(self) -> str: ... - def setparams(self, params: _wave_params | tuple[int, int, int, int, str, str]) -> None: ... - def getparams(self) -> _wave_params: ... - @deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") - def setmark(self, id: Any, pos: Any, name: Any) -> NoReturn: ... - @deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") - def getmark(self, id: Any) -> NoReturn: ... - @deprecated("Deprecated in Python 3.13; removal scheduled for Python 3.15") - def getmarkers(self) -> None: ... - def tell(self) -> int: ... - def writeframesraw(self, data: ReadableBuffer) -> None: ... - def writeframes(self, data: ReadableBuffer) -> None: ... - def close(self) -> None: ... - -@overload -def open(f: _File, mode: Literal["r", "rb"]) -> Wave_read: ... -@overload -def open(f: _File, mode: Literal["w", "wb"]) -> Wave_write: ... -@overload -def open(f: _File, mode: str | None = None) -> Any: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/weakref.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/weakref.pyi deleted file mode 100644 index 593eb4615c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/weakref.pyi +++ /dev/null @@ -1,190 +0,0 @@ -from _typeshed import SupportsKeysAndGetItem -from _weakref import getweakrefcount as getweakrefcount, getweakrefs as getweakrefs, proxy as proxy -from _weakrefset import WeakSet as WeakSet -from collections.abc import Callable, Iterable, Iterator, Mapping, MutableMapping -from types import GenericAlias -from typing import Any, ClassVar, Generic, TypeVar, final, overload -from typing_extensions import ParamSpec, Self - -__all__ = [ - "ref", - "proxy", - "getweakrefcount", - "getweakrefs", - "WeakKeyDictionary", - "ReferenceType", - "ProxyType", - "CallableProxyType", - "ProxyTypes", - "WeakValueDictionary", - "WeakSet", - "WeakMethod", - "finalize", -] - -_T = TypeVar("_T") -_T1 = TypeVar("_T1") -_T2 = TypeVar("_T2") -_KT = TypeVar("_KT") -_VT = TypeVar("_VT") -_CallableT = TypeVar("_CallableT", bound=Callable[..., Any]) -_P = ParamSpec("_P") - -ProxyTypes: tuple[type[Any], ...] - -# These classes are implemented in C and imported from _weakref at runtime. However, -# they consider themselves to live in the weakref module for sys.version_info >= (3, 11), -# so defining their stubs here means we match their __module__ value. -# Prior to 3.11 they did not declare a module for themselves and ended up looking like they -# came from the builtin module at runtime, which was just wrong, and we won't attempt to -# duplicate that. - -@final -class CallableProxyType(Generic[_CallableT]): # "weakcallableproxy" - def __eq__(self, value: object, /) -> bool: ... - def __getattr__(self, attr: str) -> Any: ... - __call__: _CallableT - __hash__: ClassVar[None] # type: ignore[assignment] - -@final -class ProxyType(Generic[_T]): # "weakproxy" - def __eq__(self, value: object, /) -> bool: ... - def __getattr__(self, attr: str) -> Any: ... - __hash__: ClassVar[None] # type: ignore[assignment] - -class ReferenceType(Generic[_T]): # "weakref" - __callback__: Callable[[Self], Any] - def __new__(cls, o: _T, callback: Callable[[Self], Any] | None = ..., /) -> Self: ... - def __call__(self) -> _T | None: ... - def __eq__(self, value: object, /) -> bool: ... - def __hash__(self) -> int: ... - def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... - -ref = ReferenceType - -# everything below here is implemented in weakref.py - -class WeakMethod(ref[_CallableT]): - def __new__(cls, meth: _CallableT, callback: Callable[[Self], Any] | None = None) -> Self: ... - 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 - def __init__(self) -> None: ... - @overload - def __init__( - self: WeakValueDictionary[_KT, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 - other: Mapping[_KT, _VT] | Iterable[tuple[_KT, _VT]], - /, - ) -> None: ... - @overload - def __init__( - self: WeakValueDictionary[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 - other: Mapping[str, _VT] | Iterable[tuple[str, _VT]] = (), - /, - **kwargs: _VT, - ) -> None: ... - def __len__(self) -> int: ... - def __getitem__(self, key: _KT) -> _VT: ... - def __setitem__(self, key: _KT, value: _VT) -> None: ... - def __delitem__(self, key: _KT) -> None: ... - def __contains__(self, key: object) -> bool: ... - def __iter__(self) -> Iterator[_KT]: ... - def copy(self) -> WeakValueDictionary[_KT, _VT]: ... - __copy__ = copy - def __deepcopy__(self, memo: Any) -> Self: ... - @overload - def get(self, key: _KT, default: None = None) -> _VT | None: ... - @overload - def get(self, key: _KT, default: _T) -> _VT | _T: ... - # These are incompatible with Mapping - def keys(self) -> Iterator[_KT]: ... # type: ignore[override] - def values(self) -> Iterator[_VT]: ... # type: ignore[override] - def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override] - def itervaluerefs(self) -> Iterator[KeyedRef[_KT, _VT]]: ... - def valuerefs(self) -> list[KeyedRef[_KT, _VT]]: ... - def setdefault(self, key: _KT, default: _VT) -> _VT: ... - @overload - def pop(self, key: _KT) -> _VT: ... - @overload - def pop(self, key: _KT, default: _VT) -> _VT: ... - @overload - def pop(self, key: _KT, default: _T) -> _VT | _T: ... - @overload - def update(self, other: SupportsKeysAndGetItem[_KT, _VT], /, **kwargs: _VT) -> None: ... - @overload - def update(self, other: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ... - @overload - def update(self, other: None = None, /, **kwargs: _VT) -> None: ... - def __or__(self, other: Mapping[_T1, _T2]) -> WeakValueDictionary[_KT | _T1, _VT | _T2]: ... - def __ror__(self, other: Mapping[_T1, _T2]) -> WeakValueDictionary[_KT | _T1, _VT | _T2]: ... - # WeakValueDictionary.__ior__ should be kept roughly in line with MutableMapping.update() - @overload # type: ignore[misc] - def __ior__(self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... - @overload - def __ior__(self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... - -class KeyedRef(ref[_T], Generic[_KT, _T]): - key: _KT - def __new__(type, ob: _T, callback: Callable[[Self], Any], key: _KT) -> Self: ... - def __init__(self, ob: _T, callback: Callable[[Self], Any], key: _KT) -> None: ... - -class WeakKeyDictionary(MutableMapping[_KT, _VT]): - @overload - def __init__(self, dict: None = None) -> None: ... - @overload - def __init__(self, dict: Mapping[_KT, _VT] | Iterable[tuple[_KT, _VT]]) -> None: ... - def __len__(self) -> int: ... - def __getitem__(self, key: _KT) -> _VT: ... - def __setitem__(self, key: _KT, value: _VT) -> None: ... - def __delitem__(self, key: _KT) -> None: ... - def __contains__(self, key: object) -> bool: ... - def __iter__(self) -> Iterator[_KT]: ... - def copy(self) -> WeakKeyDictionary[_KT, _VT]: ... - __copy__ = copy - def __deepcopy__(self, memo: Any) -> Self: ... - @overload - def get(self, key: _KT, default: None = None) -> _VT | None: ... - @overload - def get(self, key: _KT, default: _T) -> _VT | _T: ... - # These are incompatible with Mapping - def keys(self) -> Iterator[_KT]: ... # type: ignore[override] - def values(self) -> Iterator[_VT]: ... # type: ignore[override] - def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override] - def keyrefs(self) -> list[ref[_KT]]: ... - # Keep WeakKeyDictionary.setdefault in line with MutableMapping.setdefault, modulo positional-only differences - @overload - def setdefault(self: WeakKeyDictionary[_KT, _VT | None], key: _KT, default: None = None) -> _VT: ... - @overload - def setdefault(self, key: _KT, default: _VT) -> _VT: ... - @overload - def pop(self, key: _KT) -> _VT: ... - @overload - def pop(self, key: _KT, default: _VT) -> _VT: ... - @overload - def pop(self, key: _KT, default: _T) -> _VT | _T: ... - @overload - def update(self, dict: SupportsKeysAndGetItem[_KT, _VT], /, **kwargs: _VT) -> None: ... - @overload - def update(self, dict: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ... - @overload - def update(self, dict: None = None, /, **kwargs: _VT) -> None: ... - def __or__(self, other: Mapping[_T1, _T2]) -> WeakKeyDictionary[_KT | _T1, _VT | _T2]: ... - def __ror__(self, other: Mapping[_T1, _T2]) -> WeakKeyDictionary[_KT | _T1, _VT | _T2]: ... - # WeakKeyDictionary.__ior__ should be kept roughly in line with MutableMapping.update() - @overload # type: ignore[misc] - def __ior__(self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ... - @overload - def __ior__(self, other: Iterable[tuple[_KT, _VT]]) -> Self: ... - -class finalize(Generic[_P, _T]): - def __init__(self, obj: _T, func: Callable[_P, Any], /, *args: _P.args, **kwargs: _P.kwargs) -> None: ... - def __call__(self, _: Any = None) -> Any | None: ... - def detach(self) -> tuple[_T, Callable[_P, Any], tuple[Any, ...], dict[str, Any]] | None: ... - def peek(self) -> tuple[_T, Callable[_P, Any], tuple[Any, ...], dict[str, Any]] | None: ... - @property - def alive(self) -> bool: ... - atexit: bool diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/webbrowser.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/webbrowser.pyi deleted file mode 100644 index 773786c248..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/webbrowser.pyi +++ /dev/null @@ -1,78 +0,0 @@ -import sys -from abc import abstractmethod -from collections.abc import Callable, Sequence -from typing import Literal -from typing_extensions import deprecated - -__all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"] - -class Error(Exception): ... - -def register( - name: str, klass: Callable[[], BaseBrowser] | None, instance: BaseBrowser | None = None, *, preferred: bool = False -) -> None: ... -def get(using: str | None = None) -> BaseBrowser: ... -def open(url: str, new: int = 0, autoraise: bool = True) -> bool: ... -def open_new(url: str) -> bool: ... -def open_new_tab(url: str) -> bool: ... - -class BaseBrowser: - args: list[str] - name: str - basename: str - def __init__(self, name: str = "") -> None: ... - @abstractmethod - def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... - def open_new(self, url: str) -> bool: ... - def open_new_tab(self, url: str) -> bool: ... - -class GenericBrowser(BaseBrowser): - def __init__(self, name: str | Sequence[str]) -> None: ... - def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... - -class BackgroundBrowser(GenericBrowser): ... - -class UnixBrowser(BaseBrowser): - def open(self, url: str, new: Literal[0, 1, 2] = 0, autoraise: bool = True) -> bool: ... # type: ignore[override] - raise_opts: list[str] | None - background: bool - redirect_stdout: bool - remote_args: list[str] - remote_action: str - remote_action_newwin: str - remote_action_newtab: str - -class Mozilla(UnixBrowser): ... - -if sys.version_info < (3, 12): - class Galeon(UnixBrowser): - raise_opts: list[str] - - class Grail(BaseBrowser): - def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... - -class Chrome(UnixBrowser): ... -class Opera(UnixBrowser): ... -class Elinks(UnixBrowser): ... - -class Konqueror(BaseBrowser): - def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... - -if sys.platform == "win32": - class WindowsDefault(BaseBrowser): - def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... - -if sys.platform == "darwin": - if sys.version_info < (3, 13): - @deprecated("Deprecated in 3.11, to be removed in 3.13.") - class MacOSX(BaseBrowser): - def __init__(self, name: str) -> None: ... - def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... - - class MacOSXOSAScript(BaseBrowser): # In runtime this class does not have `name` and `basename` - if sys.version_info >= (3, 11): - def __init__(self, name: str = "default") -> None: ... - else: - def __init__(self, name: str) -> None: ... - - def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/winreg.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/winreg.pyi deleted file mode 100644 index d4d04817d7..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/winreg.pyi +++ /dev/null @@ -1,132 +0,0 @@ -import sys -from _typeshed import ReadableBuffer, Unused -from types import TracebackType -from typing import Any, Final, Literal, final, overload -from typing_extensions import Self, TypeAlias - -if sys.platform == "win32": - _KeyType: TypeAlias = HKEYType | int - def CloseKey(hkey: _KeyType, /) -> None: ... - def ConnectRegistry(computer_name: str | None, key: _KeyType, /) -> HKEYType: ... - def CreateKey(key: _KeyType, sub_key: str | None, /) -> HKEYType: ... - def CreateKeyEx(key: _KeyType, sub_key: str | None, reserved: int = 0, access: int = 131078) -> HKEYType: ... - def DeleteKey(key: _KeyType, sub_key: str, /) -> None: ... - def DeleteKeyEx(key: _KeyType, sub_key: str, access: int = 256, reserved: int = 0) -> None: ... - def DeleteValue(key: _KeyType, value: str, /) -> None: ... - def EnumKey(key: _KeyType, index: int, /) -> str: ... - def EnumValue(key: _KeyType, index: int, /) -> tuple[str, Any, int]: ... - def ExpandEnvironmentStrings(string: str, /) -> str: ... - def FlushKey(key: _KeyType, /) -> None: ... - def LoadKey(key: _KeyType, sub_key: str, file_name: str, /) -> None: ... - def OpenKey(key: _KeyType, sub_key: str, reserved: int = 0, access: int = 131097) -> HKEYType: ... - def OpenKeyEx(key: _KeyType, sub_key: str, reserved: int = 0, access: int = 131097) -> HKEYType: ... - def QueryInfoKey(key: _KeyType, /) -> tuple[int, int, int]: ... - def QueryValue(key: _KeyType, sub_key: str | None, /) -> str: ... - def QueryValueEx(key: _KeyType, name: str, /) -> tuple[Any, int]: ... - def SaveKey(key: _KeyType, file_name: str, /) -> None: ... - def SetValue(key: _KeyType, sub_key: str, type: int, value: str, /) -> None: ... - @overload # type=REG_DWORD|REG_QWORD - def SetValueEx( - key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[4, 5], value: int | None, / - ) -> None: ... - @overload # type=REG_SZ|REG_EXPAND_SZ - def SetValueEx( - key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[1, 2], value: str | None, / - ) -> None: ... - @overload # type=REG_MULTI_SZ - def SetValueEx( - key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[7], value: list[str] | None, / - ) -> None: ... - @overload # type=REG_BINARY and everything else - def SetValueEx( - key: _KeyType, - value_name: str | None, - reserved: Unused, - type: Literal[0, 3, 8, 9, 10, 11], - value: ReadableBuffer | None, - /, - ) -> None: ... - @overload # Unknown or undocumented - def SetValueEx( - key: _KeyType, - value_name: str | None, - reserved: Unused, - type: int, - value: int | str | list[str] | ReadableBuffer | None, - /, - ) -> None: ... - def DisableReflectionKey(key: _KeyType, /) -> None: ... - def EnableReflectionKey(key: _KeyType, /) -> None: ... - def QueryReflectionKey(key: _KeyType, /) -> bool: ... - - HKEY_CLASSES_ROOT: int - HKEY_CURRENT_USER: int - HKEY_LOCAL_MACHINE: int - HKEY_USERS: int - HKEY_PERFORMANCE_DATA: int - HKEY_CURRENT_CONFIG: int - HKEY_DYN_DATA: int - - KEY_ALL_ACCESS: Final = 983103 - KEY_WRITE: Final = 131078 - KEY_READ: Final = 131097 - KEY_EXECUTE: Final = 131097 - KEY_QUERY_VALUE: Final = 1 - KEY_SET_VALUE: Final = 2 - KEY_CREATE_SUB_KEY: Final = 4 - KEY_ENUMERATE_SUB_KEYS: Final = 8 - KEY_NOTIFY: Final = 16 - KEY_CREATE_LINK: Final = 32 - - KEY_WOW64_64KEY: Final = 256 - KEY_WOW64_32KEY: Final = 512 - - REG_BINARY: Final = 3 - REG_DWORD: Final = 4 - REG_DWORD_LITTLE_ENDIAN: Final = 4 - REG_DWORD_BIG_ENDIAN: Final = 5 - REG_EXPAND_SZ: Final = 2 - REG_LINK: Final = 6 - REG_MULTI_SZ: Final = 7 - REG_NONE: Final = 0 - REG_QWORD: Final = 11 - REG_QWORD_LITTLE_ENDIAN: Final = 11 - REG_RESOURCE_LIST: Final = 8 - REG_FULL_RESOURCE_DESCRIPTOR: Final = 9 - REG_RESOURCE_REQUIREMENTS_LIST: Final = 10 - REG_SZ: Final = 1 - - REG_CREATED_NEW_KEY: Final = 1 # undocumented - REG_LEGAL_CHANGE_FILTER: Final = 268435471 # undocumented - REG_LEGAL_OPTION: Final = 31 # undocumented - REG_NOTIFY_CHANGE_ATTRIBUTES: Final = 2 # undocumented - REG_NOTIFY_CHANGE_LAST_SET: Final = 4 # undocumented - REG_NOTIFY_CHANGE_NAME: Final = 1 # undocumented - REG_NOTIFY_CHANGE_SECURITY: Final = 8 # undocumented - REG_NO_LAZY_FLUSH: Final = 4 # undocumented - REG_OPENED_EXISTING_KEY: Final = 2 # undocumented - REG_OPTION_BACKUP_RESTORE: Final = 4 # undocumented - REG_OPTION_CREATE_LINK: Final = 2 # undocumented - REG_OPTION_NON_VOLATILE: Final = 0 # undocumented - REG_OPTION_OPEN_LINK: Final = 8 # undocumented - REG_OPTION_RESERVED: Final = 0 # undocumented - REG_OPTION_VOLATILE: Final = 1 # undocumented - REG_REFRESH_HIVE: Final = 2 # undocumented - REG_WHOLE_HIVE_VOLATILE: Final = 1 # undocumented - - error = OSError - - # Though this class has a __name__ of PyHKEY, it's exposed as HKEYType for some reason - @final - class HKEYType: - def __bool__(self) -> bool: ... - def __int__(self) -> int: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None - ) -> bool | None: ... - def Close(self) -> None: ... - def Detach(self) -> int: ... - def __hash__(self) -> int: ... - @property - def handle(self) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/winsound.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/winsound.pyi deleted file mode 100644 index a20e81f94f..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/winsound.pyi +++ /dev/null @@ -1,28 +0,0 @@ -import sys -from _typeshed import ReadableBuffer -from typing import Final, Literal, overload - -if sys.platform == "win32": - SND_APPLICATION: Final = 128 - SND_FILENAME: Final = 131072 - SND_ALIAS: Final = 65536 - SND_LOOP: Final = 8 - SND_MEMORY: Final = 4 - SND_PURGE: Final = 64 - SND_ASYNC: Final = 1 - SND_NODEFAULT: Final = 2 - SND_NOSTOP: Final = 16 - SND_NOWAIT: Final = 8192 - - MB_ICONASTERISK: Final = 64 - MB_ICONEXCLAMATION: Final = 48 - MB_ICONHAND: Final = 16 - MB_ICONQUESTION: Final = 32 - MB_OK: Final = 0 - def Beep(frequency: int, duration: int) -> None: ... - # Can actually accept anything ORed with 4, and if not it's definitely str, but that's inexpressible - @overload - def PlaySound(sound: ReadableBuffer | None, flags: Literal[4]) -> None: ... - @overload - def PlaySound(sound: str | ReadableBuffer | None, flags: int) -> None: ... - def MessageBeep(type: int = 0) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/__init__.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/handlers.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/handlers.pyi deleted file mode 100644 index ebead54001..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/handlers.pyi +++ /dev/null @@ -1,91 +0,0 @@ -from _typeshed import OptExcInfo -from _typeshed.wsgi import ErrorStream, InputStream, StartResponse, WSGIApplication, WSGIEnvironment -from abc import abstractmethod -from collections.abc import Callable, MutableMapping -from typing import IO - -from .headers import Headers -from .util import FileWrapper - -__all__ = ["BaseHandler", "SimpleHandler", "BaseCGIHandler", "CGIHandler", "IISCGIHandler", "read_environ"] - -def format_date_time(timestamp: float | None) -> str: ... # undocumented -def read_environ() -> dict[str, str]: ... - -class BaseHandler: - wsgi_version: tuple[int, int] # undocumented - wsgi_multithread: bool - wsgi_multiprocess: bool - wsgi_run_once: bool - - origin_server: bool - http_version: str - server_software: str | None - - os_environ: MutableMapping[str, str] - - wsgi_file_wrapper: type[FileWrapper] | None - headers_class: type[Headers] # undocumented - - traceback_limit: int | None - error_status: str - error_headers: list[tuple[str, str]] - error_body: bytes - def run(self, application: WSGIApplication) -> None: ... - def setup_environ(self) -> None: ... - def finish_response(self) -> None: ... - def get_scheme(self) -> str: ... - def set_content_length(self) -> None: ... - def cleanup_headers(self) -> None: ... - def start_response( - self, status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = None - ) -> Callable[[bytes], None]: ... - def send_preamble(self) -> None: ... - def write(self, data: bytes) -> None: ... - def sendfile(self) -> bool: ... - def finish_content(self) -> None: ... - def close(self) -> None: ... - def send_headers(self) -> None: ... - def result_is_file(self) -> bool: ... - def client_is_modern(self) -> bool: ... - def log_exception(self, exc_info: OptExcInfo) -> None: ... - def handle_error(self) -> None: ... - def error_output(self, environ: WSGIEnvironment, start_response: StartResponse) -> list[bytes]: ... - @abstractmethod - def _write(self, data: bytes) -> None: ... - @abstractmethod - def _flush(self) -> None: ... - @abstractmethod - def get_stdin(self) -> InputStream: ... - @abstractmethod - def get_stderr(self) -> ErrorStream: ... - @abstractmethod - def add_cgi_vars(self) -> None: ... - -class SimpleHandler(BaseHandler): - stdin: InputStream - stdout: IO[bytes] - stderr: ErrorStream - base_env: MutableMapping[str, str] - def __init__( - self, - stdin: InputStream, - stdout: IO[bytes], - stderr: ErrorStream, - environ: MutableMapping[str, str], - multithread: bool = True, - multiprocess: bool = False, - ) -> None: ... - def get_stdin(self) -> InputStream: ... - def get_stderr(self) -> ErrorStream: ... - def add_cgi_vars(self) -> None: ... - def _write(self, data: bytes) -> None: ... - def _flush(self) -> None: ... - -class BaseCGIHandler(SimpleHandler): ... - -class CGIHandler(BaseCGIHandler): - def __init__(self) -> None: ... - -class IISCGIHandler(BaseCGIHandler): - def __init__(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/headers.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/headers.pyi deleted file mode 100644 index 2654d79bf4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/headers.pyi +++ /dev/null @@ -1,26 +0,0 @@ -from re import Pattern -from typing import overload -from typing_extensions import TypeAlias - -_HeaderList: TypeAlias = list[tuple[str, str]] - -tspecials: Pattern[str] # undocumented - -class Headers: - def __init__(self, headers: _HeaderList | None = None) -> None: ... - def __len__(self) -> int: ... - def __setitem__(self, name: str, val: str) -> None: ... - def __delitem__(self, name: str) -> None: ... - def __getitem__(self, name: str) -> str | None: ... - def __contains__(self, name: str) -> bool: ... - def get_all(self, name: str) -> list[str]: ... - @overload - def get(self, name: str, default: str) -> str: ... - @overload - def get(self, name: str, default: str | None = None) -> str | None: ... - def keys(self) -> list[str]: ... - def values(self) -> list[str]: ... - def items(self) -> _HeaderList: ... - def __bytes__(self) -> bytes: ... - def setdefault(self, name: str, value: str) -> str: ... - def add_header(self, _name: str, _value: str | None, **_params: str | None) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/simple_server.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/simple_server.pyi deleted file mode 100644 index 547f562cc1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/simple_server.pyi +++ /dev/null @@ -1,37 +0,0 @@ -from _typeshed.wsgi import ErrorStream, StartResponse, WSGIApplication, WSGIEnvironment -from http.server import BaseHTTPRequestHandler, HTTPServer -from typing import TypeVar, overload - -from .handlers import SimpleHandler - -__all__ = ["WSGIServer", "WSGIRequestHandler", "demo_app", "make_server"] - -server_version: str # undocumented -sys_version: str # undocumented -software_version: str # undocumented - -class ServerHandler(SimpleHandler): # undocumented - server_software: str - -class WSGIServer(HTTPServer): - application: WSGIApplication | None - base_environ: WSGIEnvironment # only available after call to setup_environ() - def setup_environ(self) -> None: ... - def get_app(self) -> WSGIApplication | None: ... - def set_app(self, application: WSGIApplication | None) -> None: ... - -class WSGIRequestHandler(BaseHTTPRequestHandler): - server_version: str - def get_environ(self) -> WSGIEnvironment: ... - def get_stderr(self) -> ErrorStream: ... - -def demo_app(environ: WSGIEnvironment, start_response: StartResponse) -> list[bytes]: ... - -_S = TypeVar("_S", bound=WSGIServer) - -@overload -def make_server(host: str, port: int, app: WSGIApplication, *, handler_class: type[WSGIRequestHandler] = ...) -> WSGIServer: ... -@overload -def make_server( - host: str, port: int, app: WSGIApplication, server_class: type[_S], handler_class: type[WSGIRequestHandler] = ... -) -> _S: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/types.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/types.pyi deleted file mode 100644 index 57276fd05e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/types.pyi +++ /dev/null @@ -1,32 +0,0 @@ -from _typeshed import OptExcInfo -from collections.abc import Callable, Iterable, Iterator -from typing import Any, Protocol -from typing_extensions import TypeAlias - -__all__ = ["StartResponse", "WSGIEnvironment", "WSGIApplication", "InputStream", "ErrorStream", "FileWrapper"] - -class StartResponse(Protocol): - def __call__( - self, status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = ..., / - ) -> Callable[[bytes], object]: ... - -WSGIEnvironment: TypeAlias = dict[str, Any] -WSGIApplication: TypeAlias = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] - -class InputStream(Protocol): - def read(self, size: int = ..., /) -> bytes: ... - def readline(self, size: int = ..., /) -> bytes: ... - def readlines(self, hint: int = ..., /) -> list[bytes]: ... - def __iter__(self) -> Iterator[bytes]: ... - -class ErrorStream(Protocol): - def flush(self) -> object: ... - def write(self, s: str, /) -> object: ... - def writelines(self, seq: list[str], /) -> object: ... - -class _Readable(Protocol): - def read(self, size: int = ..., /) -> bytes: ... - # Optional: def close(self) -> object: ... - -class FileWrapper(Protocol): - def __call__(self, file: _Readable, block_size: int = ..., /) -> Iterable[bytes]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/util.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/util.pyi deleted file mode 100644 index 3966e17b0d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/util.pyi +++ /dev/null @@ -1,26 +0,0 @@ -import sys -from _typeshed.wsgi import WSGIEnvironment -from collections.abc import Callable -from typing import IO, Any - -__all__ = ["FileWrapper", "guess_scheme", "application_uri", "request_uri", "shift_path_info", "setup_testing_defaults"] -if sys.version_info >= (3, 13): - __all__ += ["is_hop_by_hop"] - -class FileWrapper: - filelike: IO[bytes] - blksize: int - close: Callable[[], None] # only exists if filelike.close exists - def __init__(self, filelike: IO[bytes], blksize: int = 8192) -> None: ... - if sys.version_info < (3, 11): - def __getitem__(self, key: Any) -> bytes: ... - - def __iter__(self) -> FileWrapper: ... - def __next__(self) -> bytes: ... - -def guess_scheme(environ: WSGIEnvironment) -> str: ... -def application_uri(environ: WSGIEnvironment) -> str: ... -def request_uri(environ: WSGIEnvironment, include_query: bool = True) -> str: ... -def shift_path_info(environ: WSGIEnvironment) -> str | None: ... -def setup_testing_defaults(environ: WSGIEnvironment) -> None: ... -def is_hop_by_hop(header_name: str) -> bool: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/validate.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/validate.pyi deleted file mode 100644 index fa8a6bbb8d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/wsgiref/validate.pyi +++ /dev/null @@ -1,50 +0,0 @@ -from _typeshed.wsgi import ErrorStream, InputStream, WSGIApplication -from collections.abc import Callable, Iterable, Iterator -from typing import Any, NoReturn -from typing_extensions import TypeAlias - -__all__ = ["validator"] - -class WSGIWarning(Warning): ... - -def validator(application: WSGIApplication) -> WSGIApplication: ... - -class InputWrapper: - input: InputStream - def __init__(self, wsgi_input: InputStream) -> None: ... - def read(self, size: int) -> bytes: ... - def readline(self, size: int = ...) -> bytes: ... - def readlines(self, hint: int = ...) -> bytes: ... - def __iter__(self) -> Iterator[bytes]: ... - def close(self) -> NoReturn: ... - -class ErrorWrapper: - errors: ErrorStream - def __init__(self, wsgi_errors: ErrorStream) -> None: ... - def write(self, s: str) -> None: ... - def flush(self) -> None: ... - def writelines(self, seq: Iterable[str]) -> None: ... - def close(self) -> NoReturn: ... - -_WriterCallback: TypeAlias = Callable[[bytes], Any] - -class WriteWrapper: - writer: _WriterCallback - def __init__(self, wsgi_writer: _WriterCallback) -> None: ... - def __call__(self, s: bytes) -> None: ... - -class PartialIteratorWrapper: - iterator: Iterator[bytes] - def __init__(self, wsgi_iterator: Iterator[bytes]) -> None: ... - def __iter__(self) -> IteratorWrapper: ... - -class IteratorWrapper: - original_iterator: Iterator[bytes] - iterator: Iterator[bytes] - closed: bool - check_start_response: bool | None - def __init__(self, wsgi_iterator: Iterator[bytes], check_start_response: bool | None) -> None: ... - def __iter__(self) -> IteratorWrapper: ... - def __next__(self) -> bytes: ... - def close(self) -> None: ... - def __del__(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xdrlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xdrlib.pyi deleted file mode 100644 index 78f3ecec8d..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xdrlib.pyi +++ /dev/null @@ -1,57 +0,0 @@ -from collections.abc import Callable, Sequence -from typing import TypeVar - -__all__ = ["Error", "Packer", "Unpacker", "ConversionError"] - -_T = TypeVar("_T") - -class Error(Exception): - msg: str - def __init__(self, msg: str) -> None: ... - -class ConversionError(Error): ... - -class Packer: - def reset(self) -> None: ... - def get_buffer(self) -> bytes: ... - def get_buf(self) -> bytes: ... - def pack_uint(self, x: int) -> None: ... - def pack_int(self, x: int) -> None: ... - def pack_enum(self, x: int) -> None: ... - def pack_bool(self, x: bool) -> None: ... - def pack_uhyper(self, x: int) -> None: ... - def pack_hyper(self, x: int) -> None: ... - def pack_float(self, x: float) -> None: ... - def pack_double(self, x: float) -> None: ... - def pack_fstring(self, n: int, s: bytes) -> None: ... - def pack_fopaque(self, n: int, s: bytes) -> None: ... - def pack_string(self, s: bytes) -> None: ... - def pack_opaque(self, s: bytes) -> None: ... - def pack_bytes(self, s: bytes) -> None: ... - def pack_list(self, list: Sequence[_T], pack_item: Callable[[_T], object]) -> None: ... - def pack_farray(self, n: int, list: Sequence[_T], pack_item: Callable[[_T], object]) -> None: ... - def pack_array(self, list: Sequence[_T], pack_item: Callable[[_T], object]) -> None: ... - -class Unpacker: - def __init__(self, data: bytes) -> None: ... - def reset(self, data: bytes) -> None: ... - def get_position(self) -> int: ... - def set_position(self, position: int) -> None: ... - def get_buffer(self) -> bytes: ... - def done(self) -> None: ... - def unpack_uint(self) -> int: ... - def unpack_int(self) -> int: ... - def unpack_enum(self) -> int: ... - def unpack_bool(self) -> bool: ... - def unpack_uhyper(self) -> int: ... - def unpack_hyper(self) -> int: ... - def unpack_float(self) -> float: ... - def unpack_double(self) -> float: ... - def unpack_fstring(self, n: int) -> bytes: ... - def unpack_fopaque(self, n: int) -> bytes: ... - def unpack_string(self) -> bytes: ... - def unpack_opaque(self) -> bytes: ... - def unpack_bytes(self) -> bytes: ... - def unpack_list(self, unpack_item: Callable[[], _T]) -> list[_T]: ... - def unpack_farray(self, n: int, unpack_item: Callable[[], _T]) -> list[_T]: ... - def unpack_array(self, unpack_item: Callable[[], _T]) -> list[_T]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/__init__.pyi deleted file mode 100644 index 7a24096513..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/__init__.pyi +++ /dev/null @@ -1,3 +0,0 @@ -# At runtime, listing submodules in __all__ without them being imported is -# valid, and causes them to be included in a star import. See #6523 -__all__ = ["dom", "parsers", "sax", "etree"] # noqa: F822 # pyright: ignore[reportUnsupportedDunderAll] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/NodeFilter.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/NodeFilter.pyi deleted file mode 100644 index 007df982e0..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/NodeFilter.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Literal -from xml.dom.minidom import Node - -class NodeFilter: - FILTER_ACCEPT: Literal[1] - FILTER_REJECT: Literal[2] - FILTER_SKIP: Literal[3] - - SHOW_ALL: int - SHOW_ELEMENT: int - SHOW_ATTRIBUTE: int - SHOW_TEXT: int - SHOW_CDATA_SECTION: int - SHOW_ENTITY_REFERENCE: int - SHOW_ENTITY: int - SHOW_PROCESSING_INSTRUCTION: int - SHOW_COMMENT: int - SHOW_DOCUMENT: int - SHOW_DOCUMENT_TYPE: int - SHOW_DOCUMENT_FRAGMENT: int - SHOW_NOTATION: int - def acceptNode(self, node: Node) -> int: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/__init__.pyi deleted file mode 100644 index d9615f9aac..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/__init__.pyi +++ /dev/null @@ -1,100 +0,0 @@ -from typing import Any, Final, Literal - -from .domreg import getDOMImplementation as getDOMImplementation, registerDOMImplementation as registerDOMImplementation - -class Node: - ELEMENT_NODE: Literal[1] - ATTRIBUTE_NODE: Literal[2] - TEXT_NODE: Literal[3] - CDATA_SECTION_NODE: Literal[4] - ENTITY_REFERENCE_NODE: Literal[5] - ENTITY_NODE: Literal[6] - PROCESSING_INSTRUCTION_NODE: Literal[7] - COMMENT_NODE: Literal[8] - DOCUMENT_NODE: Literal[9] - DOCUMENT_TYPE_NODE: Literal[10] - DOCUMENT_FRAGMENT_NODE: Literal[11] - NOTATION_NODE: Literal[12] - -# ExceptionCode -INDEX_SIZE_ERR: Final = 1 -DOMSTRING_SIZE_ERR: Final = 2 -HIERARCHY_REQUEST_ERR: Final = 3 -WRONG_DOCUMENT_ERR: Final = 4 -INVALID_CHARACTER_ERR: Final = 5 -NO_DATA_ALLOWED_ERR: Final = 6 -NO_MODIFICATION_ALLOWED_ERR: Final = 7 -NOT_FOUND_ERR: Final = 8 -NOT_SUPPORTED_ERR: Final = 9 -INUSE_ATTRIBUTE_ERR: Final = 10 -INVALID_STATE_ERR: Final = 11 -SYNTAX_ERR: Final = 12 -INVALID_MODIFICATION_ERR: Final = 13 -NAMESPACE_ERR: Final = 14 -INVALID_ACCESS_ERR: Final = 15 -VALIDATION_ERR: Final = 16 - -class DOMException(Exception): - code: int - def __init__(self, *args: Any, **kw: Any) -> None: ... - def _get_code(self) -> int: ... - -class IndexSizeErr(DOMException): - code: Literal[1] - -class DomstringSizeErr(DOMException): - code: Literal[2] - -class HierarchyRequestErr(DOMException): - code: Literal[3] - -class WrongDocumentErr(DOMException): - code: Literal[4] - -class InvalidCharacterErr(DOMException): - code: Literal[5] - -class NoDataAllowedErr(DOMException): - code: Literal[6] - -class NoModificationAllowedErr(DOMException): - code: Literal[7] - -class NotFoundErr(DOMException): - code: Literal[8] - -class NotSupportedErr(DOMException): - code: Literal[9] - -class InuseAttributeErr(DOMException): - code: Literal[10] - -class InvalidStateErr(DOMException): - code: Literal[11] - -class SyntaxErr(DOMException): - code: Literal[12] - -class InvalidModificationErr(DOMException): - code: Literal[13] - -class NamespaceErr(DOMException): - code: Literal[14] - -class InvalidAccessErr(DOMException): - code: Literal[15] - -class ValidationErr(DOMException): - code: Literal[16] - -class UserDataHandler: - NODE_CLONED: Literal[1] - NODE_IMPORTED: Literal[2] - NODE_DELETED: Literal[3] - NODE_RENAMED: Literal[4] - -XML_NAMESPACE: Final = "http://www.w3.org/XML/1998/namespace" -XMLNS_NAMESPACE: Final = "http://www.w3.org/2000/xmlns/" -XHTML_NAMESPACE: Final = "http://www.w3.org/1999/xhtml" -EMPTY_NAMESPACE: Final[None] -EMPTY_PREFIX: Final[None] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/domreg.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/domreg.pyi deleted file mode 100644 index 346a4bf63b..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/domreg.pyi +++ /dev/null @@ -1,8 +0,0 @@ -from _typeshed.xml import DOMImplementation -from collections.abc import Callable, Iterable - -well_known_implementations: dict[str, str] -registered: dict[str, Callable[[], DOMImplementation]] - -def registerDOMImplementation(name: str, factory: Callable[[], DOMImplementation]) -> None: ... -def getDOMImplementation(name: str | None = None, features: str | Iterable[tuple[str, str | None]] = ()) -> DOMImplementation: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/expatbuilder.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/expatbuilder.pyi deleted file mode 100644 index 228ad07e15..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/expatbuilder.pyi +++ /dev/null @@ -1,121 +0,0 @@ -from _typeshed import ReadableBuffer, SupportsRead -from typing import Any, NoReturn -from typing_extensions import TypeAlias -from xml.dom.minidom import Document, DocumentFragment, DOMImplementation, Element, Node, TypeInfo -from xml.dom.xmlbuilder import DOMBuilderFilter, Options -from xml.parsers.expat import XMLParserType - -_Model: TypeAlias = tuple[int, int, str | None, tuple[Any, ...]] # same as in pyexpat - -TEXT_NODE = Node.TEXT_NODE -CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE -DOCUMENT_NODE = Node.DOCUMENT_NODE -FILTER_ACCEPT = DOMBuilderFilter.FILTER_ACCEPT -FILTER_REJECT = DOMBuilderFilter.FILTER_REJECT -FILTER_SKIP = DOMBuilderFilter.FILTER_SKIP -FILTER_INTERRUPT = DOMBuilderFilter.FILTER_INTERRUPT -theDOMImplementation: DOMImplementation - -class ElementInfo: - tagName: str - def __init__(self, tagName: str, model: _Model | None = None) -> None: ... - def getAttributeType(self, aname: str) -> TypeInfo: ... - def getAttributeTypeNS(self, namespaceURI: str | None, localName: str) -> TypeInfo: ... - def isElementContent(self) -> bool: ... - def isEmpty(self) -> bool: ... - def isId(self, aname: str) -> bool: ... - def isIdNS(self, euri: str, ename: str, auri: str, aname: str) -> bool: ... - -class ExpatBuilder: - document: Document # Created in self.reset() - curNode: DocumentFragment | Element | Document # Created in self.reset() - def __init__(self, options: Options | None = None) -> None: ... - def createParser(self) -> XMLParserType: ... - def getParser(self) -> XMLParserType: ... - def reset(self) -> None: ... - def install(self, parser: XMLParserType) -> None: ... - def parseFile(self, file: SupportsRead[ReadableBuffer | str]) -> Document: ... - def parseString(self, string: str | ReadableBuffer) -> Document: ... - def start_doctype_decl_handler( - self, doctypeName: str, systemId: str | None, publicId: str | None, has_internal_subset: bool - ) -> None: ... - def end_doctype_decl_handler(self) -> None: ... - def pi_handler(self, target: str, data: str) -> None: ... - def character_data_handler_cdata(self, data: str) -> None: ... - def character_data_handler(self, data: str) -> None: ... - def start_cdata_section_handler(self) -> None: ... - def end_cdata_section_handler(self) -> None: ... - def entity_decl_handler( - self, - entityName: str, - is_parameter_entity: bool, - value: str | None, - base: str | None, - systemId: str, - publicId: str | None, - notationName: str | None, - ) -> None: ... - def notation_decl_handler(self, notationName: str, base: str | None, systemId: str, publicId: str | None) -> None: ... - def comment_handler(self, data: str) -> None: ... - def external_entity_ref_handler(self, context: str, base: str | None, systemId: str | None, publicId: str | None) -> int: ... - def first_element_handler(self, name: str, attributes: list[str]) -> None: ... - def start_element_handler(self, name: str, attributes: list[str]) -> None: ... - def end_element_handler(self, name: str) -> None: ... - def element_decl_handler(self, name: str, model: _Model) -> None: ... - def attlist_decl_handler(self, elem: str, name: str, type: str, default: str | None, required: bool) -> None: ... - def xml_decl_handler(self, version: str, encoding: str | None, standalone: int) -> None: ... - -class FilterVisibilityController: - filter: DOMBuilderFilter - def __init__(self, filter: DOMBuilderFilter) -> None: ... - def startContainer(self, node: Node) -> int: ... - def acceptNode(self, node: Node) -> int: ... - -class FilterCrutch: - def __init__(self, builder: ExpatBuilder) -> None: ... - -class Rejecter(FilterCrutch): - def start_element_handler(self, *args: Any) -> None: ... - def end_element_handler(self, *args: Any) -> None: ... - -class Skipper(FilterCrutch): - def start_element_handler(self, *args: Any) -> None: ... - def end_element_handler(self, *args: Any) -> None: ... - -class FragmentBuilder(ExpatBuilder): - fragment: DocumentFragment | None - originalDocument: Document - context: Node - def __init__(self, context: Node, options: Options | None = None) -> None: ... - def reset(self) -> None: ... - def parseFile(self, file: SupportsRead[ReadableBuffer | str]) -> DocumentFragment: ... # type: ignore[override] - def parseString(self, string: ReadableBuffer | str) -> DocumentFragment: ... # type: ignore[override] - def external_entity_ref_handler(self, context: str, base: str | None, systemId: str | None, publicId: str | None) -> int: ... - -class Namespaces: - def createParser(self) -> XMLParserType: ... - def install(self, parser: XMLParserType) -> None: ... - def start_namespace_decl_handler(self, prefix: str | None, uri: str) -> None: ... - def start_element_handler(self, name: str, attributes: list[str]) -> None: ... - def end_element_handler(self, name: str) -> None: ... # only exists if __debug__ - -class ExpatBuilderNS(Namespaces, ExpatBuilder): ... -class FragmentBuilderNS(Namespaces, FragmentBuilder): ... -class ParseEscape(Exception): ... - -class InternalSubsetExtractor(ExpatBuilder): - subset: str | list[str] | None = None - def getSubset(self) -> str: ... - def parseFile(self, file: SupportsRead[ReadableBuffer | str]) -> None: ... # type: ignore[override] - def parseString(self, string: str | ReadableBuffer) -> None: ... # type: ignore[override] - def start_doctype_decl_handler( # type: ignore[override] - self, name: str, publicId: str | None, systemId: str | None, has_internal_subset: bool - ) -> None: ... - def end_doctype_decl_handler(self) -> NoReturn: ... - def start_element_handler(self, name: str, attrs: list[str]) -> NoReturn: ... - -def parse(file: str | SupportsRead[ReadableBuffer | str], namespaces: bool = True) -> Document: ... -def parseString(string: str | ReadableBuffer, namespaces: bool = True) -> Document: ... -def parseFragment(file: str | SupportsRead[ReadableBuffer | str], context: Node, namespaces: bool = True) -> DocumentFragment: ... -def parseFragmentString(string: str | ReadableBuffer, context: Node, namespaces: bool = True) -> DocumentFragment: ... -def makeBuilder(options: Options) -> ExpatBuilderNS | ExpatBuilder: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/minicompat.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/minicompat.pyi deleted file mode 100644 index 162f60254a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/minicompat.pyi +++ /dev/null @@ -1,22 +0,0 @@ -from collections.abc import Iterable -from typing import Any, Literal, TypeVar - -__all__ = ["NodeList", "EmptyNodeList", "StringTypes", "defproperty"] - -_T = TypeVar("_T") - -StringTypes: tuple[type[str]] - -class NodeList(list[_T]): - @property - def length(self) -> int: ... - def item(self, index: int) -> _T | None: ... - -class EmptyNodeList(tuple[()]): - @property - def length(self) -> Literal[0]: ... - def item(self, index: int) -> None: ... - def __add__(self, other: Iterable[_T]) -> NodeList[_T]: ... # type: ignore[override] - def __radd__(self, other: Iterable[_T]) -> NodeList[_T]: ... - -def defproperty(klass: type[Any], name: str, doc: str) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/minidom.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/minidom.pyi deleted file mode 100644 index ab2ef87e38..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/minidom.pyi +++ /dev/null @@ -1,650 +0,0 @@ -import xml.dom -from _collections_abc import dict_keys, dict_values -from _typeshed import Incomplete, ReadableBuffer, SupportsRead, SupportsWrite -from collections.abc import Iterable, Sequence -from types import TracebackType -from typing import Any, ClassVar, Generic, Literal, NoReturn, Protocol, TypeVar, overload -from typing_extensions import Self, TypeAlias -from xml.dom.minicompat import EmptyNodeList, NodeList -from xml.dom.xmlbuilder import DocumentLS, DOMImplementationLS -from xml.sax.xmlreader import XMLReader - -_NSName: TypeAlias = tuple[str | None, str] - -# Entity can also have children, but it's not implemented the same way as the -# others, so is deliberately omitted here. -_NodesWithChildren: TypeAlias = DocumentFragment | Attr | Element | Document -_NodesThatAreChildren: TypeAlias = CDATASection | Comment | DocumentType | Element | Notation | ProcessingInstruction | Text - -_AttrChildren: TypeAlias = Text # Also EntityReference, but we don't implement it -_ElementChildren: TypeAlias = Element | ProcessingInstruction | Comment | Text | CDATASection -_EntityChildren: TypeAlias = Text # I think; documentation is a little unclear -_DocumentFragmentChildren: TypeAlias = Element | Text | CDATASection | ProcessingInstruction | Comment | Notation -_DocumentChildren: TypeAlias = Comment | DocumentType | Element | ProcessingInstruction - -_N = TypeVar("_N", bound=Node) -_ChildNodeVar = TypeVar("_ChildNodeVar", bound=_NodesThatAreChildren) -_ChildNodePlusFragmentVar = TypeVar("_ChildNodePlusFragmentVar", bound=_NodesThatAreChildren | DocumentFragment) -_DocumentChildrenVar = TypeVar("_DocumentChildrenVar", bound=_DocumentChildren) -_ImportableNodeVar = TypeVar( - "_ImportableNodeVar", - bound=DocumentFragment - | Attr - | Element - | ProcessingInstruction - | CharacterData - | Text - | Comment - | CDATASection - | Entity - | Notation, -) - -class _DOMErrorHandler(Protocol): - def handleError(self, error: Exception) -> bool: ... - -class _UserDataHandler(Protocol): - def handle(self, operation: int, key: str, data: Any, src: Node, dst: Node) -> None: ... - -def parse( - file: str | SupportsRead[ReadableBuffer | str], parser: XMLReader | None = None, bufsize: int | None = None -) -> Document: ... -def parseString(string: str | ReadableBuffer, parser: XMLReader | None = None) -> Document: ... -@overload -def getDOMImplementation(features: None = None) -> DOMImplementation: ... -@overload -def getDOMImplementation(features: str | Iterable[tuple[str, str | None]]) -> DOMImplementation | None: ... - -class Node(xml.dom.Node): - parentNode: _NodesWithChildren | Entity | None - ownerDocument: Document | None - nextSibling: _NodesThatAreChildren | None - previousSibling: _NodesThatAreChildren | None - namespaceURI: str | None # non-null only for Element and Attr - prefix: str | None # non-null only for NS Element and Attr - - # These aren't defined on Node, but they exist on all Node subclasses - # and various methods of Node require them to exist. - childNodes: ( - NodeList[_DocumentFragmentChildren] - | NodeList[_AttrChildren] - | NodeList[_ElementChildren] - | NodeList[_DocumentChildren] - | NodeList[_EntityChildren] - | EmptyNodeList - ) - nodeType: ClassVar[Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]] - nodeName: str | None # only possibly None on DocumentType - - # Not defined on Node, but exist on all Node subclasses. - nodeValue: str | None # non-null for Attr, ProcessingInstruction, Text, Comment, and CDATASection - attributes: NamedNodeMap | None # non-null only for Element - - @property - def firstChild(self) -> _NodesThatAreChildren | None: ... - @property - def lastChild(self) -> _NodesThatAreChildren | None: ... - @property - def localName(self) -> str | None: ... # non-null only for Element and Attr - def __bool__(self) -> Literal[True]: ... - @overload - def toxml(self, encoding: str, standalone: bool | None = None) -> bytes: ... - @overload - def toxml(self, encoding: None = None, standalone: bool | None = None) -> str: ... - @overload - def toprettyxml( - self, - indent: str = "\t", - newl: str = "\n", - # Handle any case where encoding is not provided or where it is passed with None - encoding: None = None, - standalone: bool | None = None, - ) -> str: ... - @overload - def toprettyxml( - self, - indent: str, - newl: str, - # Handle cases where encoding is passed as str *positionally* - encoding: str, - standalone: bool | None = None, - ) -> bytes: ... - @overload - def toprettyxml( - self, - indent: str = "\t", - newl: str = "\n", - # Handle all cases where encoding is passed as a keyword argument; because standalone - # comes after, it will also have to be a keyword arg if encoding is - *, - encoding: str, - standalone: bool | None = None, - ) -> bytes: ... - def hasChildNodes(self) -> bool: ... - def insertBefore( # type: ignore[misc] - self: _NodesWithChildren, # pyright: ignore[reportGeneralTypeIssues] - newChild: _ChildNodePlusFragmentVar, - refChild: _NodesThatAreChildren | None, - ) -> _ChildNodePlusFragmentVar: ... - def appendChild( # type: ignore[misc] - self: _NodesWithChildren, node: _ChildNodePlusFragmentVar # pyright: ignore[reportGeneralTypeIssues] - ) -> _ChildNodePlusFragmentVar: ... - @overload - def replaceChild( # type: ignore[misc] - self: _NodesWithChildren, newChild: DocumentFragment, oldChild: _ChildNodeVar - ) -> _ChildNodeVar | DocumentFragment: ... - @overload - def replaceChild( # type: ignore[misc] - self: _NodesWithChildren, newChild: _NodesThatAreChildren, oldChild: _ChildNodeVar - ) -> _ChildNodeVar | None: ... - def removeChild(self: _NodesWithChildren, oldChild: _ChildNodeVar) -> _ChildNodeVar: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def normalize(self: _NodesWithChildren) -> None: ... # type: ignore[misc] # pyright: ignore[reportGeneralTypeIssues] - def cloneNode(self, deep: bool) -> Self | None: ... - def isSupported(self, feature: str, version: str | None) -> bool: ... - def isSameNode(self, other: Node) -> bool: ... - def getInterface(self, feature: str) -> Self | None: ... - def getUserData(self, key: str) -> Any | None: ... - def setUserData(self, key: str, data: Any, handler: _UserDataHandler) -> Any: ... - def unlink(self) -> None: ... - def __enter__(self) -> Self: ... - def __exit__(self, et: type[BaseException] | None, ev: BaseException | None, tb: TracebackType | None) -> None: ... - -_DFChildrenVar = TypeVar("_DFChildrenVar", bound=_DocumentFragmentChildren) -_DFChildrenPlusFragment = TypeVar("_DFChildrenPlusFragment", bound=_DocumentFragmentChildren | DocumentFragment) - -class DocumentFragment(Node): - nodeType: ClassVar[Literal[11]] - nodeName: Literal["#document-fragment"] - nodeValue: None - attributes: None - - parentNode: None - nextSibling: None - previousSibling: None - childNodes: NodeList[_DocumentFragmentChildren] - @property - def firstChild(self) -> _DocumentFragmentChildren | None: ... - @property - def lastChild(self) -> _DocumentFragmentChildren | None: ... - - namespaceURI: None - prefix: None - @property - def localName(self) -> None: ... - def __init__(self) -> None: ... - def insertBefore( # type: ignore[override] - self, newChild: _DFChildrenPlusFragment, refChild: _DocumentFragmentChildren | None - ) -> _DFChildrenPlusFragment: ... - def appendChild(self, node: _DFChildrenPlusFragment) -> _DFChildrenPlusFragment: ... # type: ignore[override] - @overload # type: ignore[override] - def replaceChild(self, newChild: DocumentFragment, oldChild: _DFChildrenVar) -> _DFChildrenVar | DocumentFragment: ... - @overload - def replaceChild(self, newChild: _DocumentFragmentChildren, oldChild: _DFChildrenVar) -> _DFChildrenVar | None: ... # type: ignore[override] - def removeChild(self, oldChild: _DFChildrenVar) -> _DFChildrenVar: ... # type: ignore[override] - -_AttrChildrenVar = TypeVar("_AttrChildrenVar", bound=_AttrChildren) -_AttrChildrenPlusFragment = TypeVar("_AttrChildrenPlusFragment", bound=_AttrChildren | DocumentFragment) - -class Attr(Node): - nodeType: ClassVar[Literal[2]] - nodeName: str # same as Attr.name - nodeValue: str # same as Attr.value - attributes: None - - parentNode: None - nextSibling: None - previousSibling: None - childNodes: NodeList[_AttrChildren] - @property - def firstChild(self) -> _AttrChildren | None: ... - @property - def lastChild(self) -> _AttrChildren | None: ... - - namespaceURI: str | None - prefix: str | None - @property - def localName(self) -> str: ... - - name: str - value: str - specified: bool - ownerElement: Element | None - - def __init__( - self, qName: str, namespaceURI: str | None = None, localName: str | None = None, prefix: str | None = None - ) -> None: ... - def unlink(self) -> None: ... - @property - def isId(self) -> bool: ... - @property - def schemaType(self) -> TypeInfo: ... - def insertBefore(self, newChild: _AttrChildrenPlusFragment, refChild: _AttrChildren | None) -> _AttrChildrenPlusFragment: ... # type: ignore[override] - def appendChild(self, node: _AttrChildrenPlusFragment) -> _AttrChildrenPlusFragment: ... # type: ignore[override] - @overload # type: ignore[override] - def replaceChild(self, newChild: DocumentFragment, oldChild: _AttrChildrenVar) -> _AttrChildrenVar | DocumentFragment: ... - @overload - def replaceChild(self, newChild: _AttrChildren, oldChild: _AttrChildrenVar) -> _AttrChildrenVar | None: ... # type: ignore[override] - def removeChild(self, oldChild: _AttrChildrenVar) -> _AttrChildrenVar: ... # type: ignore[override] - -# In the DOM, this interface isn't specific to Attr, but our implementation is -# because that's the only place we use it. -class NamedNodeMap: - def __init__(self, attrs: dict[str, Attr], attrsNS: dict[_NSName, Attr], ownerElement: Element) -> None: ... - @property - def length(self) -> int: ... - def item(self, index: int) -> Node | None: ... - def items(self) -> list[tuple[str, str]]: ... - def itemsNS(self) -> list[tuple[_NSName, str]]: ... - def __contains__(self, key: str | _NSName) -> bool: ... - def keys(self) -> dict_keys[str, Attr]: ... - def keysNS(self) -> dict_keys[_NSName, Attr]: ... - def values(self) -> dict_values[str, Attr]: ... - def get(self, name: str, value: Attr | None = None) -> Attr | None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __len__(self) -> int: ... - def __eq__(self, other: object) -> bool: ... - def __ge__(self, other: NamedNodeMap) -> bool: ... - def __gt__(self, other: NamedNodeMap) -> bool: ... - def __le__(self, other: NamedNodeMap) -> bool: ... - def __lt__(self, other: NamedNodeMap) -> bool: ... - def __getitem__(self, attname_or_tuple: _NSName | str) -> Attr: ... - def __setitem__(self, attname: str, value: Attr | str) -> None: ... - def getNamedItem(self, name: str) -> Attr | None: ... - def getNamedItemNS(self, namespaceURI: str | None, localName: str) -> Attr | None: ... - def removeNamedItem(self, name: str) -> Attr: ... - def removeNamedItemNS(self, namespaceURI: str | None, localName: str) -> Attr: ... - def setNamedItem(self, node: Attr) -> Attr | None: ... - def setNamedItemNS(self, node: Attr) -> Attr | None: ... - def __delitem__(self, attname_or_tuple: _NSName | str) -> None: ... - -AttributeList = NamedNodeMap - -class TypeInfo: - namespace: str | None - name: str | None - def __init__(self, namespace: Incomplete | None, name: str | None) -> None: ... - -_ElementChildrenVar = TypeVar("_ElementChildrenVar", bound=_ElementChildren) -_ElementChildrenPlusFragment = TypeVar("_ElementChildrenPlusFragment", bound=_ElementChildren | DocumentFragment) - -class Element(Node): - nodeType: ClassVar[Literal[1]] - nodeName: str # same as Element.tagName - nodeValue: None - @property - def attributes(self) -> NamedNodeMap: ... # type: ignore[override] - - parentNode: Document | Element | DocumentFragment | None - nextSibling: _DocumentChildren | _ElementChildren | _DocumentFragmentChildren | None - previousSibling: _DocumentChildren | _ElementChildren | _DocumentFragmentChildren | None - childNodes: NodeList[_ElementChildren] - @property - def firstChild(self) -> _ElementChildren | None: ... - @property - def lastChild(self) -> _ElementChildren | None: ... - - namespaceURI: str | None - prefix: str | None - @property - def localName(self) -> str: ... - - schemaType: TypeInfo - tagName: str - - def __init__( - self, tagName: str, namespaceURI: str | None = None, prefix: str | None = None, localName: str | None = None - ) -> None: ... - def unlink(self) -> None: ... - def getAttribute(self, attname: str) -> str: ... - def getAttributeNS(self, namespaceURI: str | None, localName: str) -> str: ... - def setAttribute(self, attname: str, value: str) -> None: ... - def setAttributeNS(self, namespaceURI: str | None, qualifiedName: str, value: str) -> None: ... - def getAttributeNode(self, attrname: str) -> Attr | None: ... - def getAttributeNodeNS(self, namespaceURI: str | None, localName: str) -> Attr | None: ... - def setAttributeNode(self, attr: Attr) -> Attr | None: ... - setAttributeNodeNS = setAttributeNode - def removeAttribute(self, name: str) -> None: ... - def removeAttributeNS(self, namespaceURI: str | None, localName: str) -> None: ... - def removeAttributeNode(self, node: Attr) -> Attr: ... - removeAttributeNodeNS = removeAttributeNode - def hasAttribute(self, name: str) -> bool: ... - def hasAttributeNS(self, namespaceURI: str | None, localName: str) -> bool: ... - def getElementsByTagName(self, name: str) -> NodeList[Element]: ... - def getElementsByTagNameNS(self, namespaceURI: str | None, localName: str) -> NodeList[Element]: ... - def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... - def hasAttributes(self) -> bool: ... - def setIdAttribute(self, name: str) -> None: ... - def setIdAttributeNS(self, namespaceURI: str | None, localName: str) -> None: ... - def setIdAttributeNode(self, idAttr: Attr) -> None: ... - def insertBefore( # type: ignore[override] - self, newChild: _ElementChildrenPlusFragment, refChild: _ElementChildren | None - ) -> _ElementChildrenPlusFragment: ... - def appendChild(self, node: _ElementChildrenPlusFragment) -> _ElementChildrenPlusFragment: ... # type: ignore[override] - @overload # type: ignore[override] - def replaceChild( - self, newChild: DocumentFragment, oldChild: _ElementChildrenVar - ) -> _ElementChildrenVar | DocumentFragment: ... - @overload - def replaceChild(self, newChild: _ElementChildren, oldChild: _ElementChildrenVar) -> _ElementChildrenVar | None: ... # type: ignore[override] - def removeChild(self, oldChild: _ElementChildrenVar) -> _ElementChildrenVar: ... # type: ignore[override] - -class Childless: - attributes: None - childNodes: EmptyNodeList - @property - def firstChild(self) -> None: ... - @property - def lastChild(self) -> None: ... - def appendChild(self, node: _NodesThatAreChildren | DocumentFragment) -> NoReturn: ... - def hasChildNodes(self) -> Literal[False]: ... - def insertBefore( - self, newChild: _NodesThatAreChildren | DocumentFragment, refChild: _NodesThatAreChildren | None - ) -> NoReturn: ... - def removeChild(self, oldChild: _NodesThatAreChildren) -> NoReturn: ... - def normalize(self) -> None: ... - def replaceChild(self, newChild: _NodesThatAreChildren | DocumentFragment, oldChild: _NodesThatAreChildren) -> NoReturn: ... - -class ProcessingInstruction(Childless, Node): - nodeType: ClassVar[Literal[7]] - nodeName: str # same as ProcessingInstruction.target - nodeValue: str # same as ProcessingInstruction.data - attributes: None - - parentNode: Document | Element | DocumentFragment | None - nextSibling: _DocumentChildren | _ElementChildren | _DocumentFragmentChildren | None - previousSibling: _DocumentChildren | _ElementChildren | _DocumentFragmentChildren | None - childNodes: EmptyNodeList - @property - def firstChild(self) -> None: ... - @property - def lastChild(self) -> None: ... - - namespaceURI: None - prefix: None - @property - def localName(self) -> None: ... - - target: str - data: str - - def __init__(self, target: str, data: str) -> None: ... - def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... - -class CharacterData(Childless, Node): - nodeValue: str - attributes: None - - childNodes: EmptyNodeList - nextSibling: _NodesThatAreChildren | None - previousSibling: _NodesThatAreChildren | None - - @property - def localName(self) -> None: ... - - ownerDocument: Document | None - data: str - - def __init__(self) -> None: ... - @property - def length(self) -> int: ... - def __len__(self) -> int: ... - def substringData(self, offset: int, count: int) -> str: ... - def appendData(self, arg: str) -> None: ... - def insertData(self, offset: int, arg: str) -> None: ... - def deleteData(self, offset: int, count: int) -> None: ... - def replaceData(self, offset: int, count: int, arg: str) -> None: ... - -class Text(CharacterData): - nodeType: ClassVar[Literal[3]] - nodeName: Literal["#text"] - nodeValue: str # same as CharacterData.data, the content of the text node - attributes: None - - parentNode: Attr | Element | DocumentFragment | None - nextSibling: _DocumentFragmentChildren | _ElementChildren | _AttrChildren | None - previousSibling: _DocumentFragmentChildren | _ElementChildren | _AttrChildren | None - childNodes: EmptyNodeList - @property - def firstChild(self) -> None: ... - @property - def lastChild(self) -> None: ... - - namespaceURI: None - prefix: None - @property - def localName(self) -> None: ... - - data: str - def splitText(self, offset: int) -> Self: ... - def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... - def replaceWholeText(self, content: str) -> Self | None: ... - @property - def isWhitespaceInElementContent(self) -> bool: ... - @property - def wholeText(self) -> str: ... - -class Comment(CharacterData): - nodeType: ClassVar[Literal[8]] - nodeName: Literal["#comment"] - nodeValue: str # same as CharacterData.data, the content of the comment - attributes: None - - parentNode: Document | Element | DocumentFragment | None - nextSibling: _DocumentChildren | _ElementChildren | _DocumentFragmentChildren | None - previousSibling: _DocumentChildren | _ElementChildren | _DocumentFragmentChildren | None - childNodes: EmptyNodeList - @property - def firstChild(self) -> None: ... - @property - def lastChild(self) -> None: ... - - namespaceURI: None - prefix: None - @property - def localName(self) -> None: ... - def __init__(self, data: str) -> None: ... - def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... - -class CDATASection(Text): - nodeType: ClassVar[Literal[4]] # type: ignore[assignment] - nodeName: Literal["#cdata-section"] # type: ignore[assignment] - nodeValue: str # same as CharacterData.data, the content of the CDATA Section - attributes: None - - parentNode: Element | DocumentFragment | None - nextSibling: _DocumentFragmentChildren | _ElementChildren | None - previousSibling: _DocumentFragmentChildren | _ElementChildren | None - - def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... - -class ReadOnlySequentialNamedNodeMap(Generic[_N]): - def __init__(self, seq: Sequence[_N] = ()) -> None: ... - def __len__(self) -> int: ... - def getNamedItem(self, name: str) -> _N | None: ... - def getNamedItemNS(self, namespaceURI: str | None, localName: str) -> _N | None: ... - def __getitem__(self, name_or_tuple: str | _NSName) -> _N | None: ... - def item(self, index: int) -> _N | None: ... - def removeNamedItem(self, name: str) -> NoReturn: ... - def removeNamedItemNS(self, namespaceURI: str | None, localName: str) -> NoReturn: ... - def setNamedItem(self, node: Node) -> NoReturn: ... - def setNamedItemNS(self, node: Node) -> NoReturn: ... - @property - def length(self) -> int: ... - -class Identified: - publicId: str | None - systemId: str | None - -class DocumentType(Identified, Childless, Node): - nodeType: ClassVar[Literal[10]] - nodeName: str | None # same as DocumentType.name - nodeValue: None - attributes: None - - parentNode: Document | None - nextSibling: _DocumentChildren | None - previousSibling: _DocumentChildren | None - childNodes: EmptyNodeList - @property - def firstChild(self) -> None: ... - @property - def lastChild(self) -> None: ... - - namespaceURI: None - prefix: None - @property - def localName(self) -> None: ... - - name: str | None - internalSubset: str | None - entities: ReadOnlySequentialNamedNodeMap[Entity] - notations: ReadOnlySequentialNamedNodeMap[Notation] - - def __init__(self, qualifiedName: str | None) -> None: ... - def cloneNode(self, deep: bool) -> DocumentType | None: ... - def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ... - -class Entity(Identified, Node): - nodeType: ClassVar[Literal[6]] - nodeName: str # entity name - nodeValue: None - attributes: None - - parentNode: None - nextSibling: None - previousSibling: None - childNodes: NodeList[_EntityChildren] - @property - def firstChild(self) -> _EntityChildren | None: ... - @property - def lastChild(self) -> _EntityChildren | None: ... - - namespaceURI: None - prefix: None - @property - def localName(self) -> None: ... - - actualEncoding: str | None - encoding: str | None - version: str | None - notationName: str | None - - def __init__(self, name: str, publicId: str | None, systemId: str | None, notation: str | None) -> None: ... - def appendChild(self, newChild: _EntityChildren) -> NoReturn: ... # type: ignore[override] - def insertBefore(self, newChild: _EntityChildren, refChild: _EntityChildren | None) -> NoReturn: ... # type: ignore[override] - def removeChild(self, oldChild: _EntityChildren) -> NoReturn: ... # type: ignore[override] - def replaceChild(self, newChild: _EntityChildren, oldChild: _EntityChildren) -> NoReturn: ... # type: ignore[override] - -class Notation(Identified, Childless, Node): - nodeType: ClassVar[Literal[12]] - nodeName: str # notation name - nodeValue: None - attributes: None - - parentNode: DocumentFragment | None - nextSibling: _DocumentFragmentChildren | None - previousSibling: _DocumentFragmentChildren | None - childNodes: EmptyNodeList - @property - def firstChild(self) -> None: ... - @property - def lastChild(self) -> None: ... - - namespaceURI: None - prefix: None - @property - def localName(self) -> None: ... - def __init__(self, name: str, publicId: str | None, systemId: str | None) -> None: ... - -class DOMImplementation(DOMImplementationLS): - def hasFeature(self, feature: str, version: str | None) -> bool: ... - def createDocument(self, namespaceURI: str | None, qualifiedName: str | None, doctype: DocumentType | None) -> Document: ... - def createDocumentType(self, qualifiedName: str | None, publicId: str | None, systemId: str | None) -> DocumentType: ... - def getInterface(self, feature: str) -> Self | None: ... - -class ElementInfo: - tagName: str - def __init__(self, name: str) -> None: ... - def getAttributeType(self, aname: str) -> TypeInfo: ... - def getAttributeTypeNS(self, namespaceURI: str | None, localName: str) -> TypeInfo: ... - def isElementContent(self) -> bool: ... - def isEmpty(self) -> bool: ... - def isId(self, aname: str) -> bool: ... - def isIdNS(self, namespaceURI: str | None, localName: str) -> bool: ... - -_DocumentChildrenPlusFragment = TypeVar("_DocumentChildrenPlusFragment", bound=_DocumentChildren | DocumentFragment) - -class Document(Node, DocumentLS): - nodeType: ClassVar[Literal[9]] - nodeName: Literal["#document"] - nodeValue: None - attributes: None - - parentNode: None - previousSibling: None - nextSibling: None - childNodes: NodeList[_DocumentChildren] - @property - def firstChild(self) -> _DocumentChildren | None: ... - @property - def lastChild(self) -> _DocumentChildren | None: ... - - namespaceURI: None - prefix: None - @property - def localName(self) -> None: ... - - implementation: DOMImplementation - actualEncoding: str | None - encoding: str | None - standalone: bool | None - version: str | None - strictErrorChecking: bool - errorHandler: _DOMErrorHandler | None - documentURI: str | None - doctype: DocumentType | None - documentElement: Element | None - - def __init__(self) -> None: ... - def appendChild(self, node: _DocumentChildrenVar) -> _DocumentChildrenVar: ... # type: ignore[override] - def removeChild(self, oldChild: _DocumentChildrenVar) -> _DocumentChildrenVar: ... # type: ignore[override] - def unlink(self) -> None: ... - def cloneNode(self, deep: bool) -> Document | None: ... - def createDocumentFragment(self) -> DocumentFragment: ... - def createElement(self, tagName: str) -> Element: ... - def createTextNode(self, data: str) -> Text: ... - def createCDATASection(self, data: str) -> CDATASection: ... - def createComment(self, data: str) -> Comment: ... - def createProcessingInstruction(self, target: str, data: str) -> ProcessingInstruction: ... - def createAttribute(self, qName: str) -> Attr: ... - def createElementNS(self, namespaceURI: str | None, qualifiedName: str) -> Element: ... - def createAttributeNS(self, namespaceURI: str | None, qualifiedName: str) -> Attr: ... - def getElementById(self, id: str) -> Element | None: ... - def getElementsByTagName(self, name: str) -> NodeList[Element]: ... - def getElementsByTagNameNS(self, namespaceURI: str | None, localName: str) -> NodeList[Element]: ... - def isSupported(self, feature: str, version: str | None) -> bool: ... - def importNode(self, node: _ImportableNodeVar, deep: bool) -> _ImportableNodeVar: ... - def writexml( - self, - writer: SupportsWrite[str], - indent: str = "", - addindent: str = "", - newl: str = "", - encoding: str | None = None, - standalone: bool | None = None, - ) -> None: ... - @overload - def renameNode(self, n: Element, namespaceURI: str, name: str) -> Element: ... - @overload - def renameNode(self, n: Attr, namespaceURI: str, name: str) -> Attr: ... - @overload - def renameNode(self, n: Element | Attr, namespaceURI: str, name: str) -> Element | Attr: ... - def insertBefore( - self, newChild: _DocumentChildrenPlusFragment, refChild: _DocumentChildren | None # type: ignore[override] - ) -> _DocumentChildrenPlusFragment: ... - @overload # type: ignore[override] - def replaceChild( - self, newChild: DocumentFragment, oldChild: _DocumentChildrenVar - ) -> _DocumentChildrenVar | DocumentFragment: ... - @overload - def replaceChild(self, newChild: _DocumentChildren, oldChild: _DocumentChildrenVar) -> _DocumentChildrenVar | None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/pulldom.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/pulldom.pyi deleted file mode 100644 index d9458654c1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/pulldom.pyi +++ /dev/null @@ -1,109 +0,0 @@ -import sys -from _typeshed import Incomplete, Unused -from collections.abc import MutableSequence, Sequence -from typing import Final, Literal, NoReturn -from typing_extensions import Self, TypeAlias -from xml.dom.minidom import Comment, Document, DOMImplementation, Element, ProcessingInstruction, Text -from xml.sax import _SupportsReadClose -from xml.sax.handler import ContentHandler -from xml.sax.xmlreader import AttributesImpl, AttributesNSImpl, Locator, XMLReader - -START_ELEMENT: Final = "START_ELEMENT" -END_ELEMENT: Final = "END_ELEMENT" -COMMENT: Final = "COMMENT" -START_DOCUMENT: Final = "START_DOCUMENT" -END_DOCUMENT: Final = "END_DOCUMENT" -PROCESSING_INSTRUCTION: Final = "PROCESSING_INSTRUCTION" -IGNORABLE_WHITESPACE: Final = "IGNORABLE_WHITESPACE" -CHARACTERS: Final = "CHARACTERS" - -_NSName: TypeAlias = tuple[str | None, str] -_DocumentFactory: TypeAlias = DOMImplementation | None - -_Event: TypeAlias = ( - tuple[Literal["START_ELEMENT"], Element] - | tuple[Literal["END_ELEMENT"], Element] - | tuple[Literal["COMMENT"], Comment] - | tuple[Literal["START_DOCUMENT"], Document] - | tuple[Literal["END_DOCUMENT"], Document] - | tuple[Literal["PROCESSING_INSTRUCTION"], ProcessingInstruction] - | tuple[Literal["IGNORABLE_WHITESPACE"], Text] - | tuple[Literal["CHARACTERS"], Text] -) - -class PullDOM(ContentHandler): - document: Document | None - documentFactory: _DocumentFactory - - # firstEvent is a list of length 2 - # firstEvent[0] is always None - # firstEvent[1] is None prior to any events, after which it's a - # list of length 2, where the first item is of type _Event - # and the second item is None. - firstEvent: list[Incomplete] - - # lastEvent is also a list of length 2. The second item is always None, - # and the first item is of type _Event - # This is a slight lie: The second item is sometimes temporarily what was just - # described for the type of lastEvent, after which lastEvent is always updated - # with `self.lastEvent = self.lastEvent[1]`. - lastEvent: list[Incomplete] - - elementStack: MutableSequence[Element | Document] - pending_events: ( - list[Sequence[tuple[Literal["COMMENT"], str] | tuple[Literal["PROCESSING_INSTRUCTION"], str, str] | None]] | None - ) - def __init__(self, documentFactory: _DocumentFactory = None) -> None: ... - def pop(self) -> Element | Document: ... - def setDocumentLocator(self, locator: Locator) -> None: ... - def startPrefixMapping(self, prefix: str | None, uri: str) -> None: ... - def endPrefixMapping(self, prefix: str | None) -> None: ... - def startElementNS(self, name: _NSName, tagName: str | None, attrs: AttributesNSImpl) -> None: ... - def endElementNS(self, name: _NSName, tagName: str | None) -> None: ... - def startElement(self, name: str, attrs: AttributesImpl) -> None: ... - def endElement(self, name: str) -> None: ... - def comment(self, s: str) -> None: ... - def processingInstruction(self, target: str, data: str) -> None: ... - def ignorableWhitespace(self, chars: str) -> None: ... - def characters(self, chars: str) -> None: ... - def startDocument(self) -> None: ... - def buildDocument(self, uri: str | None, tagname: str | None) -> Element: ... - def endDocument(self) -> None: ... - def clear(self) -> None: ... - -class ErrorHandler: - def warning(self, exception: BaseException) -> None: ... - def error(self, exception: BaseException) -> NoReturn: ... - def fatalError(self, exception: BaseException) -> NoReturn: ... - -class DOMEventStream: - stream: _SupportsReadClose[bytes] | _SupportsReadClose[str] - parser: XMLReader # Set to none after .clear() is called - bufsize: int - pulldom: PullDOM - def __init__(self, stream: _SupportsReadClose[bytes] | _SupportsReadClose[str], parser: XMLReader, bufsize: int) -> None: ... - if sys.version_info < (3, 11): - def __getitem__(self, pos: Unused) -> _Event: ... - - def __next__(self) -> _Event: ... - def __iter__(self) -> Self: ... - def getEvent(self) -> _Event | None: ... - def expandNode(self, node: Document) -> None: ... - def reset(self) -> None: ... - def clear(self) -> None: ... - -class SAX2DOM(PullDOM): - def startElementNS(self, name: _NSName, tagName: str | None, attrs: AttributesNSImpl) -> None: ... - def startElement(self, name: str, attrs: AttributesImpl) -> None: ... - def processingInstruction(self, target: str, data: str) -> None: ... - def ignorableWhitespace(self, chars: str) -> None: ... - def characters(self, chars: str) -> None: ... - -default_bufsize: int - -def parse( - stream_or_string: str | _SupportsReadClose[bytes] | _SupportsReadClose[str], - parser: XMLReader | None = None, - bufsize: int | None = None, -) -> DOMEventStream: ... -def parseString(string: str, parser: XMLReader | None = None) -> DOMEventStream: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/xmlbuilder.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/xmlbuilder.pyi deleted file mode 100644 index 6fb18bbc4e..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/dom/xmlbuilder.pyi +++ /dev/null @@ -1,79 +0,0 @@ -from _typeshed import SupportsRead -from typing import Any, Literal, NoReturn -from xml.dom.minidom import Document, Node, _DOMErrorHandler - -__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"] - -class Options: - namespaces: int - namespace_declarations: bool - validation: bool - external_parameter_entities: bool - external_general_entities: bool - external_dtd_subset: bool - validate_if_schema: bool - validate: bool - datatype_normalization: bool - create_entity_ref_nodes: bool - entities: bool - whitespace_in_element_content: bool - cdata_sections: bool - comments: bool - charset_overrides_xml_encoding: bool - infoset: bool - supported_mediatypes_only: bool - errorHandler: _DOMErrorHandler | None - filter: DOMBuilderFilter | None - -class DOMBuilder: - entityResolver: DOMEntityResolver | None - errorHandler: _DOMErrorHandler | None - filter: DOMBuilderFilter | None - ACTION_REPLACE: Literal[1] - ACTION_APPEND_AS_CHILDREN: Literal[2] - ACTION_INSERT_AFTER: Literal[3] - ACTION_INSERT_BEFORE: Literal[4] - def __init__(self) -> None: ... - def setFeature(self, name: str, state: int) -> None: ... - def supportsFeature(self, name: str) -> bool: ... - def canSetFeature(self, name: str, state: Literal[1, 0]) -> bool: ... - # getFeature could return any attribute from an instance of `Options` - def getFeature(self, name: str) -> Any: ... - def parseURI(self, uri: str) -> Document: ... - def parse(self, input: DOMInputSource) -> Document: ... - def parseWithContext(self, input: DOMInputSource, cnode: Node, action: Literal[1, 2, 3, 4]) -> NoReturn: ... - -class DOMEntityResolver: - def resolveEntity(self, publicId: str | None, systemId: str) -> DOMInputSource: ... - -class DOMInputSource: - byteStream: SupportsRead[bytes] | None - characterStream: SupportsRead[str] | None - stringData: str | None - encoding: str | None - publicId: str | None - systemId: str | None - baseURI: str | None - -class DOMBuilderFilter: - FILTER_ACCEPT: Literal[1] - FILTER_REJECT: Literal[2] - FILTER_SKIP: Literal[3] - FILTER_INTERRUPT: Literal[4] - whatToShow: int - def acceptNode(self, element: Node) -> Literal[1, 2, 3, 4]: ... - def startContainer(self, element: Node) -> Literal[1, 2, 3, 4]: ... - -class DocumentLS: - async_: bool - def abort(self) -> NoReturn: ... - def load(self, uri: str) -> NoReturn: ... - def loadXML(self, source: str) -> NoReturn: ... - def saveXML(self, snode: Node | None) -> str: ... - -class DOMImplementationLS: - MODE_SYNCHRONOUS: Literal[1] - MODE_ASYNCHRONOUS: Literal[2] - def createDOMBuilder(self, mode: Literal[1], schemaType: None) -> DOMBuilder: ... - def createDOMWriter(self) -> NoReturn: ... - def createDOMInputSource(self) -> DOMInputSource: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/ElementInclude.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/ElementInclude.pyi deleted file mode 100644 index 8f20ee15a1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/ElementInclude.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from _typeshed import FileDescriptorOrPath -from typing import Final, Literal, Protocol, overload -from xml.etree.ElementTree import Element - -class _Loader(Protocol): - @overload - def __call__(self, href: FileDescriptorOrPath, parse: Literal["xml"], encoding: str | None = None) -> Element: ... - @overload - def __call__(self, href: FileDescriptorOrPath, parse: Literal["text"], encoding: str | None = None) -> str: ... - -XINCLUDE: Final[str] -XINCLUDE_INCLUDE: Final[str] -XINCLUDE_FALLBACK: Final[str] - -DEFAULT_MAX_INCLUSION_DEPTH: Final = 6 - -class FatalIncludeError(SyntaxError): ... - -@overload -def default_loader(href: FileDescriptorOrPath, parse: Literal["xml"], encoding: str | None = None) -> Element: ... -@overload -def default_loader(href: FileDescriptorOrPath, parse: Literal["text"], encoding: str | None = None) -> str: ... -def include(elem: Element, loader: _Loader | None = None, base_url: str | None = None, max_depth: int | None = 6) -> None: ... - -class LimitedRecursiveIncludeError(FatalIncludeError): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/ElementPath.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/ElementPath.pyi deleted file mode 100644 index ebfb4f1ffb..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/ElementPath.pyi +++ /dev/null @@ -1,41 +0,0 @@ -from collections.abc import Callable, Generator, Iterable -from re import Pattern -from typing import Any, Literal, TypeVar, overload -from typing_extensions import TypeAlias -from xml.etree.ElementTree import Element - -xpath_tokenizer_re: Pattern[str] - -_Token: TypeAlias = tuple[str, str] -_Next: TypeAlias = Callable[[], _Token] -_Callback: TypeAlias = Callable[[_SelectorContext, Iterable[Element]], Generator[Element, None, None]] -_T = TypeVar("_T") - -def xpath_tokenizer(pattern: str, namespaces: dict[str, str] | None = None) -> Generator[_Token, None, None]: ... -def get_parent_map(context: _SelectorContext) -> dict[Element, Element]: ... -def prepare_child(next: _Next, token: _Token) -> _Callback: ... -def prepare_star(next: _Next, token: _Token) -> _Callback: ... -def prepare_self(next: _Next, token: _Token) -> _Callback: ... -def prepare_descendant(next: _Next, token: _Token) -> _Callback | None: ... -def prepare_parent(next: _Next, token: _Token) -> _Callback: ... -def prepare_predicate(next: _Next, token: _Token) -> _Callback | None: ... - -ops: dict[str, Callable[[_Next, _Token], _Callback | None]] - -class _SelectorContext: - parent_map: dict[Element, Element] | None - root: Element - def __init__(self, root: Element) -> None: ... - -@overload -def iterfind( # type: ignore[overload-overlap] - elem: Element[Any], path: Literal[""], namespaces: dict[str, str] | None = None -) -> None: ... -@overload -def iterfind(elem: Element[Any], path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... -def find(elem: Element[Any], path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... -def findall(elem: Element[Any], path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... -@overload -def findtext(elem: Element[Any], path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ... -@overload -def findtext(elem: Element[Any], path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/ElementTree.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/ElementTree.pyi deleted file mode 100644 index 4c55a1a745..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/ElementTree.pyi +++ /dev/null @@ -1,364 +0,0 @@ -import sys -from _collections_abc import dict_keys -from _typeshed import FileDescriptorOrPath, ReadableBuffer, SupportsRead, SupportsWrite -from collections.abc import Callable, Generator, ItemsView, Iterable, Iterator, Mapping, Sequence -from typing import Any, Final, Generic, Literal, Protocol, SupportsIndex, TypeVar, overload, type_check_only -from typing_extensions import TypeAlias, TypeGuard, deprecated -from xml.parsers.expat import XMLParserType - -__all__ = [ - "C14NWriterTarget", - "Comment", - "dump", - "Element", - "ElementTree", - "canonicalize", - "fromstring", - "fromstringlist", - "indent", - "iselement", - "iterparse", - "parse", - "ParseError", - "PI", - "ProcessingInstruction", - "QName", - "SubElement", - "tostring", - "tostringlist", - "TreeBuilder", - "VERSION", - "XML", - "XMLID", - "XMLParser", - "XMLPullParser", - "register_namespace", -] - -_T = TypeVar("_T") -_FileRead: TypeAlias = FileDescriptorOrPath | SupportsRead[bytes] | SupportsRead[str] -_FileWriteC14N: TypeAlias = FileDescriptorOrPath | SupportsWrite[bytes] -_FileWrite: TypeAlias = _FileWriteC14N | SupportsWrite[str] - -VERSION: Final[str] - -class ParseError(SyntaxError): - code: int - position: tuple[int, int] - -# In reality it works based on `.tag` attribute duck typing. -def iselement(element: object) -> TypeGuard[Element]: ... -@overload -def canonicalize( - xml_data: str | ReadableBuffer | None = None, - *, - out: None = None, - from_file: _FileRead | None = None, - with_comments: bool = False, - strip_text: bool = False, - rewrite_prefixes: bool = False, - qname_aware_tags: Iterable[str] | None = None, - qname_aware_attrs: Iterable[str] | None = None, - exclude_attrs: Iterable[str] | None = None, - exclude_tags: Iterable[str] | None = None, -) -> str: ... -@overload -def canonicalize( - xml_data: str | ReadableBuffer | None = None, - *, - out: SupportsWrite[str], - from_file: _FileRead | None = None, - with_comments: bool = False, - strip_text: bool = False, - rewrite_prefixes: bool = False, - qname_aware_tags: Iterable[str] | None = None, - qname_aware_attrs: Iterable[str] | None = None, - exclude_attrs: Iterable[str] | None = None, - exclude_tags: Iterable[str] | None = None, -) -> None: ... - -# The tag for Element can be set to the Comment or ProcessingInstruction -# functions defined in this module. _ElementCallable could be a recursive -# type, but defining it that way uncovered a bug in pytype. -_ElementCallable: TypeAlias = Callable[..., Element[Any]] -_CallableElement: TypeAlias = Element[_ElementCallable] - -_Tag = TypeVar("_Tag", default=str, bound=str | _ElementCallable) -_OtherTag = TypeVar("_OtherTag", default=str, bound=str | _ElementCallable) - -class Element(Generic[_Tag]): - tag: _Tag - attrib: dict[str, str] - text: str | None - tail: str | None - def __init__(self, tag: _Tag, attrib: dict[str, str] = {}, **extra: str) -> None: ... - def append(self, subelement: Element[Any], /) -> None: ... - def clear(self) -> None: ... - def extend(self, elements: Iterable[Element], /) -> None: ... - def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... - def findall(self, path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... - @overload - def findtext(self, path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ... - @overload - def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ... - @overload - def get(self, key: str, default: None = None) -> str | None: ... - @overload - def get(self, key: str, default: _T) -> str | _T: ... - def insert(self, index: int, subelement: Element, /) -> None: ... - def items(self) -> ItemsView[str, str]: ... - def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ... - @overload - def iterfind(self, path: Literal[""], namespaces: dict[str, str] | None = None) -> None: ... # type: ignore[overload-overlap] - @overload - def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... - def itertext(self) -> Generator[str, None, None]: ... - def keys(self) -> dict_keys[str, str]: ... - # makeelement returns the type of self in Python impl, but not in C impl - def makeelement(self, tag: _OtherTag, attrib: dict[str, str], /) -> Element[_OtherTag]: ... - def remove(self, subelement: Element, /) -> None: ... - def set(self, key: str, value: str, /) -> None: ... - def __copy__(self) -> Element[_Tag]: ... # returns the type of self in Python impl, but not in C impl - def __deepcopy__(self, memo: Any, /) -> Element: ... # Only exists in C impl - def __delitem__(self, key: SupportsIndex | slice, /) -> None: ... - @overload - def __getitem__(self, key: SupportsIndex, /) -> Element: ... - @overload - def __getitem__(self, key: slice, /) -> list[Element]: ... - def __len__(self) -> int: ... - # Doesn't actually exist at runtime, but instance of the class are indeed iterable due to __getitem__. - def __iter__(self) -> Iterator[Element]: ... - @overload - def __setitem__(self, key: SupportsIndex, value: Element, /) -> None: ... - @overload - def __setitem__(self, key: slice, value: Iterable[Element], /) -> None: ... - - # Doesn't really exist in earlier versions, where __len__ is called implicitly instead - @deprecated("Testing an element's truth value is deprecated.") - def __bool__(self) -> bool: ... - -def SubElement(parent: Element, tag: str, attrib: dict[str, str] = ..., **extra: str) -> Element: ... -def Comment(text: str | None = None) -> _CallableElement: ... -def ProcessingInstruction(target: str, text: str | None = None) -> _CallableElement: ... - -PI = ProcessingInstruction - -class QName: - text: str - def __init__(self, text_or_uri: str, tag: str | None = None) -> None: ... - def __lt__(self, other: QName | str) -> bool: ... - def __le__(self, other: QName | str) -> bool: ... - def __gt__(self, other: QName | str) -> bool: ... - def __ge__(self, other: QName | str) -> bool: ... - def __eq__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... - -_Root = TypeVar("_Root", Element, Element | None, default=Element | None) - -class ElementTree(Generic[_Root]): - def __init__(self, element: Element | None = None, file: _FileRead | None = None) -> None: ... - def getroot(self) -> _Root: ... - def parse(self, source: _FileRead, parser: XMLParser | None = None) -> Element: ... - def iter(self, tag: str | None = None) -> Generator[Element, None, None]: ... - def find(self, path: str, namespaces: dict[str, str] | None = None) -> Element | None: ... - @overload - def findtext(self, path: str, default: None = None, namespaces: dict[str, str] | None = None) -> str | None: ... - @overload - def findtext(self, path: str, default: _T, namespaces: dict[str, str] | None = None) -> _T | str: ... - def findall(self, path: str, namespaces: dict[str, str] | None = None) -> list[Element]: ... - @overload - def iterfind(self, path: Literal[""], namespaces: dict[str, str] | None = None) -> None: ... # type: ignore[overload-overlap] - @overload - def iterfind(self, path: str, namespaces: dict[str, str] | None = None) -> Generator[Element, None, None]: ... - def write( - self, - file_or_filename: _FileWrite, - encoding: str | None = None, - xml_declaration: bool | None = None, - default_namespace: str | None = None, - method: Literal["xml", "html", "text", "c14n"] | None = None, - *, - short_empty_elements: bool = True, - ) -> None: ... - def write_c14n(self, file: _FileWriteC14N) -> None: ... - -HTML_EMPTY: set[str] - -def register_namespace(prefix: str, uri: str) -> None: ... -@overload -def tostring( - element: Element, - encoding: None = None, - method: Literal["xml", "html", "text", "c14n"] | None = None, - *, - xml_declaration: bool | None = None, - default_namespace: str | None = None, - short_empty_elements: bool = True, -) -> bytes: ... -@overload -def tostring( - element: Element, - encoding: Literal["unicode"], - method: Literal["xml", "html", "text", "c14n"] | None = None, - *, - xml_declaration: bool | None = None, - default_namespace: str | None = None, - short_empty_elements: bool = True, -) -> str: ... -@overload -def tostring( - element: Element, - encoding: str, - method: Literal["xml", "html", "text", "c14n"] | None = None, - *, - xml_declaration: bool | None = None, - default_namespace: str | None = None, - short_empty_elements: bool = True, -) -> Any: ... -@overload -def tostringlist( - element: Element, - encoding: None = None, - method: Literal["xml", "html", "text", "c14n"] | None = None, - *, - xml_declaration: bool | None = None, - default_namespace: str | None = None, - short_empty_elements: bool = True, -) -> list[bytes]: ... -@overload -def tostringlist( - element: Element, - encoding: Literal["unicode"], - method: Literal["xml", "html", "text", "c14n"] | None = None, - *, - xml_declaration: bool | None = None, - default_namespace: str | None = None, - short_empty_elements: bool = True, -) -> list[str]: ... -@overload -def tostringlist( - element: Element, - encoding: str, - method: Literal["xml", "html", "text", "c14n"] | None = None, - *, - xml_declaration: bool | None = None, - default_namespace: str | None = None, - short_empty_elements: bool = True, -) -> list[Any]: ... -def dump(elem: Element | ElementTree[Any]) -> None: ... -def indent(tree: Element | ElementTree[Any], space: str = " ", level: int = 0) -> None: ... -def parse(source: _FileRead, parser: XMLParser[Any] | None = None) -> ElementTree[Element]: ... - -# This class is defined inside the body of iterparse -@type_check_only -class _IterParseIterator(Iterator[tuple[str, Element]], Protocol): - def __next__(self) -> tuple[str, Element]: ... - if sys.version_info >= (3, 13): - def close(self) -> None: ... - if sys.version_info >= (3, 11): - def __del__(self) -> None: ... - -def iterparse(source: _FileRead, events: Sequence[str] | None = None, parser: XMLParser | None = None) -> _IterParseIterator: ... - -_EventQueue: TypeAlias = tuple[str] | tuple[str, tuple[str, str]] | tuple[str, None] - -class XMLPullParser(Generic[_E]): - def __init__(self, events: Sequence[str] | None = None, *, _parser: XMLParser[_E] | None = None) -> None: ... - def feed(self, data: str | ReadableBuffer) -> None: ... - def close(self) -> None: ... - def read_events(self) -> Iterator[_EventQueue | tuple[str, _E]]: ... - def flush(self) -> None: ... - -def XML(text: str | ReadableBuffer, parser: XMLParser | None = None) -> Element: ... -def XMLID(text: str | ReadableBuffer, parser: XMLParser | None = None) -> tuple[Element, dict[str, Element]]: ... - -# This is aliased to XML in the source. -fromstring = XML - -def fromstringlist(sequence: Sequence[str | ReadableBuffer], parser: XMLParser | None = None) -> Element: ... - -# This type is both not precise enough and too precise. The TreeBuilder -# requires the elementfactory to accept tag and attrs in its args and produce -# some kind of object that has .text and .tail properties. -# I've chosen to constrain the ElementFactory to always produce an Element -# because that is how almost everyone will use it. -# Unfortunately, the type of the factory arguments is dependent on how -# TreeBuilder is called by client code (they could pass strs, bytes or whatever); -# but we don't want to use a too-broad type, or it would be too hard to write -# elementfactories. -_ElementFactory: TypeAlias = Callable[[Any, dict[Any, Any]], Element] - -class TreeBuilder: - # comment_factory can take None because passing None to Comment is not an error - def __init__( - self, - element_factory: _ElementFactory | None = None, - *, - comment_factory: Callable[[str | None], Element[Any]] | None = None, - pi_factory: Callable[[str, str | None], Element[Any]] | None = None, - insert_comments: bool = False, - insert_pis: bool = False, - ) -> None: ... - insert_comments: bool - insert_pis: bool - - def close(self) -> Element: ... - def data(self, data: str, /) -> None: ... - # tag and attrs are passed to the element_factory, so they could be anything - # depending on what the particular factory supports. - def start(self, tag: Any, attrs: dict[Any, Any], /) -> Element: ... - def end(self, tag: str, /) -> Element: ... - # These two methods have pos-only parameters in the C implementation - def comment(self, text: str | None, /) -> Element[Any]: ... - def pi(self, target: str, text: str | None = None, /) -> Element[Any]: ... - -class C14NWriterTarget: - def __init__( - self, - write: Callable[[str], object], - *, - with_comments: bool = False, - strip_text: bool = False, - rewrite_prefixes: bool = False, - qname_aware_tags: Iterable[str] | None = None, - qname_aware_attrs: Iterable[str] | None = None, - exclude_attrs: Iterable[str] | None = None, - exclude_tags: Iterable[str] | None = None, - ) -> None: ... - def data(self, data: str) -> None: ... - def start_ns(self, prefix: str, uri: str) -> None: ... - def start(self, tag: str, attrs: Mapping[str, str]) -> None: ... - def end(self, tag: str) -> None: ... - def comment(self, text: str) -> None: ... - def pi(self, target: str, data: str) -> None: ... - -# The target type is tricky, because the implementation doesn't -# require any particular attribute to be present. This documents the attributes -# that can be present, but uncommenting any of them would require them. -class _Target(Protocol): - # start: Callable[str, dict[str, str], Any] | None - # end: Callable[[str], Any] | None - # start_ns: Callable[[str, str], Any] | None - # end_ns: Callable[[str], Any] | None - # data: Callable[[str], Any] | None - # comment: Callable[[str], Any] - # pi: Callable[[str, str], Any] | None - # close: Callable[[], Any] | None - ... - -_E = TypeVar("_E", default=Element) - -# This is generic because the return type of close() depends on the target. -# The default target is TreeBuilder, which returns Element. -# C14NWriterTarget does not implement a close method, so using it results -# in a type of XMLParser[None]. -class XMLParser(Generic[_E]): - parser: XMLParserType - target: _Target - # TODO: what is entity used for??? - entity: dict[str, str] - version: str - def __init__(self, *, target: _Target | None = None, encoding: str | None = None) -> None: ... - def close(self) -> _E: ... - def feed(self, data: str | ReadableBuffer, /) -> None: ... - def flush(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/__init__.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/cElementTree.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/cElementTree.pyi deleted file mode 100644 index 02272d803c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/etree/cElementTree.pyi +++ /dev/null @@ -1 +0,0 @@ -from xml.etree.ElementTree import * diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/__init__.pyi deleted file mode 100644 index cebdb6a300..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/__init__.pyi +++ /dev/null @@ -1 +0,0 @@ -from xml.parsers import expat as expat diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/expat/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/expat/__init__.pyi deleted file mode 100644 index d9b7ea5369..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/expat/__init__.pyi +++ /dev/null @@ -1,7 +0,0 @@ -from pyexpat import * - -# This is actually implemented in the C module pyexpat, but considers itself to live here. -class ExpatError(Exception): - code: int - lineno: int - offset: int diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/expat/errors.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/expat/errors.pyi deleted file mode 100644 index e22d769ec3..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/expat/errors.pyi +++ /dev/null @@ -1 +0,0 @@ -from pyexpat.errors import * diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/expat/model.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/expat/model.pyi deleted file mode 100644 index d8f44b47c5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/parsers/expat/model.pyi +++ /dev/null @@ -1 +0,0 @@ -from pyexpat.model import * diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/__init__.pyi deleted file mode 100644 index a2eecc5a78..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/__init__.pyi +++ /dev/null @@ -1,25 +0,0 @@ -from _typeshed import ReadableBuffer, StrPath, SupportsRead, _T_co -from collections.abc import Iterable -from typing import Protocol -from typing_extensions import TypeAlias -from xml.sax._exceptions import ( - SAXException as SAXException, - SAXNotRecognizedException as SAXNotRecognizedException, - SAXNotSupportedException as SAXNotSupportedException, - SAXParseException as SAXParseException, - SAXReaderNotAvailable as SAXReaderNotAvailable, -) -from xml.sax.handler import ContentHandler as ContentHandler, ErrorHandler as ErrorHandler -from xml.sax.xmlreader import XMLReader - -class _SupportsReadClose(SupportsRead[_T_co], Protocol[_T_co]): - def close(self) -> None: ... - -_Source: TypeAlias = StrPath | _SupportsReadClose[bytes] | _SupportsReadClose[str] - -default_parser_list: list[str] - -def make_parser(parser_list: Iterable[str] = ()) -> XMLReader: ... -def parse(source: _Source, handler: ContentHandler, errorHandler: ErrorHandler = ...) -> None: ... -def parseString(string: ReadableBuffer | str, handler: ContentHandler, errorHandler: ErrorHandler | None = ...) -> None: ... -def _create_parser(parser_name: str) -> XMLReader: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/_exceptions.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/_exceptions.pyi deleted file mode 100644 index e9cc8856a9..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/_exceptions.pyi +++ /dev/null @@ -1,19 +0,0 @@ -from typing import NoReturn -from xml.sax.xmlreader import Locator - -class SAXException(Exception): - def __init__(self, msg: str, exception: Exception | None = None) -> None: ... - def getMessage(self) -> str: ... - def getException(self) -> Exception | None: ... - def __getitem__(self, ix: object) -> NoReturn: ... - -class SAXParseException(SAXException): - def __init__(self, msg: str, exception: Exception | None, locator: Locator) -> None: ... - def getColumnNumber(self) -> int | None: ... - def getLineNumber(self) -> int | None: ... - def getPublicId(self) -> str | None: ... - def getSystemId(self) -> str | None: ... - -class SAXNotRecognizedException(SAXException): ... -class SAXNotSupportedException(SAXException): ... -class SAXReaderNotAvailable(SAXNotSupportedException): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/expatreader.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/expatreader.pyi deleted file mode 100644 index 012d6c03e1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/expatreader.pyi +++ /dev/null @@ -1,78 +0,0 @@ -import sys -from _typeshed import ReadableBuffer -from collections.abc import Mapping -from typing import Any, Literal, overload -from typing_extensions import TypeAlias -from xml.sax import _Source, xmlreader -from xml.sax.handler import _ContentHandlerProtocol - -if sys.version_info >= (3, 10): - from xml.sax.handler import LexicalHandler - -_BoolType: TypeAlias = Literal[0, 1] | bool - -version: str -AttributesImpl = xmlreader.AttributesImpl -AttributesNSImpl = xmlreader.AttributesNSImpl - -class _ClosedParser: - ErrorColumnNumber: int - ErrorLineNumber: int - -class ExpatLocator(xmlreader.Locator): - def __init__(self, parser: ExpatParser) -> None: ... - def getColumnNumber(self) -> int | None: ... - def getLineNumber(self) -> int: ... - def getPublicId(self) -> str | None: ... - def getSystemId(self) -> str | None: ... - -class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): - def __init__(self, namespaceHandling: _BoolType = 0, bufsize: int = 65516) -> None: ... - def parse(self, source: xmlreader.InputSource | _Source) -> None: ... - def prepareParser(self, source: xmlreader.InputSource) -> None: ... - def setContentHandler(self, handler: _ContentHandlerProtocol) -> None: ... - def getFeature(self, name: str) -> _BoolType: ... - def setFeature(self, name: str, state: _BoolType) -> None: ... - if sys.version_info >= (3, 10): - @overload - def getProperty(self, name: Literal["http://xml.org/sax/properties/lexical-handler"]) -> LexicalHandler | None: ... - - @overload - def getProperty(self, name: Literal["http://www.python.org/sax/properties/interning-dict"]) -> dict[str, Any] | None: ... - @overload - def getProperty(self, name: Literal["http://xml.org/sax/properties/xml-string"]) -> bytes | None: ... - @overload - def getProperty(self, name: str) -> object: ... - if sys.version_info >= (3, 10): - @overload - def setProperty(self, name: Literal["http://xml.org/sax/properties/lexical-handler"], value: LexicalHandler) -> None: ... - - @overload - def setProperty( - self, name: Literal["http://www.python.org/sax/properties/interning-dict"], value: dict[str, Any] - ) -> None: ... - @overload - def setProperty(self, name: str, value: object) -> None: ... - def feed(self, data: str | ReadableBuffer, isFinal: bool = False) -> None: ... - def flush(self) -> None: ... - def close(self) -> None: ... - def reset(self) -> None: ... - def getColumnNumber(self) -> int | None: ... - def getLineNumber(self) -> int: ... - def getPublicId(self) -> str | None: ... - def getSystemId(self) -> str | None: ... - def start_element(self, name: str, attrs: Mapping[str, str]) -> None: ... - def end_element(self, name: str) -> None: ... - def start_element_ns(self, name: str, attrs: Mapping[str, str]) -> None: ... - def end_element_ns(self, name: str) -> None: ... - def processing_instruction(self, target: str, data: str) -> None: ... - def character_data(self, data: str) -> None: ... - def start_namespace_decl(self, prefix: str | None, uri: str) -> None: ... - def end_namespace_decl(self, prefix: str | None) -> None: ... - def start_doctype_decl(self, name: str, sysid: str | None, pubid: str | None, has_internal_subset: bool) -> None: ... - def unparsed_entity_decl(self, name: str, base: str | None, sysid: str, pubid: str | None, notation_name: str) -> None: ... - def notation_decl(self, name: str, base: str | None, sysid: str, pubid: str | None) -> None: ... - def external_entity_ref(self, context: str, base: str | None, sysid: str, pubid: str | None) -> int: ... - def skipped_entity_handler(self, name: str, is_pe: bool) -> None: ... - -def create_parser(namespaceHandling: int = 0, bufsize: int = 65516) -> ExpatParser: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/handler.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/handler.pyi deleted file mode 100644 index 5509117345..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/handler.pyi +++ /dev/null @@ -1,86 +0,0 @@ -import sys -from typing import Literal, NoReturn, Protocol, type_check_only -from xml.sax import xmlreader - -version: str - -@type_check_only -class _ErrorHandlerProtocol(Protocol): # noqa: Y046 # Protocol is not used - def error(self, exception: BaseException) -> NoReturn: ... - def fatalError(self, exception: BaseException) -> NoReturn: ... - def warning(self, exception: BaseException) -> None: ... - -class ErrorHandler: - def error(self, exception: BaseException) -> NoReturn: ... - def fatalError(self, exception: BaseException) -> NoReturn: ... - def warning(self, exception: BaseException) -> None: ... - -@type_check_only -class _ContentHandlerProtocol(Protocol): # noqa: Y046 # Protocol is not used - def setDocumentLocator(self, locator: xmlreader.Locator) -> None: ... - def startDocument(self) -> None: ... - def endDocument(self) -> None: ... - def startPrefixMapping(self, prefix: str | None, uri: str) -> None: ... - def endPrefixMapping(self, prefix: str | None) -> None: ... - def startElement(self, name: str, attrs: xmlreader.AttributesImpl) -> None: ... - def endElement(self, name: str) -> None: ... - def startElementNS(self, name: tuple[str | None, str], qname: str | None, attrs: xmlreader.AttributesNSImpl) -> None: ... - def endElementNS(self, name: tuple[str | None, str], qname: str | None) -> None: ... - def characters(self, content: str) -> None: ... - def ignorableWhitespace(self, whitespace: str) -> None: ... - def processingInstruction(self, target: str, data: str) -> None: ... - def skippedEntity(self, name: str) -> None: ... - -class ContentHandler: - def setDocumentLocator(self, locator: xmlreader.Locator) -> None: ... - def startDocument(self) -> None: ... - def endDocument(self) -> None: ... - def startPrefixMapping(self, prefix: str | None, uri: str) -> None: ... - def endPrefixMapping(self, prefix: str | None) -> None: ... - def startElement(self, name: str, attrs: xmlreader.AttributesImpl) -> None: ... - def endElement(self, name: str) -> None: ... - def startElementNS(self, name: tuple[str | None, str], qname: str | None, attrs: xmlreader.AttributesNSImpl) -> None: ... - def endElementNS(self, name: tuple[str | None, str], qname: str | None) -> None: ... - def characters(self, content: str) -> None: ... - def ignorableWhitespace(self, whitespace: str) -> None: ... - def processingInstruction(self, target: str, data: str) -> None: ... - def skippedEntity(self, name: str) -> None: ... - -@type_check_only -class _DTDHandlerProtocol(Protocol): # noqa: Y046 # Protocol is not used - def notationDecl(self, name: str, publicId: str | None, systemId: str) -> None: ... - def unparsedEntityDecl(self, name: str, publicId: str | None, systemId: str, ndata: str) -> None: ... - -class DTDHandler: - def notationDecl(self, name: str, publicId: str | None, systemId: str) -> None: ... - def unparsedEntityDecl(self, name: str, publicId: str | None, systemId: str, ndata: str) -> None: ... - -@type_check_only -class _EntityResolverProtocol(Protocol): # noqa: Y046 # Protocol is not used - def resolveEntity(self, publicId: str | None, systemId: str) -> str: ... - -class EntityResolver: - def resolveEntity(self, publicId: str | None, systemId: str) -> str: ... - -feature_namespaces: str -feature_namespace_prefixes: str -feature_string_interning: str -feature_validation: str -feature_external_ges: str -feature_external_pes: str -all_features: list[str] -property_lexical_handler: Literal["http://xml.org/sax/properties/lexical-handler"] -property_declaration_handler: Literal["http://xml.org/sax/properties/declaration-handler"] -property_dom_node: Literal["http://xml.org/sax/properties/dom-node"] -property_xml_string: Literal["http://xml.org/sax/properties/xml-string"] -property_encoding: Literal["http://www.python.org/sax/properties/encoding"] -property_interning_dict: Literal["http://www.python.org/sax/properties/interning-dict"] -all_properties: list[str] - -if sys.version_info >= (3, 10): - class LexicalHandler: - def comment(self, content: str) -> None: ... - def startDTD(self, name: str, public_id: str | None, system_id: str | None) -> None: ... - def endDTD(self) -> None: ... - def startCDATA(self) -> None: ... - def endCDATA(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/saxutils.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/saxutils.pyi deleted file mode 100644 index a29588faae..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/saxutils.pyi +++ /dev/null @@ -1,68 +0,0 @@ -from _typeshed import SupportsWrite -from codecs import StreamReaderWriter, StreamWriter -from collections.abc import Mapping -from io import RawIOBase, TextIOBase -from typing import Literal, NoReturn -from xml.sax import _Source, handler, xmlreader - -def escape(data: str, entities: Mapping[str, str] = {}) -> str: ... -def unescape(data: str, entities: Mapping[str, str] = {}) -> str: ... -def quoteattr(data: str, entities: Mapping[str, str] = {}) -> str: ... - -class XMLGenerator(handler.ContentHandler): - def __init__( - self, - out: TextIOBase | RawIOBase | StreamWriter | StreamReaderWriter | SupportsWrite[bytes] | None = None, - encoding: str = "iso-8859-1", - short_empty_elements: bool = False, - ) -> None: ... - def _qname(self, name: tuple[str | None, str]) -> str: ... - def startDocument(self) -> None: ... - def endDocument(self) -> None: ... - def startPrefixMapping(self, prefix: str | None, uri: str) -> None: ... - def endPrefixMapping(self, prefix: str | None) -> None: ... - def startElement(self, name: str, attrs: xmlreader.AttributesImpl) -> None: ... - def endElement(self, name: str) -> None: ... - def startElementNS(self, name: tuple[str | None, str], qname: str | None, attrs: xmlreader.AttributesNSImpl) -> None: ... - def endElementNS(self, name: tuple[str | None, str], qname: str | None) -> None: ... - def characters(self, content: str) -> None: ... - def ignorableWhitespace(self, content: str) -> None: ... - def processingInstruction(self, target: str, data: str) -> None: ... - -class XMLFilterBase(xmlreader.XMLReader): - def __init__(self, parent: xmlreader.XMLReader | None = None) -> None: ... - # ErrorHandler methods - def error(self, exception: BaseException) -> NoReturn: ... - def fatalError(self, exception: BaseException) -> NoReturn: ... - def warning(self, exception: BaseException) -> None: ... - # ContentHandler methods - def setDocumentLocator(self, locator: xmlreader.Locator) -> None: ... - def startDocument(self) -> None: ... - def endDocument(self) -> None: ... - def startPrefixMapping(self, prefix: str | None, uri: str) -> None: ... - def endPrefixMapping(self, prefix: str | None) -> None: ... - def startElement(self, name: str, attrs: xmlreader.AttributesImpl) -> None: ... - def endElement(self, name: str) -> None: ... - def startElementNS(self, name: tuple[str | None, str], qname: str | None, attrs: xmlreader.AttributesNSImpl) -> None: ... - def endElementNS(self, name: tuple[str | None, str], qname: str | None) -> None: ... - def characters(self, content: str) -> None: ... - def ignorableWhitespace(self, chars: str) -> None: ... - def processingInstruction(self, target: str, data: str) -> None: ... - def skippedEntity(self, name: str) -> None: ... - # DTDHandler methods - def notationDecl(self, name: str, publicId: str | None, systemId: str) -> None: ... - def unparsedEntityDecl(self, name: str, publicId: str | None, systemId: str, ndata: str) -> None: ... - # EntityResolver methods - def resolveEntity(self, publicId: str | None, systemId: str) -> str: ... - # XMLReader methods - def parse(self, source: xmlreader.InputSource | _Source) -> None: ... - def setLocale(self, locale: str) -> None: ... - def getFeature(self, name: str) -> Literal[1, 0] | bool: ... - def setFeature(self, name: str, state: Literal[1, 0] | bool) -> None: ... - def getProperty(self, name: str) -> object: ... - def setProperty(self, name: str, value: object) -> None: ... - # XMLFilter methods - def getParent(self) -> xmlreader.XMLReader | None: ... - def setParent(self, parent: xmlreader.XMLReader) -> None: ... - -def prepare_input_source(source: xmlreader.InputSource | _Source, base: str = "") -> xmlreader.InputSource: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/xmlreader.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/xmlreader.pyi deleted file mode 100644 index e7d04ddead..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xml/sax/xmlreader.pyi +++ /dev/null @@ -1,90 +0,0 @@ -from _typeshed import ReadableBuffer -from collections.abc import Mapping -from typing import Generic, Literal, TypeVar, overload -from typing_extensions import Self, TypeAlias -from xml.sax import _Source, _SupportsReadClose -from xml.sax.handler import _ContentHandlerProtocol, _DTDHandlerProtocol, _EntityResolverProtocol, _ErrorHandlerProtocol - -class XMLReader: - def parse(self, source: InputSource | _Source) -> None: ... - def getContentHandler(self) -> _ContentHandlerProtocol: ... - def setContentHandler(self, handler: _ContentHandlerProtocol) -> None: ... - def getDTDHandler(self) -> _DTDHandlerProtocol: ... - def setDTDHandler(self, handler: _DTDHandlerProtocol) -> None: ... - def getEntityResolver(self) -> _EntityResolverProtocol: ... - def setEntityResolver(self, resolver: _EntityResolverProtocol) -> None: ... - def getErrorHandler(self) -> _ErrorHandlerProtocol: ... - def setErrorHandler(self, handler: _ErrorHandlerProtocol) -> None: ... - def setLocale(self, locale: str) -> None: ... - def getFeature(self, name: str) -> Literal[0, 1] | bool: ... - def setFeature(self, name: str, state: Literal[0, 1] | bool) -> None: ... - def getProperty(self, name: str) -> object: ... - def setProperty(self, name: str, value: object) -> None: ... - -class IncrementalParser(XMLReader): - def __init__(self, bufsize: int = 65536) -> None: ... - def parse(self, source: InputSource | _Source) -> None: ... - def feed(self, data: str | ReadableBuffer) -> None: ... - def prepareParser(self, source: InputSource) -> None: ... - def close(self) -> None: ... - def reset(self) -> None: ... - -class Locator: - def getColumnNumber(self) -> int | None: ... - def getLineNumber(self) -> int | None: ... - def getPublicId(self) -> str | None: ... - def getSystemId(self) -> str | None: ... - -class InputSource: - def __init__(self, system_id: str | None = None) -> None: ... - def setPublicId(self, public_id: str | None) -> None: ... - def getPublicId(self) -> str | None: ... - def setSystemId(self, system_id: str | None) -> None: ... - def getSystemId(self) -> str | None: ... - def setEncoding(self, encoding: str | None) -> None: ... - def getEncoding(self) -> str | None: ... - def setByteStream(self, bytefile: _SupportsReadClose[bytes] | None) -> None: ... - def getByteStream(self) -> _SupportsReadClose[bytes] | None: ... - def setCharacterStream(self, charfile: _SupportsReadClose[str] | None) -> None: ... - def getCharacterStream(self) -> _SupportsReadClose[str] | None: ... - -_AttrKey = TypeVar("_AttrKey", default=str) - -class AttributesImpl(Generic[_AttrKey]): - def __init__(self, attrs: Mapping[_AttrKey, str]) -> None: ... - def getLength(self) -> int: ... - def getType(self, name: str) -> str: ... - def getValue(self, name: _AttrKey) -> str: ... - def getValueByQName(self, name: str) -> str: ... - def getNameByQName(self, name: str) -> _AttrKey: ... - def getQNameByName(self, name: _AttrKey) -> str: ... - def getNames(self) -> list[_AttrKey]: ... - def getQNames(self) -> list[str]: ... - def __len__(self) -> int: ... - def __getitem__(self, name: _AttrKey) -> str: ... - def keys(self) -> list[_AttrKey]: ... - def __contains__(self, name: _AttrKey) -> bool: ... - @overload - def get(self, name: _AttrKey, alternative: None = None) -> str | None: ... - @overload - def get(self, name: _AttrKey, alternative: str) -> str: ... - def copy(self) -> Self: ... - def items(self) -> list[tuple[_AttrKey, str]]: ... - def values(self) -> list[str]: ... - -_NSName: TypeAlias = tuple[str | None, str] - -class AttributesNSImpl(AttributesImpl[_NSName]): - def __init__(self, attrs: Mapping[_NSName, str], qnames: Mapping[_NSName, str]) -> None: ... - def getValue(self, name: _NSName) -> str: ... - def getNameByQName(self, name: str) -> _NSName: ... - def getQNameByName(self, name: _NSName) -> str: ... - def getNames(self) -> list[_NSName]: ... - def __getitem__(self, name: _NSName) -> str: ... - def keys(self) -> list[_NSName]: ... - def __contains__(self, name: _NSName) -> bool: ... - @overload - def get(self, name: _NSName, alternative: None = None) -> str | None: ... - @overload - def get(self, name: _NSName, alternative: str) -> str: ... - def items(self) -> list[tuple[_NSName, str]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xmlrpc/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xmlrpc/__init__.pyi deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xmlrpc/client.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xmlrpc/client.pyi deleted file mode 100644 index 6cc4361f4a..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xmlrpc/client.pyi +++ /dev/null @@ -1,297 +0,0 @@ -import gzip -import http.client -import time -from _typeshed import ReadableBuffer, SizedBuffer, SupportsRead, SupportsWrite -from collections.abc import Callable, Iterable, Mapping -from datetime import datetime -from io import BytesIO -from types import TracebackType -from typing import Any, ClassVar, Final, Literal, Protocol, overload -from typing_extensions import Self, TypeAlias - -class _SupportsTimeTuple(Protocol): - def timetuple(self) -> time.struct_time: ... - -_DateTimeComparable: TypeAlias = DateTime | datetime | str | _SupportsTimeTuple -_Marshallable: TypeAlias = ( - bool - | int - | float - | str - | bytes - | bytearray - | None - | tuple[_Marshallable, ...] - # Ideally we'd use _Marshallable for list and dict, but invariance makes that impractical - | list[Any] - | dict[str, Any] - | datetime - | DateTime - | Binary -) -_XMLDate: TypeAlias = int | datetime | tuple[int, ...] | time.struct_time -_HostType: TypeAlias = tuple[str, dict[str, str]] | str - -def escape(s: str) -> str: ... # undocumented - -MAXINT: Final[int] # undocumented -MININT: Final[int] # undocumented - -PARSE_ERROR: Final[int] # undocumented -SERVER_ERROR: Final[int] # undocumented -APPLICATION_ERROR: Final[int] # undocumented -SYSTEM_ERROR: Final[int] # undocumented -TRANSPORT_ERROR: Final[int] # undocumented - -NOT_WELLFORMED_ERROR: Final[int] # undocumented -UNSUPPORTED_ENCODING: Final[int] # undocumented -INVALID_ENCODING_CHAR: Final[int] # undocumented -INVALID_XMLRPC: Final[int] # undocumented -METHOD_NOT_FOUND: Final[int] # undocumented -INVALID_METHOD_PARAMS: Final[int] # undocumented -INTERNAL_ERROR: Final[int] # undocumented - -class Error(Exception): ... - -class ProtocolError(Error): - url: str - errcode: int - errmsg: str - headers: dict[str, str] - def __init__(self, url: str, errcode: int, errmsg: str, headers: dict[str, str]) -> None: ... - -class ResponseError(Error): ... - -class Fault(Error): - faultCode: int - faultString: str - def __init__(self, faultCode: int, faultString: str, **extra: Any) -> None: ... - -boolean = bool -Boolean = bool - -def _iso8601_format(value: datetime) -> str: ... # undocumented -def _strftime(value: _XMLDate) -> str: ... # undocumented - -class DateTime: - value: str # undocumented - def __init__(self, value: int | str | datetime | time.struct_time | tuple[int, ...] = 0) -> None: ... - __hash__: ClassVar[None] # type: ignore[assignment] - def __lt__(self, other: _DateTimeComparable) -> bool: ... - def __le__(self, other: _DateTimeComparable) -> bool: ... - def __gt__(self, other: _DateTimeComparable) -> bool: ... - def __ge__(self, other: _DateTimeComparable) -> bool: ... - def __eq__(self, other: _DateTimeComparable) -> bool: ... # type: ignore[override] - def make_comparable(self, other: _DateTimeComparable) -> tuple[str, str]: ... # undocumented - def timetuple(self) -> time.struct_time: ... # undocumented - def decode(self, data: Any) -> None: ... - def encode(self, out: SupportsWrite[str]) -> None: ... - -def _datetime(data: Any) -> DateTime: ... # undocumented -def _datetime_type(data: str) -> datetime: ... # undocumented - -class Binary: - data: bytes - def __init__(self, data: bytes | bytearray | None = None) -> None: ... - def decode(self, data: ReadableBuffer) -> None: ... - def encode(self, out: SupportsWrite[str]) -> None: ... - def __eq__(self, other: object) -> bool: ... - __hash__: ClassVar[None] # type: ignore[assignment] - -def _binary(data: ReadableBuffer) -> Binary: ... # undocumented - -WRAPPERS: Final[tuple[type[DateTime], type[Binary]]] # undocumented - -class ExpatParser: # undocumented - def __init__(self, target: Unmarshaller) -> None: ... - def feed(self, data: str | ReadableBuffer) -> None: ... - def close(self) -> None: ... - -_WriteCallback: TypeAlias = Callable[[str], object] - -class Marshaller: - dispatch: dict[type[_Marshallable] | Literal["_arbitrary_instance"], Callable[[Marshaller, Any, _WriteCallback], None]] - memo: dict[Any, None] - data: None - encoding: str | None - allow_none: bool - def __init__(self, encoding: str | None = None, allow_none: bool = False) -> None: ... - def dumps(self, values: Fault | Iterable[_Marshallable]) -> str: ... - def __dump(self, value: _Marshallable, write: _WriteCallback) -> None: ... # undocumented - def dump_nil(self, value: None, write: _WriteCallback) -> None: ... - def dump_bool(self, value: bool, write: _WriteCallback) -> None: ... - def dump_long(self, value: int, write: _WriteCallback) -> None: ... - def dump_int(self, value: int, write: _WriteCallback) -> None: ... - def dump_double(self, value: float, write: _WriteCallback) -> None: ... - def dump_unicode(self, value: str, write: _WriteCallback, escape: Callable[[str], str] = ...) -> None: ... - def dump_bytes(self, value: ReadableBuffer, write: _WriteCallback) -> None: ... - def dump_array(self, value: Iterable[_Marshallable], write: _WriteCallback) -> None: ... - def dump_struct( - self, value: Mapping[str, _Marshallable], write: _WriteCallback, escape: Callable[[str], str] = ... - ) -> None: ... - def dump_datetime(self, value: _XMLDate, write: _WriteCallback) -> None: ... - def dump_instance(self, value: object, write: _WriteCallback) -> None: ... - -class Unmarshaller: - dispatch: dict[str, Callable[[Unmarshaller, str], None]] - - _type: str | None - _stack: list[_Marshallable] - _marks: list[int] - _data: list[str] - _value: bool - _methodname: str | None - _encoding: str - append: Callable[[Any], None] - _use_datetime: bool - _use_builtin_types: bool - def __init__(self, use_datetime: bool = False, use_builtin_types: bool = False) -> None: ... - def close(self) -> tuple[_Marshallable, ...]: ... - def getmethodname(self) -> str | None: ... - def xml(self, encoding: str, standalone: Any) -> None: ... # Standalone is ignored - def start(self, tag: str, attrs: dict[str, str]) -> None: ... - def data(self, text: str) -> None: ... - def end(self, tag: str) -> None: ... - def end_dispatch(self, tag: str, data: str) -> None: ... - def end_nil(self, data: str) -> None: ... - def end_boolean(self, data: str) -> None: ... - def end_int(self, data: str) -> None: ... - def end_double(self, data: str) -> None: ... - def end_bigdecimal(self, data: str) -> None: ... - def end_string(self, data: str) -> None: ... - def end_array(self, data: str) -> None: ... - def end_struct(self, data: str) -> None: ... - def end_base64(self, data: str) -> None: ... - def end_dateTime(self, data: str) -> None: ... - def end_value(self, data: str) -> None: ... - def end_params(self, data: str) -> None: ... - def end_fault(self, data: str) -> None: ... - def end_methodName(self, data: str) -> None: ... - -class _MultiCallMethod: # undocumented - __call_list: list[tuple[str, tuple[_Marshallable, ...]]] - __name: str - def __init__(self, call_list: list[tuple[str, _Marshallable]], name: str) -> None: ... - def __getattr__(self, name: str) -> _MultiCallMethod: ... - def __call__(self, *args: _Marshallable) -> None: ... - -class MultiCallIterator: # undocumented - results: list[list[_Marshallable]] - def __init__(self, results: list[list[_Marshallable]]) -> None: ... - def __getitem__(self, i: int) -> _Marshallable: ... - -class MultiCall: - __server: ServerProxy - __call_list: list[tuple[str, tuple[_Marshallable, ...]]] - def __init__(self, server: ServerProxy) -> None: ... - def __getattr__(self, name: str) -> _MultiCallMethod: ... - def __call__(self) -> MultiCallIterator: ... - -# A little white lie -FastMarshaller: Marshaller | None -FastParser: ExpatParser | None -FastUnmarshaller: Unmarshaller | None - -def getparser(use_datetime: bool = False, use_builtin_types: bool = False) -> tuple[ExpatParser, Unmarshaller]: ... -def dumps( - params: Fault | tuple[_Marshallable, ...], - methodname: str | None = None, - methodresponse: bool | None = None, - encoding: str | None = None, - allow_none: bool = False, -) -> str: ... -def loads( - data: str | ReadableBuffer, use_datetime: bool = False, use_builtin_types: bool = False -) -> tuple[tuple[_Marshallable, ...], str | None]: ... -def gzip_encode(data: ReadableBuffer) -> bytes: ... # undocumented -def gzip_decode(data: ReadableBuffer, max_decode: int = 20971520) -> bytes: ... # undocumented - -class GzipDecodedResponse(gzip.GzipFile): # undocumented - io: BytesIO - def __init__(self, response: SupportsRead[ReadableBuffer]) -> None: ... - -class _Method: # undocumented - __send: Callable[[str, tuple[_Marshallable, ...]], _Marshallable] - __name: str - def __init__(self, send: Callable[[str, tuple[_Marshallable, ...]], _Marshallable], name: str) -> None: ... - def __getattr__(self, name: str) -> _Method: ... - def __call__(self, *args: _Marshallable) -> _Marshallable: ... - -class Transport: - user_agent: str - accept_gzip_encoding: bool - encode_threshold: int | None - - _use_datetime: bool - _use_builtin_types: bool - _connection: tuple[_HostType | None, http.client.HTTPConnection | None] - _headers: list[tuple[str, str]] - _extra_headers: list[tuple[str, str]] - - def __init__( - self, use_datetime: bool = False, use_builtin_types: bool = False, *, headers: Iterable[tuple[str, str]] = () - ) -> None: ... - def request( - self, host: _HostType, handler: str, request_body: SizedBuffer, verbose: bool = False - ) -> tuple[_Marshallable, ...]: ... - def single_request( - self, host: _HostType, handler: str, request_body: SizedBuffer, verbose: bool = False - ) -> tuple[_Marshallable, ...]: ... - def getparser(self) -> tuple[ExpatParser, Unmarshaller]: ... - def get_host_info(self, host: _HostType) -> tuple[str, list[tuple[str, str]], dict[str, str]]: ... - def make_connection(self, host: _HostType) -> http.client.HTTPConnection: ... - def close(self) -> None: ... - def send_request( - self, host: _HostType, handler: str, request_body: SizedBuffer, debug: bool - ) -> http.client.HTTPConnection: ... - def send_headers(self, connection: http.client.HTTPConnection, headers: list[tuple[str, str]]) -> None: ... - def send_content(self, connection: http.client.HTTPConnection, request_body: SizedBuffer) -> None: ... - def parse_response(self, response: http.client.HTTPResponse) -> tuple[_Marshallable, ...]: ... - -class SafeTransport(Transport): - def __init__( - self, - use_datetime: bool = False, - use_builtin_types: bool = False, - *, - headers: Iterable[tuple[str, str]] = (), - context: Any | None = None, - ) -> None: ... - def make_connection(self, host: _HostType) -> http.client.HTTPSConnection: ... - -class ServerProxy: - __host: str - __handler: str - __transport: Transport - __encoding: str - __verbose: bool - __allow_none: bool - - def __init__( - self, - uri: str, - transport: Transport | None = None, - encoding: str | None = None, - verbose: bool = False, - allow_none: bool = False, - use_datetime: bool = False, - use_builtin_types: bool = False, - *, - headers: Iterable[tuple[str, str]] = (), - context: Any | None = None, - ) -> None: ... - def __getattr__(self, name: str) -> _Method: ... - @overload - def __call__(self, attr: Literal["close"]) -> Callable[[], None]: ... - @overload - def __call__(self, attr: Literal["transport"]) -> Transport: ... - @overload - def __call__(self, attr: str) -> Callable[[], None] | Transport: ... - def __enter__(self) -> Self: ... - def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None - ) -> None: ... - def __close(self) -> None: ... # undocumented - def __request(self, methodname: str, params: tuple[_Marshallable, ...]) -> tuple[_Marshallable, ...]: ... # undocumented - -Server = ServerProxy diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xmlrpc/server.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xmlrpc/server.pyi deleted file mode 100644 index 5f497aa719..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xmlrpc/server.pyi +++ /dev/null @@ -1,144 +0,0 @@ -import http.server -import pydoc -import socketserver -from _typeshed import ReadableBuffer -from collections.abc import Callable, Iterable, Mapping -from re import Pattern -from typing import Any, ClassVar, Protocol -from typing_extensions import TypeAlias -from xmlrpc.client import Fault, _Marshallable - -# The dispatch accepts anywhere from 0 to N arguments, no easy way to allow this in mypy -class _DispatchArity0(Protocol): - def __call__(self) -> _Marshallable: ... - -class _DispatchArity1(Protocol): - def __call__(self, arg1: _Marshallable, /) -> _Marshallable: ... - -class _DispatchArity2(Protocol): - def __call__(self, arg1: _Marshallable, arg2: _Marshallable, /) -> _Marshallable: ... - -class _DispatchArity3(Protocol): - def __call__(self, arg1: _Marshallable, arg2: _Marshallable, arg3: _Marshallable, /) -> _Marshallable: ... - -class _DispatchArity4(Protocol): - def __call__( - self, arg1: _Marshallable, arg2: _Marshallable, arg3: _Marshallable, arg4: _Marshallable, / - ) -> _Marshallable: ... - -class _DispatchArityN(Protocol): - def __call__(self, *args: _Marshallable) -> _Marshallable: ... - -_DispatchProtocol: TypeAlias = ( - _DispatchArity0 | _DispatchArity1 | _DispatchArity2 | _DispatchArity3 | _DispatchArity4 | _DispatchArityN -) - -def resolve_dotted_attribute(obj: Any, attr: str, allow_dotted_names: bool = True) -> Any: ... # undocumented -def list_public_methods(obj: Any) -> list[str]: ... # undocumented - -class SimpleXMLRPCDispatcher: # undocumented - funcs: dict[str, _DispatchProtocol] - instance: Any | None - allow_none: bool - encoding: str - use_builtin_types: bool - def __init__(self, allow_none: bool = False, encoding: str | None = None, use_builtin_types: bool = False) -> None: ... - def register_instance(self, instance: Any, allow_dotted_names: bool = False) -> None: ... - def register_function(self, function: _DispatchProtocol | None = None, name: str | None = None) -> Callable[..., Any]: ... - def register_introspection_functions(self) -> None: ... - def register_multicall_functions(self) -> None: ... - def _marshaled_dispatch( - self, - data: str | ReadableBuffer, - dispatch_method: Callable[[str, tuple[_Marshallable, ...]], Fault | tuple[_Marshallable, ...]] | None = None, - path: Any | None = None, - ) -> str: ... # undocumented - def system_listMethods(self) -> list[str]: ... # undocumented - def system_methodSignature(self, method_name: str) -> str: ... # undocumented - def system_methodHelp(self, method_name: str) -> str: ... # undocumented - def system_multicall(self, call_list: list[dict[str, _Marshallable]]) -> list[_Marshallable]: ... # undocumented - def _dispatch(self, method: str, params: Iterable[_Marshallable]) -> _Marshallable: ... # undocumented - -class SimpleXMLRPCRequestHandler(http.server.BaseHTTPRequestHandler): - rpc_paths: ClassVar[tuple[str, ...]] - encode_threshold: int # undocumented - aepattern: Pattern[str] # undocumented - def accept_encodings(self) -> dict[str, float]: ... - def is_rpc_path_valid(self) -> bool: ... - def do_POST(self) -> None: ... - def decode_request_content(self, data: bytes) -> bytes | None: ... - def report_404(self) -> None: ... - -class SimpleXMLRPCServer(socketserver.TCPServer, SimpleXMLRPCDispatcher): - _send_traceback_handler: bool - def __init__( - self, - addr: tuple[str, int], - requestHandler: type[SimpleXMLRPCRequestHandler] = ..., - logRequests: bool = True, - allow_none: bool = False, - encoding: str | None = None, - bind_and_activate: bool = True, - use_builtin_types: bool = False, - ) -> None: ... - -class MultiPathXMLRPCServer(SimpleXMLRPCServer): # undocumented - dispatchers: dict[str, SimpleXMLRPCDispatcher] - def __init__( - self, - addr: tuple[str, int], - requestHandler: type[SimpleXMLRPCRequestHandler] = ..., - logRequests: bool = True, - allow_none: bool = False, - encoding: str | None = None, - bind_and_activate: bool = True, - use_builtin_types: bool = False, - ) -> None: ... - def add_dispatcher(self, path: str, dispatcher: SimpleXMLRPCDispatcher) -> SimpleXMLRPCDispatcher: ... - def get_dispatcher(self, path: str) -> SimpleXMLRPCDispatcher: ... - -class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher): - def __init__(self, allow_none: bool = False, encoding: str | None = None, use_builtin_types: bool = False) -> None: ... - def handle_xmlrpc(self, request_text: str) -> None: ... - def handle_get(self) -> None: ... - def handle_request(self, request_text: str | None = None) -> None: ... - -class ServerHTMLDoc(pydoc.HTMLDoc): # undocumented - def docroutine( # type: ignore[override] - self, - object: object, - name: str, - mod: str | None = None, - funcs: Mapping[str, str] = {}, - classes: Mapping[str, str] = {}, - methods: Mapping[str, str] = {}, - cl: type | None = None, - ) -> str: ... - def docserver(self, server_name: str, package_documentation: str, methods: dict[str, str]) -> str: ... - -class XMLRPCDocGenerator: # undocumented - server_name: str - server_documentation: str - server_title: str - def set_server_title(self, server_title: str) -> None: ... - def set_server_name(self, server_name: str) -> None: ... - def set_server_documentation(self, server_documentation: str) -> None: ... - def generate_html_documentation(self) -> str: ... - -class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): - def do_GET(self) -> None: ... - -class DocXMLRPCServer(SimpleXMLRPCServer, XMLRPCDocGenerator): - def __init__( - self, - addr: tuple[str, int], - requestHandler: type[SimpleXMLRPCRequestHandler] = ..., - logRequests: bool = True, - allow_none: bool = False, - encoding: str | None = None, - bind_and_activate: bool = True, - use_builtin_types: bool = False, - ) -> None: ... - -class DocCGIXMLRPCRequestHandler(CGIXMLRPCRequestHandler, XMLRPCDocGenerator): - def __init__(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/xxlimited.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/xxlimited.pyi deleted file mode 100644 index 78a50b85f4..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/xxlimited.pyi +++ /dev/null @@ -1,24 +0,0 @@ -import sys -from typing import Any, ClassVar, final - -class Str(str): ... - -@final -class Xxo: - def demo(self) -> None: ... - if sys.version_info >= (3, 11) and sys.platform != "win32": - x_exports: int - -def foo(i: int, j: int, /) -> Any: ... -def new() -> Xxo: ... - -if sys.version_info >= (3, 10): - class Error(Exception): ... - -else: - class error(Exception): ... - - class Null: - __hash__: ClassVar[None] # type: ignore[assignment] - - def roj(b: Any, /) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/zipapp.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/zipapp.pyi deleted file mode 100644 index c7cf1704b1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/zipapp.pyi +++ /dev/null @@ -1,20 +0,0 @@ -from collections.abc import Callable -from pathlib import Path -from typing import BinaryIO -from typing_extensions import TypeAlias - -__all__ = ["ZipAppError", "create_archive", "get_interpreter"] - -_Path: TypeAlias = str | Path | BinaryIO - -class ZipAppError(ValueError): ... - -def create_archive( - source: _Path, - target: _Path | None = None, - interpreter: str | None = None, - main: str | None = None, - filter: Callable[[Path], bool] | None = None, - compressed: bool = False, -) -> None: ... -def get_interpreter(archive: _Path) -> str: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/zipfile/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/zipfile/__init__.pyi deleted file mode 100644 index ede732c0f8..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/zipfile/__init__.pyi +++ /dev/null @@ -1,370 +0,0 @@ -import io -import sys -from _typeshed import SizedBuffer, StrOrBytesPath, StrPath -from collections.abc import Callable, Iterable, Iterator -from io import TextIOWrapper -from os import PathLike -from types import TracebackType -from typing import IO, Final, Literal, Protocol, overload -from typing_extensions import Self, TypeAlias - -__all__ = [ - "BadZipFile", - "BadZipfile", - "Path", - "error", - "ZIP_STORED", - "ZIP_DEFLATED", - "ZIP_BZIP2", - "ZIP_LZMA", - "is_zipfile", - "ZipInfo", - "ZipFile", - "PyZipFile", - "LargeZipFile", -] - -# TODO: use TypeAlias for these two when mypy bugs are fixed -# https://github.com/python/mypy/issues/16581 -_DateTuple = tuple[int, int, int, int, int, int] # noqa: Y026 -_ZipFileMode = Literal["r", "w", "x", "a"] # noqa: Y026 - -_ReadWriteMode: TypeAlias = Literal["r", "w"] - -class BadZipFile(Exception): ... - -BadZipfile = BadZipFile -error = BadZipfile - -class LargeZipFile(Exception): ... - -class _ZipStream(Protocol): - def read(self, n: int, /) -> bytes: ... - # The following methods are optional: - # def seekable(self) -> bool: ... - # def tell(self) -> int: ... - # def seek(self, n: int, /) -> object: ... - -# Stream shape as required by _EndRecData() and _EndRecData64(). -class _SupportsReadSeekTell(Protocol): - def read(self, n: int = ..., /) -> bytes: ... - def seek(self, cookie: int, whence: int, /) -> object: ... - def tell(self) -> int: ... - -class _ClosableZipStream(_ZipStream, Protocol): - def close(self) -> object: ... - -class ZipExtFile(io.BufferedIOBase): - MAX_N: int - MIN_READ_SIZE: int - MAX_SEEK_READ: int - newlines: list[bytes] | None - mode: _ReadWriteMode - name: str - @overload - def __init__( - self, fileobj: _ClosableZipStream, mode: _ReadWriteMode, zipinfo: ZipInfo, pwd: bytes | None, close_fileobj: Literal[True] - ) -> None: ... - @overload - def __init__( - self, - fileobj: _ClosableZipStream, - mode: _ReadWriteMode, - zipinfo: ZipInfo, - pwd: bytes | None = None, - *, - close_fileobj: Literal[True], - ) -> None: ... - @overload - def __init__( - self, - fileobj: _ZipStream, - mode: _ReadWriteMode, - zipinfo: ZipInfo, - pwd: bytes | None = None, - close_fileobj: Literal[False] = False, - ) -> None: ... - def read(self, n: int | None = -1) -> bytes: ... - def readline(self, limit: int = -1) -> bytes: ... # type: ignore[override] - def peek(self, n: int = 1) -> bytes: ... - def read1(self, n: int | None) -> bytes: ... # type: ignore[override] - def seek(self, offset: int, whence: int = 0) -> int: ... - -class _Writer(Protocol): - def write(self, s: str, /) -> object: ... - -class _ZipReadable(Protocol): - def seek(self, offset: int, whence: int = 0, /) -> int: ... - def read(self, n: int = -1, /) -> bytes: ... - -class _ZipTellable(Protocol): - def tell(self) -> int: ... - -class _ZipReadableTellable(_ZipReadable, _ZipTellable, Protocol): ... - -class _ZipWritable(Protocol): - def flush(self) -> None: ... - def close(self) -> None: ... - def write(self, b: bytes, /) -> int: ... - -class ZipFile: - filename: str | None - debug: int - comment: bytes - filelist: list[ZipInfo] - fp: IO[bytes] | None - NameToInfo: dict[str, ZipInfo] - start_dir: int # undocumented - compression: int # undocumented - compresslevel: int | None # undocumented - mode: _ZipFileMode # undocumented - pwd: bytes | None # undocumented - # metadata_encoding is new in 3.11 - if sys.version_info >= (3, 11): - @overload - def __init__( - self, - file: StrPath | IO[bytes], - mode: _ZipFileMode = "r", - compression: int = 0, - allowZip64: bool = True, - compresslevel: int | None = None, - *, - strict_timestamps: bool = True, - metadata_encoding: str | None = None, - ) -> None: ... - # metadata_encoding is only allowed for read mode - @overload - def __init__( - self, - file: StrPath | _ZipReadable, - mode: Literal["r"] = "r", - compression: int = 0, - allowZip64: bool = True, - compresslevel: int | None = None, - *, - strict_timestamps: bool = True, - metadata_encoding: str | None = None, - ) -> None: ... - @overload - def __init__( - self, - file: StrPath | _ZipWritable, - mode: Literal["w", "x"] = ..., - compression: int = 0, - allowZip64: bool = True, - compresslevel: int | None = None, - *, - strict_timestamps: bool = True, - metadata_encoding: None = None, - ) -> None: ... - @overload - def __init__( - self, - file: StrPath | _ZipReadableTellable, - mode: Literal["a"] = ..., - compression: int = 0, - allowZip64: bool = True, - compresslevel: int | None = None, - *, - strict_timestamps: bool = True, - metadata_encoding: None = None, - ) -> None: ... - else: - @overload - def __init__( - self, - file: StrPath | IO[bytes], - mode: _ZipFileMode = "r", - compression: int = 0, - allowZip64: bool = True, - compresslevel: int | None = None, - *, - strict_timestamps: bool = True, - ) -> None: ... - @overload - def __init__( - self, - file: StrPath | _ZipReadable, - mode: Literal["r"] = "r", - compression: int = 0, - allowZip64: bool = True, - compresslevel: int | None = None, - *, - strict_timestamps: bool = True, - ) -> None: ... - @overload - def __init__( - self, - file: StrPath | _ZipWritable, - mode: Literal["w", "x"] = ..., - compression: int = 0, - allowZip64: bool = True, - compresslevel: int | None = None, - *, - strict_timestamps: bool = True, - ) -> None: ... - @overload - def __init__( - self, - file: StrPath | _ZipReadableTellable, - mode: Literal["a"] = ..., - compression: int = 0, - allowZip64: bool = True, - compresslevel: int | None = None, - *, - strict_timestamps: bool = True, - ) -> None: ... - - def __enter__(self) -> Self: ... - def __exit__( - self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None - ) -> None: ... - def close(self) -> None: ... - def getinfo(self, name: str) -> ZipInfo: ... - def infolist(self) -> list[ZipInfo]: ... - def namelist(self) -> list[str]: ... - def open( - self, name: str | ZipInfo, mode: _ReadWriteMode = "r", pwd: bytes | None = None, *, force_zip64: bool = False - ) -> IO[bytes]: ... - def extract(self, member: str | ZipInfo, path: StrPath | None = None, pwd: bytes | None = None) -> str: ... - def extractall( - self, path: StrPath | None = None, members: Iterable[str | ZipInfo] | None = None, pwd: bytes | None = None - ) -> None: ... - def printdir(self, file: _Writer | None = None) -> None: ... - def setpassword(self, pwd: bytes) -> None: ... - def read(self, name: str | ZipInfo, pwd: bytes | None = None) -> bytes: ... - def testzip(self) -> str | None: ... - def write( - self, - filename: StrPath, - arcname: StrPath | None = None, - compress_type: int | None = None, - compresslevel: int | None = None, - ) -> None: ... - def writestr( - self, - zinfo_or_arcname: str | ZipInfo, - data: SizedBuffer | str, - compress_type: int | None = None, - compresslevel: int | None = None, - ) -> None: ... - if sys.version_info >= (3, 11): - def mkdir(self, zinfo_or_directory_name: str | ZipInfo, mode: int = 0o777) -> None: ... - - def __del__(self) -> None: ... - -class PyZipFile(ZipFile): - def __init__( - self, file: str | IO[bytes], mode: _ZipFileMode = "r", compression: int = 0, allowZip64: bool = True, optimize: int = -1 - ) -> None: ... - def writepy(self, pathname: str, basename: str = "", filterfunc: Callable[[str], bool] | None = None) -> None: ... - -class ZipInfo: - filename: str - date_time: _DateTuple - compress_type: int - comment: bytes - extra: bytes - create_system: int - create_version: int - extract_version: int - reserved: int - flag_bits: int - volume: int - internal_attr: int - external_attr: int - header_offset: int - CRC: int - compress_size: int - file_size: int - orig_filename: str # undocumented - if sys.version_info >= (3, 13): - compress_level: int | None - - def __init__(self, filename: str = "NoName", date_time: _DateTuple = (1980, 1, 1, 0, 0, 0)) -> None: ... - @classmethod - def from_file(cls, filename: StrPath, arcname: StrPath | None = None, *, strict_timestamps: bool = True) -> Self: ... - def is_dir(self) -> bool: ... - def FileHeader(self, zip64: bool | None = None) -> bytes: ... - -if sys.version_info >= (3, 12): - from zipfile._path import CompleteDirs as CompleteDirs, Path as Path - -else: - class CompleteDirs(ZipFile): - def resolve_dir(self, name: str) -> str: ... - @overload - @classmethod - def make(cls, source: ZipFile) -> CompleteDirs: ... - @overload - @classmethod - def make(cls, source: StrPath | IO[bytes]) -> Self: ... - - class Path: - root: CompleteDirs - at: str - def __init__(self, root: ZipFile | StrPath | IO[bytes], at: str = "") -> None: ... - @property - def name(self) -> str: ... - @property - def parent(self) -> PathLike[str]: ... # undocumented - if sys.version_info >= (3, 10): - @property - def filename(self) -> PathLike[str]: ... # undocumented - if sys.version_info >= (3, 11): - @property - def suffix(self) -> str: ... - @property - def suffixes(self) -> list[str]: ... - @property - def stem(self) -> str: ... - - @overload - def open( - self, - mode: Literal["r", "w"] = "r", - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - line_buffering: bool = ..., - write_through: bool = ..., - *, - pwd: bytes | None = None, - ) -> TextIOWrapper: ... - @overload - def open(self, mode: Literal["rb", "wb"], *, pwd: bytes | None = None) -> IO[bytes]: ... - - if sys.version_info >= (3, 10): - def iterdir(self) -> Iterator[Self]: ... - else: - def iterdir(self) -> Iterator[Path]: ... - - def is_dir(self) -> bool: ... - def is_file(self) -> bool: ... - def exists(self) -> bool: ... - def read_text( - self, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., - line_buffering: bool = ..., - write_through: bool = ..., - ) -> str: ... - def read_bytes(self) -> bytes: ... - if sys.version_info >= (3, 10): - def joinpath(self, *other: StrPath) -> Path: ... - else: - def joinpath(self, add: StrPath) -> Path: ... # undocumented - - def __truediv__(self, add: StrPath) -> Path: ... - -def is_zipfile(filename: StrOrBytesPath | _SupportsReadSeekTell) -> bool: ... - -ZIP_STORED: Final[int] -ZIP_DEFLATED: Final[int] -ZIP64_LIMIT: Final[int] -ZIP_FILECOUNT_LIMIT: Final[int] -ZIP_MAX_COMMENT: Final[int] -ZIP_BZIP2: Final[int] -ZIP_LZMA: Final[int] diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/zipfile/_path/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/zipfile/_path/__init__.pyi deleted file mode 100644 index 4c7b39ec4c..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/zipfile/_path/__init__.pyi +++ /dev/null @@ -1,83 +0,0 @@ -import sys -from _typeshed import StrPath -from collections.abc import Iterator, Sequence -from io import TextIOWrapper -from os import PathLike -from typing import IO, Literal, TypeVar, overload -from typing_extensions import Self -from zipfile import ZipFile - -_ZF = TypeVar("_ZF", bound=ZipFile) - -if sys.version_info >= (3, 12): - __all__ = ["Path"] - - class InitializedState: - def __init__(self, *args: object, **kwargs: object) -> None: ... - def __getstate__(self) -> tuple[list[object], dict[object, object]]: ... - def __setstate__(self, state: Sequence[tuple[list[object], dict[object, object]]]) -> None: ... - - class CompleteDirs(InitializedState, ZipFile): - def resolve_dir(self, name: str) -> str: ... - @overload - @classmethod - def make(cls, source: ZipFile) -> CompleteDirs: ... - @overload - @classmethod - def make(cls, source: StrPath | IO[bytes]) -> Self: ... - if sys.version_info >= (3, 13): - @classmethod - def inject(cls, zf: _ZF) -> _ZF: ... - - class Path: - root: CompleteDirs - at: str - def __init__(self, root: ZipFile | StrPath | IO[bytes], at: str = "") -> None: ... - @property - def name(self) -> str: ... - @property - def parent(self) -> PathLike[str]: ... # undocumented - @property - def filename(self) -> PathLike[str]: ... # undocumented - @property - def suffix(self) -> str: ... - @property - def suffixes(self) -> list[str]: ... - @property - def stem(self) -> str: ... - @overload - def open( - self, - mode: Literal["r", "w"] = "r", - encoding: str | None = None, - errors: str | None = None, - newline: str | None = None, - line_buffering: bool = ..., - write_through: bool = ..., - *, - pwd: bytes | None = None, - ) -> TextIOWrapper: ... - @overload - def open(self, mode: Literal["rb", "wb"], *, pwd: bytes | None = None) -> IO[bytes]: ... - def iterdir(self) -> Iterator[Self]: ... - def is_dir(self) -> bool: ... - def is_file(self) -> bool: ... - def exists(self) -> bool: ... - def read_text( - self, - encoding: str | None = ..., - errors: str | None = ..., - newline: str | None = ..., - line_buffering: bool = ..., - write_through: bool = ..., - ) -> str: ... - def read_bytes(self) -> bytes: ... - def joinpath(self, *other: StrPath) -> Path: ... - def glob(self, pattern: str) -> Iterator[Self]: ... - def rglob(self, pattern: str) -> Iterator[Self]: ... - def is_symlink(self) -> Literal[False]: ... - def relative_to(self, other: Path, *extra: StrPath) -> str: ... - def match(self, path_pattern: str) -> bool: ... - def __eq__(self, other: object) -> bool: ... - def __hash__(self) -> int: ... - def __truediv__(self, add: StrPath) -> Path: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/zipfile/_path/glob.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/zipfile/_path/glob.pyi deleted file mode 100644 index f25ae71725..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/zipfile/_path/glob.pyi +++ /dev/null @@ -1,22 +0,0 @@ -import sys -from collections.abc import Iterator -from re import Match - -if sys.version_info >= (3, 13): - class Translator: - def __init__(self, seps: str = ...) -> None: ... - def translate(self, pattern: str) -> str: ... - def extend(self, pattern: str) -> str: ... - def match_dirs(self, pattern: str) -> str: ... - def translate_core(self, pattern: str) -> str: ... - def replace(self, match: Match[str]) -> str: ... - def restrict_rglob(self, pattern: str) -> None: ... - def star_not_empty(self, pattern: str) -> str: ... - -else: - def translate(pattern: str) -> str: ... - def match_dirs(pattern: str) -> str: ... - def translate_core(pattern: str) -> str: ... - def replace(match: Match[str]) -> str: ... - -def separate(pattern: str) -> Iterator[Match[str]]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/zipimport.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/zipimport.pyi deleted file mode 100644 index 3e94c681b7..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/zipimport.pyi +++ /dev/null @@ -1,41 +0,0 @@ -import sys -from _typeshed import StrOrBytesPath -from importlib.abc import ResourceReader -from importlib.machinery import ModuleSpec -from types import CodeType, ModuleType -from typing_extensions import deprecated - -if sys.version_info >= (3, 10): - from _frozen_importlib_external import _LoaderBasics -else: - _LoaderBasics = object - -__all__ = ["ZipImportError", "zipimporter"] - -class ZipImportError(ImportError): ... - -class zipimporter(_LoaderBasics): - archive: str - prefix: str - if sys.version_info >= (3, 11): - def __init__(self, path: str) -> None: ... - else: - def __init__(self, path: StrOrBytesPath) -> None: ... - - if sys.version_info < (3, 12): - def find_loader(self, fullname: str, path: str | None = None) -> tuple[zipimporter | None, list[str]]: ... # undocumented - def find_module(self, fullname: str, path: str | None = None) -> zipimporter | None: ... - - def get_code(self, fullname: str) -> CodeType: ... - def get_data(self, pathname: str) -> bytes: ... - def get_filename(self, fullname: str) -> str: ... - def get_resource_reader(self, fullname: str) -> ResourceReader | None: ... # undocumented - def get_source(self, fullname: str) -> str | None: ... - def is_package(self, fullname: str) -> bool: ... - @deprecated("Deprecated since 3.10; use exec_module() instead") - def load_module(self, fullname: str) -> ModuleType: ... - if sys.version_info >= (3, 10): - def exec_module(self, module: ModuleType) -> None: ... - def create_module(self, spec: ModuleSpec) -> None: ... - def find_spec(self, fullname: str, target: ModuleType | None = None) -> ModuleSpec | None: ... - def invalidate_caches(self) -> None: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/zlib.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/zlib.pyi deleted file mode 100644 index 7cafb44b34..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/zlib.pyi +++ /dev/null @@ -1,70 +0,0 @@ -import sys -from _typeshed import ReadableBuffer -from typing import Any, Final, final, type_check_only -from typing_extensions import Self - -DEFLATED: Final = 8 -DEF_MEM_LEVEL: int # can change -DEF_BUF_SIZE: Final = 16384 -MAX_WBITS: int -ZLIB_VERSION: str # can change -ZLIB_RUNTIME_VERSION: str # can change -Z_NO_COMPRESSION: Final = 0 -Z_PARTIAL_FLUSH: Final = 1 -Z_BEST_COMPRESSION: Final = 9 -Z_BEST_SPEED: Final = 1 -Z_BLOCK: Final = 5 -Z_DEFAULT_COMPRESSION: Final = -1 -Z_DEFAULT_STRATEGY: Final = 0 -Z_FILTERED: Final = 1 -Z_FINISH: Final = 4 -Z_FIXED: Final = 4 -Z_FULL_FLUSH: Final = 3 -Z_HUFFMAN_ONLY: Final = 2 -Z_NO_FLUSH: Final = 0 -Z_RLE: Final = 3 -Z_SYNC_FLUSH: Final = 2 -Z_TREES: Final = 6 - -class error(Exception): ... - -# This class is not exposed at runtime. It calls itself zlib.Compress. -@final -@type_check_only -class _Compress: - def __copy__(self) -> Self: ... - def __deepcopy__(self, memo: Any, /) -> Self: ... - def compress(self, data: ReadableBuffer, /) -> bytes: ... - def flush(self, mode: int = 4, /) -> bytes: ... - def copy(self) -> _Compress: ... - -# This class is not exposed at runtime. It calls itself zlib.Decompress. -@final -@type_check_only -class _Decompress: - @property - def unused_data(self) -> bytes: ... - @property - def unconsumed_tail(self) -> bytes: ... - @property - def eof(self) -> bool: ... - def __copy__(self) -> Self: ... - def __deepcopy__(self, memo: Any, /) -> Self: ... - def decompress(self, data: ReadableBuffer, /, max_length: int = 0) -> bytes: ... - def flush(self, length: int = 16384, /) -> bytes: ... - def copy(self) -> _Decompress: ... - -def adler32(data: ReadableBuffer, value: int = 1, /) -> int: ... - -if sys.version_info >= (3, 11): - def compress(data: ReadableBuffer, /, level: int = -1, wbits: int = 15) -> bytes: ... - -else: - def compress(data: ReadableBuffer, /, level: int = -1) -> bytes: ... - -def compressobj( - level: int = -1, method: int = 8, wbits: int = 15, memLevel: int = 8, strategy: int = 0, zdict: ReadableBuffer | None = None -) -> _Compress: ... -def crc32(data: ReadableBuffer, value: int = 0, /) -> int: ... -def decompress(data: ReadableBuffer, /, wbits: int = 15, bufsize: int = 16384) -> bytes: ... -def decompressobj(wbits: int = 15, zdict: ReadableBuffer = b"") -> _Decompress: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/zoneinfo/__init__.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/zoneinfo/__init__.pyi deleted file mode 100644 index 35381758a1..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/zoneinfo/__init__.pyi +++ /dev/null @@ -1,28 +0,0 @@ -from collections.abc import Iterable -from datetime import datetime, timedelta, tzinfo -from typing_extensions import Self -from zoneinfo._common import ZoneInfoNotFoundError as ZoneInfoNotFoundError, _IOBytes -from zoneinfo._tzpath import ( - TZPATH as TZPATH, - InvalidTZPathWarning as InvalidTZPathWarning, - available_timezones as available_timezones, - reset_tzpath as reset_tzpath, -) - -__all__ = ["ZoneInfo", "reset_tzpath", "available_timezones", "TZPATH", "ZoneInfoNotFoundError", "InvalidTZPathWarning"] - -class ZoneInfo(tzinfo): - @property - def key(self) -> str: ... - def __new__(cls, key: str) -> Self: ... - @classmethod - def no_cache(cls, key: str) -> Self: ... - @classmethod - def from_file(cls, fobj: _IOBytes, /, key: str | None = None) -> Self: ... - @classmethod - def clear_cache(cls, *, only_keys: Iterable[str] | None = None) -> None: ... - def tzname(self, dt: datetime | None, /) -> str | None: ... - def utcoffset(self, dt: datetime | None, /) -> timedelta | None: ... - def dst(self, dt: datetime | None, /) -> timedelta | None: ... - -def __dir__() -> list[str]: ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/zoneinfo/_common.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/zoneinfo/_common.pyi deleted file mode 100644 index a2f29f2d14..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/zoneinfo/_common.pyi +++ /dev/null @@ -1,13 +0,0 @@ -import io -from typing import Any, Protocol - -class _IOBytes(Protocol): - def read(self, size: int, /) -> bytes: ... - def seek(self, size: int, whence: int = ..., /) -> Any: ... - -def load_tzdata(key: str) -> io.BufferedReader: ... -def load_data( - fobj: _IOBytes, -) -> tuple[tuple[int, ...], tuple[int, ...], tuple[int, ...], tuple[int, ...], tuple[str, ...], bytes | None]: ... - -class ZoneInfoNotFoundError(KeyError): ... diff --git a/crates/red_knot_vendored/vendor/typeshed/stdlib/zoneinfo/_tzpath.pyi b/crates/red_knot_vendored/vendor/typeshed/stdlib/zoneinfo/_tzpath.pyi deleted file mode 100644 index 0ef78d03e5..0000000000 --- a/crates/red_knot_vendored/vendor/typeshed/stdlib/zoneinfo/_tzpath.pyi +++ /dev/null @@ -1,13 +0,0 @@ -from _typeshed import StrPath -from collections.abc import Sequence - -# Note: Both here and in clear_cache, the types allow the use of `str` where -# a sequence of strings is required. This should be remedied if a solution -# to this typing bug is found: https://github.com/python/typing/issues/256 -def reset_tzpath(to: Sequence[StrPath] | None = None) -> None: ... -def find_tzfile(key: str) -> str | None: ... -def available_timezones() -> set[str]: ... - -TZPATH: tuple[str, ...] - -class InvalidTZPathWarning(RuntimeWarning): ...