mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
fix weakref.KeyedRef and weakref.ref constructor type (#12803)
This commit is contained in:
@@ -54,8 +54,8 @@ class ProxyType(Generic[_T]): # "weakproxy"
|
||||
def __getattr__(self, attr: str) -> Any: ...
|
||||
|
||||
class ReferenceType(Generic[_T]): # "weakref"
|
||||
__callback__: Callable[[ReferenceType[_T]], Any]
|
||||
def __new__(cls, o: _T, callback: Callable[[ReferenceType[_T]], Any] | None = ..., /) -> Self: ...
|
||||
__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: ...
|
||||
@@ -126,8 +126,8 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
|
||||
|
||||
class KeyedRef(ref[_T], Generic[_KT, _T]):
|
||||
key: _KT
|
||||
def __new__(type, ob: _T, callback: Callable[[_T], Any], key: _KT) -> Self: ...
|
||||
def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ...
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user