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)
Links
Project details
Release history Release notifications | RSS feed
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.2.tar.gz
(5.0 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file Deprecated-1.1.2.tar.gz.
File metadata
- Download URL: Deprecated-1.1.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
261b5b6cc64f68e1c4b8192847e78101b5819e1af9de77083eab77993f6ffb8e
|
|
| MD5 |
b0867d6a3191e87f9f7f4ce97418e95d
|
|
| BLAKE2b-256 |
a2cc1ccc1af5bf518c5dafbd8df7fee41bcce8ec13acf11e5a9b0ae35162a8cc
|
File details
Details for the file Deprecated-1.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: Deprecated-1.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 4.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e5288eec18b5a66023ff579522b2e500027a0636ddbb55b6eb25f1da4ef4be9
|
|
| MD5 |
40c7b258e2beeaa1680322e42ba57862
|
|
| BLAKE2b-256 |
dad998b627c184012530d115e9cdfd1380d75d655a94ab1507cfd335f29f91c7
|