2014-03-30 21:14:55 +01:00
|
|
|
def gen():
|
|
|
|
yield from (1, 2, 3)
|
|
|
|
|
|
|
|
def gen2():
|
|
|
|
yield from gen()
|
|
|
|
|
2015-05-09 22:41:34 +01:00
|
|
|
def gen3():
|
|
|
|
yield from (4, 5)
|
|
|
|
yield 6
|
|
|
|
|
2014-03-30 21:14:55 +01:00
|
|
|
print(list(gen()))
|
|
|
|
print(list(gen2()))
|
2015-05-09 22:41:34 +01:00
|
|
|
print(list(gen3()))
|