Maintain your code
Project description
maintenance
This library provides utilities to easily deprecate code, without manually setting up the warnings. If your project uses experimental feautures, this library might be useful as well.
Installation
pip install maintenance.py
Usage
from maintenance import deprecated, experimental
class MyClass:
def matches_pep8_convention(self, arg):
self.arg = arg
print(arg)
@deprecated(
"New method matches pep8 convention.",
new = "matches_pep8_convention",
since = "1.2.3",
)
def doesNotMatchPep8Convention(self, arg):
return self.matches_pep8_convention(arg)
@experimental(
"Can only be used when `matches_pep8_convention` was previously used.",
stable_in = "2.0.0"
)
def might_break(self):
print(self.arg)
Both functions deprecated
and experimental
only
have optional parameters.
Parameters for deprecated
message
Optional message providing extra information.
new
The new object, that is intended to use. May be a python object or a string.
since
A version number since when this object is deprecated.
Parameters for experimental
message
Optional message providing extra information.
stable_in
Version number, when the object is expected to be stable.
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
maintenance.py-0.1.0.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for maintenance.py-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b022fc6b51474be3a7c0d3cb1d9799f834c55a70e48fbe1b6e06c65117fbdca |
|
MD5 | 912f60aa4ebc8843cff2c013054a9189 |
|
BLAKE2b-256 | abcbe6123bc1d1561abe885346dcb553ddfda3f5fa0016d76013592b193447ef |