[issue29992] Expose parse_string in JSONDecoder

Tobias Oberstein report at bugs.python.org
Wed Apr 5 05:58:50 EDT 2017


Tobias Oberstein added the comment:

I agree, my use case is probably exotic: transparent roundtripping of binaries over JSON using a beginning \0 byte marker to distinguish plain string and base64 encoded binaries.

FWIW, I do think however that adding "parse_string" kw param to the ctor of JSONDecoder would at least fit the current approach: there are parse_xxx parameters for all the other things already.

If overriding string parsing would be via subclassing, while all the others stay with the kw parameter approach, that could be slightly confusing too, because it looses on consistency.

Switching everything to subclassing/overriding for _all_ parse_XXX is I guess a no go, because it breaks existing stuff?

> For me in my situation, it'll be messy anyways, because I need to support Py2 and 3, and CPy and PyPy .. I just filed the issue for "completeness".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29992>
_______________________________________


More information about the Python-bugs-list mailing list