Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: I love assert Date: Wed, 12 Nov 2014 14:10:10 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 23 Message-ID: References: <96c138e4-ab95-4e5f-a0c8-e696b5a926bb@googlegroups.com> <85389pcxn5.fsf@benfinney.id.au> NNTP-Posting-Host: 67-130-15-94.dia.static.qwest.net Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: reader1.panix.com 1415801410 157 67.130.15.94 (12 Nov 2014 14:10:10 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 12 Nov 2014 14:10:10 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:80604 On 2014-11-12, Ben Finney wrote: > Chris Angelico writes: > >> On Wed, Nov 12, 2014 at 7:03 AM, Ben Finney wrote: >> > An ‘assert’ statement in the code will sometimes be active, and >> > sometimes be a no-op, for *exactly* the same code under different >> > circumstances. That's a trap for the reader, and I'd rather not set >> > it. >> >> This is no worse than other forms of preprocessor magic. > > That other languages do it doesn't argue in favour of it. It argues, > rather, that we should be glad not to have it in our Python code. Technically it's not an argument for assert, but I think it is a refutation of one of your arguments against assert. It refutes your statement that the fact that asserts may not always be active is a suprise to people and therefore acts as a "trap". -- Grant Edwards grant.b.edwards Yow! Is it clean in other at dimensions? gmail.com