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 details)
Built Distribution
File details
Details for the file hybridmethods-0.1.3.tar.gz
.
File metadata
- Download URL: hybridmethods-0.1.3.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.12 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e6621503b2010c36ab9758c5b7a764c8f17f58d2c919c8cf8e3d5d4f70e6457 |
|
MD5 | 0b6e82297f96d447cd45de8befdf646c |
|
BLAKE2b-256 | b542524f90d7b69d998cd90477c30216f20a176a1b891a75d6acdb1ef9b6f3dc |
File details
Details for the file hybridmethods-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: hybridmethods-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.12 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c87ae3ebc67907d7f003ecff7c5920edf2671245852cbdff7ea9611f6e419b5 |
|
MD5 | a0acd90f7cc7352cff74c5e9c69332da |
|
BLAKE2b-256 | 22610ff70665ed4f1ab0f7d747fbbff6210ea52c2379b1c11dc4761c32072848 |