mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Improve __(r)or__ signatures for TypedDict classes (#10565)
This commit is contained in:
@@ -233,8 +233,16 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta):
|
||||
def values(self) -> dict_values[str, object]: ...
|
||||
def __delitem__(self, k: Never) -> None: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
@overload
|
||||
def __or__(self, __value: Self) -> Self: ...
|
||||
def __ior__(self, __value: Self) -> Self: ...
|
||||
@overload
|
||||
def __or__(self, __value: dict[str, Any]) -> dict[str, object]: ...
|
||||
@overload
|
||||
def __ror__(self, __value: Self) -> Self: ...
|
||||
@overload
|
||||
def __ror__(self, __value: dict[str, Any]) -> dict[str, object]: ...
|
||||
# supposedly incompatible definitions of `__ior__` and `__or__`:
|
||||
def __ior__(self, __value: Self) -> Self: ... # type: ignore[misc]
|
||||
|
||||
# TypedDict is a (non-subscriptable) special form.
|
||||
TypedDict: object
|
||||
|
||||
Reference in New Issue
Block a user