Removing a warnings filter?

Torsten Bronger bronger at physik.rwth-aachen.de
Sat Jun 4 09:51:35 CEST 2005


Hallöchen!

Dave Benjamin <ramen at lackingtalent.com> writes:

> Torsten Bronger wrote:
>
>> When I add a warning filter with warnings.filterwarnings, how can
>> I get rid of it?  I've read about resetwarnings(), but it removes
>> all filters, even those that I didn't install in a certain
>> function.
>
> I have never used this module, but judging by a quick glance of
> the source to "warnings.py", it appears that warning filters are
> added to a list called "warnings.filters".

Thank you, I'll use it in my program.  However, I don't like it very
much, because warnings.filters isn't mentioned in the reference, and
in other languages that I've used, internal features are not
guaranteed to work across different versions.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus



More information about the Python-list mailing list