ANN: Design By Contract for Python 1.0 beta 1
Terence Way
terry at wayforward.net
Thu May 22 22:04:18 EDT 2003
On Thu, 22 May 2003 20:14:25 -0400, Cristian Tibirna wrote:
> Thus, question. Is this (deactivation) a planned feature for your
> wonderful tool?
Thanks for your feedback.
You bet! Actually, you need to specifically *enable* contract
checking, by calling contract.checkmod on a module. If you don't
do this, then the contracts just stay in the docstrings, no extra
overhead at all. Contract checking is disabled anyway when running
in optimized mode (-O on the python command line).
What I don't have (yet) is some way to have only pre-conditions
checked -- Eiffel offers this and it makes a lot of sense.
Cheers
More information about the Python-list
mailing list