My quarterly question on Design by Contract in Python...

William Tanksley wtanksle at dolphin.openprojects.net
Sat May 8 14:26:13 EDT 1999


On Fri, 07 May 1999 22:25:40 +1000, Stuart Hungerford wrote:
>Hi all,

>Every so often after a minor or major Python
>release I like to ask the gurus of this group
>about implementing Design By Contract mechanisms
>(a-la Eiffel) in Python.

Nobody seems to have made this connectionn yet, but...

Sommeone posted a system a while ago which allowed addition of arbitrary
code before and after a function.  With some work, that system could be
mixed into a class (perhaps even a metaclass) to implement pre/post
conditions and invariants.

>Stu

-- 
-William "Billy" Tanksley
"But you shall not escape my iambics."
           -- Gaius Valerius Catullus




More information about the Python-list mailing list