From 31afc75d846e9c30e352cd8653643d4e2a6b2dae Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Thu, 2 Apr 2026 17:54:54 +0100 Subject: [PATCH] Revert "remove `dict.__or__` overloads (#14284)" This reverts commit bfb7342f83b040a91d56abe055106a83d90b48ca. --- stdlib/builtins.pyi | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 5657ac74a9ac..a22bb400adfe 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1240,7 +1240,13 @@ class dict(MutableMapping[_KT, _VT]): def __reversed__(self) -> Iterator[_KT]: ... __hash__: ClassVar[None] # type: ignore[assignment] def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... + @overload + def __or__(self, value: dict[_KT, _VT], /) -> dict[_KT, _VT]: ... + @overload def __or__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ... + @overload + def __ror__(self, value: dict[_KT, _VT], /) -> dict[_KT, _VT]: ... + @overload def __ror__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ... # dict.__ior__ should be kept roughly in line with MutableMapping.update() @overload # type: ignore[misc]