Skip to content

Instantly share code, notes, and snippets.

@adw0rd
Created November 22, 2018 15:49
Show Gist options
  • Save adw0rd/28cc4e2d510b498fa4592a355fcf9a16 to your computer and use it in GitHub Desktop.
Save adw0rd/28cc4e2d510b498fa4592a355fcf9a16 to your computer and use it in GitHub Desktop.
class Base:
prop = 42
other = 1
def func(self):
print('Base func')
return self.prop
class Child(Base):
other = 2
def func(self):
print('Child func')
super().func()
print(self.prop)
print(self.other)
print(super().other)
Child().func()
@adw0rd
Copy link
Author

adw0rd commented Nov 22, 2018

Result:

Child func
Base func
42
2
1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment