While investigating how to save the flattened dictionary computed by FlatDict, I noticed that the result of casting a FlatDict to a dict is always empty. Not sure if this is was by design, but wouldn't it be more appropriate for a dict cast of a FlatDict to return what dict(f.iteritems()) returns below?
Thanks for the issue and sorry for the long delay. I just pushed a cleanup of the library to master and will release v2.0.0 soon. I added a test case for your expected behavior.
While investigating how to save the flattened dictionary computed by FlatDict, I noticed that the result of casting a FlatDict to a dict is always empty. Not sure if this is was by design, but wouldn't it be more appropriate for a dict cast of a FlatDict to return what
dict(f.iteritems())
returns below?Relatedly, it would be nice to add a
FlatDict.as_flat_dict()
method that would return the flattened dict (rather than the original unflattened dict).I'm using flatdict 1.2.0 with Python 2.7.11 on Ubuntu 14.04.3.