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:
deffunc():
print(gen.gi_suspended, "func") # False funcyield0print(gen.gi_suspended, "func") # False funcyield1print(gen.gi_suspended, "func") # False funcyield2print(gen.gi_suspended, "func") # False funcgen=func()
print(gen.gi_suspended) # Falseprint(next(gen)) # 0print(gen.gi_suspended) # Trueprint(next(gen)) # 1print(gen.gi_suspended) # Trueprint(next(gen)) # 2print(gen.gi_suspended) # Trueprint(next(gen)) # StopIteration:
Linked PRs
Python doc doesn't have the explanation of
gi_suspendedto be used to check if the generator is currently suspended(paused) or not so it should be added to Types and members:Linked PRs
gi_suspendedattribute (GH-139008) #139019gi_suspendedattribute (GH-139008) #139020