Created
May 22, 2018 17:13
-
-
Save lanfon72/782d5a5754c613f60138faf6bc0079ef to your computer and use it in GitHub Desktop.
wtf self and __class__
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 A: | |
def calc(self): | |
print('A', __class__, self) | |
class B(A): | |
def calc(self): | |
print('B', __class__, self) | |
super().calc() | |
class C(B): | |
pass | |
C().calc() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment