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 return value is restricted to given types (what the encoder is capable 
on its own), it is harder to shoot oneself in the foot. 

In other words what's the point of returning arbitrary Python object from the 
function?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21213>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to