On 02/09/2021 11:41, Chris Angelico wrote:
On Thu, Sep 2, 2021 at 7:36 PM Peter Otten <__pete...@web.de> wrote:

On 02/09/2021 04:32, Steven D'Aprano wrote:
On Wed, Sep 01, 2021 at 03:40:37PM +0200, Peter Otten wrote:

Instead of removing it you might add a filter to get a similar effect:

[...]

warnings.filterwarnings("always", "woof!")

Unfortunately that's too aggressive. In my use-case, `bark` will be
called many, many times in a loop, and so potentially "woof" will be
displayed over and over again. That will be annoying.

Then use filterwarnings("once", ...):

That has the side effect that all OTHER warnings get their onceness
reset too though.

Oops, insufficient testing. But I really didn't expect that...

(It's actually the same as resetfilters, and for the same reason -
whenever the filters change, all oncenesses get forgotten.)

Could be changed (I'm tempted to say fixed)?

_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/DVRDNWRBGN3P2IKO46LJLV4LYYJXUPDC/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to