[Python-ideas] Pre-conditions and post-conditions

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Aug 29 16:41:02 EDT 2018


Jonathan Fine wrote:
> 
> My message of support for Ivan quoted the Eiffel docs.
> 
>>https://www.eiffel.org/doc/eiffel/ET-_Design_by_Contract_%28tm%29%2C_Assertions_and_Exceptions
> 
>>During development and testing, assertion monitoring should
>>be turned on at the highest possible level. Combined with
>>static typing and the immediate feedback of compilation techniques
>>[...] this permits the development process  [...]
>>where errors are exterminated at birth.

I think you're misinterpreting the Eiffel docs here. It's saying
that contracts *together* with static typing help to catch a lot
of errors early in the development process. It's not saying that
contracts are verified statically, or that all the errors thus
caught are caught at compile time.

> the context to me makes it clear
> that in Eiffel static typing IS NOT regarded as a run-time assertion.

That's true, but static typing and contracts are *different things*
in Eiffel. Static types are checked at compile time, contracts
are checked at run time.

-- 
Greg


More information about the Python-ideas mailing list