diff options
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/stdtypes.rst | 8 | ||||
-rw-r--r-- | Doc/library/symtable.rst | 4 | ||||
-rw-r--r-- | Doc/library/timeit.rst | 5 |
3 files changed, 15 insertions, 2 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index bd02b37..1ccc457 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -583,10 +583,18 @@ Once an iterator's :meth:`__next__` method raises :exc:`StopIteration`, it must continue to do so on subsequent calls. Implementations that do not obey this property are deemed broken. + +.. _generator-types: + +Generator Types +--------------- + Python's :term:`generator`\s provide a convenient way to implement the iterator protocol. If a container object's :meth:`__iter__` method is implemented as a generator, it will automatically return an iterator object (technically, a generator object) supplying the :meth:`__iter__` and :meth:`__next__` methods. +More information about generators can be found in :ref:`the documentation for +the yield expression <yieldexpr>`. .. _typesseq: diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst index 9ea3f01..9aafd4e 100644 --- a/Doc/library/symtable.rst +++ b/Doc/library/symtable.rst @@ -144,6 +144,10 @@ Examining Symbol Tables Return ``True`` if the symbol is global. + .. method:: is_declared_global() + + Return ``True`` if the symbol is declared global with a global statement. + .. method:: is_local() Return ``True`` if the symbol is local to its block. diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst index 495ac81..a85fa3e 100644 --- a/Doc/library/timeit.rst +++ b/Doc/library/timeit.rst @@ -24,8 +24,9 @@ The module defines the following public class: The constructor takes a statement to be timed, an additional statement used for setup, and a timer function. Both statements default to ``'pass'``; the timer - function is platform-dependent (see the module doc string). The statements may - contain newlines, as long as they don't contain multi-line string literals. + function is platform-dependent (see the module doc string). *stmt* and *setup* + may also contain multiple statements separated by ``;`` or newlines, as long as + they don't contain multi-line string literals. To measure the execution time of the first statement, use the :meth:`timeit` method. The :meth:`repeat` method is a convenience to call :meth:`timeit` |