'Turn functions and methods into fully controllable objects'
Project description
The concepts:
wirerope.rope.WireRope is a wrapper interface for python callable.
Custom wirerope.wire.Wire class provides user-defined behavior. A subclass of this class is working similar to a decorator function body.
A wire object is associated with a bound method.
Rope is dispatching types.
wirerope.rope.WireRope is the wrapper for callables. By wrapping a function with WireRope with a custom subclass of the wirerope.wire.Wire class, the wire object will be created by each function or bound method.
Wire is the most important part. The given class will be instantiated and bound to each function or bound method - which fits the concept of instance cmethod of human. For example, when f is a free function or staticmethod, the wire also will be a single object. When f is a method or property, wires will be created for each method owner object self. When f is a classmethod, wires will be created for each method owner class cls. Yes, it will detect the owner and bound to it regardless of the calling type.
Rope is internal dispatcher. It will be helpful when creating a complex object for decorated callable instead of simple callable feature.
See also
See [documentation](https://wirerope.readthedocs.io/en/latest/) - though it is not yet written very well.
See tests/test_wire.py for simple example.
See [methodtools](https://github.com/youknowone/methodtools) for practical example.
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
Built Distribution
File details
Details for the file wirerope-0.4.8.tar.gz
.
File metadata
- Download URL: wirerope-0.4.8.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa172d09eff7534563f315e38712b5fa3b88a1aa3467b539a7510f2e427a7af4 |
|
MD5 | 2f05e377650da3890ad033641669f03d |
|
BLAKE2b-256 | bc09b9f811e2bf9b14c0a99fa072f431bb48a327101a2239b32c9ee1d2f46efe |
Provenance
The following attestation bundles were made for wirerope-0.4.8.tar.gz
:
Publisher:
release.yml
on youknowone/wirerope
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
wirerope-0.4.8.tar.gz
- Subject digest:
fa172d09eff7534563f315e38712b5fa3b88a1aa3467b539a7510f2e427a7af4
- Sigstore transparency entry: 147757475
- Sigstore integration time:
- Predicate type:
File details
Details for the file wirerope-0.4.8-py2.py3-none-any.whl
.
File metadata
- Download URL: wirerope-0.4.8-py2.py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99e54b9bd9d3a8e18199b87e2c5edf58d7f64e3f7e2f5bb041034025f03a4e68 |
|
MD5 | 8e8369ad39823b712933568d264f573a |
|
BLAKE2b-256 | ebfe5a7e62fa87e75a262e50da6a6575fe1c1556b407ab27deea1a1946ae400f |
Provenance
The following attestation bundles were made for wirerope-0.4.8-py2.py3-none-any.whl
:
Publisher:
release.yml
on youknowone/wirerope
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
wirerope-0.4.8-py2.py3-none-any.whl
- Subject digest:
99e54b9bd9d3a8e18199b87e2c5edf58d7f64e3f7e2f5bb041034025f03a4e68
- Sigstore transparency entry: 147757476
- Sigstore integration time:
- Predicate type: