mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-19 02:15:58 +08:00
Add various __*or__ methods, and improve dict.__ior__ (#6961)
This commit is contained in:
@@ -869,7 +869,11 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __class_getitem__(cls, __item: Any) -> GenericAlias: ...
|
||||
def __or__(self, __value: Mapping[_T1, _T2]) -> dict[_KT | _T1, _VT | _T2]: ...
|
||||
def __ror__(self, __value: Mapping[_T1, _T2]) -> dict[_KT | _T1, _VT | _T2]: ...
|
||||
def __ior__(self, __value: Mapping[_KT, _VT]) -> dict[_KT, _VT]: ... # type: ignore[misc]
|
||||
# dict.__ior__ should be kept roughly in line with MutableMapping.update()
|
||||
@overload # type: ignore[misc]
|
||||
def __ior__(self: Self, __value: SupportsKeysAndGetItem[_KT, _VT]) -> Self: ...
|
||||
@overload
|
||||
def __ior__(self: Self, __value: Iterable[tuple[_KT, _VT]]) -> Self: ...
|
||||
|
||||
class set(MutableSet[_T], Generic[_T]):
|
||||
def __init__(self, __iterable: Iterable[_T] = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user