Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!nerim.net!novso.com!news.skynet.be!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'else:': 0.03; 'argument': 0.04; 'variables.': 0.07; 'occasionally': 0.09; 'def': 0.10; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nameerror': 0.16; 'wrote:': 0.17; 'tim': 0.18; 'example': 0.23; 'header:In-Reply-To:1': 0.25; 'looks': 0.26; 'skip:m 30': 0.26; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'actual': 0.28; 'chase': 0.29; 'declared': 0.29; 'becomes': 0.30; 'to:addr:python- list': 0.33; 'skip:d 20': 0.34; 'skip:b 20': 0.34; 'received:google.com': 0.34; 'received:209.85': 0.35; 'something': 0.35; 'but': 0.36; 'should': 0.36; 'received:209': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'real': 0.61; '2013': 0.84; 'favour': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=lzRGm1CS39t2nIPiguJdhpcS0y0h8fE4Hr3NE+zY7wM=; b=mJ19twdxWG3cvQ32zeHG2EEl9KwJGQwU3prDx69IlyPXTk6tZLyqiODBNMTgKPubPv RGQ/+5Z+A+6FRmCLXaSBCGblW18cZD3/KNmeWRkXvHV+b2lEcC/RQc6atRCcl9Zl65qm Ka68XoJ2a9ID6dYc45rW213pfrqJkr2NlvcGdpfKLJiS55p9ZblnqmmaJ8U+sKGh14UV 3jtZF/PeingtQN+wrmH70L//jiyuumT1JNSgkB9d1QTxMZvcTfRCwTWAK3mzNYrNsqOS fqpWBR9lFAFSUPt8ipu8vFqR5J1CFxH6zkk4oRXkbgu5tatkWC7ivHxAf9145YZh0+mb 83FA== MIME-Version: 1.0 X-Received: by 10.58.56.161 with SMTP id b1mr13763480veq.42.1363477703838; Sat, 16 Mar 2013 16:48:23 -0700 (PDT) In-Reply-To: <20130316183615.7d72b3c2@bigbox.christie.dr> References: <20130316183615.7d72b3c2@bigbox.christie.dr> Date: Sun, 17 Mar 2013 10:48:23 +1100 Subject: Re: PyWart: NameError trackbacks are superfluous From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363477711 news.xs4all.nl 6984 [2001:888:2000:d::a6]:48540 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41337 On Sun, Mar 17, 2013 at 10:36 AM, Tim Chase wrote: > Because, in the real world, that example looks something like > > def broken(intelligence_level): > if intelligence_level < 100: > return dumb_down(intellegence_level) > else: > return make_harder(intelligence_level) > broken(op.iq) > > Pylint, pyflakes or some other such linter should catch it, but this > happens ALL THE TIME in actual development, occasionally leaking into > production. That's actually an argument in favour of declared variables. NameError becomes a parse-time failure :) ChrisA