Skip to content

Instantly share code, notes, and snippets.

@makmanalp
Created June 7, 2016 02:23
Show Gist options
  • Save makmanalp/5b8dfbcfd645306ba0e4fe5e935cb6ec to your computer and use it in GitHub Desktop.
Save makmanalp/5b8dfbcfd645306ba0e4fe5e935cb6ec to your computer and use it in GitHub Desktop.
Code in the body of a class - 11
In [1]: class Foo(object):
...: for i in range(3):
...: locals()["x" + str(i)] = i
...:
In [2]: Foo.x2
Out[2]: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment