GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Inaccurate terminology in the “Generator functions” section · Issue #156837 · python/cpython

Inaccurate terminology in the “Generator functions” section #156837

New issue
Copy link
New issue
Copy link
Closed
#156863
Closed
Inaccurate terminology in the “Generator functions” section#156837
#156863
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir

Description

@dluschan
dluschan
opened on Sep 2, 2026
Issue body actions

Documentation

The wording in section 3.2.8.3 is potentially misleading:

“A function or method which uses the yield statement … is called a generator function.”

and later:

“the function … provides a value using the yield statement.”

yield is not necessarily a yield statement (yield_stmt in the grammar). It can also occur as part of an expression, for example:

def f():
    x = yield 5

Here yield 5 is a yield expression, but f is still a generator function.

It may be more accurate to refer to a function that contains a yield expression rather than one that “uses the yield statement”.

Linked PRs

  • gh-156837: Refer to yield expressions in generator function definitions #156863
  • [3.14] gh-156837: Refer to yield expressions in generator function definitions (GH-156863) #157218
  • [3.13] gh-156837: Refer to yield expressions in generator function definitions (GH-156863) #157219
  • [3.15] gh-156837: Refer to yield expressions in generator function definitions (GH-156863) #157220

Activity

  1. dluschan
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Sep 2, 2026
  2. github-project-automation
    added this to docs issueson Sep 2, 2026
  3. github-project-automation
    moved this to Todo in docs issueson Sep 2, 2026
  4. StanFromIreland commented on Sep 2, 2026

    @StanFromIreland
    StanFromIreland
    on Sep 2, 2026
    Member
    More actions

    CC @encukou

  5. dluschan commented on Sep 2, 2026

    @dluschan
    dluschan
    on Sep 2, 2026
    Author
    More actions

    There is a similar issue with the use of the term “statement” below, in section 3.2.8.5 (“Asynchronous generator functions”).

  6. lul-cas commented on Sep 2, 2026

    @lul-cas
    lul-cas
    on Sep 2, 2026
    SponsorContributor
    More actions

    Hi!
    Opened a PR for this.

  7. encukou
    closed this as completedin #156863on Sep 9, 2026
  8. encukou
    added 3 commits that reference this issue on Sep 9, 2026

    gh-156837: Refer to yield expressions in generator function definitio…

    2723799

    [3.13] gh-156837: Refer to yield expressions in generator function de…

    2932294

    [3.14] gh-156837: Refer to yield expressions in generator function de…

    c494a34
  9. maurycy
    added a commit that references this issue on Sep 10, 2026

    Merge branch 'main' into tachyon-native-callable

    e028ff5
  10. hugovk
    added a commit that references this issue on Sep 11, 2026

    [3.15] gh-156837: Refer to yield expressions in generator function de…

    aa67b3f
  11. clin1234
    added a commit that references this issue on Sep 12, 2026

    pythongh-156837: Refer to yield expressions in generator function def…

    deb649d
  12. johnslavik
    added a commit that references this issue on Sep 14, 2026

    pythongh-156837: Refer to yield expressions in generator function def…

    d0f7f14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirDocumentation in the Doc dir

    Projects

    • docs issues
      Status
      Todo
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.