mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Improve __reduce__ signature accross stdlib (#7182)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from typing import Any, Generic, Iterable, TypeVar
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
_S = TypeVar("_S")
|
||||
_SLT = TypeVar("_SLT", int, float, bool, str, bytes, None)
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@@ -24,7 +24,7 @@ if sys.version_info >= (3, 8):
|
||||
def __init__(self, sequence: Iterable[_SLT] | None = ..., *, name: str | None = ...) -> None: ...
|
||||
def __getitem__(self, position: int) -> _SLT: ...
|
||||
def __setitem__(self, position: int, value: _SLT) -> None: ...
|
||||
def __reduce__(self: _S) -> tuple[_S, tuple[_SLT, ...]]: ...
|
||||
def __reduce__(self: Self) -> tuple[Self, tuple[_SLT, ...]]: ...
|
||||
def __len__(self) -> int: ...
|
||||
@property
|
||||
def format(self) -> str: ...
|
||||
|
||||
@@ -76,7 +76,7 @@ class SynchronizedBase(Generic[_CT]):
|
||||
acquire: _AcquireFunc
|
||||
release: Callable[[], None]
|
||||
def __init__(self, obj: Any, lock: _LockLike | None = ..., ctx: Any | None = ...) -> None: ...
|
||||
def __reduce__(self) -> tuple[Callable[..., Any], tuple[Any, _LockLike]]: ...
|
||||
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: ...
|
||||
|
||||
Reference in New Issue
Block a user