performance question: dictionary or list, float or string?

bkamrani at gmail.com bkamrani at gmail.com
Thu Dec 4 07:48:10 EST 2008


On Dec 4, 1:28 pm, alex23 <wuwe... at gmail.com> wrote:
> 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):

You're right! That was interesting!



More information about the Python-list mailing list