[issue2750] Add simplejson to Python 2.6/3.0 standard library
report at bugs.python.org
Tue May 6 16:52:24 CEST 2008
Bob Ippolito <bob at redivi.com> added the comment:
loads will take unicode or str. if it's str then it assumes utf-8,
otherwise the explicitly specified encoding. All of the string instances
generated by loads will be unicode objects (some of them may be str
objects if they're all ASCII as an optimization, I'm not sure if I
implemented that or not).
dumps produces an ASCII str, but if you explicitly specify
ensure_ascii=False then it will return a unicode object.
obviously load and dump will be working on a file-like object so should
be dealing with bytes...
I'm not entirely sure whether semantically dumps should produce bytes or
str in py3k, I guess whatever the other text-based encodings do is
appropriate (e.g. base64, mime).
Tracker <report at bugs.python.org>
More information about the Python-bugs-list