RSDecorator
An alternative to @decorator which allows you to easily fiddle with pre-resolved arguments, before transferring control to the wrapped function.
See the project repository: https://github.com/pakal/rsdecorator
Installation
pip install RSDecorator
Example
from rsdecorator import resolving_decorator
@resolving_decorator
def inject_session(func, **all_kwargs):
if not all_kwargs["session"]:
all_kwargs["session"] = "<SESSION>"
return func(**all_kwargs)
@inject_session
def myfunc(session):
return session
assert myfunc(None) == myfunc(session=None) == "<SESSION>"
assert myfunc("<stuff>") == myfunc(session="<stuff>") == "<stuff>"
Development
pip install -e .[test]
pytest
Run the full test matrix across supported Python versions with:
tox
Metadata
Release files for RSDecorator 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rsdecorator-0.1.0.tar.gz | 5.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rsdecorator-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.5 kB
Release files / rsdecorator-0.1.0.tar.gz
| Download URL | rsdecorator-0.1.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
803261eb5b978b2b006e2b43cdfa3725d5e35d8642f6482836575aaf14031868
|
|
BLAKE2b-256 checksum How to use checksums |
80b86f445cc27bd3f82b334305da20f708c5e98f0a28b49fa6a887676bd30fcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Release files / rsdecorator-0.1.0-py3-none-any.whl
| Download URL | rsdecorator-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
848c7da45cb339bd1352ab05757a4df675e5ae0d7dcbe1839590f34e0a51433e
|
|
BLAKE2b-256 checksum How to use checksums |
98961acc42599c31f4a1ea5e8906c03937ca691919ced0353048a5f51cf7a8a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.2
|
Security for RSDecorator 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.