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 <rep...@bugs.python.org>
<http://bugs.python.org/issue29992>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to