Skip to main content

Python @deprecated decorator to deprecate old python classes, functions or methods.

Project description

Deprecated is Easy to Use

If you need to mark a function or a method as deprecated, you can use the @deprecated decorator:

Save in a hello.py:

from deprecated import deprecated


@deprecated
def some_old_function(x, y):
    return x + y


class SomeClass(object):
    @deprecated
    def some_old_method(self, x, y):
        return x + y


some_old_function(12, 34)
obj = SomeClass()
obj.some_old_method(5, 8)

And Easy to Setup

And run it:

$ pip install Deprecated
$ python hello.py
hello.py:15: DeprecationWarning: Call to deprecated function some_old_function.
  some_old_function(12, 34)
hello.py:17: DeprecationWarning: Call to deprecated function some_old_method.
  obj.some_old_method(5, 8)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Deprecated-1.1.3.tar.gz (5.0 MB view hashes)

Uploaded Source

Built Distribution

Deprecated-1.1.3-py2.py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page