Skip to content

Instantly share code, notes, and snippets.

@youtux
Created June 10, 2021 13:55
Show Gist options
  • Select an option

  • Save youtux/ad398ea628bb1fd83e9aee66a868342e to your computer and use it in GitHub Desktop.

Select an option

Save youtux/ad398ea628bb1fd83e9aee66a868342e to your computer and use it in GitHub Desktop.
Python quick n dirty object wrapper
class Wrapper(object):
def __init__(self, wrappee):
self.wrappee = wrappee
# Override your method here
def foo(self):
print('override foo')
def __getattr__(self, attr):
return getattr(self.wrappee, attr)
class Wrappee(object):
def foo(self):
print('foo')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment