Created
September 4, 2013 22:51
-
-
Save saadbinakhlaq/6443879 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> class Parent(object): | |
... def __init__(self, name, age): | |
... self.name = name | |
... self.age = age | |
... def rep(self): | |
... print self.name | |
... print self.age | |
>>> class Child(Parent): | |
... def __init__(self, pet): | |
... self.pet = pet | |
... def rep(self): | |
... print self.pet | |
... print self.name | |
>>> c = Child(pet='dog', name='saad') | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: __init__() got an unexpected keyword argument 'name' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment