Library to create hybrids of class methods and instance methods
Project description
hybridmethods
A library for the creation of hybrid methods. Methods that can be called as either class methods or instance methods.
Usage
from hybridmethods import cl, hybridmethod, instance
class Test1:
@hybridmethod
def method(this):
if instance(this): # Run when called as instance method
pass
else: # Run when called as class method
pass
class Test2:
@cl.assmethod
def method(cls):
pass
@method.instance
def _(self):
pass
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
hybridmethods-0.1.3.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for hybridmethods-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c87ae3ebc67907d7f003ecff7c5920edf2671245852cbdff7ea9611f6e419b5 |
|
MD5 | a0acd90f7cc7352cff74c5e9c69332da |
|
BLAKE2b-256 | 22610ff70665ed4f1ab0f7d747fbbff6210ea52c2379b1c11dc4761c32072848 |