Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsfeed.xs4all.nl!newsfeed6.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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '3.2': 0.05; 'warnings': 0.05; 'interpreter': 0.07; 'subject:when': 0.07; 'python': 0.08; 'run.': 0.09; 'programmer': 0.10; '16,': 0.15; 'disagree,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'open()': 0.16; 'subject:builtin': 0.16; 'wrote:': 0.16; "wouldn't": 0.17; 'language': 0.17; '>>>': 0.18; 'once,': 0.18; '(like': 0.21; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'tue,': 0.23; 'aggressive': 0.23; 'gcc': 0.23; 'pm,': 0.24; 'aug': 0.24; 'code': 0.25; 'compile': 0.29; 'message-id:@mail.gmail.com': 0.29; 'lines': 0.30; 'subject:?': 0.31; 'changes': 0.31; 'seem': 0.31; "isn't": 0.33; 'to:addr:python-list': 0.33; 'uses': 0.35; 'addition,': 0.36; 'issue': 0.36; 'run': 0.37; 'think': 0.38; 'showing': 0.38; 'everyone': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'should': 0.38; 'subject:: ': 0.39; 'itself.': 0.39; 'to:addr:python.org': 0.39; "it's": 0.40; 'more': 0.60; 'basis': 0.61; 'you.': 0.62; 'perfect': 0.63; 'cost': 0.65; 'cause': 0.67; 'billion': 0.73; 'time?': 0.73; 'quality': 0.73; './configure': 0.84; 'make,': 0.84; "program's": 0.84; 'spread.': 0.84; 'amongst': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=NVRimO5Zjzm8oNjfDeckwSz/kZng+0Mh5v9EssOF5HM=; b=XpMUg26F69vH0WR400amEbSnPxv6WGCzl5Tq7Sv6lYRo6dr5h5Wmfv1p8Fzp/xmc2D E6JftN2wANBQ5usXTcRo9ajJ58oKoVWPJfmlFq0iS/ht04Cnbv/4s5vPV+6U92NsiySj ikVAG+wWpRTv7qfBCS6mWCw2i2t46Dy5+pfso= MIME-Version: 1.0 In-Reply-To: <4E4AAC30.6010100@stoneleaf.us> References: <4e49c89a$0$30001$c3e8da3$5496439d@news.astraweb.com> <4e49fcd7$0$29974$c3e8da3$5496439d@news.astraweb.com> <2A3EB048-1F10-46E8-973F-9BBD303E7B9F@semanchuk.com> <4E4A8F94.50706@stoneleaf.us> <4E4AAC30.6010100@stoneleaf.us> Date: Tue, 16 Aug 2011 19:23:22 +0100 Subject: Re: Why no warnings when re-assigning builtin names? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313519005 news.xs4all.nl 23842 [2001:888:2000:d::a6]:53137 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11593 On Tue, Aug 16, 2011 at 6:43 PM, Ethan Furman wrote: > Seebs wrote: >> >> On 2011-08-16, Ethan Furman wrote: >>> >>> I think warnings should be reserved for language changes and such (like >>> DeprecationWarning, RuntimeWarning, and FutureWarning), not for possibl= e >>> programmer mistakes. >> >> I disagree, on the basis of the following: >> >> The quality of C code I have to deal with has increased dramatically as >> gcc's aggressive use of warnings has spread. > > With gcc you pay the cost once, with Python you would pay it with every r= un. > =A0A linter would be more along the lines of 'pay it once'. Agreed; in addition, it's spam. Spam at compile time isn't much of an issue; you type ./configure and make, and a billion messages scroll past you. Spam at run time? Everyone who USES the program has to deal with it, and in amongst the program's own output. I don't know how to have Python emit warnings that wouldn't cause these issues. The only thing I can think of is to have the interactive interpreter default to showing more warnings, which is far from perfect itself. As to 'file' specifically, my 3.2 doesn't seem to have it as a builtin. The return value from open() is _io.TextIOWrapper, so the whole issue of file=3Dopen(...) may have been completely dodged. ChrisA