I have a data structure which essentially amounts to a nested dictionary. Let\'s say it looks like this:
{\'new jersey\': {\'mercer county\': {\'plumbers\':
I like the idea of wrapping this in a class and implementing __getitem__
and __setitem__
such that they implemented a simple query language:
>>> d['new jersey/mercer county/plumbers'] = 3
>>> d['new jersey/mercer county/programmers'] = 81
>>> d['new jersey/mercer county/programmers']
81
>>> d['new jersey/mercer country']
If you wanted to get fancy you could also implement something like:
>>> d['*/*/programmers']
but mostly I think such a thing would be really fun to implement :D