Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/witer33/justmagic
https://github.com/witer33/justmagic
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/witer33/justmagic
- Owner: witer33
- License: gpl-3.0
- Created: 2021-12-31T10:28:51.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-06T16:34:23.000Z (over 2 years ago)
- Last Synced: 2024-07-09T20:27:45.649Z (4 months ago)
- Language: Python
- Size: 33.2 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 = namedef 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
```