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

Support UserDict and friends #10

Open
acetylen opened this issue Feb 14, 2020 · 1 comment
Open

Support UserDict and friends #10

acetylen opened this issue Feb 14, 2020 · 1 comment

Comments

@acetylen
Copy link

Currently (version 0.3.0) the qtoml dumper doesn't understand UserDicts, which makes using their subclasses annoying. Subclassing dict would of course work, but the internal optimizations of the dict class means that overriding methods can be unpredictable.

@miccoli
Copy link
Contributor

miccoli commented Jul 22, 2020

Also the closest relative to qtoml in the standard library, namely json, does not support UserDict objects:

>>> json.dumps(UserDict(foo='bar'))
...
TypeError: Object of type UserDict is not JSON serializable

May be the best solution would be to implement an extensible TOML encoder, see #11.

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

2 participants