I love assert
ethan at stoneleaf.us
Sat Nov 29 23:33:39 CET 2014
On 11/28/2014 05:30 PM, Steven D'Aprano wrote:
> alister wrote:
>> And as may wiser people than me have already highlighted Assertions can
>> be switched off in python which means they cannot be relied upon in
>> production code invalidating the authors suggestion that they can
>> automate bug reports & "Extend testing into the lifetime of the product"
> I'm afraid that you appear to have missed the point of assertions as tests.
> Since they should never be used to *enforce* correct behaviour, but only to
> *verify* behaviour is correct (i.e. as a form of testing), it doesn't
> matter if you disable them. If I turn them off, all that happens is that
> the tests won't run *for me*. The software will still be just as correct,
> or just as buggy, regardless of the assertions.
And you have missed the point that building an intricate error-reporting, program restarting framework on top of
'assert' is ridiculous.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: OpenPGP digital signature
More information about the Python-list