Raymond Hettinger added the comment: There is a difference. An __json__ attribute would have to convert to a list first. Adding support directly to the json module would allow the deque to be read directly.
I think you all are leaning towards premature generalization and making this harder than it needs to be. Chris and Tarek's proposal is a reasonable and straight-forward, but it is not being pushed towards PEP territory and I think Guido would need to opine on whether to enshrine yet another dunder method that would infest the library and privilege the json serialization format over all formats. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20774> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com