mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-07 10:20:58 +08:00
Improve __(r)or__ signatures for TypedDict classes (#10565)
This commit is contained in:
@@ -28,8 +28,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):
|
||||
def __or__(self, __other: Self) -> Self: ...
|
||||
def __ior__(self, __other: Self) -> Self: ...
|
||||
@overload
|
||||
def __or__(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 `__or__` and `__ior__`:
|
||||
def __ior__(self, __value: Self) -> Self: ... # type: ignore[misc]
|
||||
|
||||
def TypedDict(typename: str, fields: dict[str, type[Any]], total: bool = ...) -> type[dict[str, Any]]: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user