-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated typeshed stubs to the latest version.
- Loading branch information
Showing
135 changed files
with
1,702 additions
and
811 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
b0d57cc03c83e6e75a7b9cf13fb89b06c5fa039f | ||
af4df4eb24f1cda42033f74440ba1117ce4c8f7e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
packages/pyright-internal/typeshed-fallback/stdlib/_blake2.pyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
import sys | ||
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 | ||
if sys.version_info >= (3, 9): | ||
def __init__( | ||
self, | ||
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, | ||
) -> None: ... | ||
else: | ||
def __init__( | ||
self, | ||
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, | ||
) -> None: ... | ||
|
||
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 | ||
if sys.version_info >= (3, 9): | ||
def __init__( | ||
self, | ||
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, | ||
) -> None: ... | ||
else: | ||
def __init__( | ||
self, | ||
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, | ||
) -> None: ... | ||
|
||
def copy(self) -> Self: ... | ||
def digest(self) -> bytes: ... | ||
def hexdigest(self) -> str: ... | ||
def update(self, data: ReadableBuffer, /) -> None: ... |
18 changes: 18 additions & 0 deletions
18
packages/pyright-internal/typeshed-fallback/stdlib/_bz2.pyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from _typeshed import ReadableBuffer | ||
from typing import final | ||
|
||
@final | ||
class BZ2Compressor: | ||
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: ... |
61 changes: 61 additions & 0 deletions
61
packages/pyright-internal/typeshed-fallback/stdlib/_contextvars.pyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import sys | ||
from collections.abc import Callable, Iterator, Mapping | ||
from typing import Any, ClassVar, Generic, TypeVar, final, overload | ||
from typing_extensions import ParamSpec | ||
|
||
if sys.version_info >= (3, 9): | ||
from types import GenericAlias | ||
|
||
_T = TypeVar("_T") | ||
_D = TypeVar("_D") | ||
_P = ParamSpec("_P") | ||
|
||
@final | ||
class ContextVar(Generic[_T]): | ||
@overload | ||
def __init__(self, name: str) -> None: ... | ||
@overload | ||
def __init__(self, name: str, *, default: _T) -> None: ... | ||
def __hash__(self) -> int: ... | ||
@property | ||
def name(self) -> str: ... | ||
@overload | ||
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: ... | ||
if sys.version_info >= (3, 9): | ||
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] | ||
if sys.version_info >= (3, 9): | ||
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: ... | ||
def __getitem__(self, key: ContextVar[_T], /) -> _T: ... | ||
def __iter__(self) -> Iterator[ContextVar[Any]]: ... | ||
def __len__(self) -> int: ... | ||
def __eq__(self, value: object, /) -> bool: ... |
43 changes: 43 additions & 0 deletions
43
packages/pyright-internal/typeshed-fallback/stdlib/_dbm.pyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
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 | ||
|
||
class error(OSError): ... | ||
library: str | ||
|
||
# Actual typename dbm, not exposed by the implementation | ||
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 __del__(self) -> None: ... | ||
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, /) -> _dbm: ... | ||
else: | ||
def open(filename: str, flags: str = "r", mode: int = 0o666, /) -> _dbm: ... |
Oops, something went wrong.