[Python-Dev] inplace operators and setitem (original) (raw)
Reinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Wed Sep 28 15:12:17 CEST 2005
- Previous message: [Python-Dev] RELEASED Python 2.4.2 (final)
- Next message: [Python-Dev] inplace operators and __setitem__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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!
- Previous message: [Python-Dev] RELEASED Python 2.4.2 (final)
- Next message: [Python-Dev] inplace operators and __setitem__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]