Alan Kennedy wrote: > [John] >> Sounds like a case *for* strict parsing, in my opinion. PHP's loose >> parsing made it difficult to figure out why the JSON was invalid. If >> trailing comma handling is to try to work around copy-paste errors, -1 >> from me. > > No, the PHP lib did exactly what it should, IMHO. The PHP lib was > liberal in what it consumed (a dangling comma), and strict in what it > produced (no dangling comma). > > It accepted my broken document with a dangling-comma, and emitted a > strictly conformant document with the offending comma removed, which > enabled my co-worker to proceed with his job.
I prefer liberal, with an option to turn on warnings or be strict. Potentially warnings could be turned on by default, and turned off with the warnings module. (Is there a way to have a warning raise an exception by default? I only know of the command-line option to the interpreter.) Ian _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com