Last active
November 1, 2017 19:50
-
-
Save grihabor/01790de0c5655be0beb56f31b5b50a4e to your computer and use it in GitHub Desktop.
Define attributes all over the code on the fly #bad
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
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