Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.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; 'assignment': 0.07; 'modified': 0.07; 'assigning': 0.09; 'augmented': 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; 'part,': 0.09; 'similar,': 0.09; 'target,': 0.09; '~ethan~': 0.09; '"an': 0.16; 'effect.': 0.16; 'in-place': 0.16; 'in-place,': 0.16; 'once.': 0.16; 'reedy': 0.16; 'rewritten': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'possible,': 0.19; 'meant': 0.20; '>>>': 0.22; 'manual': 0.22; 'creating': 0.23; 'header:User-Agent:1': 0.23; 'instead.': 0.24; 'possibly': 0.26; 'header:In-Reply-To:1': 0.27; "doesn't": 0.30; 'says': 0.33; 'actual': 0.34; 'except': 0.35; 'equal': 0.35; 'johnson': 0.35; 'but': 0.35; 'charset:us- ascii': 0.36; 'version,': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'expression': 0.60; 'ian': 0.60; 'new': 0.61; 'received:173': 0.61; 'more': 0.64; 'received:69.56': 0.68; 'rick': 0.93 Date: Tue, 11 Mar 2014 23:32:53 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Tuples and immutability References: <0d76f320-a39e-44e9-85a2-74220b646566@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; 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 - gator3304.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-IP: 173.12.184.233 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.233]) [173.12.184.233]:34903 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20= 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1394609184 news.xs4all.nl 2887 [2001:888:2000:d::a6]:38987 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68261 On 03/11/2014 08:25 PM, Terry Reedy wrote: > On 3/11/2014 10:01 PM, Rick Johnson wrote: >> >> On Thursday, February 27, 2014 4:18:01 PM UTC-6, Ian wrote: >>> x += y is meant to be equivalent, except possibly in-place and >>> more efficient, than x = x + y. > > The manual actually says "An augmented assignment expression like x += 1 can be rewritten as x = x + 1 to achieve a > similar, but not exactly equal effect. In the augmented version, x is only evaluated once. Also, when possible, the > actual operation is performed in-place, meaning that rather than creating a new object and assigning that to the target, > the old object is modified instead. ... and reassigned to the target. :) (If it doesn't say that last part, it should.) -- ~Ethan~