我今天早些时候试图将threading.Condition子类化,但它没有成功.当我尝试子类化threading.Condition类时,这是Python解释器的输出:
>>> import threading
>>> class ThisWontWork(threading.Condition):
... pass
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Error when calling the metaclass bases
function() argument 1 must be code, not str
Run Code Online (Sandbox Code Playgroud)
有人可以解释这个错误吗?谢谢!