Raymond Hettinger wrote:
> Also, I recommend tightening the PEP's motivation.  There are only two
> advantages, encoding and readability.  The former is only a minor gain
> because all it saves is a function call, an O(1) savings in an O(n)
> context.  The latter is where the real benefits lay.

The introduction of 'enumerate', and the proliferation of better 
iterators that reduce the need for pure-integer loops should be 
adressed in the revised motivation. I know my use of 'range' drops 
close to zero when I'm working with Python versions that supply 
'enumerate'.

Even when I do have a pure integer loop, I'll often assign the result 
of the range/xrange call to a local variable, just so I can give it a 
name that indicates the *significance* of that particular bunch of 
numbers.

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.blogspot.com
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to