A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-September/056774.html below:

[Python-Dev] inplace operators and __setitem__

[Python-Dev] inplace operators and __setitem__ [Python-Dev] inplace operators and __setitem__Reinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Wed Sep 28 17:15:56 CEST 2005
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!

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4