Guard like Haskell for Python.
- Python 2.7 or Python 3.6 over or PyPy 2.4.0 over
- guard with lambda
- Enable to use function or method as
guard_cl
statement argument.
$ pip install --user pguard or (venv)$ pip install pguard
>>> from pguard import guard >>> from pguard import guard_cl as g >>> (lambda n: guard( ... g(-1, n < 0), ... g(0, n == 0), ... g(1) ## otherwise ... ))(0) 0