我收到一些我不知道的错误。任何线索我的示例代码有什么问题吗?
class B:
    def meth(self, arg):
        print arg
class C(B):
    def meth(self, arg):
        super(C, self).meth(arg)
print C().meth(1)
我从“ super”内置方法的帮助下获得了示例测试代码。
这是错误:
Traceback (most recent call last):
  File "./test.py", line 10, in ?
    print C().meth(1)
  File "./test.py", line 8, in meth
    super(C, self).meth(arg)
TypeError: super() argument 1 must be type, not classobj
仅供参考,这是python本身的帮助(超级):
Help on class super in module __builtin__:
class super(object)
 |  super(type) -> unbound super object
 |  super(type, obj) -> bound super object; requires isinstance(obj, type)
 |  super(type, type2) -> bound super object; requires issubclass(type2, type)
 |  Typical use to call a cooperative superclass method:
 |  class C(B):
 |      def meth(self, arg):
 |          super(C, self).meth(arg)
 |
          
                  python super()的
                
                
                  
                    —
                    用户
                    
                  
                
              
                  方法?那是编程术语,还是……知道吗?请澄清。
                
                
                  
                    —
                    Cplusplusplus 2015年
                    
                  
                
              
                  @Cplusplusplus:可能代表方法;-)
                
                
                  
                    —
                    ShadowFlame 2015年