Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'skip:l 60': 0.07; 'skip:p 60': 0.07; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'pgp': 0.09; 'skip:o 60': 0.09; '~ethan~': 0.09; '(gnu/linux)': 0.16; '-----begin': 0.16; '-----end': 0.16; 'gnupg': 0.16; 'hash:': 0.16; 'incorrect': 0.16; 'sha1': 0.16; 'skip:/ 60': 0.16; 'wrote:': 0.18; 'message-----': 0.19; '>>>': 0.22; 'programming': 0.22; 'header:User-Agent:1': 0.23; '(such': 0.24; "aren't": 0.24; 'skip:n 60': 0.24; 'signed': 0.27; 'header :In-Reply-To:1': 0.27; 'point': 0.28; 'appear': 0.29; 'correct': 0.29; 'errors': 0.30; '>>>>': 0.31; "d'aprano": 0.31; 'disabled': 0.31; 'skip:i 60': 0.31; 'steven': 0.31; 'skip:d 20': 0.34; 'but': 0.35; 'version:': 0.36; 'charset:us-ascii': 0.36; 'easily': 0.37; 'expected': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'use.': 0.39; 'to:addr:python.org': 0.39; 'no.': 0.61; 'received:173': 0.61; 'techniques': 0.66; 'believe': 0.68; 'as:': 0.81; 'defensive': 0.84; 'end-user': 0.84; 'ethan': 0.84; 'furman': 0.84; 'unknowingly': 0.84; 'technique': 0.93 Date: Sun, 16 Nov 2014 19:25:05 -0800 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: I love assert References: <96c138e4-ab95-4e5f-a0c8-e696b5a926bb@googlegroups.com> <87a93wqeq3.fsf@elektro.pacujo.net> <5465e887$0$12976$c3e8da3$5496439d@news.astraweb.com> <5466c13d$0$13009$c3e8da3$5496439d@news.astraweb.com> <546958ca$0$12976$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <546958ca$0$12976$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416194716 news.xs4all.nl 2959 [2001:888:2000:d::a6]:55610 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80959 -----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-----