saaj added the comment:
I'll try to be more specific at my point. There're two cases:
1. Scalar: NoneType, int, bool, float, str. Ended immediately.
2. Non-scalar: list/tuple, dict. Recursively traversed, which may result in
subsequent calls to the custom function.
If the retur
saaj added the comment:
Well, as far as I see the question here is whether it makes sense to allow the
default function to return JSON-incompatible objects.
--
___
Python tracker
<http://bugs.python.org/issue21
New submission from saaj:
I was chaning an implementation of the function that is passed to json.dumps to
extend serializable types. By a mistake (**return** instead of **raise**) it
turned into, which at its minum can be expressed as::
def d(obj):
return TypeError(repr(obj