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/056766.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 15:12:17 CEST 2005
Hi,

a general question. Consider:

class A(list):
    def __setitem__(self, index, item):
        # do something with index and item
        return list.__setitem__(self, index, item)

lst = A([1,set()])

lst[0] |= 1

lst[1] |= set([1])

Do we want lst.__setitem__ to be called in the second inplace assignment?

A case where this matters is here: http://python.org/sf/1306777

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