weakref: small improvements (#4495)

Co-authored-by: hauntsaninja <>
This commit is contained in:
Shantanu
2020-08-30 06:43:58 -07:00
committed by GitHub
parent ad5bc751f3
commit d07e65c53e
2 changed files with 5 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
@overload
def __init__(self) -> None: ...
@overload
def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ...
def __init__(self, __other: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, k: _KT) -> _VT: ...
def __setitem__(self, k: _KT, v: _VT) -> None: ...
@@ -76,13 +76,14 @@ 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) -> KeyedRef: ...
def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ...
class WeakKeyDictionary(MutableMapping[_KT, _VT]):
@overload
def __init__(self) -> None: ...
def __init__(self, dict: None = ...) -> None: ...
@overload
def __init__(self, __map: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]], **kwargs: _VT) -> None: ...
def __init__(self, dict: Union[Mapping[_KT, _VT], Iterable[Tuple[_KT, _VT]]]) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, k: _KT) -> _VT: ...
def __setitem__(self, k: _KT, v: _VT) -> None: ...