Skip to content

Avoid narrowing NewType#20766

Open
hauntsaninja wants to merge 1 commit intopython:masterfrom
hauntsaninja:narrow90
Open

Avoid narrowing NewType#20766
hauntsaninja wants to merge 1 commit intopython:masterfrom
hauntsaninja:narrow90

Conversation

@hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Feb 8, 2026

Fixes #20733

I might make this type munging look a little nicer in a future refactor

This introduces new errors in two primer projects

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

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

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/csgo/state.py:213: error: Argument 1 to "__delitem__" of "dict" has incompatible type "int"; expected "AssetID"  [arg-type]
+ steam/ext/csgo/state.py:214: error: Argument 1 to "__delitem__" of "dict" has incompatible type "int"; expected "AssetID"  [arg-type]

rotki (https://github.com/rotki/rotki)
- rotkehlchen/chain/evm/decoding/zerox/decoder.py:146: error: Unused "type: ignore" comment  [unused-ignore]
- rotkehlchen/chain/ethereum/modules/sky/decoder.py:147: error: Unused "type: ignore" comment  [unused-ignore]

@hauntsaninja
Copy link
Collaborator Author

rotki was fixed in #20492 and is regressed here
steam was fixed in #20602 and is regressed here

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.

Regression: Type of literal narrowed when asserting equality to a NewType

1 participant