Specializing Inherited Methods : Inheritance : Class PYTHON TUTORIALS


PYTHON TUTORIALS » Class » Inheritance »

 

Specializing Inherited Methods


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(  )



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Class
» Inheritance