I find it more convenient to access dict keys as obj.foo instead of obj[\'foo\'], so I wrote this snippet:
obj.foo
obj[\'foo\']
class AttributeDict(dict
What if you wanted a key which was a method, such as __eq__ or __getattr__?
__eq__
__getattr__
And you wouldn't be able to have an entry that didn't start with a letter, so using 0343853 as a key is out.
0343853
And what if you didn't want to use a string?