This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients SilentGhost, altvod, r.david.murray
Date 2016-07-25.13:48:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1469454522.47.0.90440384421.issue27613@psf.upfronthosting.co.za>
In-reply-to
Content
If you break the invariants (in this case: a list has an accurate len) code that expects lists is only going to work by accident.

What you really want to do is define your own json encoder for your type.  If that isn't possible for a streamed sequence of undefined length, then enhancing json's extension machinery to allow it would be a good feature request.

That said, could json's ability to handle this be improved?  Possibly.  I think we would accept a patch if it doesn't make the code more complicated.  Ideally handling certain cases as "don't care" makes the code simpler, but that may or may not be the case here.  Or it may come out as a consequence of the enhancement.
History
Date User Action Args
2016-07-25 13:48:42r.david.murraysetrecipients: + r.david.murray, SilentGhost, altvod
2016-07-25 13:48:42r.david.murraysetmessageid: <1469454522.47.0.90440384421.issue27613@psf.upfronthosting.co.za>
2016-07-25 13:48:42r.david.murraylinkissue27613 messages
2016-07-25 13:48:42r.david.murraycreate