Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

as_dict() not working with empty dict values #43

Open
eevleevs opened this issue Jul 9, 2020 · 3 comments
Open

as_dict() not working with empty dict values #43

eevleevs opened this issue Jul 9, 2020 · 3 comments

Comments

@eevleevs
Copy link

eevleevs commented Jul 9, 2020

If you have a value that is an empty dict, it will be set as another FlatDict, that is not cast back by as_dict().

Actual:

>>> FlatDict({'a': {}}).as_dict()
{'a': <FlatDict id=140733286897024 {}>"}

Expected:

>>> FlatDict({'a': {}}).as_dict()
{'a': {}}
@CrashLaker
Copy link

same issue.
it depends on the use case but as a workaround i'm doing this

image

@tgh19
Copy link

tgh19 commented Nov 14, 2023

I have a PR out that should fix this #57

print(FlatDict({'a': {}, 'b': []}).as_dict())
{'a': {}, 'b': []}

@jpo-tu
Copy link

jpo-tu commented Oct 24, 2024

The issue is a little more nuanced, turns out: #59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants