diff options
author | Guido van Rossum <guido@python.org> | 2002-07-16 19:53:39 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-07-16 19:53:39 (GMT) |
commit | 9534e14033f26b32ed75c02a6a51bfe47c7f16a9 (patch) | |
tree | 513da854625dd519e38bd2b9231fc1e211d56db5 /Doc/lib | |
parent | 39c6116483bd7932cee220943e329c5994f62cc7 (diff) | |
download | cpython-9534e14033f26b32ed75c02a6a51bfe47c7f16a9.zip cpython-9534e14033f26b32ed75c02a6a51bfe47c7f16a9.tar.gz cpython-9534e14033f26b32ed75c02a6a51bfe47c7f16a9.tar.bz2 |
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.
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/libstdtypes.tex | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex index 1a07d3c..aabc9bf 100644 --- a/Doc/lib/libstdtypes.tex +++ b/Doc/lib/libstdtypes.tex @@ -377,6 +377,13 @@ general and specific sequence types, dictionaries, and other more 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}} |