Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed5.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'behavior.': 0.07; 'subject:when': 0.07; 'whichever': 0.07; 'python': 0.08; 'builtin': 0.09; 'coding.': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'received:gator410.hostgator.com': 0.09; '~ethan~': 0.09; 'handy': 0.16; 'received:72.11': 0.16; 'received:72.11.125': 0.16; 'received:72.11.125.166': 0.16; 'received:gateway01.websitewelcome.com': 0.16; 'subject:builtin': 0.16; 'written': 0.16; 'wrote:': 0.16; 'language,': 0.17; 'language': 0.17; '>>>': 0.18; 'seems': 0.20; 'header:In-Reply- To:1': 0.22; '(or': 0.23; 'mask': 0.23; 'code': 0.25; 'code.': 0.26; 'beyond': 0.28; 'depends': 0.28; 'programmers': 0.31; 'subject:?': 0.31; 'least': 0.31; 'third-party': 0.32; "can't": 0.33; 'there': 0.33; 'to:addr:python-list': 0.33; 'community': 0.34; 'header:User-Agent:1': 0.34; 'explicit': 0.34; 'starting': 0.36; 'doing': 0.36; 'skip:" 10': 0.36; 'but': 0.37; 'something': 0.37; 'especially': 0.37; 'two': 0.37; 'think': 0.38; 'subject:: ': 0.39; 'files,': 0.39; 'help': 0.39; 'basic': 0.39; "there's": 0.39; 'to:addr:python.org': 0.39; 'might': 0.40; 'one,': 0.40; 'thinking': 0.40; 'more': 0.60; 'easily': 0.61; 'received:websitewelcome.com': 0.64; 'received:184': 0.67; 'care': 0.71; 'received:69.56': 0.73; 'entertaining': 0.84; 'problematic': 0.84 Date: Mon, 15 Aug 2011 16:12:07 -0700 From: Ethan Furman User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: python-list@python.org Subject: Re: Why no warnings when re-assigning builtin names? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator410.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: mail.admailinc.com ([192.168.10.136]) [72.11.125.166]:2860 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 4 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ== 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313448950 news.xs4all.nl 23863 [2001:888:2000:d::a6]:33118 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11479 Seebs wrote: > On 2011-08-15, Ethan Furman wrote: >> Gerrat Rickert wrote: >>> What sayest the Python community about having an explicit warning >>> against such un-pythonic behaviour (re-assigning builtin names)? > >> What makes you think this behavior is unpythonic? Python is not about >> hand-holding. > > It seems like something which is sufficiently likely to be a mistake might > deserve a warning -- especially since, so far as I can tell, there's never > going to be a program which can't easily be written to avoid the problematic > behavior. "sufficiently likely" depends entirely on who is doing the coding. I use `open()` for opening my files, and so regularly use `file` as a name. It can also be very handy to mask a built-in when doing something even more fun and entertaining and I, for one, have zero desire to have Python start warning me about perfectly legitimate code. Programmers need to learn whichever language they are choosing to code in, and if extra help is needed beyond whatever is basic for that language, find (or write! ;) the third-party tool to help out. There are at least two linters for Python, and multiple IDEs that can help with these, and other, problems. (I don't much care for IDEs, but I am thinking of starting to use a linter, myself.) ~Ethan~