justmagic

Use a function as a method with this mystic script, like in Nim.

Just an example

from justmagic import justmagic

justmagic.inject()


class Person:

    def __init__(self, name: str) -> None:
        self.name = name


def hello(who: Person, prefix: str):
    print(f"Hello {prefix} {who.name}")


me = Person("John")

me.hello("mr.")

GitHub

View Github