-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Added try-except-raise message example #6540
Conversation
Co-authored-by: Vladyslav Krylasov <[email protected]>
08cf7b5
to
85bec08
Compare
Thanks. Is |
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 agree that we should add a detail.rst, to be clear that there's a legitimate use case for re raising immediately but that this check is smart enough to not have a false positive for it.
I.e. with the following inheritance tree:
+-- ArithmeticError
| +-- FloatingPointError
| +-- OverflowError
| +-- ZeroDivisionError
try:
some_calculation(...)
except ZeroDivisionError as e:
raise
except ArithmeticError:
pass
will not get a pylint warning because ZeroDivisionError inherit from ArithmeticError.
Co-authored-by: Pierre Sassoulas <[email protected]>
Co-authored-by: Jacob Walls <[email protected]>
Added details.rst. Please review if now it is OK. |
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.
π
Type of Changes
Description
Related #5953