ANN: Design By Contract for Python 1.0 beta 1

Terence Way terry at wayforward.net
Thu May 22 00:45:34 EDT 2003


Announcing Design By Contract for Python 1.0 beta 1

Design by Contract is familiar to anyone who has spent time with the
Eiffel programming language.  This implementation is a cross between
full Eiffel-style contracts and the doctest module.

Contracts are high-level assertions that are part of the program's
documentation.  Modules and classes have invariants, expressions that
must be true at the start and end of every public function or method
call.  Methods and functions have pre-conditions, expressions that must
be true on entry; and post-conditions, expressions that must be true
on exit.

     http://www.wayforward.net/pycontract/

This version supports the full contract feature set:
* pre: expressions in function and method docstrings;
* post: expressions in function and method docstrings;
* inv: expressions in class and module docstrings;
* post: expressions can access __old__ values and the __return__
   value;
* pre: expressions are weakened by derived methods; and
* post: and inv: expressions are tightened by derived classes.

<P><A HREF="http://www.wayforward.net/pycontract/">Contract 1.0 
beta1</A> -
Design By Contract for Python.  (21-May-03)






More information about the Python-list mailing list