Guest User

Untitled

a guest
Jun 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1.  
  2. class object_dict(dict):
  3. """Index to attribute proxy object.
  4.  
  5. >>> od = object_dict({"a": 1, "b": 2})
  6. >>> od.a
  7. 1
  8. >>> od.b
  9. 2
  10.  
  11. """
  12.  
  13. __getattr__= dict.__getitem__
  14. __setattr__ = dict.__setitem__
Add Comment
Please, Sign In to add comment