[Numpy-discussion] Adding a version system to the deprecation functions in numpy/lib/utils ?

Robert Kern robert.kern@gmail....
Fri Jun 20 02:12:13 CDT 2008

On Fri, Jun 20, 2008 at 01:54, David Cournapeau
<david@ar.media.kyoto-u.ac.jp> wrote:
> Robert Kern wrote:

>> It will be hard to write something generic. The individual functions
>> will still have to write code that handles the old arguments anyways,
>> so all it would do is move the warning message from a warnings.warn()
>> into the decorator. It's not worth it.
> If we change default values of some functions, you don't think it would
> be useful to raise a warning if people do not use the argument (that is
> use the default value) ? I remember a long time ago, when some functions
> got their axis argument changed (pre 1.0 numpy), it took me a long time
> to realize why my code broke.

I don't see a reason to wrap it in a decorator. It saves no significant effort.

> By saying the function has to handle the old argument, you are implying
> that we don't allow API changes, right ? If we enforce this, again,
> deprecating argument/default value has no value at all. But up to now,
> it has happened fairly regularly.

It should not be happening regularly in the future.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
 -- Umberto Eco

More information about the Numpy-discussion mailing list