Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #67980

Assertions are bad, m'kay?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.028
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'type,': 0.09; 'violates': 0.09; 'abusing': 0.16; 'arg': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'exception': 0.16; 'to:name :python-list@python.org': 0.22; 'least': 0.26; 'message- id:@mail.gmail.com': 0.30; 'assert': 0.31; 'another': 0.32; 'checking': 0.33; 'received:google.com': 0.35; 'subject:?': 0.36; 'wrong': 0.37; 'to:addr:python-list': 0.38; 'expect': 0.39; 'to:addr:python.org': 0.39; 'disappear': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=i11Okeop0UNpr1ouB5Ekid8xnnsG9wul6J58vtv8wWY=; b=KDBU3TIafSrWFDrLT9fjF8hHFDqAoaxQSVQ4NoS6SAHdJoMeJQAptPYtTjfjpuuruE 7b93IRAYELYTuxsqD7tj4zjKcjoBJPwE8FlG1XD8I6sbxGEUco7JiiYgOAn5n4RUks8h BJKi1m9OvYX1/GuIAqKwmQttJJqr31jghVQqtPDWagANGCWj6qQfoMMCOMqka61cIl2c 2Hv+xD//gw3v2gI1uvXu6QTlerpeQ3b+ZMDEKaogc3ylYuC5uSsAMxP47Atva9ce1LsA IHvEJ817gphm/nlCZ+dV2XakoPZE7YE66/BXRIQ86pRasumOLDZiBAur8pU1Fpp9umon Qhwg==
MIME-Version 1.0
X-Received by 10.68.200.74 with SMTP id jq10mr2812619pbc.169.1394176615142; Thu, 06 Mar 2014 23:16:55 -0800 (PST)
Date Fri, 7 Mar 2014 18:16:55 +1100
Subject Assertions are bad, m'kay?
From Chris Angelico <rosuav@gmail.com>
To "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7890.1394176617.18130.python-list@python.org> (permalink)
Lines 9
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1394176617 news.xs4all.nl 2949 [2001:888:2000:d::a6]:51540
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:67980

Show key headers only | View raw


They produce the wrong exception type, they disappear when you least
expect them, and now we have another reason not to use assert.

http://xkcd.com/1339/

Abusing assert for arg checking violates XKCD 1339. Write
standards-compliant code!

ChrisA

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Assertions are bad, m'kay? Chris Angelico <rosuav@gmail.com> - 2014-03-07 18:16 +1100
  Re: Assertions are bad, m'kay? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-07 11:11 +0000
    Re: Assertions are bad, m'kay? Chris Angelico <rosuav@gmail.com> - 2014-03-07 22:24 +1100
    Re: Assertions are bad, m'kay? Dan Stromberg <drsalists@gmail.com> - 2014-03-07 16:15 -0800
      Re: Assertions are bad, m'kay? Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2014-03-08 01:26 +0100
      Re: Assertions are bad, m'kay? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-08 14:44 +0000
    Re: Assertions are bad, m'kay? Ben Finney <ben+python@benfinney.id.au> - 2014-03-08 11:22 +1100

csiph-web