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
Correct ValueError to TypeError #29002
Correct ValueError to TypeError #29002
Conversation
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.
Why? Please add a description on why this change, what it fixes, why is it needed.
Also, if there are tests, they should also be fixed.
Also, please justify changing from constructor(str, arg)
to constructor(str.format(arg))
This is a TypeError instead of ValueError because, in the `if` clause, we are checking the type of `identifier`. See https://docs.python.org/3/library/exceptions.html#TypeError : > Passing arguments of the wrong type (e.g. passing a list when an int is expected) should result in a TypeError, but passing arguments with the wrong value (e.g. a number outside expected boundaries) should result in a ValueError. The change from `constructor(str, arg)` to `constructor(str.format(arg))` is because the former is undocumented.
8cafbb8
to
5143891
Compare
Hi @mihaimaruseac, I've updated the commit message.
|
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
PiperOrigin-RevId: 250538786
No description provided.