Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/witer33/justmagic


https://github.com/witer33/justmagic

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# justmagic

Use a [function as a method](https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax) with this mystic script, just like in Nim.

# Just an example

```python

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