typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

remove `dict.__or__` overloads

Open randolf-scholz opened this issue 5 months ago • 8 comments

See #14283. Sibling PR for #14282.

randolf-scholz avatar Jun 16 '25 11:06 randolf-scholz

Diff from mypy_primer, showing the effect of this PR on open source code:

artigraph (https://github.com/artigraph/artigraph)
- tests/arti/internal/test_mappings.py:40: error: No overload variant of "__or__" of "dict" matches argument type "frozendict[Never, int]"  [operator]
+ tests/arti/internal/test_mappings.py:40: error: Unsupported operand types for | ("dict[str, int]" and "frozendict[Never, int]")  [operator]
- tests/arti/internal/test_mappings.py:40: note: Possible overload variants:
- tests/arti/internal/test_mappings.py:40: note:     def __or__(self, dict[str, int], /) -> dict[str, int]
- tests/arti/internal/test_mappings.py:40: note:     def [_T1, _T2] __or__(self, dict[_T1, _T2], /) -> dict[str | _T1, int | _T2]

github-actions[bot] avatar Jun 16 '25 11:06 github-actions[bot]