Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:verizon.net': 0.07; 'terry': 0.07; 'python': 0.08; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:" ': 0.10; 'reedy': 0.16; 'subject:=': 0.16; 'wrote:': 0.16; 'jan': 0.19; 'header:In-Reply- To:1': 0.22; 'pm,': 0.24; 'creating': 0.25; 'bound': 0.29; 'agreed.': 0.30; 'chris': 0.32; 'probably': 0.33; 'to:addr:python- list': 0.33; 'header:User-Agent:1': 0.34; 'header:X-Complaints- To:1': 0.35; 'but': 0.37; 'something': 0.37; 'received:org': 0.38; 'subject:: ': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'subject: (': 0.39; 'alternative': 0.64; 'making': 0.67; 'subject:+': 0.73 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: relative speed of incremention syntaxes (or "i=i+1" VS "i+=1") Date: Sun, 21 Aug 2011 22:11:46 -0400 References: <4e513ceb$0$23863$e4fe514c@news2.news.xs4all.nl> <1313947658.3424.3.camel@thegeorge> <747a8223-0a9b-4691-8886-0a04433e54dc@glegroupsg2000goo.googlegroups.com> <1313969134.3135.21.camel@thegeorge> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-74-109-121-73.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20110812 Thunderbird/6.0 In-Reply-To: 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1313979157 news.xs4all.nl 23971 [2001:888:2000:d::a6]:44953 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:11986 On 8/21/2011 7:41 PM, Chris Angelico wrote: > Agreed. If Python needed a faster alternative to "a=a+1", then I would > recommend an "a.inc()" call or something But looking up the method name, creating a bound method wrapper, and making the call would probably be slower than the syntax;-). -- Terry Jan Reedy