擅长:python、mysql、java
<p>正确的方法是这样调用<code>super</code></p>
<pre><code># Python 2.7 using new style classes
class Inherited(Mainclass):
"""
Inherited class from the Main Class
"""
def display(self):
print("**********")
super(Mainclass,self).display(self)
print("**********")
</code></pre>
<p>或者这样</p>
<pre><code># Python 3.x
class Inherited(Mainclass):
"""
Inherited class from the Main Class
"""
def display(self):
print("**********")
super().display(self)
print("**********")
</code></pre>