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 rhettinger
Recipients acdha, ezio.melotti,, pitrou, r.david.murray, rhettinger, serhiy.storchaka
Date 2017-03-05.02:45:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
See also, the same feature request from Tarek Ziadé, , "collections.deque could be serialized in JSON as a simple array. The only thing we can lose in the process is the maxlen value, but I think it's a decent behaviour to ignore it when encoding and to set it to None when decoding."

+1 from me as well.  This isn't really different that how we handle tuples and I can see that it would be useful to be able to dump a deque into JSON.  I concur that it is reasonable to ignore maxlen because that is primarily a convenience feature (auto-popping on overflow) rather than something that is intrinsic to the semantics of data itself.

For now, just adding deque support is reasonable.  We can't just do all sequences because string/bytearray like objects would need to be excluded.
Date User Action Args
2017-03-05 02:45:50rhettingersetrecipients: + rhettinger, pitrou, ezio.melotti, r.david.murray,, serhiy.storchaka, acdha
2017-03-05 02:45:50rhettingersetmessageid: <>
2017-03-05 02:45:50rhettingerlinkissue20774 messages
2017-03-05 02:45:49rhettingercreate