Stdlib: add many missing __hash__ and __eq__ methods (#10464)

This commit is contained in:
Alex Waygood
2023-07-17 13:21:02 +01:00
committed by GitHub
parent a04822051f
commit 03b4bb9cce
22 changed files with 78 additions and 2 deletions

View File

@@ -11,17 +11,20 @@ _T = TypeVar("_T")
@final
class CallableProxyType(Generic[_C]): # "weakcallableproxy"
def __eq__(self, __value: object) -> bool: ...
def __getattr__(self, attr: str) -> Any: ...
__call__: _C
@final
class ProxyType(Generic[_T]): # "weakproxy"
def __eq__(self, __value: object) -> bool: ...
def __getattr__(self, attr: str) -> Any: ...
class ReferenceType(Generic[_T]):
__callback__: Callable[[ReferenceType[_T]], Any]
def __new__(cls, __o: _T, __callback: Callable[[ReferenceType[_T]], Any] | None = ...) -> Self: ...
def __call__(self) -> _T | None: ...
def __eq__(self, __value: object) -> bool: ...
def __hash__(self) -> int: ...
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...