Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for generator.send method #59083

Closed
StephenLacy mannequin opened this issue May 22, 2012 · 6 comments
Closed

Improve documentation for generator.send method #59083

StephenLacy mannequin opened this issue May 22, 2012 · 6 comments
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@StephenLacy
Copy link
Mannequin

StephenLacy mannequin commented May 22, 2012

BPO 14878
Nosy @akuchling, @merwok
Files
  • 14878.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2013-05-10.00:56:12.853>
    created_at = <Date 2012-05-22.04:54:52.410>
    labels = ['type-feature', 'docs']
    title = 'Improve documentation for generator.send method'
    updated_at = <Date 2013-05-10.01:19:45.907>
    user = 'https://bugs.python.org/StephenLacy'

    bugs.python.org fields:

    activity = <Date 2013-05-10.01:19:45.907>
    actor = 'ezio.melotti'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2013-05-10.00:56:12.853>
    closer = 'akuchling'
    components = ['Documentation']
    creation = <Date 2012-05-22.04:54:52.410>
    creator = 'Stephen.Lacy'
    dependencies = []
    files = ['27842']
    hgrepos = []
    issue_num = 14878
    keywords = ['patch']
    message_count = 6.0
    messages = ['161320', '161364', '161598', '174503', '188800', '188801']
    nosy_count = 6.0
    nosy_names = ['akuchling', 'eric.araujo', 'docs@python', 'python-dev', 'Stephen.Lacy', 'dhgmgn']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue14878'
    versions = ['Python 2.7']

    @StephenLacy
    Copy link
    Mannequin Author

    StephenLacy mannequin commented May 22, 2012

    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 "PEP-342 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.

    @StephenLacy StephenLacy mannequin assigned docspython May 22, 2012
    @StephenLacy StephenLacy mannequin added the docs Documentation in the Doc dir label May 22, 2012
    @StephenLacy
    Copy link
    Mannequin Author

    StephenLacy mannequin commented May 22, 2012

    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.

    @merwok
    Copy link
    Member

    merwok commented May 25, 2012

    Thanks for the report. Are you interested in making a patch? Guidelines are in the devguide.

    @merwok merwok changed the title send statement from PEP342 is poorly documented. Improve documentation for generator.send method May 25, 2012
    @dhgmgn
    Copy link
    Mannequin

    dhgmgn mannequin commented Nov 2, 2012

    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

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 10, 2013

    New changeset 7b8c0bf8fcb8 by Andrew Kuchling in branch '2.7':
    bpo-14878: add cross-reference to the yield statement.
    http://hg.python.org/cpython/rev/7b8c0bf8fcb8

    @akuchling
    Copy link
    Member

    Thanks for the patch!

    @ezio-melotti ezio-melotti added the type-feature A feature request or enhancement label May 10, 2013
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants