Skip to content

Instantly share code, notes, and snippets.

@grihabor
Last active November 1, 2017 19:50
Show Gist options
  • Save grihabor/01790de0c5655be0beb56f31b5b50a4e to your computer and use it in GitHub Desktop.
Save grihabor/01790de0c5655be0beb56f31b5b50a4e to your computer and use it in GitHub Desktop.
Define attributes all over the code on the fly #bad
class X:
def __init__(self):
self.a = 'a'
def run(self, b)
self.b = 'b'
x = X()
x.c = 'c'
x.run('b')
print(x.a, x.b, x.c)
#|a b c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment