PEP 284, Integer for-loops

Steve Lamb grey at despair.dmiyu.org
Wed Mar 6 20:05:03 EST 2002


On Wed, 06 Mar 2002 16:57:03 -0800, David Eppstein <eppstein at ics.uci.edu>
wrote:
> I think you have made my point for me, that range is hard to use 
> correctly.  Did you try running range(n-1,0)?  What list did it give you?

>>> range(-10,0)
>>> [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1]

    And?  How does this prove your point other than some minor nit I'm sure
you're going to pick?  Point stands, there are other ways of doing it.

    While I've got your attention, let me ask you this.  In your notation how
would you do the following?

for x in range(n-1,-1,-2):

    That, unlike the allusion you made above, is not a nit.  

-- 
         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
         ICQ: 5107343          | main connection to the switchboard of souls.
    To email: Don't despair!   |  -- Lenny Nero, Strange Days
-------------------------------+---------------------------------------------



More information about the Python-list mailing list