Issue 9087: json docstrings on 3.x still use 'unicode' and 'str' (original) (raw)
In the json package there are still lot of docstrings that refer to 'unicode' and 'str' instead of 'str' and 'bytes' (AFAIU 'bytes' are not even allowed anymore in several places, so there should probably be only 'str' there). A few examples:
in json/init.py: If
skipkeys
is true thendict
keys that are not basic types (str
,unicode
,int
,float
,bool
,None
) will be skipped instead of raising aTypeError
. Ifensure_ascii
is false, then the some chunks written tofp
may beunicode
instances, subject to normal Pythonstr
tounicode
coercion rules.in json/decoder.py: Decode a JSON document from
s
(astr
orunicode
beginning with a JSON document) and return a 2-tuple of the Python representation and the index ins
where the document ended.in json/encoder.py: If ensure_ascii is true, the output is guaranteed to be str objects with all incoming unicode characters escaped. If ensure_ascii is false, the output will be unicode object.
Note that the documentation (Doc/library/json.rst) seems already updated, so update the docstrings should be enough.