Skip to main content

Contracts for Python

Project description

Contracts for Python 3

https://snyk.io/test/github/digitalmensch/contrapy/badge.svg https://travis-ci.org/digitalmensch/contrapy.svg?branch=master https://coveralls.io/repos/github/digitalmensch/contrapy/badge.svg?branch=master https://img.shields.io/pypi/pyversions/contrapy.svg https://img.shields.io/pypi/l/contrapy.svg

Examples

import contrapy

@contrapy.check(lambda a, b, _return: a + b == _return, lambda a, b: a < b)
def demo(a : 22, b : float) -> float:
    return a + b

>>> demo(22, 33.0)
55.0
>>> demo(21, 33.0)
[...]
ValueError: a should be 22

Project details


Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
contrapy-2018.1.30.tar.gz (2.3 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page