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

translate isn't called for dictionaries #6

Open
stratoukos opened this issue Sep 23, 2015 · 1 comment
Open

translate isn't called for dictionaries #6

stratoukos opened this issue Sep 23, 2015 · 1 comment

Comments

@stratoukos
Copy link

I am trying to use a custom dictionary class for all parsed dictionaries and I thought that I could do that using the translate callback to load/loads. Turns out, translate is only called for scalars and lists, but not for dictionaries (even though there is an elif kind == 'table': in process_value).

It would also be useful if there was a way to provide the dict class and have it done automatically (uiri/toml has such an option).

Thanks!

@avakar
Copy link
Owner

avakar commented Sep 24, 2015

Thanks! I guess translate is only called for inline tables. I'll have a look at the problem when I have a bit more time, and I'll probably also add object_hook and object_pairs_hook akin to what json.load has, so you can use object_pairs_hook=OrderedDict directly without going through translate.

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