Automatically advancing a bi-directional generator to the point of accepting a non-None value?

后端 未结 0 896
独厮守ぢ
独厮守ぢ 2020-11-22 01:02

Suppose we write a very simple bi-directional generator in Python:

def share_of_total():
    s = 0
    new_num = 0
    while True:
        new_num = yield new         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题