Skip to content

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

@hyperkai

Description

@hyperkai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc direasytriagedThe issue has been accepted as valid by a triager.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions