Created
February 4, 2020 21:35
-
-
Save sjvrijn/3de054a81756a757f39b6ddafd71bc1a to your computer and use it in GitHub Desktop.
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
# source: https://twitter.com/Pen_Bird/status/1218965711780904960 | |
# it supports map['foo'] = 42, AND http://map.foo = 42, because its __dict__ is itself | |
class Map(dict): | |
def __init__(self, **kwargs): | |
super(Map, self).__init__(**kwargs) | |
self.__dict__ = self |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment