gmr / flatdict

Python module for interacting with nested dicts as a single level dict with delimited keys.
https://flatdict.readthedocs.io
BSD 3-Clause "New" or "Revised" License
111 stars 32 forks source link

Calling get on a sub-dictionary always returns None #9

Closed ksindi closed 7 years ago

ksindi commented 8 years ago

Is this expected behavior?

>>> import flatdict
>>> D = {'a': {'b': {'c': 0}}}
>>> F = flatdict.FlatDict(D)
>>> F['a:b:c']
0
>>> F.get('a:b:c')
0
>>> F['a:b']
{'c': 0}
>>> F.get('a:b')
None

I would have expected F.get('a:b') to also return {'c': 0}.