Maybe I'm missing something, but I don't think that there is anyway to remove a warning from the warnings filter list so that it will be shown again.
Example: >>> import warnings >>> warnings.warn("something happened") <stdin>:1: UserWarning: something happened >>> warnings.warn("something happened") >>> Once a warning has been displayed, it won't be displayed again until you exit the interpreter and start a new session. That's usually what we want, but sometimes I do want to re-display the warning. The warnings module has a function, reset_warnings, but it does too much, removing all the filters including those set at interpreter startup. I'd like a function to remove a single item, something like this: >>> warnings.warn("something happened") <stdin>:1: UserWarning: something happened >>> warnings.warn("something happened") >>> >>> warnings.forget(UserWarning("something happened")) >>> warnings.warn("something happened") <stdin>:1: UserWarning: something happened or similar. Thoughts? -- Steve _______________________________________________ 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/IJYNSHWPUBZGC2RNPJ6NMRPN5N56OL4D/ Code of Conduct: http://python.org/psf/codeofconduct/