Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3835)

Unified Diff: Doc/library/exceptions.rst

Issue 11682: PEP 380 reference implementation for 3.3
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
--- a/Doc/library/exceptions.rst Thu Jan 12 08:06:49 2012 +0100
+++ b/Doc/library/exceptions.rst Fri Jan 13 00:26:31 2012 +1000
@@ -250,7 +250,16 @@
.. exception:: StopIteration
Raised by built-in function :func:`next` and an :term:`iterator`\'s
- :meth:`__next__` method to signal that there are no further values.
+ :meth:`__next__` method to signal that there are no further items to be
+ produced by the iterator.
+
+ The exception object has a single attribute :attr:`value`, which is
+ given as an argument when constructing the exception, and defaults
+ to :const:`None`.
+
+ When a generator function returns, a new :exc:`StopIteration` instance is
+ raised, and the value returned by the function is used as the
+ :attr:`value` parameter to the constructor of the exception.
.. exception:: SyntaxError
« no previous file with comments | « Doc/library/dis.rst ('k') | Doc/reference/expressions.rst » ('j') | Modules/parsermodule.c » ('J')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+