Setting global JsonEncoder in Python
Unfortunately, I could not find a way to set default encoders or decoders for the json module.
So the best way is to do what flask do, that is wrapping the calls to dump or dumps, and provide a default in that wrapper.
Basically, I'm fighting with the age-old problem that Python's default json encoder does not support datetime. However all the solutions I can find call to json.dumps and manually pass the "proper" encoder on each invocation. And honestly, that can't be the best way to do it. Especially if you want to use a wrapper like jsonify to set up your response object properly, where you can't even specify these parameters. 
So: long story short: how to override the global default encoder in Python's JSON implementation to a custom one, that actually does support the features I want?
EDIT: ok so I figured out how to do this for my specific use case (inside Flask). You can do app.json_encoder = MyCustomJSONEncoder there. However how to do this outside of flask would still be an interesting question.