Created
January 27, 2021 10:01
-
-
Save arpol/7e2c61f3fc4a4e5b5360acab78a9bd40 to your computer and use it in GitHub Desktop.
Convert Python dict to a namespace object
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
# Create a namespace of variables: | |
class Bunch(object): | |
def __init__(self, adict): | |
self.__dict__.update(adict) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment