[Guido van Rossum] > I had test_sort.py fail once on line 143 (in test_bug453523). How did it fail? By not raising any exception, or by raising an exception other than ValueError? > Later it wouldn't fail. The code in question uses a random generator. > Could I have been unlucky enough that the particular random sequence it > used this time didn't create the intended failure condition? No: every call to __lt__ mutates the list, the code checking for list mutation should be impossible to fool, the code checking for list mutation raises ValueError at the end of list.sort() iff mutation occurred during the sort, and since the list has more than 1 element __lt__ will be called at least once. It's possible that the code checking for list mutation became less than bulletproof after list object internals were reworked, though -- don't know about that. While it was bulletproof before (according to both Armin and me), it was delicate (as evidence, it took both Armin and me to come up with it <wink>).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4