Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'override': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'gui': 0.11; 'library': 0.15; 'agree.': 0.16; 'personally,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:type': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'code.': 0.20; 'variable': 0.20; 'url:com)': 0.22; 'defined': 0.22; 'errors': 0.23; 'non': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'language.': 0.27; 'header:X-Complaints-To:1': 0.28; "i'm": 0.29; "skip:' 10": 0.30; 'fri,': 0.30; 'function': 0.30; 'automation': 0.33; 'to:addr :python-list': 0.33; 'hi,': 0.33; 'list': 0.35; 'built-in': 0.35; 'nov': 0.35; 'especially': 0.35; 'received:org': 0.36; 'michael': 0.36; 'bad': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'called': 0.39; 'list,': 0.39; 'subject:-': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'obvious': 0.71; 'fitting': 0.84; 'horrible': 0.84; 'received:fios.verizon.net': 0.84; 'joel': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Is it bad style to override the built-in function `type`? Date: Fri, 23 Nov 2012 13:35:54 -0500 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 In-Reply-To: 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1353695779 news.xs4all.nl 6893 [2001:888:2000:d::a6]:35428 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33858 On 11/23/2012 11:22 AM, Joel Goldstick wrote: > > > > On Fri, Nov 23, 2012 at 11:12 AM, Michael Herrmann > > > wrote: > > Hi, > > do you think it's bad style to override the built-in function > `type`? I'm co-developing a GUI automation library called Automa > (http://www.getautoma.com) and 'type' would be a very fitting name > for a function that generates artificial key strokes. > > Personally, I think this is a horrible idea. On this list and the tutor > list, people often use variable names that are already defined in the > language. It leads to non obvious errors -- especially when revisting > old code. Why not call the thing 'key_stroke'? I agree. -- Terry Jan Reedy