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.1.tar.gz (3.7 kB 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.1-py2.py3-none-any.whl (4.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: Deprecated-1.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Deprecated-1.1.1.tar.gz
Algorithm Hash digest
SHA256 86f79eebfa3f56636dfaff8b35c9cce7508355c7dea96b9d4e9b95efc3657668
MD5 d81bb05388511fd283df3dd6f6e86da4
BLAKE2b-256 4c1fffae419a0f9de81084faaf83690e1dc42b6329745fbe7ccff4a41105d9bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Deprecated-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0098d3312a28465be521b9a40626ef7ddb489a880bc61789ec23e88569b41f74
MD5 a2ec8e64367829b80876186c16257fe1
BLAKE2b-256 cc3bb8539e01e7d8318430e48dc426749a942efbf8bc04d6cbbd670c56b1888c

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