Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'omit': 0.07; 'received:verizon.net': 0.07; 'terry': 0.07; 'object?': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'am,': 0.12; '"+="': 0.16; 'int.': 0.16; 'pydev': 0.16; 'reedy': 0.16; 'subject:copy': 0.16; 'wrote:': 0.16; "wouldn't": 0.17; 'say,': 0.19; 'jan': 0.19; 'seems': 0.19; 'discussion': 0.21; 'header:In- Reply-To:1': 0.22; 'creating': 0.25; 'not.': 0.28; '(and': 0.29; 'augmented': 0.30; 'list).': 0.30; 'semantics': 0.30; 'suggested': 0.32; 'list': 0.32; 'idea': 0.32; 'header:User-Agent:1': 0.33; 'to:addr:python-list': 0.33; 'object': 0.33; 'there': 0.33; 'assignment': 0.34; 'operations': 0.34; 'header:X-Complaints- To:1': 0.34; 'probably': 0.35; 'uses': 0.36; 'but': 0.37; 'received:org': 0.37; 'could': 0.37; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; 'one,': 0.40; 'type': 0.60; 'john': 0.62; 'exact': 0.68; 'succeed': 0.73; 'with,': 0.73; 'introduced.': 0.84; 'subject:write': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: copy on write Date: Thu, 02 Feb 2012 12:25:00 -0500 References: <4f101f45$0$29999$c3e8da3$5496439d@news.astraweb.com> <4f102bd0$0$29999$c3e8da3$5496439d@news.astraweb.com> <4F107AAF.5000600@stoneleaf.us> <20120202141812.649c31d832bb15bd899eb952@johnohagan.com> <4f2a5478$0$29895$c3e8da3$5496439d@news.astraweb.com> <20120203011748.592f060f32ac79d450a2ca8d@johnohagan.com> 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:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <20120203011748.592f060f32ac79d450a2ca8d@johnohagan.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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1328203521 news.xs4all.nl 6906 [2001:888:2000:d::a6]:35032 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19804 On 2/2/2012 9:17 AM, John O'Hagan wrote: > It's not so much about the type of x but that of x[1]. Wouldn't it be > possible to omit the assignment simply if the object referred to by > x[1] uses "+=" without creating a new object? That way, some_tuple[i] > += y will succeed if some_tuple[i] is a list but not with, say, an > int. That seems reasonable to me. There was considerable discussion of the exact semantics of augmented operations when they were introduced. I do not remember if that particular idea was suggested (and rejected) or not. You could try to look at the PEP, if there is one, or the dicussion ( probably on pydev list). -- Terry Jan Reedy