potassco / clorm

🗃️ A Python ORM-like interface for the Clingo Answer Set Programming (ASP) reasoner
https://clorm.readthedocs.io
MIT License
52 stars 5 forks source link

use python typehints with asp-callable decorators #96

Closed florianfischer91 closed 2 years ago

florianfischer91 commented 2 years ago

The PR enables to use types (beside clorm's BaseField-Classes) as typehints when defining methods which should be callable by clingo

@make_function_asp_callable
def method(x: int, y: str) -> Tuple[int, int]:
    return (x, int(y))