|
| 1 | +From d88a4b774fc59ecd0f2d0fdda8e0e61092adafd3 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Ivan Levkivskyi <levkivskyi@gmail.com> |
| 3 | +Date: Wed, 8 Apr 2026 00:01:44 +0100 |
| 4 | +Subject: [PATCH] Revert dict.__or__ typeshed change |
| 5 | + |
| 6 | +--- |
| 7 | + mypy/typeshed/stdlib/builtins.pyi | 6 ++++++ |
| 8 | + 1 file changed, 6 insertions(+) |
| 9 | + |
| 10 | +diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi |
| 11 | +index 674142d70..25b21ba97 100644 |
| 12 | +--- a/mypy/typeshed/stdlib/builtins.pyi |
| 13 | ++++ b/mypy/typeshed/stdlib/builtins.pyi |
| 14 | +@@ -1142,7 +1142,13 @@ class dict(MutableMapping[_KT, _VT]): |
| 15 | + def __reversed__(self) -> Iterator[_KT]: ... |
| 16 | + __hash__: ClassVar[None] # type: ignore[assignment] |
| 17 | + def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... |
| 18 | ++ @overload |
| 19 | ++ def __or__(self, value: dict[_KT, _VT], /) -> dict[_KT, _VT]: ... |
| 20 | ++ @overload |
| 21 | + def __or__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ... |
| 22 | ++ @overload |
| 23 | ++ def __ror__(self, value: dict[_KT, _VT], /) -> dict[_KT, _VT]: ... |
| 24 | ++ @overload |
| 25 | + def __ror__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ... |
| 26 | + # dict.__ior__ should be kept roughly in line with MutableMapping.update() |
| 27 | + @overload # type: ignore[misc] |
| 28 | +-- |
| 29 | +2.25.1 |
| 30 | + |
0 commit comments