Phillip J. Eby wrote:

>>A case where this matters is here: http://python.org/sf/1306777
> 
> I've closed it as invalid; the behavior is as-defined.
> 
> In principle, there *could* be an optimization to avoid rebinding the 
> lvalue in the case where the __i*__ form did return self.  But using it for 
> the purpose of allowing augmented assignment to tuple members seems dubious 
> at best, and likely to create confusion about the mutability or lack 
> thereof of tuples.  IMO it's better to have augmented assignment to tuple 
> members always fail, so that the code has to be a little more specific 
> about its intent.

Okay. I assume that we must accept that

s = set()
t = (s,)
t[0] |= set([1])

changes s in spite of raising TypeError.

Reinhold

-- 
Mail address is perfectly valid!

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to