I love assert

Ethan Furman ethan at stoneleaf.us
Mon Nov 17 04:25:05 CET 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/16/2014 06:09 PM, Steven D'Aprano wrote:
> Ethan Furman wrote:
>> On 11/14/2014 06:58 PM, Steven D'Aprano wrote:
>>> Ethan Furman wrote:
>>>> 
>>>> My point being:  a safety net that is so easily disabled does not count (IMHO) as a backup.
>>> 
>>> Assertions are not a backup or a safety net. [...]
>> 
>> Would you be happier if I phrased that as: Defensive programming techniques that can be unknowingly disabled by
>> the end-user aren't very helpful?
> 
> No.
> 
> You appear to be labouring under the misapprehension that assertion-based techniques (such as design by contract)
> are a technique for guarding against expected errors in (say) data.

I believe we are in violent agreement here.  My hissy-fit is not on the correct use of asserts, but their incorrect use.

- --
~Ethan~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJUaWqRAAoJENZ7D1rrH75N5pAQAKTiuIMWSpVYX80XdyPh036f
7FTvIerwaCtxwhBG2ma5GKQSXLIPIp6n6LQopnIN6Y82Odx6CqtUmlOpbrxZ4L5w
HG+GaCgBKPCP43ghP8NV+IDNK+mpz3g8uqa3F7ofgygDiBUqXg07/aBR2Eifkyl2
yoB9OjwRek2/m+KkUxe+hnEAmNjeyHF1+0rpFkjf04c4O38/fXJ2Gv6aoluoc/on
IdmST56ukgcVU9JjTTLD+PhLA8v/uvTHyFFQvGng9cUTIMxJEvItIikp+20VS1CP
PY8xJabI28TA4IEtC3atMwk/bDme2H6ovv0O0yvYswF38Y0u6U+NpNgKYUZfXKwS
nFHIJMFSfFpWddmxUGCNmjvGlDRVH5py11QGEl430PhUr3Y5re4MUglye9lFWoy9
NwSVA4c6zoM4lrgdZ2qzzDX8LUaLr1c//sNvS+kVaI6syIf0C60++QJGBboauIMR
lprJ65FfmiHhfI9e+7sS5KX09iILkuPjnwGi79CJG/TehfFcvueqDjNzRan8JzVX
/Czo3zwBK8B4cV13DBeRP2oaJcreMvA5bysXXKJ7iqZkLST+K8hiFpoKCGZiGdcZ
OBafvCwMqP5GzuCCzBxwAOIPo4KHR+KDVMarLZ+NI2kebZPTgKmWmtPrIIztTxE0
DFNrXUK0o8z0WGKP2Ke6
=tM/a
-----END PGP SIGNATURE-----



More information about the Python-list mailing list