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.0.tar.gz (3.6 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.0-py2.py3-none-any.whl (4.7 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for Deprecated-1.1.0.tar.gz
Algorithm Hash digest
SHA256 772a80559cf0a163227ad01c21057146fe7513c3ab1e2de12cf1a55cf269e27e
MD5 13a2b846676b7202f9b1006d34ebb355
BLAKE2b-256 3f7294394b55da61d585f7903e89b6b742318b6d136dd4e796f48d9cfddc5ec0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for Deprecated-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4bf417d3f8b1d80903bf3f9835a974af0336c122c103c5a47222ca53b30b8e63
MD5 23d08657a063d9ec0547d6953cc1a40a
BLAKE2b-256 18861fa1eb651ca26bbadaa6be813b8d17e6a750aee0c88c3f1827bed072a9da

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