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 — The explanation of `gi_suspended` should be added to Types and members · Issue #138966 · python/cpython

The explanation of gi_suspended should be added to Types and members #138966

New issue
Copy link
New issue
Copy link
Closed
Closed
The explanation of gi_suspended should be added to Types and members#138966
Copy link
Labels
docsDocumentation in the Doc dirDocumentation in the Doc direasytriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.

Description

@hyperkai
hyperkai
opened on Sep 16, 2025
Issue body actions

Python doc doesn't have the explanation of gi_suspended to be used to check if the generator is currently suspended(paused) or not so it should be added to Types and members:

def func():
    print(gen.gi_suspended, "func") # False func
    yield 0
    print(gen.gi_suspended, "func") # False func
    yield 1
    print(gen.gi_suspended, "func") # False func
    yield 2
    print(gen.gi_suspended, "func") # False func

gen = func()

print(gen.gi_suspended) # False
print(next(gen))        # 0
print(gen.gi_suspended) # True
print(next(gen))        # 1
print(gen.gi_suspended) # True
print(next(gen))        # 2
print(gen.gi_suspended) # True
print(next(gen))        # StopIteration:

Linked PRs

  • gh-138966: Add description for gi_suspended attribute #139008
  • [3.13] gh-138966: Add description for gi_suspended attribute (GH-139008) #139019
  • [3.14] gh-138966: Add description for gi_suspended attribute (GH-139008) #139020

Activity

  1. hyperkai
    added
    docsDocumentation in the Doc dirDocumentation in the Doc dir
    on Sep 16, 2025
  2. github-project-automation
    added this to docs issueson Sep 16, 2025
  3. github-project-automation
    moved this to Todo in docs issueson Sep 16, 2025
  4. picnixz
    added this to Inspect issues 🔍on Sep 16, 2025
  5. picnixz
    added
    triagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.
    easy
    on Sep 16, 2025
  6. picnixz commented on Sep 16, 2025

    @picnixz
    picnixz
    on Sep 16, 2025
    Member
    More actions

    We should use the same words as those in the comment for https://docs.python.org/3/library/inspect.html#inspect.getgeneratorstate:

        """Get current state of a generator-iterator.
    
        Possible states are:
          GEN_CREATED: Waiting to start execution.
          GEN_RUNNING: Currently being executed by the interpreter.
          GEN_SUSPENDED: Currently suspended at a yield expression.
          GEN_CLOSED: Execution has completed.
        """
  7. codenamenam commented on Sep 17, 2025

    @codenamenam
    codenamenam
    on Sep 17, 2025
    Contributor
    More actions

    I've submitted a pull request.

    While @picnixz suggested using the phrasing from inspect.getgeneratorstate, I followed the more concise style of the directly related gi_running attribute "is the generator running?" for consistency within this table.

    I believe this respects both the meaning from the original suggestion and the established style of the "Types and members" section.

    If you have any other thoughts, please feel free to share. Thank you!

  8. ZeroIntensity
    added a commit that references this issue on Sep 17, 2025

    gh-138966: Add description for `gi_suspended` attribute (GH-139008)

    c025576
  9. miss-islington
    added 2 commits that reference this issue on Sep 17, 2025

    pythongh-138966: Add description for `gi_suspended` attribute (python…

    3316aee

    pythongh-138966: Add description for `gi_suspended` attribute (python…

    1cd96e9
  10. ZeroIntensity
    added a commit that references this issue on Sep 17, 2025

    [3.13] gh-138966: Add description for `gi_suspended` attribute (GH-13…

    b6d8ec3
  11. hugovk
    added a commit that references this issue on Sep 17, 2025

    [3.14] gh-138966: Add description for `gi_suspended` attribute (GH-13…

    82fce82
  12. picnixz
    closed this as completedon Sep 17, 2025
  13. github-project-automation
    moved this to Done in Inspect issues 🔍on Sep 17, 2025
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 direasytriagedThe issue has been accepted as valid by a triager.The issue has been accepted as valid by a triager.

    Projects

    • Inspect issues 🔍
      Status
      Done
      Show more project fields
    • 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 01402503 — 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.