Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (16 sloc) 360 Bytes
from greenlet import greenlet
def sub():
print("sub is switching to two.")
g2.switch()
print("sub is done.")
def one():
sub()
def two():
print("two is switching to one.")
g1.switch()
print("two is done.")
g1 = greenlet(one)
g2 = greenlet(two)
print("main switching to one.")
g1.switch()
print("main is done.")
Jump to Line
Something went wrong with that request. Please try again.