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
112 stars 32 forks source link

Fix empty nested Flatterdict #30

Closed wsantos closed 5 years ago

wsantos commented 5 years ago

Problem:

In [1]: import flatdict  

In [2]: dd = { 
   ...:     "inner": [] 
   ...: }      

In [3]: flatdict.FlatterDict(dd).as_dict()                                                                                
Out[3]: {'inner': <FlatterDict id=4602756288 {}>"}

Expected output

In [3]: flatdict.FlatterDict(dd).as_dict()                                                                                
Out[3]: {'inner': []}
gmr commented 5 years ago

Thanks!