summaryrefslogtreecommitdiff
path: root/simplejson/compat.py
Commit message (Collapse)AuthorAgeFilesLines
* Support builds without cStringIO.cStringIOSerhiy Storchaka2018-04-251-5/+6
| | | | | The cStringIO module is optional. Fall back to StringIO if it is not available.
* Simplify compatibility code.compatSerhiy Storchaka2018-04-241-9/+2
| | | | | Since minimal supported Python 3 version is 3.3, the u() helper no longer needed.
* Remove fromhex all togetherRoy Williams2016-09-221-10/+0
|
* Add support for Python 2.5Roy Williams2016-09-221-2/+6
|
* Use binascii instead of codecsRoy Williams2016-09-221-4/+3
|
* Use `codecs.decode` in Python 2 as opposed to `str.decode` in Python 2.Roy Williams2016-09-211-2/+3
| | | | | | | | | | | | | | | | | | | I am investigating a migration to Python 3, and to facilitate this we are using the `-3` flag as decribed here: https://docs.python.org/3/howto/pyporting.html#prevent-compatibility-regressions . When using this flag, I get warnings from simplejson about the use of decode. While obviously this is a invalid warning since this code is gated in Python 2, committing this change will allow users to run their code in `-3` mode in Python 2 without warnings from simplejson. Microbenchmarking this change with `timeit` also reveals it's faster! ```py >>> import timeit >>> timeit.timeit("decode_hex('4f6c6567')[0]", setup="import codecs; decode_hex = codecs.getdecoder('hex_codec')") 0.6572110652923584 >>> timeit.timeit("'4f6c6567'.decode('hex')") 0.9076640605926514 ```
* improve Python 3.3 compat #87, bump to 3.3.3v3.3.3Bob Ippolito2014-02-141-1/+4
|
* First pass at Python 3.3 compatibilityBob Ippolito2012-12-281-0/+43
First pass at Python 3.3 compatibility, bump to 3.0.0