Created
August 17, 2016 02:45
-
-
Save kkirsche/b7c122f756ed551d006f434b99b91d57 to your computer and use it in GitHub Desktop.
Python kwargs initialization method
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
| def __init__(self, **kwargs): | |
| for key, value in kwargs.items(): | |
| setattr(self, key, value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment