Specializing Inherited Methods : Inheritance « Class « Python Tutorial






class Super: 
    def method(self): 
        print 'in Super.method' 

class Sub(Super): 
    def method(self):                        
        print 'starting Sub.method'          
        Super.method(self)                   
        print 'ending Sub.method' 

x = Super(  )              
x.method(  )               

x = Sub(  )                
x.method(  )








11.11.Inheritance
11.11.1.Inherit from two base classes
11.11.2.OOP and Inheritance: "Is-a" Relationships
11.11.3.Specializing Inherited Methods
11.11.4.Classes Are Customized by Inheritance