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 rubbis
On 12/1/2015 4:36 PM, Denis McMahon wrote:
On Tue, 01 Dec 2015 16:18:49 -0500, Terry Reedy wrote:
On 12/1/2015 3:32 PM, Denis McMahon wrote:
On Tue, 01 Dec 2015 03:32:31 +, MRAB wrote:
In the case of:
tup[1] += [6, 7]
what it's trying to do is:
tup[1] = tup[1].__iadd__([
On 01/12/15 21:37, Denis McMahon wrote:
The assignment succeeds. That's imo a bug. If it's a TypeError to try and
assign a value to tup[1], then tup[1] should not allow the mutated list
to be assigned.
Nothing got assigned.
That original list object remains in that slot. However, it has been
On Tue, 01 Dec 2015 14:44:38 -0600, Ian Kelly wrote:
> On Tue, Dec 1, 2015 at 2:32 PM, Denis McMahon
> wrote:
>> On Tue, 01 Dec 2015 03:32:31 +, MRAB wrote:
>>
>>> In the case of:
>>>
>>> tup[1] += [6, 7]
>>>
>>> what it's trying to do is:
>>>
>>> tup[1] = tup[1].__iadd__([6, 7])
>>
On Tue, 01 Dec 2015 16:18:49 -0500, Terry Reedy wrote:
> On 12/1/2015 3:32 PM, Denis McMahon wrote:
>> On Tue, 01 Dec 2015 03:32:31 +, MRAB wrote:
>>
>>> In the case of:
>>>
>>> tup[1] += [6, 7]
>>>
>>> what it's trying to do is:
>>>
>>> tup[1] = tup[1].__iadd__([6, 7])
>>>
>>> tup
On 12/1/2015 3:32 PM, Denis McMahon wrote:
On Tue, 01 Dec 2015 03:32:31 +, MRAB wrote:
In the case of:
tup[1] += [6, 7]
what it's trying to do is:
tup[1] = tup[1].__iadd__([6, 7])
tup[1] refers to a list, and the __iadd__ method _does_ mutate it, but
then Python tries to put
On Tue, Dec 1, 2015 at 2:32 PM, Denis McMahon wrote:
> On Tue, 01 Dec 2015 03:32:31 +, MRAB wrote:
>
>> In the case of:
>>
>> tup[1] += [6, 7]
>>
>> what it's trying to do is:
>>
>> tup[1] = tup[1].__iadd__([6, 7])
>>
>> tup[1] refers to a list, and the __iadd__ method _does_ mutate
On Tue, 01 Dec 2015 03:32:31 +, MRAB wrote:
> In the case of:
>
> tup[1] += [6, 7]
>
> what it's trying to do is:
>
> tup[1] = tup[1].__iadd__([6, 7])
>
> tup[1] refers to a list, and the __iadd__ method _does_ mutate it, but
> then Python tries to put the result that the method
On 2015-12-01 02:14, fl wrote:
On Wednesday, June 24, 2015 at 8:17:08 PM UTC-4, Chris Angelico wrote:
On Thu, Jun 25, 2015 at 9:52 AM, fl wrote:
> The reason is that list implements __iadd__ like this (except in C, not
Python):
>
> class List:
> def __iadd__(self, other):
> self.ex
On Wednesday, June 24, 2015 at 8:17:08 PM UTC-4, Chris Angelico wrote:
> On Thu, Jun 25, 2015 at 9:52 AM, fl wrote:
> > The reason is that list implements __iadd__ like this (except in C, not
> > Python):
> >
> > class List:
> > def __iadd__(self, other):
> > self.extend(other)
> >
On Thu, Jun 25, 2015 at 9:52 AM, fl wrote:
> The reason is that list implements __iadd__ like this (except in C, not
> Python):
>
> class List:
> def __iadd__(self, other):
> self.extend(other)
> return self
> When you execute "nums += more", you're getting the same effect as:
Hi,
I read a blog written by Ned and find it is very interesting, but I am still
unclear it in some parts. In the following example, I am almost lost at the
last line:
nums = num
Could anyone explain it in a more detail to me?
Thanks,
...
The reason is that list imple
12 matches
Mail list logo