This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients ncoghlan, r.david.murray
Date 2017-12-06.13:21:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512566467.0.0.213398074469.issue32229@psf.upfronthosting.co.za>
In-reply-to
Content
Warnings aren't off by default in general - we just add implicit "ignore" filters for a few specific types.

So the primary functionality is to opt in to hiding *all* warnings, but to do it in a way that can be overridden by PYTHONWARNINGS, the interpreter's "-W" switch and the new "-X dev" mode.

For that, the usage looks like:

    import warnings
    warnings.hide_warnings()

Essentially, it flips the default behaviour over to "ignore everything", but reverts to the regular default if there are any config settings supplied.

The odd structure of my opening message arises from the fact that *given* such a modified default, it's then surprisingly tricky to say "hide warnings, except for those from modules I'm responsible for". That latter complication then becomes the rationale for the design of the proposed "show" parameter to carve out exceptions to the overall "hide everything" filter.
History
Date User Action Args
2017-12-06 13:21:07ncoghlansetrecipients: + ncoghlan, r.david.murray
2017-12-06 13:21:07ncoghlansetmessageid: <1512566467.0.0.213398074469.issue32229@psf.upfronthosting.co.za>
2017-12-06 13:21:06ncoghlanlinkissue32229 messages
2017-12-06 13:21:06ncoghlancreate