[Web-SIG] Time a for JSON parser in the standard library?

Bob Ippolito bob at redivi.com
Fri Mar 21 02:19:14 CET 2008


On Thu, Mar 20, 2008 at 5:50 PM, Robert Brewer <fumanchu at aminus.org> wrote:
> Deron Meranda wrote:
>  > And even then, we're not just talking about a JSON parser.  We're all
>  > doing more than that; we're mapping Python to JSON.  And there is
>  > no definitive spec for that.  Just look at my numbers tests; there are
>  > a lot of differences in how numeric mappings are done, but yet many
>  > of them can be arguably "correct" while still doing things
>  differently.
>
>  ...which IMO argues that any json implementation that goes in the stdlib
>  needs to at least allow access to the raw bytes in both directions. For
>  example, if you really want JSON numerals to become Python decimals, you
>  shouldn't be forced to lose information just because the json decoder
>  was only designed to hand you a float. Arbitrary converter plugins would
>  be icing on the cake. A built in decimal converter would be heaven. :)

That can be easily done, but at the expense of speed or clarity in the
implementation... I'd be willing to add some hooks to simplejson that
allow people to pass in their own functions that turn JSON terms (as
strings) into Python objects.

-bob


More information about the Web-SIG mailing list