Skip to content

fix: prevent false positive "untyped after decorator transformation" after deferral#19591

Merged
ilevkivskyi merged 4 commits intopython:masterfrom
sterliakov:bugfix/gh-19589-untyped-deferred
Aug 15, 2025
Merged

fix: prevent false positive "untyped after decorator transformation" after deferral#19591
ilevkivskyi merged 4 commits intopython:masterfrom
sterliakov:bugfix/gh-19589-untyped-deferred

Conversation

@sterliakov
Copy link
Copy Markdown
Collaborator

Fixes #19589

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Member

@emmatyping emmatyping left a comment

Choose a reason for hiding this comment

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

Thank you! This looks correct.

pass

c = [1]
[builtins fixtures/list.pyi]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Although I think the fix looks right, I don't understand the logic of the tests: shouldn't we check that there is no false positive if the decorator is precisely typed (and there is a deferral)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Whoops, thanks! Fixed

@github-actions
Copy link
Copy Markdown
Contributor

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

@ilevkivskyi ilevkivskyi merged commit 8e66cf2 into python:master Aug 15, 2025
20 checks passed
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.

function untyped after decorator transformation

3 participants