Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'automate': 0.07; 'restarting': 0.07; 'tests.': 0.07; 'correct,': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; '~ethan~': 0.09; 'python': 0.11; 'bug': 0.12; 'missed': 0.12; 'filename:fname piece:signature': 0.16; 'highlighted': 0.16; 'product"': 0.16; 'wrote:': 0.18; 'tests': 0.22; 'header:User- Agent:1': 0.23; 'switched': 0.24; 'regardless': 0.24; 'header:In- Reply-To:1': 0.27; 'point': 0.28; 'appear': 0.29; 'testing': 0.29; 'correct': 0.29; "doesn't": 0.30; "i'm": 0.30; 'code': 0.31; "d'aprano": 0.31; 'disable': 0.31; 'steven': 0.31; 'run': 0.32; '(i.e.': 0.33; 'framework': 0.33; 'but': 0.35; 'building': 0.35; 'charset:us-ascii': 0.36; 'should': 0.36; 'reports': 0.37; 'turn': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'matter': 0.61; 'received:173': 0.61; 'afraid': 0.65; 'production': 0.68; 'off,': 0.84; '*for': 0.91 Date: Sat, 29 Nov 2014 14:33:39 -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> <5CCdw.40818$9A7.12372@fx27.am4> <547921c9$0$13013$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <547921c9$0$13013$c3e8da3$5496439d@news.astraweb.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KsRhTa0F2b07ArM9QbvPhMfvnpatiHSWe" 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: 58 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1417300424 news.xs4all.nl 2905 [2001:888:2000:d::a6]:55178 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:81724 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KsRhTa0F2b07ArM9QbvPhMfvnpatiHSWe Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable On 11/28/2014 05:30 PM, Steven D'Aprano wrote: > alister wrote: >=20 >> And as may wiser people than me have already highlighted Assertions ca= n >> 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 produc= t" >=20 > I'm afraid that you appear to have missed the point of assertions as te= sts. > Since they should never be used to *enforce* correct behaviour, but onl= y 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 tha= t > the tests won't run *for me*. The software will still be just as correc= t, > 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. -- ~Ethan~ --KsRhTa0F2b07ArM9QbvPhMfvnpatiHSWe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJUeknDAAoJENZ7D1rrH75Nq3sP/1jnRhOZLxDDdb/irU5l1tpQ xXTvWElFww3fMhAHC45QkhefbCRJ/frLZ/zH2sIfFz8haE5fbN6O9w6HTPTb4fOe gbZHh5zVf89At6M3YSl4aXdH9V5Rct+a+TlB4y9zzoeJYtEtxYP/kTD/gtVrRrNn gGEAgVyVG1/Nj9s8XmujRB25N0LwfgVOseX8qTvFE3ODb9J+eZtigVWS0ftLe30X o51vCHxzJSKzSfldRG5Oyu7akXqVh2bIZFYCwAwsVILrgT6qAoNhHNaMd7D/rstJ DKKALizbjWsijUiMOZe5d3v94xPYVq7uwFgPEsNw13cUwcfS5n+ykzW0UesY0GMn w+Z9kxzARrsqRkD/Y+VSlgew4+aMl5RKSDx27MV9rFjF1FukXIyTdUT2CppusE29 mSRngoSnoSvNzku1qz2nX+6V/IB3RHH1UDdWgriDvqeyCGLBB70Ny/H910Flvsos LrQHGF6Q3RGEVFN/2dDMZ7TPeTDPoTjfwZH2/vrNyA3YUpbqIQQbDL8swqmEesOf LhvpTUkY1Z5pGZZWUOBDNwy77ggvhM1QweAhAl4GH8JBcTBGQs+VI8o6J4lV+F1J jFV7KQh/sQrgWL2/64S+jmfIC7V5RXix1S1kItafA2lzh6M/mdtsFUonXmf6AAJE JaPQffKK/kCnnr3dXFxZ =Z/UT -----END PGP SIGNATURE----- --KsRhTa0F2b07ArM9QbvPhMfvnpatiHSWe--