Skip to content

Instantly share code, notes, and snippets.

@justinsantoro
Created February 23, 2019 18:12
Show Gist options
  • Save justinsantoro/8605220cadd2bcc55764f016e7753f1a to your computer and use it in GitHub Desktop.
Save justinsantoro/8605220cadd2bcc55764f016e7753f1a to your computer and use it in GitHub Desktop.
def outside_function(obj):
obj.foo = 'baz'
class Test(object):
def __init__(self):
self.foo = 'bar'
def do_something(self):
outside_function(self)
print(self.foo)
if __name__ == '__main__':
x = Test()
x.do_something()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment