-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-119057: Use better error messages for zero division #119066
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
mdickinson
left a comment
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.
The code changes look fine to me in principle. I think there's still some wrangling to do over the exact error messages we want - we need to resolve that on the issue.
x // 0
mdickinson
left a comment
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 - thank you! I searched for missing cases of both ZeroDivisionError and PyExc_ZeroDivisionError and didn't find any.
I'm a little horrified at how often we use ZeroDivisionError in random tests that have nothing to do with arithmetic, but that's another story ...
|
Thanks a lot for the help and review! 👍 I will open a new issue about |
Now these two errors are very similar:
Better wording is always welcome!
📚 Documentation preview 📚: https://cpython-previews--119066.org.readthedocs.build/