python报"TypeError: object of type 'Greenlet' has no len()"

TypeError: object of type 'Greenlet' has no len()

问题代码:

gevent.joinall(

gevent.spawn(func1),

gevent.spawn(func2),

gevent.spawn(func3),

)

应该为:

gevent.joinall([

gevent.spawn(func1),

gevent.spawn(func2),

gevent.spawn(func3),

])

总结:gevent.joinall()的参数应该为列表形式[ gevent.spawn(func1), gevent.spawn(func2), gevent.spawn(func3),]

原文地址:https://www.cnblogs.com/gangzi4321/p/10987565.html