Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Guard like Haskell for Python.

Project Description

Guard like Haskell for Python.

Status

Requirements

  • Python 2.7 or Python 3.3 over or PyPy 2.4.0 over

Features

  • guard with lambda
  • Enable to use function or method as guard_cl statement argument.

Setup

$ pip install --user pguard
or
(venv)$ pip install pguard

Simple usage

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

ChangeLog

0.3.0 (2016-04-30)

  • Fixes lazy evaluation.
  • Changes guard_cl() respond values.

0.2.1 (2016-04-29)

  • Fixes Python 2.7 classmethod behavior bugs.

0.2.0 (2016-04-27)

  • Supports “function” and “method” as guard_cl statement argument.

0.1.4 (2016-04-24)

  • Fixes setup.py url.

0.1.3 (2016-04-23)

  • Fixes README.
  • Adds check long-description to pre-commit hook.

0.1.2 (2016-04-23)

  • Fixes setup.py version.

0.1.1 (2016-04-23)

  • completed coverage 100%.
  • Adds sample usages.

0.1.0 (2016-04-23)

  • Initial release.
Release History

Release History

This version
History Node

0.3.0

History Node

0.2.1

History Node

0.2.0

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pguard-0.3.0.tar.gz (9.7 kB) Copy SHA256 Checksum SHA256 Source Apr 30, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting