Created
February 23, 2019 18:12
-
-
Save justinsantoro/8605220cadd2bcc55764f016e7753f1a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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