Skip to content

Fix crash on decorated getter in settable property #18787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2025

Conversation

ilevkivskyi
Copy link
Member

Follow up for #18774

Fix for crash is trivial, properly handle getter the same way as setter. Note I also consistently handle callable instances.

cc @cdce8p could you please check this branch?

Copy link
Contributor

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

@cdce8p
Copy link
Collaborator

cdce8p commented Mar 11, 2025

@cdce8p could you please check this branch?

This does resolve the crash. Thanks for the quick fix @ilevkivskyi!

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix!

@JukkaL JukkaL merged commit 0f5ddd5 into python:master Mar 11, 2025
18 checks passed
@ilevkivskyi ilevkivskyi deleted the settable-property-type-getter branch March 11, 2025 17:13
@@ -8514,12 +8514,23 @@ class C(B):
@deco_untyped
def baz(self, x: int) -> None: ...

@property
def tricky(self) -> int: ...
@baz.setter

Choose a reason for hiding this comment

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

It feels like this should probably be @tricky.setter. Unless this is intentional, but it definitely looks like a copy/paste issue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks that way. Thanks for letting us know! Opened #18946 to fix it.

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.

4 participants