Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.027 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:" ': 0.03; 'assert': 0.09; 'wrote:': 0.15; 'codebase': 0.16; 'side-effects': 0.16; 'subject: \n ': 0.16; 'subject:() ': 0.16; 'subject:versus': 0.16; 'subject:was': 0.16; 'cc:addr:python-list': 0.16; 'pm,': 0.16; 'subject:list': 0.16; 'subject:skip:d 10': 0.17; 'cheers,': 0.19; 'subject:not': 0.21; 'cc:2**0': 0.21; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'code': 0.24; 'testing': 0.25; 'fri,': 0.28; 'message-id:@mail.gmail.com': 0.28; 'expressions': 0.29; 'cc:addr:python.org': 0.30; 'turned': 0.30; 'logic': 0.30; 'chris': 0.32; 'rather': 0.33; 'there': 0.34; 'test': 0.34; 'issue': 0.37; 'using': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'steven': 0.38; 'think': 0.38; 'either': 0.39; 'received:209': 0.40; 'hope': 0.60; 'your': 0.60; 'matter': 0.61; 'sender:addr:chris': 0.84; 'subject:should': 0.84; 'url:rebertia': 0.84; 'received:209.85.218.46': 0.91; 'received:mail- yi0-f46.google.com': 0.91; 'subject:place': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=pZbvxQvzVGSvvzt17WuzY4aNffRmI/YYuQfTJaMYRB8=; b=Upv9ENqdfUpuZDXxuGNmseEKt6jMWQDXeMU9rrrdfdfddZvSkmA/ztpq/roZ5QWSq/ p4PQ1M+yt1m3RV2HOBeMUEPhaQskOP4nGP0wXFt8xXpGD08efVi9fxF9HjQvOwEs2Gtb 1GIe5axxs6rfhAiRcYaOJDnykLJodAg9l9rEg= MIME-Version: 1.0 Sender: chris@rebertia.com In-Reply-To: <4e20fbc9$0$29979$c3e8da3$5496439d@news.astraweb.com> References: <874o2nb00n.fsf@benfinney.id.au> <4e20fbc9$0$29979$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 15 Jul 2011 22:02:03 -0700 X-Google-Sender-Auth: gUCqnlAaGejgBYY5hozJ2SnGErE Subject: Re: Type checking versus polymorphism (was: list(), tuple() should not place at "Built-in functions" in documentation) From: Chris Rebert To: "Steven D'Aprano" Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310792526 news.xs4all.nl 23902 [2001:888:2000:d::a6]:50851 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9598 On Fri, Jul 15, 2011 at 7:47 PM, Steven D'Aprano wrote: > Assertions are for testing internal program logic, not for validation. > > (I don't even like using assert for testing. How do you test your code with > assertions turned off if you use assert for testing?) I would think that would only matter if either the asserted expressions caused side-effects or there was nontrivial logic in the AssertionError handler, which would indicate a rather screwy codebase and point to a possible PEBKAC issue that testing cannot hope to remedy. Cheers, Chris -- http://rebertia.com