class-interference
Monkey patching utilities for classes.
Installation
pip install class-interference
Usage example
from class_interference import Extension, inject, apply_extensions
class LibraryClass:
def library_method(self, *args, **kwargs):
return None
class LibraryClassExtension(LibraryClass, Extension):
@inject
def library_method(self, *args, **kwargs):
original_value = self.super_ext.library_method(*args, **kwargs)
if original_value is None:
raise ValueError
return original_value
apply_extensions(LibraryClassExtension)
if __name__ == "__main__":
library_class_instance = LibraryClass()
library_class_instance.library_method() # raises ValueError
Metadata
Release files for class-interference 1.1.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 | Provenance | Actions |
|---|---|---|---|---|
| class_interference-1.1.1.tar.gz | 4.0 kB | Without provenance | Details for class_interference-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| class_interference-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for class_interference-1.1.1-py3-none-any.whl |
Total release size: 9.1 kB
Release files / class_interference-1.1.1.tar.gz
| Download URL | class_interference-1.1.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f63f6241cd541b2203ebc4628e174d822ae5775ac366b44bd3312d76f88ae62
|
|
BLAKE2b-256 checksum How to use checksums |
af0662e0edaceb1c0607bc2e65ef3633344793fbbafaef5ea0ce7dabca4356a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.6 Darwin/21.6.0
|
Release files / class_interference-1.1.1-py3-none-any.whl
| Download URL | class_interference-1.1.1-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd7281747a58efcb1c767f5b41befe55dc8f30c309d9cca43fb4ea8545994c11
|
|
BLAKE2b-256 checksum How to use checksums |
f63377886184f51772555b86c336b7f7c7ca9ff39be98569126c789ccde8b731
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.6 Darwin/21.6.0
|
Security for class-interference 1.1.1
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.