-
Notifications
You must be signed in to change notification settings - Fork 8k
Improve TypeError messages for non-numeric/empty strings in coercions; Closes #20632 #20639
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
iluuu1994
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.
Please also see my comment in #20632 (comment).
…e callers Removed unnecessary changes.
|
I don't know if the code churn is worth it. @Girgias Opinions? |
| @@ -0,0 +1,35 @@ | |||
| --TEST-- | |||
| Error message for non-numaric strings in arithmetic contexts | |||
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.
| Error message for non-numaric strings in arithmetic contexts | |
| Error message for non-numeric strings in arithmetic contexts |
Girgias
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.
This is a lot of code churn and I don't even think the implementation is correct vis a vis strict_types.
I'd prefer a discussion on the mailing list, I can understand the rationale somewhat, but an empty string is non-numeric so this seems redundant?
And I'd be more inclined to do this just for binary ops, rather than all type checks.
Implements proposal from #20632