Thoughts on PEP284

Stephen Horne $$$$$$$$$$$$$$$$$ at $$$$$$$$$$$$$$$$$$$$.co.uk
Tue Sep 23 07:14:54 CEST 2003


On Tue, 23 Sep 2003 04:49:42 GMT, "M-a-S" <NO-MAIL at hotmail.com> wrote:

>
>> > Some more looping thoughts - this time on integer for loops...
>
>I guess this should be a matter of optimization. Why don't the Python
>compiler recognize 'for <var> in [x]range(<from>,<till>):'? It should be
>pretty easy. Microsoft does marvels optimizing loops in C. Why an open
>source project like Python can't do it?

For all I know it does. Complaints about the 'xrange' notation are
normally about the syntax, not the efficiency. For instance, take this
quote from Guidos parade of PEPs...

"""
PEP 284 - Integer for-loops - Eppstein, Ewing
Yet another way to address the fact that some people find 

    for i in range(10):

too ugly.
"""

The word is "ugly", not "slow".


-- 
Steve Horne

steve at ninereeds dot fsnet dot co dot uk




More information about the Python-list mailing list