On Wed, Apr 9, 2008 at 8:04 PM, John Millikin <[EMAIL PROTECTED]> wrote: > On Wed, Apr 9, 2008 at 7:20 PM, Ian Bicking <[EMAIL PROTECTED]> wrote: > > 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.) > > > I forgot about the warnings module. > > For "exception by default" behavior, the library can call > warnings.simplefilter ("error", JSONWarning) on initialization. Then > we just define various subclasses of JSONWarning for the different > warning types (trailing comma, illegal whitespace, NaN etc). If users > want to ignore some or all of the warnings, they can specify which (or > all). Best of all, it wouldn't require long parameter lists.
That sounds like a really bad idea, if there is an option to change the behavior it shouldn't live in module state. -bob _______________________________________________ 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