diff Doc/lib/libstdtypes.tex @ 24253:62f4b45b05fd legacy-trunk

Record the decision that StopIteration is a sink state (see recent discussion in python-dev with subject "Termination of two-arg iter()"). Implementation will follow.
author Guido van Rossum <guido@python.org>
date Tue, 16 Jul 2002 19:53:39 +0000
parents 8a67f28a42a5
children 189eb6fa9ded
line wrap: on
line diff
--- a/Doc/lib/libstdtypes.tex	Tue Jul 16 19:47:43 2002 +0000
+++ b/Doc/lib/libstdtypes.tex	Tue Jul 16 19:53:39 2002 +0000
@@ -377,6 +377,13 @@
 specialized forms.  The specific types are not important beyond their
 implementation of the iterator protocol.
 
+The intention of the protocol is that once an iterator's
+\method{next()} method raises \exception{StopIteration}, it will
+continue to do so on subsequent calls.  Implementations that
+do not obey this property are deemed broken.  (This constraint
+was added in Python 2.3; in Python 2.2, various iterators are
+broken according to this rule.)
+
 
 \subsection{Sequence Types \label{typesseq}}