Serhiy Storchaka added the comment:
This is a duplicate of issue20774.
--
nosy: +serhiy.storchaka
resolution: -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder: -> collections.deque should ship with a stdlib json serializer
_
Raymond Hettinger added the comment:
+1 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)
New submission 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.
--
components: Library (