Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

inherit functions from other classes

class Common(object):
    def __init__(self,x):
        self.x = x
    def sharedMethod(self):
        print self.x

class Alpha(Common):
    def __init__(self):
        Common.__init__(self,"Alpha")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #inherit #functions #classes
ADD COMMENT
Topic
Name
4+8 =