-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
bpo-13349: repr object in tuple.index ValueError message #1820
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
|
@llllllllll, thanks for your PR! By analyzing the history of the files in this pull request, we identified @serhiy-storchaka, @rhettinger and @tiran to be potential reviewers. |
Objects/tupleobject.c
Outdated
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 don't do assignment in an if guard as it's hard to notice it's not a comparison.
|
Could you open an issue for this, @llllllllll ? I actually want to discuss the message a bit more. |
a6e09fb to
453213f
Compare
|
It looks like we just changed the title at the same time, should it include the issue number? |
|
@llllllllll yep, race condition. 😬 |
453213f to
23a63ad
Compare
|
I made another PR a couple of months back that address the error message both for |
|
I've renumbered this to the superseding issue so we know we have two implementations for a similar idea (assuming the idea even gets approved). |
|
bpo-13349 was closed. The idea was rejected. |
The old error of
tuple.index(x): x not in tupleseemed very confusing to me. It was also harder to quickly understand what the program was doing wrong. This saves people a second pass through the program under the debugger because they can just see what the invalid value was.The reason I am explicitly calling repr instead of using
%Ris that I didn't want to call repr twice if I didn't need to. If people think that is fine the format can just betuple.index(%R): %R not in tupleinstead.