Yo, json.dumps() can be a pain with custom objects. If you’re getting errors, it’s probably cuz your data has stuff json doesn’t like.
Quick tip: Use a custom encoder. Like, subclass json.JSONEncoder and override the default() method to handle your weird types.
Also, if you’re dealing with nested/complex data, maybe try `jsonpickle`? It’s not pure json, but it’ll serialize almost anything.
Quick tip: Use a custom encoder. Like, subclass json.JSONEncoder and override the default() method to handle your weird types.
Also, if you’re dealing with nested/complex data, maybe try `jsonpickle`? It’s not pure json, but it’ll serialize almost anything.
