[issue10038] Returntype of json.loads() on strings
New submission from Nik Tautenhahn
Changes by Antoine Pitrou
Fred L. Drake, Jr.
Nik Tautenhahn
Fred L. Drake, Jr.
Nik Tautenhahn
Barry A. Warsaw
Fred L. Drake, Jr.
Changes by Barry A. Warsaw
Changes by Barry A. Warsaw
Changes by Fred L. Drake, Jr.
Antoine Pitrou
Nik Tautenhahn
import json json.loads(json.dumps("abc"))
'abc' If, however, I am evil and hide _json.so (which is the C-part of the json module for speedup), the JSON code falls back to its python implementation and voila:
import json json.loads(json.dumps("abc"))
u'abc'
Not so neat, if your fallback is not a fallback but shows such different behaviour.
----------
_______________________________________
Python tracker
Alternately, the Python implementation may be thought of as definitive and the optimizations are broken.
Walter Dörwald
Barry A. Warsaw
Fred L. Drake, Jr.
Raymond Hettinger
Barry A. Warsaw
Barry A. Warsaw
Barry A. Warsaw
participants (7)
-
Antoine Pitrou
-
Barry A. Warsaw
-
Fred Drake
-
Fred L. Drake, Jr.
-
Nik Tautenhahn
-
Raymond Hettinger
-
Walter Dörwald