Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #99827

Re: Could you explain this rebinding (or some other action) on "nums = nums"?

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Erik <python@lucidity.plus.com>
Newsgroups comp.lang.python
Subject Re: Could you explain this rebinding (or some other action) on "nums = nums"?
Date Tue, 1 Dec 2015 22:44:53 +0000
Lines 23
Message-ID <mailman.91.1449009930.14615.python-list@python.org> (permalink)
References <94c2e42e-1e5f-40cf-9259-26035e277bf3@googlegroups.com> <mailman.37.1435191416.3674.python-list@python.org> <b48d4b38-a28a-4408-8271-f79e850f453f@googlegroups.com> <mailman.51.1448940760.14615.python-list@python.org> <n3l050$l7a$4@dont-email.me> <mailman.83.1449002726.14615.python-list@python.org> <n3l3vk$l7a$6@dont-email.me> <565E2065.1050704@lucidity.plus.com>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de MQ5bfQBh6JQV/K2A8biX8QwD3NphX2JKfNRh8ieBMOtA==
Return-Path <python@lucidity.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.040
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'immutable': 0.09; 'subsequent': 0.15; 'assignment.': 0.16; 'erik': 0.16; 'from:addr:python': 0.16; 'mutated': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Could': 0.16; 'wrote:': 0.16; 'element': 0.18; 'to:2**1': 0.21; 'explicit': 0.22; 'header:In- Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'example': 0.26; 'subject:other': 0.29; 'subject:some': 0.29; 'subject:) ': 0.32; 'point': 0.33; 'similar': 0.33; 'something': 0.35; 'asking': 0.35; 'but': 0.36; 'assigned': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'charset:windows-1252': 0.62; 'above,': 0.63; 'situation': 0.67; 'contains.': 0.84; 'subject:this': 0.85; 'subject:you': 0.85
X-CM-Score 0.00
X-CNFS-Analysis v=2.1 cv=bI7rW6KZ c=1 sm=1 tr=0 a=Ypmeq7T0cKALDUsRPCToMg==:117 a=Ypmeq7T0cKALDUsRPCToMg==:17 a=0Bzu9jTXAAAA:8 a=EBOSESyhAAAA:8 a=N659UExz7-8A:10 a=hczHA9gShFpHkIuQ9NoA:9 a=pILNOxqGKmIA:10
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
In-Reply-To <565E2065.1050704@lucidity.plus.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:99827

Show key headers only | View raw


Apologies for self-replying,

On 01/12/15 22:34, Erik wrote:
>  what you're asking for is that
> the *container* object whose element is being assigned to is first
> queried as to whether it will accept a mutated element being assigned to
> it before that element is mutated.

What I said above is rubbish. The situation is approximately similar to:

a = [4, 5, 6]
t = ([1, 2, 4], a)
a.append(7)
a.append(8)
a.append(9)

The point is, you're mutating something that an immutable object 
contains. In the example you give, that's caught because of the 
subsequent explicit assignment.

In the example above, it's not caught. But it's the same thing.

E.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Could you explain this rebinding (or some other action) on "nums = nums"? fl <rxjwg98@gmail.com> - 2015-11-30 18:14 -0800
  Re: Could you explain this rebinding (or some other action) on "nums = nums"? MRAB <python@mrabarnett.plus.com> - 2015-12-01 03:32 +0000
    Re: Could you explain this rebinding (or some other action) on "nums = nums"? Denis McMahon <denismfmcmahon@gmail.com> - 2015-12-01 20:32 +0000
      Re: Could you explain this rebinding (or some other action) on "nums = nums"? Ian Kelly <ian.g.kelly@gmail.com> - 2015-12-01 14:44 -0600
        Re: Could you explain this rebinding (or some other action) on "nums = nums"? Denis McMahon <denismfmcmahon@gmail.com> - 2015-12-01 21:37 +0000
          Re: Could you explain this rebinding (or some other action) on "nums = nums"? Erik <python@lucidity.plus.com> - 2015-12-01 22:34 +0000
          Re: Could you explain this rebinding (or some other action) on "nums = nums"? Erik <python@lucidity.plus.com> - 2015-12-01 22:44 +0000
      Re: Could you explain this rebinding (or some other action) on "nums = nums"? Terry Reedy <tjreedy@udel.edu> - 2015-12-01 16:18 -0500
        Re: Could you explain this rebinding (or some other action) on "nums = nums"? Denis McMahon <denismfmcmahon@gmail.com> - 2015-12-01 21:36 +0000
          Re: Could you explain this rebinding (or some other action) on "nums = nums"? Terry Reedy <tjreedy@udel.edu> - 2015-12-01 17:37 -0500

csiph-web