[Numpy-discussion] Silent DeprecationWarnings under Python 2.7 onwards

Peter numpy-discussion at maubp.freeserve.co.uk
Thu Sep 9 12:05:52 EDT 2010


Hi all,

NumPy currently makes extensive use of the DeprecationWarning
class to alert users when some feature is going to be withdrawn.
However, as of Python 2.7, the DeprecationWarning is silent by
default, see:

http://docs.python.org/library/warnings.html#updating-code-for-new-versions-of-python

This makes sense to me for deprecation warnings from Python
itself or the standard library - after all, Python 2.7 is the last of the
Python 2.x series.

However, I believe that a silent DeprecationWarning is bad news
for third party libraries like NumPy where many end users are
coders and we want them to see these warnings by default.
Is anyone else concerned about this? A typical NumPy user
(on Python 2.7+ or Python 3.2+) may never see the warnings
(because they have to deliberately turn them on), the first they'll
 know about it is when they upgrade to a new release and their
code suddenly stops working.

Potentially NumPy would have to introduce its own NumPy
specific DeprecationWarning warning class, and use that.

Peter



More information about the NumPy-Discussion mailing list