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


Groups > comp.lang.python > #79711

Re: When to use assert

X-FeedAbuse http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63
Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!news.muarf.org!news.ecp.fr!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.029
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'programmer': 0.03; 'paths': 0.07; 'returns,': 0.09; 'sure,': 0.09; 'tests,': 0.09; 'cc:addr:python-list': 0.11; 'bugs.': 0.16; 'coding?': 0.16; 'correctness': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'guess.': 0.16; 'regression': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'code,': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'testing': 0.29; 'direction': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'etc.)': 0.35; 'received:google.com': 0.35; 'wrong': 0.37; 'performance': 0.37; 'pm,': 0.38; 'anything': 0.39; 'sure': 0.39; 'how': 0.40; 'cost.': 0.60; 'eventually': 0.60; 'tell': 0.60; 'reach': 0.63; 'more': 0.64; 'worth': 0.66; '26,': 0.68; 'hoping': 0.75; 'diminishing': 0.84; 'take,': 0.84; 'capture': 0.91; 'to:none': 0.92; 'confidence': 0.95
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=y/m6JJF2NKfeOtFVgvlYjX0xlzCIkvrzgTVKryuUm3w=; b=A3uk5VbWUgx6ND8aG+S557Gg4003Th4jMs/utz+AWxvUMHIPybY+u88FASjdVE8Jpd o9I1Iec0dg5KOhwWBWk819GeQg4ovSXSBInukGCMASytflJ5koXoEyLLPqjBfSUqqjGF dUgRDddP96z/iS4JaASve9EL9L4MYS5IGIWosqog9B7jsCwXckWRUrPQEuA7LLz5uVCT EaDeglu67bCaRL0iS8LnupZ1kYGx5gwENYMLP4rqHjMFRTQ1f8xmn1BCRLb11KkGIkAI Yk4fdiyv9Z1D8e+FxNHJxieo3XHEibiCtWjVxx+HzZawcEjZMHzwZrC57Pa1TlwKuDCs iG2A==
MIME-Version 1.0
X-Received by 10.50.79.167 with SMTP id k7mr14842297igx.14.1414317079833; Sun, 26 Oct 2014 02:51:19 -0700 (PDT)
In-Reply-To <544cc160$0$12991$c3e8da3$5496439d@news.astraweb.com>
References <528871d5$0$29975$c3e8da3$5496439d@news.astraweb.com> <4d46b9b6-3ab9-45bc-afe9-55da4d0fe76c@googlegroups.com> <54470c17$0$12985$c3e8da3$5496439d@news.astraweb.com> <mailman.15053.1413942836.18130.python-list@python.org> <5447d20c$0$12997$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmpqKUe6Ou3nuNJNc7M8zuOcYK6YvYWWrO5abH3n3yVjTg@mail.gmail.com> <mailman.15081.1413994712.18130.python-list@python.org> <544a049c$0$13011$c3e8da3$5496439d@news.astraweb.com> <mailman.15126.1414138713.18130.python-list@python.org> <544cc160$0$12991$c3e8da3$5496439d@news.astraweb.com>
Date Sun, 26 Oct 2014 20:51:19 +1100
Subject Re: When to use assert
From Chris Angelico <rosuav@gmail.com>
Cc "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.15193.1414317082.18130.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1414317082 news.xs4all.nl 2978 [2001:888:2000:d::a6]:41317
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:79711

Show key headers only | View raw


On Sun, Oct 26, 2014 at 8:39 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> In the absence of correctness proofs for your code, anything you do (unit
> tests, assertions, regression tests, etc.) is just a statistically sampling
> of all the potential paths your code might take, hoping to capture bugs. As
> any statistician will tell you, eventually you will reach the point of
> diminishing returns, where adding more samples isn't worth the cost. That
> point will depend on the cost in programmer effort, the performance
> implications, and your confidence in the code.

That's about the size of it, I guess. How much testing versus how much
time actually spent coding?

I'm pretty sure a lot of my code has the wrong ratio... I'm just not
sure, for a lot of the code, which direction it's wrong :)

ChrisA

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


Thread

Re: When to use assert Anton <anton.schattenfeld@gmail.com> - 2014-10-21 00:48 -0700
  Re: When to use assert Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-22 12:44 +1100
    Re: When to use assert Chris Angelico <rosuav@gmail.com> - 2014-10-22 12:53 +1100
      Re: When to use assert Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-23 02:49 +1100
        Re: When to use assert Chris Angelico <rosuav@gmail.com> - 2014-10-23 03:01 +1100
        Re: When to use assert Dan Stromberg <drsalists@gmail.com> - 2014-10-22 09:18 -0700
          Re: When to use assert Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-24 18:49 +1100
            Re: When to use assert Chris Angelico <rosuav@gmail.com> - 2014-10-24 19:18 +1100
              Re: When to use assert Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-10-26 20:39 +1100
                Re: When to use assert Chris Angelico <rosuav@gmail.com> - 2014-10-26 20:51 +1100

csiph-web