Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment: Things are more complicated. bytes object is an iterable. I think serialize an bytes object (which can be unexpectedly leaked in a code ported from 2.7) as a list of integers is not expected behavior in most cases. It is safer to fail by default and provide an explicit handling for bytes if it is needed. There are other iterables that are better not to serialize by default: mappings, which are not dict subclasses, exhaustible iterators.
I'm working on large patch for the json module (maybe even a PEP). It will not allow serializing all iterables by default, but will make easy to switch on serialization for particular types, including iterables. ---------- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka priority: normal -> low _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue14573> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com