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
You can have all legal string characters as part of the key if you use array notation. For example, obj['!#$%^&*()_']
obj['!#$%^&*()_']