Skip to main content

'Turn functions and methods into fully controllable objects'

Project description

https://travis-ci.com/youknowone/wirerope.svg?branch=master https://codecov.io/gh/youknowone/wirerope/graph/badge.svg

The concepts:

  • g`wirerope.rope.WireRope` is a wrapper interface for python callable.

  • Custom g`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.

g`wirerope.rope.WireRope` is the wrapper for callables. By wrapping a function with WireRope with a custom subclass of the g`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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wirerope-0.4.0.tar.gz (8.4 kB view details)

Uploaded Source

File details

Details for the file wirerope-0.4.0.tar.gz.

File metadata

  • Download URL: wirerope-0.4.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.1

File hashes

Hashes for wirerope-0.4.0.tar.gz
Algorithm Hash digest
SHA256 13994bb07a06cc2a10cdf225fe82a88c85fafaa67f080025211581c974728420
MD5 d7ca4a1a8bd434d04a4a1a435d15fbbb
BLAKE2b-256 6dd77c66b8bdc487cdbb100b9434aec51026f3c6bfd5472c474b23bd375ebb30

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page