![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
QQの喵
这个作者很懒,什么都没留下…
展开
-
python 装饰器
多层装饰器原理最外层接收装饰器的参数第二层传递函数, 返回值为下一层函数,不调用其他内层返回下一层函数的调用最内层包装被装饰的函数, 如果被装饰的函数有返回值则返回def one(args, cc): print('----args--', args, cc) def two(func): print('----two') def th...原创 2018-12-20 22:16:06 · 118 阅读 · 0 评论 -
python报错: can't send non-None value to a just-started generator
def gen(): x =0 while True: x = yield x*xa = gen()# next(a)time.sleep(3)for i in range(5): print(a.send(i))在一个生成器函数未启动之前,是不能传递数值进去。必须先传递一个None进去或者调用一次next(g)方法,才能进行传值操作...原创 2019-01-11 08:48:08 · 593 阅读 · 0 评论