如何返回一个空的生成器:
>>> def foo():
... return
... yield
...
>>> foo()
<generator object foo at 0x01C46968>
>>> list(foo())
[]
>>>
如何返回一个空的生成器:
>>> def foo():
... return
... yield
...
>>> foo()
<generator object foo at 0x01C46968>
>>> list(foo())
[]
>>>
Comments