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

John Millikin jmillikin at gmail.com
Thu Apr 10 08:01:07 CEST 2008


On Wed, Apr 9, 2008 at 10:15 PM, Bob Ippolito <bob at redivi.com> wrote:
>  That sounds like a really bad idea, if there is an option to change
>  the behavior it shouldn't live in module state.
>
Would you rather have strictness controls as parameters? demjson
currently has seventeen of those. Maybe we could have loads(bytes) and
loads_broken(bytes, allow_trailing_comma, allow_all_whitespace,
allow_comments, ...) functions, one for parsing JSON, the other for
parsing garbage.  There's no real way to hide or remove the complexity
in parsing invalid data, so both warnings and parameters will cause
the implementation to be much larger, but at least having to call
warnings.filter ("ignore", JSONWarning) might serve to make some users
think twice.


More information about the Web-SIG mailing list