Yep, custom encoder is the way to go for python json.dumps embedded object issues.
But if you don’t wanna write one, check out `simplejson`—it’s a drop-in replacement for `json` with better handling for complex types.
Also, `orjson` is *blazing* fast and handles datetimes out of the box. Just `pip install orjson` and you’re golden.
But if you don’t wanna write one, check out `simplejson`—it’s a drop-in replacement for `json` with better handling for complex types.
Also, `orjson` is *blazing* fast and handles datetimes out of the box. Just `pip install orjson` and you’re golden.
