-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix crash on match statement with value restricted TypeVar #13728
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
Conversation
This comment has been minimized.
This comment has been minimized.
guards=self.optional_expressions(o.guards), | ||
bodies=self.blocks(o.bodies), | ||
) | ||
|
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.
I wonder why the next method does not do self.expr(node.expr)
.
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.
Yeah, I was wondering about that too. I guess I should probably not be lazy and write out all the boilerplate for patterns...
This comment has been minimized.
This comment has been minimized.
1 similar comment
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
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.
Sadly, I cannot come up with any ideas on how to catch this early.
Since NodeVisitor
does not have abstract methods.
🤔
Sadly, python/mypy#13728 was not merged into the 0.981 release, meaning we still have the weird None check when using the `extract_binary_oper` function. I could just use the master branch instead of the pypi release of mypy, but those don't have wheels built for it, meaning it would (probably) be a lot harder to install for the end user.
Fixes #13727, fixes #12448, fixes #13213