An interesting find on PyPI: PyDBC 0.2 "Contracts for Python 2.2+". PyDBC creates a new metaclass that can be used to handle preconditions, postconditions, and invariants.