Ugh, yeah, json.dumps can be a pain.
If you’re using Django or similar, check if your framework has built-in serializers. Otherwise, `default=lambda o: getattr(o, '__dict__', str(o))` is a lazy fix.
Also, `orjson` is a faster alternative that handles some extra types—might be worth a look!
If you’re using Django or similar, check if your framework has built-in serializers. Otherwise, `default=lambda o: getattr(o, '__dict__', str(o))` is a lazy fix.
Also, `orjson` is a faster alternative that handles some extra types—might be worth a look!
