Skip to content

Revert dict.__or__ typeshed change#21186

Merged
ilevkivskyi merged 4 commits intopython:masterfrom
ilevkivskyi:revert-dict-or
Apr 9, 2026
Merged

Revert dict.__or__ typeshed change#21186
ilevkivskyi merged 4 commits intopython:masterfrom
ilevkivskyi:revert-dict-or

Conversation

@ilevkivskyi
Copy link
Copy Markdown
Member

Fixes #21141

I am not sure how typeshed patches work. If possible, I would add some tests here, otherwise I will add tests in a follow-up PR.

@github-actions

This comment has been minimized.

@cdce8p
Copy link
Copy Markdown
Collaborator

cdce8p commented Apr 8, 2026

I am not sure how typeshed patches work.

You'll need to add the patch to misc/typeshed_patches. Afterwards, it will be picked up for any subsequent typeshed sync.

git format-patch -1 -o misc/typeshed_patches/ HEAD

If possible, I would add some tests here, otherwise I will add tests in a follow-up PR.

I believe the pythoneval.test tests are run using the full stubs, so you should be able to a regression test there. You can do that in this PR as well, no need to create a separate one for it.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

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: Unsupported operand types for | ("dict[str, int]" and "frozendict[Never, int]")  [operator]
+ 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: 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]

rotki (https://github.com/rotki/rotki)
- rotkehlchen/chain/evm/decoding/aave/v3/decoder.py:583: error: Unused "type: ignore" comment  [unused-ignore]

@ilevkivskyi ilevkivskyi merged commit 6cbd2cc into python:master Apr 9, 2026
24 checks passed
@ilevkivskyi ilevkivskyi deleted the revert-dict-or branch April 9, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[1.20 regression] "Unsupported operand types for |" with recursive type definition

3 participants