[Python-Dev] deprecated regex used by un-deprecated modules

Guido van Rossum guido@digicool.com
Fri, 19 Jan 2001 11:53:39 -0500


> There are several modules in the standard library that use the regex
> module.  When they are imported, they print a warning about using a
> deprecated module.  I think this is bad form.  Either the modules that
> depend on regex should by updated to use re or they should be
> deprecated themselves.  
> 
> I discovered the following offenders:
> asynchat
> knee
> poplib
> reconvert
> 
> I would suggest fixing asynchat and poplib and deprecating knee.  The
> reconvert module may be a special case.

Agreed.  There's an idiom to disable the warning, which you can find
in regsub.py:

    import warnings
    warnings.filterwarnings("ignore", "", DeprecationWarning, __name__)

(The "" should be replaced by the specific warning message though.)

--Guido van Rossum (home page: http://www.python.org/~guido/)