-
Notifications
You must be signed in to change notification settings - Fork 94
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
Make it possible for from_diff to support custom types (issue #107) #108
Make it possible for from_diff to support custom types (issue #107) #108
Conversation
Thanks for the pull request - looks great! Could you add a simple example to the tutorial? Thanks :) |
I will do. Do you have any opinion on what to do about |
I see no reason to deprecate those two. We could also add an optional parameter to those two functions. |
Additionally: * from_string gets a loads parameter * to_string gets a dumps_parameter * documentation added * added more tests
@stefankoegl sorry about the delay in getting the PR updated, real life intervened. I have added some documentation as requested, and used I have also made it possible to subclass Let me know if you have any comments and I'll get things turned around quicker this time :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one little inline comment. Everything else looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefankoegl should we merge this PR?
Merged, thanks :) |
This makes it possible to pass a custom
dumps
implementation tofrom_diff
to support types not natively supported by Python's json module.I have not dealt with
from_string
andto_string
which also use the json module. The easy solution here would be to deprecate them and rely on people using whichever implementation of json dumping and loading they prefer.