Skip to content

Fix deferral logic for special types#20678

Merged
ilevkivskyi merged 1 commit intopython:masterfrom
ilevkivskyi:fix-td-defer
Jan 29, 2026
Merged

Fix deferral logic for special types#20678
ilevkivskyi merged 1 commit intopython:masterfrom
ilevkivskyi:fix-td-defer

Conversation

@ilevkivskyi
Copy link
Copy Markdown
Member

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.

@github-actions
Copy link
Copy Markdown
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]

@ilevkivskyi ilevkivskyi merged commit 7029712 into python:master Jan 29, 2026
23 checks passed
@ilevkivskyi ilevkivskyi deleted the fix-td-defer branch January 29, 2026 13:10
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.

Cyclic import and Unpack raises INTERNAL ERROR

2 participants