classification
Title: Encode set, frozenset, bytearray, and iterators as json arrays
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: bob.ippolito Nosy List: bob.ippolito, javenoneal
Priority: normal Keywords:

Created on 2017-08-09 09:23 by javenoneal, last changed 2017-08-09 19:15 by rhettinger.

Pull Requests
URL Status Linked Edit
PR 3034 open javenoneal, 2017-08-09 09:23
Messages (1)
msg299981 - (view) Author: Javen O'Neal (javenoneal) * Date: 2017-08-09 09:23
Currently json.dump, json.dumps, and json.JSONEncoder do not support writing iterator objects. Users can choose to pass the iterator to a tuple and write that as a json array, but this is wasteful if the iterator is large, requiring a large amount of memory to be temporarily allocated for the tuple prior to json encoding.

The json module also does not support writing sets, frozensets, or bytearrays.
History
Date User Action Args
2017-08-09 19:15:47rhettingersetassignee: bob.ippolito

nosy: + bob.ippolito
2017-08-09 09:23:16javenonealcreate