Applying “Design by Contract” [pdf]
se.ethz.ch
se.ethz.ch
pycontracts and icontract are Python libraries that enable contracts. icontract starts faster because it avoids parsing Python code, and its lambdas are understood by your IDE.
C++20 will support contracts.