[Python-checkins] python/nondist/peps pep-0322.txt,1.3,1.4
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Fri Sep 26 12:09:56 EDT 2003
Update of /cvsroot/python/python/nondist/peps
In directory sc8-pr-cvs1:/tmp/cvs-serv11227
Modified Files:
pep-0322.txt
Log Message:
Rename the proposal to ireverse().
Index: pep-0322.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0322.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pep-0322.txt 26 Sep 2003 03:07:56 -0000 1.3
--- pep-0322.txt 26 Sep 2003 16:09:54 -0000 1.4
***************
*** 47,59 ****
========
! Add a method called *iter_backwards()* to sequence objects that can
benefit from it. The above examples then simplify to::
! for i in xrange(n).iter_backwards():
print seqn[i]
::
! for elem in seqn.iter_backwards():
print elem
--- 47,59 ----
========
! Add a method called *ireverse()* to sequence objects that can
benefit from it. The above examples then simplify to::
! for i in xrange(n).ireverse():
print seqn[i]
::
! for elem in seqn.ireverse():
print elem
***************
*** 105,109 ****
and clearer with::
! for func, target, kargs in _exithandlers.iter_backwards():
. . .
del _exithandlers
--- 105,109 ----
and clearer with::
! for func, target, kargs in _exithandlers.ireverse():
. . .
del _exithandlers
***************
*** 132,136 ****
result.sort()
! return [x for score, x in result[-n:].iter_backwards()]
* heapq.heapify() uses ``for i in xrange(n//2 - 1, -1, -1)`` because
--- 132,136 ----
result.sort()
! return [x for score, x in result[-n:].ireverse()]
* heapq.heapify() uses ``for i in xrange(n//2 - 1, -1, -1)`` because
***************
*** 159,163 ****
be run in a forward direction but is less intuitive and rarely
presented that way in literature. The replacement code
! ``for i in xrange(1, len(x)).iter_backwards()`` is much easier
to mentally verify.
--- 159,163 ----
be run in a forward direction but is less intuitive and rarely
presented that way in literature. The replacement code
! ``for i in xrange(1, len(x)).ireverse()`` is much easier
to mentally verify.
More information about the Python-checkins
mailing list