Exception as the primary error handling mechanism?
aioe.org at technicalbloke.com
Wed Jan 6 02:03:12 CET 2010
Lie Ryan wrote:
> On 1/6/2010 1:48 AM, r0g wrote:
>> Steven D'Aprano wrote:
>>> On Tue, 05 Jan 2010 13:06:20 +0000, r0g wrote:
>>>> that's the case how can you expect it to validate anything at all in
>>> The asserts still operate so long as you don't use the -O switch.
> checking, since the function relies on the caller obeying the
> contract and never calling it with an invalid input.
> DbC uses assertions spuriously, unlike the traditional approach which
> is much more conservative when using assertions.
>  or explicit language support which is just syntax sugar for assertions
>  of course, on a debug release, the contract validation code will
> still be enforced to catch logic/consistency bugs that causes the violation
Thanks for the responses Steven/Dave/Lie, that's some really insightful
More information about the Python-list