[Tutor] Questions about the deprecation of standard library modules

boB Stepp robertvstepp at gmail.com
Sat Mar 30 23:13:16 EDT 2019


While reading in chapter 3 of "Learning Python, 5th ed." by Mark Lutz,
I was playing around with reload() in the imp module.  In the
interpreter I did a "from imp import reload" and then help(reload).
This had a warning that it was deprecated.  After a search online I
found that the entire imp library was deprecated since Python 3.4.
The aforementioned book covers through Python 3.3.  This got me to
wondering when the imp module would be removed from Python 3, which
led me to finding PEP 4.  In it it says:

Module name:   imp
Rationale:     Replaced by the importlib module.
Date:          2013-02-10
Documentation: Deprecated as of Python 3.4.

There is no mention as to _when_ the module might be removed.  PEP 4
says that a deprecated module may be removed as early as the next
Python release after it becomes deprecated.  Also the PEP states that
if a module exists in both Python 2.7 and Python 3.5, it will not be
removed until Python 2.7 is no longer supported, which, I suppose,
means next year.

So my main question is how does one know in which Python version a
deprecated module will be removed?  I'm not too concerned about the
imp module, but _do_ want to know how the removal process works for
deprecated standard library modules that I might be interested in.

-- 
boB


More information about the Tutor mailing list