diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libstdtypes.tex | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex index 4c1dcbd..2b64d89 100644 --- a/Doc/lib/libstdtypes.tex +++ b/Doc/lib/libstdtypes.tex @@ -395,6 +395,12 @@ 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.) +Python's generators provide a convenient way to implement the +iterator protocol. If a container object's \method{__iter__()} +method is implemented as a generator, it will automatically +return an iterator object (technically, a generator object) +supplying the \method{__iter__()} and \method{next()} methods. + \subsection{Sequence Types \label{typesseq}} |