Python 'for' loop is memory inefficient

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Tue Aug 18 07:45:18 EDT 2009


On 03:56 am, tjreedy at udel.edu wrote:
>exarkun at twistedmatrix.com wrote:
>>There's a lot of things in Python that I don't strictly *need*.  That 
>>doesn't mean that they wouldn't be welcome if I could have them. 
>>Getting rid of the range/xrange dichotomy would improve things.
>
>The developers agreed a couple of years ago. Starting using 3.1 if you 
>want this.

And there was much rejoicing, et cetera.
>Since 'range' could refer to a user-defined object, rather than the 
>builtin function, there is no way the interpreter should substitute 
>'xrange'.

See the earlier parts of this thread for the reasons this isn't true. :)

Jean-Paul



More information about the Python-list mailing list