[Web-SIG] Time a for JSON parser in the standard library?
Ian Bicking
ianb at colorstudy.com
Thu Apr 10 09:25:40 CEST 2008
John Millikin wrote:
> 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.
What reason is there for all the different flags? Why not just strict
and loose?
--
Ian Bicking : ianb at colorstudy.com : http://blog.ianbicking.org
More information about the Web-SIG
mailing list