Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'behavior,': 0.07; 'builtins': 0.07; 'subject:when': 0.07; 'worse': 0.07; '__future__': 0.09; 'def': 0.15; 'bye,': 0.16; 'confusing.': 0.16; 'contrary,': 0.16; 'directive': 0.16; 'fits': 0.16; 'newcomers': 0.16; 'objects?': 0.16; 'philosophy.': 0.16; 'received:mindspring.com': 0.16; 'subject:builtin': 0.16; 'x-mailer:apple mail (2.1084)': 0.16; 'wrote:': 0.16; 'language': 0.17; 'issue,': 0.18; "they've": 0.18; 'compared': 0.21; 'pointed': 0.21; 'header:In-Reply-To:1': 0.22; 'tue,': 0.23; "one's": 0.23; 'replacing': 0.23; 'pm,': 0.24; 'aug': 0.24; "python's": 0.24; 'described': 0.28; 'import': 0.28; 'pass': 0.29; 'script.': 0.29; 'not.': 0.30; 'accidentally': 0.30; 'agreed.': 0.30; 'remains': 0.30; 'class': 0.30; 'subject:?': 0.31; 'chris': 0.32; 'received:24': 0.32; 'objects': 0.32; 'to:addr:python-list': 0.33; 'done': 0.34; 'idea': 0.34; 'anything': 0.36; 'charset:us- ascii': 0.36; 'doing': 0.36; 'useful': 0.36; 'but': 0.37; 'something': 0.37; 'steven': 0.38; 'some': 0.38; 'should': 0.38; 'easier': 0.38; 'subject:: ': 0.39; 'header:Mime-Version:1': 0.39; "there's": 0.39; 'why': 0.39; 'to:addr:python.org': 0.39; "i'd": 0.40; 'official': 0.40; 'might': 0.40; "it's": 0.40; 'more': 0.60; 'your': 0.61; 'header:Message-Id:1': 0.61; 'making': 0.67; '"we\'re': 0.84; 'masking': 0.84; 'received:69.73': 0.84; 'sacred': 0.84 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1084) Subject: Re: Why no warnings when re-assigning builtin names? From: Philip Semanchuk In-Reply-To: <4e49c89a$0$30001$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 15 Aug 2011 23:23:06 -0400 Content-Transfer-Encoding: quoted-printable References: <4e49c89a$0$30001$c3e8da3$5496439d@news.astraweb.com> To: Lista-Comp-Lang-Python list X-Mailer: Apple Mail (2.1084) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - deimos.nocdirect.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - semanchuk.com 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: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313464992 news.xs4all.nl 23942 [2001:888:2000:d::a6]:33113 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11501 On Aug 15, 2011, at 9:32 PM, Steven D'Aprano wrote: > On Tue, 16 Aug 2011 08:15 am Chris Angelico wrote: >=20 >> If you want a future directive that deals with it, I'd do it the = other >> way - from __future__ import mask_builtin_warning or something - so >> the default remains as it currently is. But this may be a better job >> for a linting script. >=20 > Agreed. It's a style issue, nothing else. There's nothing worse about: >=20 > def spam(list): > pass >=20 > compared to >=20 > class thingy: pass >=20 > def spam(thingy): > pass >=20 > Why should built-ins be treated as more sacred than your own objects? Because built-ins are described in the official documentation as having = a specific behavior, while my objects are not. Yes, it can be useful to replace some of the builtins with one's own = implementation, and yes, doing so fits in with Python's "we're all = consenting adults" philosophy. But replacing (shadowing, masking -- call = it what you will) builtins is not everyday practice. On the contrary, as = the OP Gerrat pointed out, it's most often done unwittingly by newcomers = to the language who have no idea that they've done anything out of the = ordinary or potentially confusing.=20 If a language feature is most often invoked accidentally without = knowledge of or regard for its potential negative consequences, then it = might be worth making it easier to avoid those accidents.=20 bye, Philip=