Skip to content

Instantly share code, notes, and snippets.

@lostmsu
Created May 23, 2020 20:19
Show Gist options
  • Save lostmsu/f9370029a389fd54493a1b1631917e77 to your computer and use it in GitHub Desktop.
Save lostmsu/f9370029a389fd54493a1b1631917e77 to your computer and use it in GitHub Desktop.
class List:
def add(self, item): ...
class ListMixin:
def append(self, item): return self.add(item)
def mix_in(target_type, mixin):
???
mix_in(List, ListMixin)
l = List()
l.append(42)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment