matplotlib/matplotlib — pull request #1596 by ivanov (2012-12-14 20:44:38+00:00)
Title: new MatplotlibDeprecationWarning class (against 1.2.x)

Here's the promised rebase of #1565 onto the maintenance branch, with some whitespace fixes suggested there squashed into the commit here.

In light of the fact that Python builtin DeprecationWarnings are ignored
by default as of Python 2.7 (see link below), this class was put in to
allow for the signaling of deprecation, but via UserWarnings which are
not ignored by default.

http://docs.python.org/dev/whatsnew/2.7.html#the-future-for-python-2-x

Prior to this commit:

```
In [1]: %pylab

Welcome to pylab, a matplotlib-based Python environment [backend: agg].
For more information, type 'help(pylab)'.

In [2]: mlab.liaupunov([1,2], np.diff)
Out[2]: 0.0
```

After this commit:
```
In [1]: %pylab

Welcome to pylab, a matplotlib-based Python environment [backend: agg].
For more information, type 'help(pylab)'.

In [2]: mlab.liaupunov([1,2], np.diff)
/home/pi/.local/lib/python2.7/site-packages/matplotlib/mlab.py:1212:
MatplotlibDeprecationWarning: This does not belong in matplotlib and
will be removed
mDeprecation) # 2009/06/13
Out[2]: 0.0
```