Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4a.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'assign': 0.07; 'assignment': 0.07; 'bug.': 0.09; 'cc:addr:python-list': 0.11; 'anyway': 0.14; 'arbitrarily': 0.16; 'assignment.': 0.16; 'attempted.': 0.16; 'did.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'mutated': 0.16; 'simple.': 0.16; 'tuple': 0.16; 'sat,': 0.16; 'wrote:': 0.18; '(the': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'logical': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'giant': 0.31; 'raised': 0.31; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'really': 0.36; 'should': 0.36; 'two': 0.37; 'pm,': 0.38; 'telling': 0.64; 'mar': 0.68; 'anything.': 0.68; 'lying': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=/i3rdA9KkeawzNzM0ACciHLJ7of76+3ae7HoYpDH2z0=; b=FJ1VaC8V9k4wHOjB4dJATQD8wN4wjGz48noxFMP500hCFBOnWGI91ToiEp76CuKUj1 xCgP9nSbFg9588Gnv/QlyLC7fQSQBi7mb/6A26HRRDv/bcgjRKRfb40B6fd0bbwxoeK+ ld51b9gJ+vLX3URLLLYEdPLUYJ9uxIIPxgOcU/ABp0o8iig61rq2yQBEbSVTzCcoNfsq N2Sct0YyGPlP2bvOuKO/Ws1r3kcq3zMwsEzwR1/ixw6Y3D5+JFpnVoOFBGC/lXIbuk1N 9STSYd1cW6/hY2ku4Cprol3Z2m0PrlqCki0tjW0H77wvWTYFX19QkDve6FWMUIsTggT+ icIg== MIME-Version: 1.0 X-Received: by 10.68.223.193 with SMTP id qw1mr8251903pbc.16.1393655384164; Fri, 28 Feb 2014 22:29:44 -0800 (PST) In-Reply-To: References: <059a3d10-453a-40fd-99f9-33ceb8ecabf7@googlegroups.com> Date: Sat, 1 Mar 2014 17:29:44 +1100 Subject: Re: Tuples and immutability From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393655392 news.xs4all.nl 2917 [2001:888:2000:d::a6]:40293 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67299 On Sat, Mar 1, 2014 at 5:16 PM, Mark H. Harris wrot= e: > This is what I mean... the error message is telling the user that it ca= nnot do what he has requested, and yet IT DID. You have one of two scenari= os: 1) the message is arbitrarily lying and it really can assign an immut= able's item... (and it did!) or 2) It really should NOT assign an immuta= bles item (the message is truth) but the action was "allowed" anyway despit= e the protocol and accepted policy... in which case the two scenarios add = up to a giant logical inconsistency... QED a bug. > It did not assign anything. The error was raised because the tuple rejects item assignment. It's that simple. The object was mutated before the assignment was attempted. ChrisA