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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2Python 3

File details

Details for the file Deprecated-1.1.3.tar.gz.

File metadata

  • Download URL: Deprecated-1.1.3.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1

File hashes

Hashes for Deprecated-1.1.3.tar.gz
Algorithm Hash digest
SHA256 3f6ab8cf46738ac692a871f65cdf4491f6c9161294b769ecadd4b24c0b53386d
MD5 3a63d5cf934935a5b98ad56e7b414e0e
BLAKE2b-256 a4a905b0ae270ea35fa2d4d83fe453b0cc8502767336076e50446691a722a4f9

See more details on using hashes here.

File details

Details for the file Deprecated-1.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: Deprecated-1.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1

File hashes

Hashes for Deprecated-1.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7773db0e83f3ac19bbc5900751bc83ae9344bc041f2147404c12883c27ba575a
MD5 0a8a37bcbfdf69dd58e68a4f91b85184
BLAKE2b-256 bdddb1a74259f4aea345fecc0293bba1396aadf0ef1f549d2a95a0f04629a495

See more details on using hashes here.

Supported by

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