Message403497
"We'll definitely want to make sure that we're careful about bad indices ... since it would be easy to get weird behavior where too-large negative indexes start 'wrapping around'"
When I noticed the problem, I originally thought "Hey, the test for a negative index can come *before* the range check and save some work for negative indices". Then I realized, while composing this bug report, that that would make p.parents[-4] with len(p.parents) == 3 → p.parents[-1] as you said, and die with a RecursionError for p.parents[-3000] or so. I'm going to ignore the possibility I'm sleep-deprived and/or sloppy, and assume a lot of good programmers would think to make that "optimization" and accidentally introduce new bugs. :-) So yeah, all the tests. |
|
Date |
User |
Action |
Args |
2021-10-08 19:45:21 | josh.r | set | recipients:
+ josh.r, p-ganssle |
2021-10-08 19:45:21 | josh.r | set | messageid: <1633722321.3.0.292756370253.issue45414@roundup.psfhosted.org> |
2021-10-08 19:45:21 | josh.r | link | issue45414 messages |
2021-10-08 19:45:21 | josh.r | create | |
|