-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix crash on decorated getter in settable property #18787
Conversation
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
This does resolve the crash. Thanks for the quick fix @ilevkivskyi! |
There was a problem hiding this 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!
@@ -8514,12 +8514,23 @@ class C(B): | |||
@deco_untyped | |||
def baz(self, x: int) -> None: ... | |||
|
|||
@property | |||
def tricky(self) -> int: ... | |||
@baz.setter |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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?