performance question: dictionary or list, float or string?

alex23 wuwei23 at gmail.com
Thu Dec 4 07:28:03 EST 2008


On Dec 4, 8:12 pm, bkamr... at gmail.com wrote:
> About the piece of code you posted, there is something I don't
> understand.
>
>         for i, line in data:
>
> where data is a file object. Is it legal to write that?
> I believe it results in "too many values to unpack" or do I miss
> something?

>From the context, my guess is Matimus intended to write:

         for i, line in enumerate(data):



More information about the Python-list mailing list