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
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