Possible Duplicate:
How can I get around declaring an unused variable in a for loop?
In Python what is the best practice for naming a variable that is not going to be used? This is an odd question sure, but for my specific case I have a tuple of (key, value) where I am only interested in the value. A basic demo of my use case:
some_stuff = [("key", "value"), ("key2", "value")]
for _, value in some_stuff:
pass # TODO: do something really important with value
I've noticed in Eclipse that naming a variable _ or with an _ prefix (e.g. _k) will not show an unused variable warning and removing the _ prefix causes the warning to be raised, but this may just be an oddity/"feature" in Eclipse rather than Python best practice..