print Derive" />
发布时间:2019-09-15 10:01:33编辑:auto阅读(2429)
今天遇到这个错误:
Traceback (most recent call last):
File "t2.py", line 14, in <module>
print Derived().meth()
File "t2.py", line 10, in meth
super(Derived,self).meth()
TypeError: must be type, not classobj
试验代码如下:
- class Base():
- def meth(self):
- print "i'm base"
- class Derived(Base):
- def meth(self):
- super(Derived,self).meth()
- print "this is derived"
- print Derived().meth()
- class Base(object):
- def meth(self):
- print "i'm base"
上一篇: Windows下Python自动补全
下一篇: python telnet 登录
51592
51180
41683
38445
32931
29916
28623
23587
23517
21865
2023°
2733°
2282°
2211°
2684°
2238°
2985°
4922°
4780°
3399°