-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix #5557: Don't emit comparison-with-callable
if the callable raises
#5563
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 #5557: Don't emit comparison-with-callable
if the callable raises
#5563
Conversation
Pull Request Test Coverage Report for Build 1606974330
💛 - Coveralls |
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.
LGTM !
The issue with the pipeline was due to #5561, it's reverted now, you should rebase to fix the primers :) |
…lable raises Typing constants such as `typing.Any` raise when called.
14d15dd
to
a35e7cf
Compare
Co-authored-by: Pierre Sassoulas <[email protected]>
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.
Good job finding the special case for Optional
. Small changes but looks good!
tests/functional/c/comparison_with_callable_typing_constants.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Daniël van Noord <[email protected]>
Co-authored-by: Daniël van Noord <[email protected]>
Type of Changes
Description
Typing constants such as
typing.Any
raise when called, which means they should not emitcomparison-with-callable
.This PR skips emitting that message when a callable raises in its body (or if it's a typing constant, since some typing constants only raise via their decorator, not via their body).
Closes #5557