Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

'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:

  • 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

Project details


Download files

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

Files for wirerope, version 0.4.2
Filename, size File type Python version Upload date Hashes
Filename, size wirerope-0.4.2.tar.gz (8.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page