Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not a drop-in replacement #252

Open
coryvirok opened this issue Feb 16, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@coryvirok
Copy link

commented Feb 16, 2017

I tried using this as a drop-in replacement for the standard json library only to find that ujson doesn't support longs.

>>> import ujson
>>> import json
>>> json.loads("272757895493505930073807329622695606794392")
272757895493505930073807329622695606794392L
>>> ujson.loads("272757895493505930073807329622695606794392")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Value is too big!

Are there any plans on supporting longs? If not, can you please update your README?

@Jahaja

This comment has been minimized.

Copy link
Member

commented Feb 16, 2017

It's a drop-in replacement in the same liberal sense that that is a long :)

But yeah, you're right that the readme should point out where it doesn't align with the standard json module.

@coryvirok

This comment has been minimized.

Copy link
Author

commented Feb 17, 2017

Hah, touché!

@ramanan-r

This comment has been minimized.

Copy link

commented Feb 23, 2017

Ujson escapes slashes, while json and simplejson doesn't.

>>> url = {"url":"https://www.google.com"}
>>> json.dumps(url)
'{"url": "https://www.google.com"}'
>>> simplejson.dumps(url)
'{"url": "https://www.google.com"}'
>>> ujson.dumps(url)
'{"url":"https:\\/\\/www.google.com"}'

Please mention differences like this in the ReadMe. It may save some time for dev's in debugging new errors after changing to ujson.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.