I noticed a bug with FlatterDict today and am curious about how to try and tackle it. The problem is that if I have an iterable, if its depth is an odd number in the dictionary, the as_dict() method won't return it properly. For example:
will not return list as a list. I've made a fork and added an instance like this to the tests. Looking through the code this seems to occur because in as_dict() the parent key and child key are always retrieved as a pair, even though in an odd-depth the parent key's original type might be an iterable.
I noticed a bug with
FlatterDict
today and am curious about how to try and tackle it. The problem is that if I have an iterable, if its depth is an odd number in the dictionary, theas_dict()
method won't return it properly. For example:works fine, but
will not return
list
as a list. I've made a fork and added an instance like this to the tests. Looking through the code this seems to occur because inas_dict()
the parent key and child key are always retrieved as a pair, even though in an odd-depth the parent key's original type might be an iterable.