Created
May 6, 2019 17:51
-
-
Save kevinmmartins/8fc7c9faadd9bc1031f22f2f828a0a83 to your computer and use it in GitHub Desktop.
Create a object with dict atributes
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 Aggregator: | |
def __init__(self, *initial_data): | |
for dictionary in initial_data: | |
for key in dictionary: | |
setattr(self, key, dictionary[key]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment