You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm in the process of migrating from the build-in json encoder library to the much faster Orjson library, in a rather large project. One of the approaches I've been looking at is to monkey-patch the requests library, so that I don't have to rewrite all the handlers.
This is easier said than done unfortunately. So I'm now looking at httpx, but unfortunately I would still have to monkey-patch the _main and the _models modules.
It would be great if there way a way to specify custom dumps and loads handlers for JSON.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm in the process of migrating from the build-in
json
encoder library to the much fasterOrjson
library, in a rather large project. One of the approaches I've been looking at is to monkey-patch therequests
library, so that I don't have to rewrite all the handlers.This is easier said than done unfortunately. So I'm now looking at httpx, but unfortunately I would still have to monkey-patch the
_main
and the_models
modules.It would be great if there way a way to specify custom
dumps
andloads
handlers for JSON.For example Pydantic supports this using the json_loads and json_dumps properties in its Config: https://docs.pydantic.dev/usage/exporting_models/#custom-json-deserialisation
Beta Was this translation helpful? Give feedback.
All reactions