Design by Contract with Python?

Franz GEIGER fgeiger at datec.at
Fri May 18 05:53:42 EDT 2001


Saw in comp.lang.ruby that they have a module, which allows you to check
pre- and post conditions like you can do e.g. in Eiffel (see
http://www.pragmaticprogrammer.com/ruby/downloads/dbc.html).

The difference to assert is here, that you can place the pre and post inbase
classes. They then assert all the overridden methods as well.

There is also the possibility to check the returnd data at *one* point.

Are such things possible in Python too? Or is the possibility of execution
of code blocks necessary for that? Or any other restrictions?

Thanks andreagrds
Franz






More information about the Python-list mailing list