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: 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 To: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 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