Design By Contract in Python

One possibility is to vaguely mimic the interface C4J uses for Java with class decorators and additional classes (possibly inside the defined class).

I’m not sure if it’s a good idea to separate the contracts from the implementing code…But it would add a lot of flexibility to be able to add contracts to existing classes (via wrapping).

Comments are closed.