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 :) |
|
Just one little inline comment. Everything else looks great! |
|
@stefankoegl should we merge this PR? |
|
Merged, thanks :) |
This makes it possible to pass a custom
dumpsimplementation tofrom_diffto support types not natively supported by Python's json module.I have not dealt with
from_stringandto_stringwhich 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.