Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
It's possible to have an extremely simple standard-conformant JSON parser!
# RFC 7159 § 9
# "An implementation may set limits on the size of texts that it accepts."
def parse_json(text):
if len(text) != 1:
raise ValueError("Only accepts single character JSON values")
return int(text[0])
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.