butler
butler copied to clipboard
implement 'at' similar to 'get' but throws error
Ref: http://www.reddit.com/r/Python/comments/22fdpj/butler_python_dictionaries_and_lists_on_steroids/cgn16dy
python dicts have a way to now throw if the key isn't found:
foo['x'] # <- throws!
foo.get('x') # <- returns None
You could have the same thing:
foo.at('a', 'b', 'c') # <- throws!
foo.get('a', 'b', 'c') # returns None