Created
November 7, 2014 22:06
-
-
Save depp/87a5f1079556eb0ed07e to your computer and use it in GitHub Desktop.
Why you shouldn't call super(self.__class__, self).__init__()
This file contains hidden or 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 A(object): | |
def __init__(self): | |
print('A') | |
class B(A): | |
def __init__(self): | |
print('B') | |
super(self.__class__, self).__init__() | |
class C(B): | |
def __init__(self): | |
print('C') | |
super(self.__class__, self).__init__() | |
C() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment