Issue 14878: Improve documentation for generator.send method (original) (raw)

Issue14878

Created on 2012-05-22 04:54 by Stephen.Lacy, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
14878.patch dhgmgn,2012-11-02 11:33 review
Messages (6)
msg161320 - (view) Author: Stephen Lacy (Stephen.Lacy) Date: 2012-05-22 04:54
There's reasonable documentation of the yield statement for most python versions under Section 6: Simple Statements, particularly 6.8 "The Yield Statement" (http://docs.python.org/release/2.7/reference/simple_stmts.html#the-yield-statement) But, there's no mention of the return value of the yield statement, or that the send statement even exists. It's mentioned in passing here under "PEP342 New Generator Features" (http://docs.python.org/whatsnew/2.5.html#pep-342-new-generator-features) but should be given fuller explanation and cross-linking from the yield statement documentation. It's also mentioned a bit here: http://docs.python.org/howto/functional.html#passing-values-into-a-generator but again, not under the language documentation itself.
msg161364 - (view) Author: Stephen Lacy (Stephen.Lacy) Date: 2012-05-22 16:39
okay, found the documentation I was looking for here: http://docs.python.org/reference/expressions.html#yield-expressions which appears to be copied and pasted and modified version of the docs here: http://docs.python.org/reference/simple_stmts.html#grammar-token-yield_stmt At the very least these should cross-reference each other, but I would guess that the text should be unified, but I'm not sure where.
msg161598 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-05-25 18:49
Thanks for the report. Are you interested in making a patch? Guidelines are in the devguide.
msg174503 - (view) Author: Jan Duzinkiewicz (dhgmgn) Date: 2012-11-02 11:33
The latest docs have a crossrefence at the end of the section: http://docs.python.org/3/reference/simple_stmts.html#grammar-token-yield_stmt I copied the reference to 2.7 docs
msg188800 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-10 00:55
New changeset 7b8c0bf8fcb8 by Andrew Kuchling in branch '2.7': #14878: add cross-reference to the yield statement. http://hg.python.org/cpython/rev/7b8c0bf8fcb8
msg188801 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2013-05-10 00:56
Thanks for the patch!
History
Date User Action Args
2022-04-11 14:57:30 admin set github: 59083
2013-05-10 01:19:45 ezio.melotti set stage: needs patch -> resolvedtype: enhancementversions: - Python 3.2, Python 3.3
2013-05-10 00:56:12 akuchling set status: open -> closednosy: + akuchlingmessages: + resolution: fixed
2013-05-10 00:55:46 python-dev set nosy: + python-devmessages: +
2012-11-02 11:33:06 dhgmgn set files: + 14878.patchnosy: + dhgmgnmessages: + keywords: + patch
2012-05-25 18:49:18 eric.araujo set nosy: + eric.araujotitle: send statement from PEP342 is poorly documented. -> Improve documentation for generator.send methodmessages: + versions: - Python 2.6, Python 3.1, Python 3.4stage: needs patch
2012-05-22 16:39:07 Stephen.Lacy set messages: +
2012-05-22 04:54:52 Stephen.Lacy create