Use @deprecated library

Issue #1234 new
created an issue

Hi Charlie & Co.

I have just seen that you use an "enhanced" copy of the Deprecated library. But this version is old now and have limitations (i.e.: you can't decorate classes).

The new version (1.2.x branch) has support for Sphinx directives. So you can decorate a deprecated function/method/class and update its docstring.

For instance:

from deprecated.sphinx import deprecated

@deprecated(version='1.0', reason="This function will be removed soon")
def function_three():
    '''This is the function three'''

It will add the .. deprecated:: directive automatically.

Also take into consideration that this new implementation uses Wrapt, which allows an efficient implementation of decorators.

As you know, I am the author of this library, I think it would be great to use it in OpenPyXl.


– Laurent.

Comments (2)

  1. CharlieC

    I don't think we're actually using an external library, just something I cargo-culted. I'll take a look at the library and see if we should switch to using it explicitly.

  2. Log in to comment