stdlib: correct many pos-or-kw arg names in dunder methods (#7451)

This commit is contained in:
Alex Waygood
2022-03-07 15:40:03 +00:00
committed by GitHub
parent 626ccdaee2
commit f4ae363b56
27 changed files with 153 additions and 162 deletions

View File

@@ -56,10 +56,10 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
self: WeakValueDictionary[str, _VT], __other: Mapping[str, _VT] | Iterable[tuple[str, _VT]] = ..., **kwargs: _VT
) -> None: ...
def __len__(self) -> int: ...
def __getitem__(self, k: _KT) -> _VT: ...
def __setitem__(self, k: _KT, v: _VT) -> None: ...
def __delitem__(self, v: _KT) -> None: ...
def __contains__(self, o: object) -> bool: ...
def __getitem__(self, key: _KT) -> _VT: ...
def __setitem__(self, key: _KT, value: _VT) -> None: ...
def __delitem__(self, key: _KT) -> None: ...
def __contains__(self, key: object) -> bool: ...
def __iter__(self) -> Iterator[_KT]: ...
def copy(self) -> WeakValueDictionary[_KT, _VT]: ...
__copy__ = copy
@@ -80,9 +80,9 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
def __ror__(self, other: Mapping[_T1, _T2]) -> WeakValueDictionary[_KT | _T1, _VT | _T2]: ...
# WeakValueDictionary.__ior__ should be kept roughly in line with MutableMapping.update()
@overload # type: ignore[misc]
def __ior__(self: Self, value: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ...
def __ior__(self: Self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ...
@overload
def __ior__(self: Self, value: Iterable[tuple[_KT, _VT]]) -> Self: ...
def __ior__(self: Self, other: Iterable[tuple[_KT, _VT]]) -> Self: ...
class KeyedRef(ref[_T], Generic[_KT, _T]):
key: _KT
@@ -96,10 +96,10 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
@overload
def __init__(self, dict: 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: ...
def __delitem__(self, v: _KT) -> None: ...
def __contains__(self, o: object) -> bool: ...
def __getitem__(self, key: _KT) -> _VT: ...
def __setitem__(self, key: _KT, value: _VT) -> None: ...
def __delitem__(self, key: _KT) -> None: ...
def __contains__(self, key: object) -> bool: ...
def __iter__(self) -> Iterator[_KT]: ...
def copy(self) -> WeakKeyDictionary[_KT, _VT]: ...
__copy__ = copy
@@ -119,9 +119,9 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
def __ror__(self, other: Mapping[_T1, _T2]) -> WeakKeyDictionary[_KT | _T1, _VT | _T2]: ...
# WeakKeyDictionary.__ior__ should be kept roughly in line with MutableMapping.update()
@overload # type: ignore[misc]
def __ior__(self: Self, value: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ...
def __ior__(self: Self, other: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ...
@overload
def __ior__(self: Self, value: Iterable[tuple[_KT, _VT]]) -> Self: ...
def __ior__(self: Self, other: Iterable[tuple[_KT, _VT]]) -> Self: ...
class finalize: # TODO: This is a good candidate for to be a `Generic[_P, _T]` class
def __init__(self, __obj: object, __func: Callable[_P, Any], *args: _P.args, **kwargs: _P.kwargs) -> None: ...