我今天早些时候尝试对 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
有人可以解释这个错误吗?谢谢!