-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use operator specific messaging in division by zero diagnostics #13588
Conversation
"Cannot divide object of type 'Literal[2]' by zero.", | ||
"Cannot divide object of type 'Literal[3]' by zero.", | ||
"Cannot floor divide object of type 'Literal[2]' by zero.", | ||
"Cannot reduce object of type 'Literal[3]' modulo zero.", |
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.
This is the most consistent language I can find for this online.
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.
could possibly do something like this, but it's annoyingly verbose:
"Cannot reduce object of type 'Literal[3]' modulo zero.", | |
"Using modulo with a zero divisor is undefined on an object of type 'Literal[3]'.", |
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 that seems too verbose to me and differs quite a bit from the other messages.
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 think what you have now is fine!
|
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.
Thank you!!
"Cannot divide object of type 'Literal[2]' by zero.", | ||
"Cannot divide object of type 'Literal[3]' by zero.", | ||
"Cannot floor divide object of type 'Literal[2]' by zero.", | ||
"Cannot reduce object of type 'Literal[3]' modulo zero.", |
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.
could possibly do something like this, but it's annoyingly verbose:
"Cannot reduce object of type 'Literal[3]' modulo zero.", | |
"Using modulo with a zero divisor is undefined on an object of type 'Literal[3]'.", |
Requested at #13576 (comment)