[Python-checkins] CVS: python/nondist/peps pep-0201.txt,1.10,1.11

Barry Warsaw python-dev@python.org
Thu, 27 Jul 2000 22:48:28 -0700


Update of /cvsroot/python/python/nondist/peps
In directory slayer.i.sourceforge.net:/tmp/cvs-serv2074

Modified Files:
	pep-0201.txt 
Log Message:
Parallel => Lockstep everywhere.

Replaced the reference implementation with one that's closer to what
the C code will actually look like; i.e. it obeys the iteration
protocol.

Other grammar and spelling fixes.


Index: pep-0201.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0201.txt,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** pep-0201.txt	2000/07/27 19:17:36	1.10
--- pep-0201.txt	2000/07/28 05:48:25	1.11
***************
*** 1,4 ****
  PEP: 201
! Title: Parallel Iteration
  Version: $Revision$
  Author: bwarsaw@beopen.com (Barry A. Warsaw)
--- 1,4 ----
  PEP: 201
! Title: Lockstep Iteration
  Version: $Revision$
  Author: bwarsaw@beopen.com (Barry A. Warsaw)
***************
*** 11,22 ****
  Introduction
  
!     This PEP describes the `parallel iteration' proposal for Python
!     2.0, previously known as `parallel for loops'.  This PEP tracks
!     the status and ownership of this feature, slated for introduction
!     in Python 2.0.  It contains a description of the feature and
!     outlines changes necessary to support the feature.  This PEP
!     summarizes discussions held in mailing list forums, and provides
!     URLs for further information, where appropriate.  The CVS revision
!     history of this file contains the definitive historical record.
  
  
--- 11,22 ----
  Introduction
  
!     This PEP describes the `lockstep iteration' proposal for Python
!     2.0.  This PEP tracks the status and ownership of this feature,
!     slated for introduction in Python 2.0.  It contains a description
!     of the feature and outlines changes necessary to support the
!     feature.  This PEP summarizes discussions held in mailing list
!     forums, and provides URLs for further information, where
!     appropriate.  The CVS revision history of this file contains the
!     definitive historical record.
  
  
***************
*** 34,40 ****
  
  
! Parallel For-Loops
  
!     Parallel for-loops are non-nested iterations over two or more
      sequences, such that at each pass through the loop, one element
      from each sequence is taken to compose the target.  This behavior
--- 34,40 ----
  
  
! Lockstep For-Loops
  
!     Lockstep for-loops are non-nested iterations over two or more
      sequences, such that at each pass through the loop, one element
      from each sequence is taken to compose the target.  This behavior
***************
*** 71,78 ****
  
      For these reasons, several proposals were floated in the Python
!     2.0 beta time frame for providing a better spelling of parallel
      for-loops.  The initial proposals centered around syntactic
      changes to the for statement, but conflicts and problems with the
!     syntax were unresolvable, especially when parallel for-loops were
      combined with another proposed feature called `list
      comprehensions' (see pep-0202.txt).
--- 71,78 ----
  
      For these reasons, several proposals were floated in the Python
!     2.0 beta time frame for providing a better spelling of lockstep
      for-loops.  The initial proposals centered around syntactic
      changes to the for statement, but conflicts and problems with the
!     syntax were unresolvable, especially when lockstep for-loops were
      combined with another proposed feature called `list
      comprehensions' (see pep-0202.txt).
***************
*** 141,146 ****
  
      Here is a reference implementation, in Python of the zip()
!     built-in function.  These would ultimately be replaced by
!     equivalent C code.
  
      def zip(*args):
--- 141,146 ----
  
      Here is a reference implementation, in Python of the zip()
!     built-in function.  This will be replaced with a C implementation
!     after final approval.
  
      def zip(*args):
***************
*** 148,159 ****
              raise TypeError('zip() expects one or more sequence arguments')
          ret = []
!         # find the length of the shortest sequence
!         shortest = min(*map(len, args))
!         for i in range(shortest):
!             item = []
!             for s in args:
!                 item.append(s[i])
!             ret.append(tuple(item))
!         return ret
  
  
--- 148,161 ----
              raise TypeError('zip() expects one or more sequence arguments')
          ret = []
!         i = 0
!         try:
!             while 1:
!                 item = []
!                 for s in args:
!                     item.append(s[i])
!                 ret.append(tuple(item))
!                 i = i + 1
!         except IndexError:
!             return ret
  
  
***************
*** 166,171 ****
        open issue listing 20+ proposed alternative names to zip().  In
        the face of no overwhelmingly better choice, the BDFL strongly
!       prefers zip() due to it's Haskell[2] heritage.  See version 1.7
!       of this PEP for the list of alteratives.
  
      - zip() shall be a built-in function.
--- 168,173 ----
        open issue listing 20+ proposed alternative names to zip().  In
        the face of no overwhelmingly better choice, the BDFL strongly
!       prefers zip() due to its Haskell[2] heritage.  See version 1.7
!       of this PEP for the list of alternatives.
  
      - zip() shall be a built-in function.