[Python-Dev] RE: test_sort.py failure (original) (raw)
Tim Peters tim.one at comcast.net
Thu Jul 29 00:36:38 CEST 2004
- Previous message: [Python-Dev] test_sort.py failure
- Next message: [Python-Dev] RE: test_sort.py failure
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Guido van Rossum]
I had testsort.py fail once on line 143 (in testbug453523).
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 ).
- Previous message: [Python-Dev] test_sort.py failure
- Next message: [Python-Dev] RE: test_sort.py failure
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]