Eliminate "extra" variable

Roy Smith roy at panix.com
Fri Dec 6 19:16:13 EST 2013


In article <mailman.3672.1386373120.18130.python-list at python.org>,
 Joel Goldstick <joel.goldstick at gmail.com> wrote:

> Python lets you iterate over a list directly, so :
> 
>     for d in originalData:
>         dateStr, freq, source = d
>         data[source] = freq

I would make it even simpler:

>     for dateStr, freq, source in originalData:
>         data[source] = freq



More information about the Python-list mailing list