Skip to content

Instantly share code, notes, and snippets.

@lanfon72
Created May 22, 2018 17:13
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 lanfon72/782d5a5754c613f60138faf6bc0079ef to your computer and use it in GitHub Desktop.
Save lanfon72/782d5a5754c613f60138faf6bc0079ef to your computer and use it in GitHub Desktop.
wtf self and __class__
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