Fix deferral logic for special types#20678
Merged
ilevkivskyi merged 1 commit intopython:masterfrom Jan 29, 2026
Merged
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: steam.py (https://github.com/Gobot1234/steam.py)
- steam/app.py:396: error: Cannot resolve NamedTuple item (possible cyclic definition) [misc]
- steam/ext/commands/commands.py: error: Cannot resolve TypedDict item (possible cyclic definition) [misc]
- steam/ext/commands/bot.py: error: Cannot resolve TypedDict item (possible cyclic definition) [misc]
|
JukkaL
approved these changes
Jan 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20671
The crash was caused by extending a TypedDict that was itself not ready (contained placeholders). While looking for a fix I noticed that for some reason we check for placeholders in previous version of a TypedDict etc. Not sure why, this mat have been a remainder of an old hack. Replacing it with a check for placeholders in current version looks more correct (although there is probably no difference for other special types) and turns out to be a fix for this issue.