[Python-Dev] Re: PEP 322: Reverse Iteration

Raymond Hettinger python at rcn.com
Wed Nov 5 10:55:10 EST 2003


> > Among the comp.lang.python crowd, nearly everyone supported some
form of
> > the PEP (with varying preferences on the name or where to put it).
The
> > community participation rate was high with about 120 posts across
four
> > threads contributing to hammering out the current version of the
pep.
> 
> How many participants in those 120 posts?  (I recall a thread where
> one individual posted 100 messages. :-)

There were 31 participants.

{'Mel Wilson': 1, 'Tom Anderson': 1, 'Dave Benjamin': 2, 'Stephen
Horne': 14, 'David Abrahams': 12, 'David Mertz': 1, 'Ron Adam': 1,
'Terry Reedy': 4, 'Sean Ross': 6, 'Bengt Richter': 1, 'Andrew Dalke': 3,
'Michele Simionato': 2, 'Bernhard Herzog': 1, 'Raymond Hettinger': 15,
'David C': 1, 'Paul Moore': 3, 'Dang Griffith': 1, 'Roy Smith': 1, 'Alex
Martelli': 14, 'Patrick Maupin': 1, 'Jeremy Fincher': 3, 'Steve Holden':
1, 'Robert Brewer': 1, 'Chad Netzer': 1, 'Werner Schiendl': 6, 'Peter
Otten': 3, 'David Eppstein': 3, 'Fredrik Lundh': 1, 'Lulu of': 2,
'Michael Hudson': 1, 'John Roth': 4}


 
> > Is there anything else that needs to be done in the way of research,
> > voting, or cheerleading for pep to be accepted?
> 
> Yes.  I'm getting cold feet about __reversed__.

What can I do to warm those feet?

I spent a month making this proposal as perfect as possible, gathering
support for it, trying each proposed modification, and enduring what
feels like hazing.  Still, there is a little bit of energy left if that
what it takes to put the ball over the goal line.

Getting this far hasn't been easy.  Python people are quick to express
negativity on just about anything and they take great pleasure is
exploring every weird variant they can think of.  


> I also still think that a reversed [x]range() would give us a bigger
> bang for the buck 

I'm not willing to go that route:
* Several posters gave negative feedback on that option.
* It doesn't address the ugly and inefficient s[::-1] approach which I
really do not want to become *the* idiom.
* Providing yet another variant of xrange() is a step backwards IMO.
* It is not an extensible protocol like the reversed() / __reversed__
pair.
* Except for the simple case of revrange(n), the multiple argument forms
are not a simplification (IMO) and are still difficult to visually
verify (try the example from random.shuffle).
* A unique benefit to python is the ability to loop over containers
without using indices.  The current proposal supports that idea.  The
revrange() approach doesn't.


Raymond Hettinger




More information about the Python-Dev mailing list