Last active
January 9, 2016 07:30
-
-
Save twmht/f2af6c8c58b6107a1ddc to your computer and use it in GitHub Desktop.
add random atrtributes
This file contains hidden or 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 Struct: | |
def __init__(self, **entries): | |
self.__dict__.update(entries) | |
a = Struct(x = 5,y = 6) | |
print a.x | |
print vars(a) | |
print a.__dict__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment