Skip to content

Instantly share code, notes, and snippets.

@pwtail
Created August 16, 2022 18:49
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 pwtail/0f3c7c6c36fd6932b8834215f164dd28 to your computer and use it in GitHub Desktop.
Save pwtail/0f3c7c6c36fd6932b8834215f164dd28 to your computer and use it in GitHub Desktop.
class Super:
def __get__(self, instance, owner):
parent = super(self.owner, instance)
return getattr(parent, self.name)
def __set_name__(self, owner, name):
self.name = name
self.owner = owner
class A:
def f(self):
return self
class B(A):
f = Super()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment