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

add default hook to loads() #44

Closed
LBdN opened this issue Jan 2, 2020 · 3 comments
Closed

add default hook to loads() #44

LBdN opened this issue Jan 2, 2020 · 3 comments

Comments

@LBdN
Copy link

LBdN commented Jan 2, 2020

Without a default hook in loads, the value of the default hook on dumps is small.

The pattern of having classes with method from_json() and to_json() is really useful when combined with a default hook.

@ijl
Copy link
Owner

ijl commented Jan 3, 2020

There are many python libraries that try to do something like this, e.g., marshmallow. I suggest using one of them.

@LBdN
Copy link
Author

LBdN commented Jan 3, 2020

it's true but aren't they one or two order of magnitude slower ? speed is important in my case and the reason for my request.

@ijl
Copy link
Owner

ijl commented Jan 4, 2020

Yes they're slow, and in terms of effort I think marshmallow is a six year project with over a hundred contributors. I'm not interested but of course the option is there to fork and implement this for yourself.

@ijl ijl closed this as completed Jan 4, 2020
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