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


Groups > comp.lang.python > #53193

Re: Interface and duck typing woes

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.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.070
X-Spam-Evidence '*H*': 0.86; '*S*': 0.00; 'wrong,': 0.09; 'bug': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'raised.': 0.16; 'reedy': 0.16; 'exception': 0.16; 'prevent': 0.16; 'wrote:': 0.18; '(not': 0.18; 'discussion': 0.18; 'all,': 0.19; 'trying': 0.19; 'thu,': 0.19; 'not,': 0.20; 'written': 0.21; 'programming': 0.22; 'aug': 0.22; "haven't": 0.24; 'header:In- Reply-To:1': 0.27; 'point': 0.28; 'testing': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'anyone': 0.31; 'probably': 0.32; 'bugs': 0.33; "i'd": 0.34; 'could': 0.34; 'problem': 0.35; "who's": 0.35; 'but': 0.35; 'received:google.com': 0.35; 'so,': 0.37; 'to:addr:python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'users': 0.40; 'catch': 0.60; 'event.': 0.60; 'worry': 0.60; "you'll": 0.62; 'protection': 0.63; 'different': 0.65; 'road': 0.65; 'believe': 0.68; 'therefore': 0.72; 'protect': 0.79; 'trouble.': 0.91; 'acknowledge': 0.93; '2013': 0.98
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:to :content-type; bh=UNhJCeZrtZRkdQJAjOf0b7ewqG60aJQKhsegf7/09CU=; b=qyUJhWpBirYqPkq5y4BGP8bUDCNhtJrrdbPlpox/CDS7O82dHXzYkEZ0ZGyFvP6ltl E0PIm2h1Ik9vbrF+oQcdjfkHGYbdH8Fb+9OLNkhTpAetTB0GQjpQgQ9Qpsx8/txiQQME /dfZ+c6YEs2HqiG2mkyoXOgnqJgzD6o0MlYIA1vCrox2y5ci4IiOnYV7GEXZ7vawIYrk xSlmFGGpxhxLvXGJiw9ibwtXg8A7PnQ2X+qhXuRKolrPus/xJ4KEqwLDhyE/THAaOqhO 5i93maV3LXWH8TEMehb4OjAkcKntB8iUFwQe9O80OG4Eu7ksGPTmSZb4fO9xLoElwM2L f9kQ==
MIME-Version 1.0
X-Received by 10.220.186.202 with SMTP id ct10mr65800vcb.14.1377731841750; Wed, 28 Aug 2013 16:17:21 -0700 (PDT)
In-Reply-To <kvlri8$uq9$1@ger.gmane.org>
References <CADuC2CtxCANpFhEHEgwYqbDe1GEFa_oR4jmAyJumV6kHOD2zAw@mail.gmail.com> <kvlri8$uq9$1@ger.gmane.org>
Date Thu, 29 Aug 2013 09:17:21 +1000
Subject Re: Interface and duck typing woes
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.331.1377731849.19984.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1377731849 news.xs4all.nl 15915 [2001:888:2000:d::a6]:60060
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:53193

Show key headers only | View raw


On Thu, Aug 29, 2013 at 7:54 AM, Terry Reedy <tjreedy@udel.edu> wrote:
> Depending on who the users will be, I might just not worry about it until an
> exception is raised. If you try to protect against everything that you might
> do wrong, you are on the road to madness, as the protection code might also
> be buggy. (Too much testing has the same problem ;-).

I'd go further.

Do you believe that you can write code to catch every bug you might
make? If so, you are naive and probably haven't spent much time
programming yet :) And if not, then you must acknowledge that bugs
WILL happen; therefore you will need to cope with them after the
event. So rather than trying to prevent them all, just improve your
means of coping, and you'll accomplish the same end with much less
trouble.

At this point I could go off into a lengthy discussion of philosophy
and original sin (not "original SYN", which is a different thing
altogether), but anyone who's ever written bug-handling code will
understand what I mean already :)

ChrisA

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


Thread

Re: Interface and duck typing woes Chris Angelico <rosuav@gmail.com> - 2013-08-29 09:17 +1000

csiph-web