Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '"if': 0.04; 'header:In- reply-to:1': 0.09; 'to:addr:comp.lang.python': 0.09; 'tracing': 0.09; 'c++': 0.12; 'cc:addr:python-list': 0.15; "'a'": 0.16; '(besides': 0.16; 'means:': 0.16; 'subject:copy': 0.16; 'wrote:': 0.16; 'cc:no real name:2**0': 0.21; 'besides': 0.24; 'performing': 0.25; '(in': 0.26; 'pm,': 0.26; 'cc:addr:python.org': 0.29; 'received:144': 0.30; 'cases': 0.32; 'actual': 0.32; 'header:User- Agent:1': 0.33; 'cc:2**1': 0.36; 'executing': 0.36; 'charset:us- ascii': 0.36; 'run': 0.37; 'reference': 0.37; 'received:128': 0.37; 'should': 0.38; 'either': 0.39; 'called': 0.39; 'subject:: ': 0.39; 'design': 0.61; 'your': 0.61; 'behaviors': 0.67; 'subject:write': 0.84 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Date: Thu, 02 Feb 2012 15:20:48 -0600 From: Evan Driscoll Subject: Re: copy on write In-reply-to: <25876847.362.1328189597333.JavaMail.geo-discussion-forums@prcu6> To: comp.lang.python@googlegroups.com X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.105.181.52 X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.2.210314, SenderIP=128.105.181.52 References: <4f101f45$0$29999$c3e8da3$5496439d@news.astraweb.com> <9nb5ubFu17U2@mid.individual.net> <9nblhhFr5bU1@mid.individual.net> <25876847.362.1328189597333.JavaMail.geo-discussion-forums@prcu6> User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 Cc: python-list@python.org, 88888 Dihedral 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1328221262 news.xs4all.nl 6968 [2001:888:2000:d::a6]:32888 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19811 On 01/-10/-28163 01:59 PM, 88888 Dihedral wrote: >> If you're working in C++ and overload your operators so that 'a +=' >> and 'a = + b' have different observable behaviors (besides perhaps >> time), then either your implementation is buggy or your design is very >> bad-mannered. >> >> Evan > > Do you mean the result instances after 'a+= and 'a=a+b' or > the actions of behaviors of instances involved in performing 'a+= and 'a=a+b'? > I mean "if which operation you called is distinguishable in any way besides the time it takes to run or by tracing it through in a debugger" That means: 1. The value of 'a' should be the same after executing 'a+=b' and 'a=a+b' 2. The actual result of the expression should be the same in both cases (in both cases it should be a reference to a) 3. Any additional side effects performed (ew!) should be the same in both cases Evan