Author valhallasw
Recipients bob.ippolito, eric.araujo, exarkun, kirubakaran, python-dev, srid, valhallasw
Date 2012-03-17.16:37:46
SpamBayes Score 5.12229e-05
Marked as misclassified No
Message-id <1332002267.03.0.121209230963.issue6566@psf.upfronthosting.co.za>
In-reply-to
Content
JSON does not have the distinction between bytes and unicode; py2 strings are coerced into unicode.

I think it would be better to speak about 'JSON string' or 'JSON string element' if it's JSON and about 'unicode' (2.7) or 'str' (3.x) when speaking about the data that has been decoded again.

>>> json.loads(json.dumps("boo"))
u'boo'
>>> json.loads(json.dumps({"a": "b"}))
{u'a': u'b'}

(the keys will always be unicode in 2.7)
History
Date User Action Args
2012-03-17 16:37:47valhallaswsetrecipients: + valhallasw, bob.ippolito, exarkun, eric.araujo, srid, python-dev, kirubakaran
2012-03-17 16:37:47valhallaswsetmessageid: <1332002267.03.0.121209230963.issue6566@psf.upfronthosting.co.za>
2012-03-17 16:37:46valhallaswlinkissue6566 messages
2012-03-17 16:37:46valhallaswcreate