Fix a remnant of the old proposal found by Tim Delaney.

This commit is contained in:
Guido van Rossum 2005-05-03 23:51:54 +00:00
parent 9b82c24996
commit 036431dd4f
1 changed files with 8 additions and 8 deletions

View File

@ -327,14 +327,14 @@ Specification: Generator Exit Handling
body. body.
When __next__() is called with an argument that is not None, the When __next__() is called with an argument that is not None, the
yield-expression that it resumes will return the value attribute yield-expression that it resumes will return the argument. If it
of the argument. If it resumes a yield-statement, the value is resumes a yield-statement, the value is ignored (this is similar
ignored (this is similar to ignoring the value returned by a to ignoring the value returned by a function call). When the
function call). When the *initial* call to __next__() receives an *initial* call to __next__() receives an argument that is not
argument that is not None, TypeError is raised; this is likely None, TypeError is raised; this is likely caused by some logic
caused by some logic error. When __next__() is called without an error. When __next__() is called without an argument or with None
argument or with None as argument, and a yield-expression is as argument, and a yield-expression is resumed, the
resumed, the yield-expression returns None. yield-expression returns None.
When a generator that has not yet terminated is garbage-collected When a generator that has not yet terminated is garbage-collected
(either through reference counting or by the cyclical garbage (either through reference counting or by the cyclical garbage