iters on ints? (reducing the need for range/xrange)

Skip Montanaro montanaro at tttech.com
Sat Nov 10 05:43:54 EST 2001


    Tim> This isn't even half as disgusting as most people will say it is
    Tim> <wink>.  I rather like it!  Write a PEP.

    Paul> The trouble is as someone else noted, "for i in 10" replaces "for
    Paul> i in range(10)".  But how do you handle range(1,10)?  "for i in
    Paul> 1,10" does precisely the wrong thing.

Hence the reason for a PEP. ;-) It helps people collect all the pros and
cons in one place, lessening the chances that something significant is
missed.  Writing a PEP doesn't mean it will be accepted, just that
the idea merits consideration.

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list