@listify 装饰器 - 返回列表而不是生成器
项目描述
安装
$ [sudo] pip install listify
示例
yield
+ list()
>>> def func():
yield "value"
>>> list(func())
list.append()
>>> def func():
result = []
result.append("value")
return result
@listify
>>> @listify
def func():
yield "value"