Python @deprecated decorator to deprecate old python classes, functions or methods.
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 Python-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)
Links
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Python-Deprecated-1.1.0.tar.gz.
File metadata
- Download URL: Python-Deprecated-1.1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a242b3c1721f97912330b12cd5529abfa5b3876084a6c60a2c683a87d4b0dd6f
|
|
| MD5 |
6567f45813d5d8a9cbaf6782f5647e3e
|
|
| BLAKE2b-256 |
c08ec5875a0cacfcd90151be65e7bf3e08686d67d390c74eb2cc2cdada4974d1
|