On Fri, 10 Jul 2009 12:27:25 -0400, Charles Yeomans wrote: >> (3) assert is absolutely unsuitable for enforcing pre-conditions and >> post- >> conditions, unless such conditions are mere "guidelines", because >> assert >> can be switched off at runtime. > > > Unless, of course, you want to switch off such checking at runtime, as > you might when using a design-by-contract approach.
So is design-by-contract just another way of saying "let's hope the data is valid, because if it's not, we're screwed"? Perhaps Python should have a new statement, `assume`, used just like `assert` except it never actually performs the test or raises an error. -- Steven -- http://mail.python.org/mailman/listinfo/python-list