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 Decorater, jbfzs, ncoghlan, r.david.murray, rhettinger, serhiy.storchaka, vstinner, Александр Карпинский
Date 2017-11-22.10:04:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511345040.21.0.213398074469.issue27535@psf.upfronthosting.co.za>
In-reply-to
Content
Touching the filesystem implicitly can have all sorts of unintentional side effects (especially in read-only environments), so we strongly prefer not to do that.

The most general solution here would be to turn the warnings registry into an LRU cache - short-lived applications wouldn't see any changes, while long-lived applications with changing warning messages would hit the upper bound and then stay there.

I also like Victor's change to have the "ignore" option skip touching the registry. If we decide we still want to optimise out the linear filter scan for those cases, then I'd suggest lazily building a dispatch table with separate per-category warnings filter lists (updating the dispatch table on the next emitted warning after the filter list changes), and then only falling back to scanning the full filter list for warning categories that aren't an exact match for anything in the dispatch table.
History
Date User Action Args
2017-11-22 10:04:00ncoghlansetrecipients: + ncoghlan, rhettinger, vstinner, r.david.murray, serhiy.storchaka, Decorater, Александр Карпинский, jbfzs
2017-11-22 10:04:00ncoghlansetmessageid: <1511345040.21.0.213398074469.issue27535@psf.upfronthosting.co.za>
2017-11-22 10:04:00ncoghlanlinkissue27535 messages
2017-11-22 10:04:00ncoghlancreate