This library provides a decorator deprecated_params that allows you to deprecate certain parameters in your class methods or function.
Installation
- For stable version
pip install pdeprector
- For developement
cd pdeprector
python -m venv .venv
source .venv/bin/activate
Example
# Example usage
class MyClass:
@deprecated_params({"old_param": "new_param"})
def __init__(self, new_param):
self.new_param = new_param
# Usage
obj = MyClass(old_param="value")
print(obj.new_param)
Warning
- It's recommended to write new functions or classes with a v2 suffix instead of using this deprecated library. - If possible, migrate to the newer version with v2 suffix. However, if migration is not feasible at the moment, you can continue using this library with caution. You should do following
pip install deprecated
from deprecated import deprecated
# Deprecate a function
@deprecated(reason="Use another_function instead")
def deprecated_function():
pass
# Deprecate a class method
class MyClass:
@deprecated(reason="Use another_method instead")
def deprecated_method(self):
pass
Metadata
Release files for pdeprecator 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pdeprecator-0.0.1.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pdeprecator-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.8 kB
Release files / pdeprecator-0.0.1.tar.gz
| Download URL | pdeprecator-0.0.1.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ac2f99f541b2f0c53df9a5886f5fa1a157043ec29db1b8425d80fc9924115bb
|
|
BLAKE2b-256 checksum How to use checksums |
358dd1be21a8fe9b731739b13e6f02a283610887c4ead92476c104699e75e957
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.10
|
Release files / pdeprecator-0.0.1-py3-none-any.whl
| Download URL | pdeprecator-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60a34163f2d308bd68f667245f56b20a9d8ed921dfb0ead65b1197a2717ee008
|
|
BLAKE2b-256 checksum How to use checksums |
065216005bcb47246810f501a290aa9bb882a1bc571f8faf271da34cdfd06fc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.10
|