Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3a.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'assignment': 0.07; 'modified': 0.07; 'result,': 0.07; 'skip:` 10': 0.07; 'cc:addr :python-list': 0.11; '3:27': 0.16; 'defined.': 0.16; 'least.': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'feb': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; '\xa0if': 0.24; 'cc:2**0': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'consequence': 0.31; 'fri,': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'list': 0.37; 'being': 0.38; 'called': 0.40; 'to:addr:gmail.com': 0.65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=3HimNt1JBrAOlP9QVabKCbUSDLy/KyN25OIy/2aI/3Q=; b=0KY9AKRcuAsUXmTNOO4ojGoOWkCyI79X2LFfdr8dd9/dipn5682Ie55AIzRZXzi8ki m6FH+5df7LnzNKbZNYQuy+R91ILuKeJIZ020A6x+4v5SZhvsbL7o7S3qdBeELuoXiYZY rX+ksspI6mWvfGJHbHHg9C2habDWvUeXkXSWQdB78GqAPhykiPSrwKLpwsNhdcXyIjL/ WnpHtgrK6xUeQk2L7ZzYg/Ji1gGgyPtSSpCagPoewj1orll+YLxE3A0S5R7Cx3EGVDRI /VaQBbNhGDNMsLijK6IGZXvyX9AnBEzKvJtrNEpl6ykwj+i5PcLK8nZQHoOcX7KCb8BU /GtQ== X-Received: by 10.180.165.15 with SMTP id yu15mr262910wib.28.1393537688986; Thu, 27 Feb 2014 13:48:08 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: Nick Timkovich Date: Thu, 27 Feb 2014 15:47:48 -0600 Subject: Re: Tuples and immutability To: Chris Angelico Content-Type: multipart/alternative; boundary=90e6ba10abe9eeeab504f36a46d3 Cc: "python-list@python.org" 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: 50 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393537690 news.xs4all.nl 2873 [2001:888:2000:d::a6]:46021 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67166 --90e6ba10abe9eeeab504f36a46d3 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Feb 27, 2014 at 10:33 AM, Chris Angelico wrote: > On Fri, Feb 28, 2014 at 3:27 AM, Eric Jacoboni > wrote: > > But, imho, it's far from being a intuitive result, to say the least. > > It's unintuitive, but it's a consequence of the way += is defined. If > you don't want assignment, don't use assignment :) > > ChrisA > Where is `.__iadd__()` called outside of `list += X`? If the only difference from `.extend()` is that it returns `self`, but the list was already modified anyway, why bother with reassignment? --90e6ba10abe9eeeab504f36a46d3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On T= hu, Feb 27, 2014 at 10:33 AM, Chris Angelico <rosuav@gmail.com> wrote:
On Fri, Feb 28, 2014 at 3:27= AM, Eric Jacoboni <eric.jaco= boni@gmail.com> wrote:
> But, imho, it's far from being a intuitive result, to say the leas= t.

It's unintuitive, but it's a consequence of the way +=3D is d= efined. If
you don't want assignment, don't use assignment :)

ChrisA

Where= is `.__iadd__()` called outside of `list +=3D X`? =A0If the only differenc= e from `.extend()` is that it returns `self`, but the list was already modi= fied anyway, why bother with reassignment?
--90e6ba10abe9eeeab504f36a46d3--