semvec/pypi-packages huggingface dataset:
hybridmethods 0.1.3
Library to create hybrids of class methods and instance methods
License: 0BSD
Requires Python: >=3.7
Keywords: hybridmethod,method,methods,utility

# hybridmethods

A library for the creation of hybrid methods. Methods that can be called as either class methods or instance methods.

## Usage

```py
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
```