这是我的代码:
class A(object):
def test(self): pass
class B(A): pass
我的问题是当我运行 super(B).test 时,出现以下异常:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'super' object has no attribute 'test'
我看到 python 文档:“super(type) -> unbound super object”,为什么它不起作用?我希望有人能给出一个正确使用“super(type)”的例子,谢谢
最佳答案
关于python - 如何在Python中使用 'super(type)'?AttributeError : 'super' object has no attribute 'test' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44493780/