diff Doc/lib/libstdtypes.tex @ 25585:dae2282bc76b 2.2

Backport 1.100: Discussion of Stop Iteration in the Iterator Protocol.
author Raymond Hettinger <python@rcn.com>
date Sat, 05 Oct 2002 15:38:16 +0000
parents ecd4ada252bc
children b287bdacde39
line wrap: on
line diff
--- a/Doc/lib/libstdtypes.tex	Sat Oct 05 15:25:33 2002 +0000
+++ b/Doc/lib/libstdtypes.tex	Sat Oct 05 15:38:16 2002 +0000
@@ -367,6 +367,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}}