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.0.tar.gz
(3.0 kB
view details)
Built Distributions
File details
Details for the file hybridmethods-0.1.0.tar.gz
.
File metadata
- Download URL: hybridmethods-0.1.0.tar.gz
- Upload date:
- Size: 3.0 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 | d13c6d6f9fbfbc6dd04cec96eef5845f37176ca5c96354f772a2bd8a49f4f33c |
|
MD5 | ec94d5f3983323e79515ba3aa9c7ea21 |
|
BLAKE2b-256 | c12fd61cdfb3974ef9acbc7cdf91e4b4bfa4d06a48bb3e431fee9511469b8181 |
File details
Details for the file hybridmethods-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: hybridmethods-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 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 | 0f81fc74aa222656ee81c61382d621a967f3538bc7db8c7f41216535b76649ea |
|
MD5 | d47a27f4a6a669339c8d315b33e95fd3 |
|
BLAKE2b-256 | a4d5ac8a4f3c7c4f32618e5f23762e126a256480e921622746446d2c7f5abf9f |
File details
Details for the file hybridmethods-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: hybridmethods-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 2, 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 | 07990f248121a8a0445bfed904bc996943d080004af03173e7ffa8f7a5e58178 |
|
MD5 | 7052d0b76fe53e13d5fe86e85595a873 |
|
BLAKE2b-256 | f4a9a9f4dcb4da07305b5b29ce9ca918982c85e3db063c6aefc7c8c488ca374d |