Skip to content

Conversation

@sterliakov
Copy link
Collaborator

Fixes #17059.

When we encounter a field with a Placeholder as a default, do not record it in the new symtable as redefinition - it becomes orphan immediately and remains there, crashing suring serialization.

The test cases are both crashing on current master. Ideally we hould emit name-defined in all cases, but it is another unrelated issue (#17610, and likely some others; this is not specific to named tuples - plain classes also allow referencing variables that are not defined yet).

@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow this fell through the cracks (I should have fixed this myself but probably forgot about this). Thanks!

@ilevkivskyi ilevkivskyi merged commit 3f03755 into python:master Oct 31, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mypy crashes on importing littlefs (from littlefs-python-0.10.0)

2 participants