[Python-Dev] A new warning category?

"Martin v. Löwis" martin at v.loewis.de
Thu Oct 14 20:23:32 CEST 2010

Am 14.10.2010 11:25, schrieb Antoine Pitrou:
> Hello,
> In the http://bugs.python.org/issue10093 discussion, I proposed to add a
> specific warning category for unclosed files. The rationale is that
> these warnings will happen in destructors and therefore filtering by
> line number and filename doesn't make sense. So a new category would be
> useful in order to allow defining specific rules.
> Do you think it would go against the moratorium?

I think that warning categories are a library feature: they are
mentioned in the library documentation, and not mentioned in the
reference manual (in fact, only a single warning *is* mentioned in
the reference manual, namely that exceptions in __del__ are printed -
which actually doesn't use the warnings module).

If it is the library feature, then it is exempt from the moratorium:

Allowed to Change
The standard library

    As the standard library is not directly tied to the language
definition it is not covered by this moratorium.


More information about the Python-Dev mailing list