[New-bugs-announce] [issue24650] Error in yield expression documentation
report at bugs.python.org
Fri Jul 17 08:53:39 CEST 2015
New submission from swanson:
6.2.9. Yield expressions
end of 1st paragraph:
"Using a yield expression in a function’s body causes that function to be a generator."
As the very next sentence explains, a generator is what's returned by such a function, not the function itself.
Basically, it should be sufficient to add the word "function" to the end of that sentence: "... generator function." However, this error does NOT exist in 3.0 to 3.2 - just in 3.3 to 3.6, so I suggest just using the same wording as 3.0 to 3.2:
"Using a yield expression in a function definition is sufficient to cause that definition to create a generator function instead of a normal function."
assignee: docs at python
nosy: docs at python, swanson
title: Error in yield expression documentation
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce