Message147215
The good thing about this is ease of debugging. You can see which is the offending value that was not found.
On the other hand, the repr of a value might be very long:
>>> [].index(list(range(1000)))
ValueError: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...
(many lines of numbers)
997, 998, 999] is not in list
Also, all values don't have a very informal repr:
>>> class Foo: pass
...
>>> [].index(Foo())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: <__main__.Foo object at 0xb736f92c> is not in list |
|
Date |
User |
Action |
Args |
2011-11-07 10:08:52 | petri.lehtinen | set | recipients:
+ petri.lehtinen, ezio.melotti |
2011-11-07 10:08:52 | petri.lehtinen | set | messageid: <1320660532.38.0.380013415211.issue13349@psf.upfronthosting.co.za> |
2011-11-07 10:08:51 | petri.lehtinen | link | issue13349 messages |
2011-11-07 10:08:51 | petri.lehtinen | create | |
|