I would like to be able to get the name of a variable as a string but I don\'t know if Python has that much introspection capabilities. Something like:
>&
you can use easydict
>>> from easydict import EasyDict as edict >>> d = edict({'foo':3, 'bar':{'x':1, 'y':2}}) >>> d.foo 3 >>> d.bar.x 1 >>> d = edict(foo=3) >>> d.foo 3
another example:
>>> d = EasyDict(log=False) >>> d.debug = True >>> d.items() [('debug', True), ('log', False)]