Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@emirotin
Created July 27, 2011 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emirotin/1108823 to your computer and use it in GitHub Desktop.
Save emirotin/1108823 to your computer and use it in GitHub Desktop.
>>> class A(object):
... def __init__(self, x):
... self.x = x
...
>>> class B(A):
... def __init__(self, x):
... super(B, self).__init__(x)
... print x
...
>>> B.__name__ = A.__name__
>>> b = B(1)
1
>>> b.__class__.__name__
'A'
>>> isinstance(b, B)
True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment