[EMAIL PROTECTED] wrote:
>> ...         _, first_n = group[0]
> 
> what is the meaning of the underscore "_" ? is it a special var ? or
> should it be readed as a way of unpacking a tuple in a non useful var ?
> like 
> 
> lost, first_n = group[0]

Yep, it's just another name.  "lost" would have worked just as well. 
It's pretty typical around here to see "_" used when a tuple is unpacked 
but some of the values aren't used.  So if you see something like::

     for _, dirs, _ in os.walk(top):
         ...

it just means that the "..." code is only going to use "dirs" (not the 
root path or files that are also available from the os.walk() iterator).

STeVe
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to