Message53208
The purpose of this enhancement would be to get the
item in a list that caused an exception when applying
a mapped function.
For instance, suppose that I want to detect if there
is an item in a list that is not a number. For this
illustration I try to map float on the list and then
catch the exception.
try:
map(float, mylist)
except ValueError:
print "The item %s in mylist is not a number." %
(my_item)
The problem is that I do not know which item in the
list caused the exception. How do I get my_item?
This information could probably be useful in a number
of different contexts.
Thank you. |
|
Date |
User |
Action |
Args |
2007-08-23 16:01:22 | admin | link | issue447143 messages |
2007-08-23 16:01:22 | admin | create | |
|