Skip to main content

decorate-all-methods

Decorator that applies a decorator to all methods of a class.

Installing

pip install decorate-all-methods

Example Usage

from decorate_all_methods import decorate_all_methods
from tenacity import retry, stop_after_attempt, wait_fixed


@decorate_all_methods(retry(stop=stop_after_attempt(3), wait=wait_fixed(1)), exclude=['__init__'])
class MyClass(object):

    def __init__(self, object):
        """Will not be retried."""
        pass

    def force_error(self):
        """Will be retried 3 times."""
        assert False

    def force_another_error(self):
        """Will also be retried 3 times."""
        assert False

Note: It is not necessary to exclude any methods.

Versioning

We use SemVer for versioning.

License

This project is licensed under the Apache License, Version 2.0.

Acknowledgments

Metadata

Release files for decorate-all-methods 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for decorate-all-methods 0.0.2
File Size Uploaded Provenance Actions
decorate-all-methods-0.0.2.tar.gz 1.8 kB Without provenance Details for decorate-all-methods-0.0.2.tar.gz

Release files / decorate-all-methods-0.0.2.tar.gz

Download URL decorate-all-methods-0.0.2.tar.gz
Size 1.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0be711749bbf4681cd1738fb8867d702437d166953cd0b638079c51ed0a2c770
BLAKE2b-256 checksum
How to use checksums
6c63234989b90902ea20bec12539410b1cab42eea2400ef1554878abb8235526
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for decorate-all-methods 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page