Python is faster than C
Paul Rubin
http
Sat Apr 3 17:19:57 EST 2004
Armin Rigo <arigo at tunes.org> writes:
> >>> enumerate([6,7,8,9]) # uh ?
> <enumerate object at 0x401a102c>
>
> I know you can always do list(_). My point is that this is a
> user-visible optimization. enumerate() should return a normal list, and
> it should be someone else's job to ensure that it is correctly optimized
> away if possible (and I'm not even talking about Psyco, it could be done
> in the current Python implementation with a reasonable amount of
> effort).
I think enumerate(xrange(1000000000)) returning a normal list would
exhaust memory before some later optimizer had a chance to do anything
with it.
More information about the Python-list
mailing list