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!

Design By Contract library

Project Description

Introduction

Design by contract is a methodology of software design. It prescribes that software designers should define formal, precise and verifiable interface specifications for software components, which extend the ordinary definition of abstract data types with preconditions, postconditions and invariants. These specifications are referred to as “contracts”, in accordance with a conceptual metaphor with the conditions and obligations of business contracts.

Usage

When using this library, just create a class and define the preconditions, postconditions or invariants in the method, or in a separate function.

For ex.

from PyContractor import PyContractor

def division(self, a, b):
    PyContractor.require(b != 0, "Divisor must be non-zero")

division(2/0)

This tiny library just gives you a start to know this methodology and it’s mainly focused for educational purposes.

Release History

Release History

This version
History Node

0.1.1

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
PyContractor-0.1.1.tar.gz (2.5 kB) Copy SHA256 Checksum SHA256 Source Aug 24, 2013

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