Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python override inherited method class model constructor

class Parent(object):
    def __init__(self, a, b):
        print 'a', a
        print 'b', b

class Child(Parent):
    def __init__(self, c, d, *args, **kwargs):
        print 'c', c
        print 'd', d
        super(Child, self).__init__(*args, **kwargs)

test = Child(1,2,3,4)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #override #inherited #method #class #model #constructor
ADD COMMENT
Topic
Name
3+7 =