Donnerstag, 26. April 2007

Python design by contract

Today I've implemented some decorators for Eiffel-like design py contract.
It's very nice to use I think:

@require('s1 != 0')
def inv(s1): return 1/s1

or
@require('x != 0')
@enshure('result > 0')
def quad(x): return x*x*x / x


For more information just ask me. I'll put the code somewhere, soon.

- stanz

Keine Kommentare: