Skip to content

Instantly share code, notes, and snippets.

@saadbinakhlaq
Created September 4, 2013 22:51
Show Gist options
  • Save saadbinakhlaq/6443879 to your computer and use it in GitHub Desktop.
Save saadbinakhlaq/6443879 to your computer and use it in GitHub Desktop.
>>> 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