【发布时间】:2014-08-01 14:32:05
【问题描述】:
当我运行下面的程序时:
import matplotlib
class abc(matplotlib):
def anything(self):
print("anything")
aa=abc()
我收到以下错误:
文件“test.py”,第 2 行,在 类 abc(matplotlib):TypeError:调用元类库时出错 module.init() 最多接受 2 个参数(给定 3 个)
我该如何解决?
【问题讨论】:
-
为什么要尝试从模块继承?你想做什么?错误的原因是 matplotlib 是一个模块实例,而不是一个类。
标签: python inheritance matplotlib