justmagic

UFCS in Python


Keywords
UFCS
License
GPL-3.0
Install
pip install justmagic==0.0.7

Documentation

justmagic

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

Just an example

import justmagic

justmagic.install(strict=False)

class Person:

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


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


me = Person("John")

me.hello("mr.").print()

Strict mode enables types checking.

Installation

pip3 install justmagic