Message326969
I think this is a bug that should be fixed. This is similar to how f-strings used to work: the generated byte code would call format(something-or-other), and if you'd defined a name "format" in your code it would fail.
Now admittedly "format" is more common than "AssertionError", but in any event I don't think assert should fail because of a name you happen to be using. That's a surprising action-at-a-distance, in my mind.
And I especially think that's true in the case of assert: when an assert fires, the last thing I want is something that I normally wouldn't have tested for causing me to not see what the assertion is.
And, I think a broader discussion on python-dev might be useful, too, in order to get more opinions. |
|
Date |
User |
Action |
Args |
2018-10-03 13:56:00 | eric.smith | set | recipients:
+ eric.smith, steven.daprano, thautwarm, vtheno athena |
2018-10-03 13:55:59 | eric.smith | set | messageid: <1538574959.99.0.545547206417.issue34880@psf.upfronthosting.co.za> |
2018-10-03 13:55:59 | eric.smith | link | issue34880 messages |
2018-10-03 13:55:59 | eric.smith | create | |
|