
Jan. 7, 2017
2:14 a.m.
On Sat, 7 Jan 2017 at 03:23 Glyph Lefkowitz <glyph@twistedmatrix.com> wrote:
Even if we do this though - is there any way to convince json.dumps to behave consistently between 2/3 for the purposes of examples?
As far as I know, the only way to handle this is with an if PY3 or if isinstance(…). I don't know of a way to make json.dumps on Python 2 consistently return unicode, and I don't know of a way to make json.dumps on Python 3 return bytes.