Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!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.050 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; '>>>>': 0.09; 'cc:addr :python-list': 0.15; 'awesome.': 0.16; 'imho,': 0.16; 'subject:copy': 0.16; 'wrote:': 0.16; 'wed,': 0.17; 'jan': 0.19; '(most': 0.21; 'cc:no real name:2**0': 0.21; 'feb': 0.22; 'header :In-Reply-To:1': 0.22; "shouldn't": 0.23; 'traceback': 0.24; 'cc:2**0': 0.25; 'pm,': 0.26; 'not.': 0.28; 'message- id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.29; 'fri,': 0.30; 'typeerror:': 0.30; 'pretty': 0.30; 'does': 0.32; "can't": 0.32; 'object': 0.33; 'there': 0.33; 'normally': 0.34; 'assignment': 0.34; 'last):': 0.34; 'received:209.85.160.46': 0.35; 'received:mail-pw0-f46.google.com': 0.35; 'received:209.85.160': 0.35; 'file': 0.35; 'but': 0.37; 'received:google.com': 0.37; 'steven': 0.38; 'received:209.85': 0.38; 'think': 0.38; 'received:209': 0.39; 'subject:: ': 0.39; 'did': 0.39; 'john': 0.62; '-0800': 0.84; 'subject:write': 0.84; 'worthy': 0.84; 'conclude': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=4/rOxBcgt3A3sbzG/PefI4S77ZutNFBil+Rq73tVNtk=; b=mQI34Ryeleb3gh3qfVTyN9XTJHnrIjlCsUV51Upzr8FmNQbESAQLlLVacUXg2nThSy sbsWPoy1qsk7mAgGFR/0CVJgZO8SD7KVgf47pOTx6gQqrf44K5NE6lTM2/mfoz1gWWm0 auF6GwkqAf9xrdAUdLJWAetkKRXejoIk4uA/M= MIME-Version: 1.0 In-Reply-To: <20120202141812.649c31d832bb15bd899eb952@johnohagan.com> 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> From: Devin Jeanpierre Date: Thu, 2 Feb 2012 01:34:48 -0500 Subject: Re: copy on write To: "John O'Hagan" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1328164533 news.xs4all.nl 6961 [2001:888:2000:d::a6]:57143 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19769 On Wed, Feb 1, 2012 at 10:18 PM, John O'Hagan wro= te: > On Fri, 13 Jan 2012 10:40:47 -0800 > Ethan Furman wrote: > >> Steven D'Aprano wrote: >> > Normally this is harmless, but there is one interesting little >> > glitch you can get: >> > >> >>>> t =3D ('a', [23]) >> >>>> t[1] +=3D [42] >> > Traceback (most recent call last): >> > =C2=A0 File "", line 1, in >> > TypeError: 'tuple' object does not support item assignment >> >>>> t >> > ('a', [23, 42]) > > IMHO, this is worthy of bug-hood: shouldn't we be able to conclude from t= he TypeError that the assignment failed? It did fail. The mutation did not. I can't think of any way out of this misleadingness, although if you can that would be pretty awesome. -- Devin