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 *
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:
@classmethod
def method(cls):
pass
@classmethod.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.1.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for hybridmethods-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a9dc7d28ea1ae319684265949506afcbe0057232344566fc9a2853241309635 |
|
MD5 | 8bc3a199ad9d275fc6c026d33336e877 |
|
BLAKE2b-256 | db536dfeb4df1bcf3260d2b6115d0d7d07bd90acae2879167fa185b01755c96c |