Serhiy Storchaka added the comment: > I am surprised that dumping to a string and to a file give different answers.
This is a difference between Python and C implementations. An iterable with fake __len__ looks breaking the invariants, but if a collection with overridden __bool__() is considered as more legitimate, the proposed patch fixes Python implementation of json for that case. ---------- components: +Library (Lib) nosy: +bob.ippolito, ezio.melotti, rhettinger, serhiy.storchaka stage: -> patch review versions: +Python 2.7, Python 3.6, Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27613> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com