[Python-checkins] python/nondist/peps pep-0234.txt,1.19,1.20

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Thu, 18 Jul 2002 21:25:09 -0700


Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv9563

Modified Files:
	pep-0234.txt 
Log Message:
Replace Ping's value judgement by a more neutral explanation of why
iterators need to support __iter__.


Index: pep-0234.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0234.txt,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** pep-0234.txt	18 Jul 2002 20:38:28 -0000	1.19
--- pep-0234.txt	19 Jul 2002 04:25:06 -0000	1.20
***************
*** 164,173 ****
      currently required to support both protocols.  The semantics of
      iteration come only from protocol 2; protocol 1 is present to make
!     iterators behave like sequences.  But the analogy is weak -- unlike
!     ordinary sequences, iterators are "sequences" that are destroyed
!     by the act of looking at their elements.
! 
!     Consequently, whenever any Python programmer says "for x in y",
!     he or she must be sure of whether this is going to destroy y.
  
  
--- 164,169 ----
      currently required to support both protocols.  The semantics of
      iteration come only from protocol 2; protocol 1 is present to make
!     iterators behave like sequences; in particular so that code
!     receiving an iterator can use a for-loop over the iterator.