Assigning to None

François Pinard pinard at iro.umontreal.ca
Fri Jul 1 15:00:32 EDT 2005


[Roy Smith]

> 4) foo, bar = gen_tuple(stuff)[0:1].  In some ways, this is the
>    cleanest because it doesn't pollute the namespace with an un-needed
>    variable, but I think it's the least readable.

Less legible often means more error prone.  For example, here,

     foo, bar = gen_tuple(stuff)[:2]

would work better.

-- 
François Pinard   http://pinard.progiciels-bpi.ca



More information about the Python-list mailing list