This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author fdrake
Date 2003-09-12.20:10:43
SpamBayes Score
Marked as misclassified
This snippet produces a TypeError in Python 2.2.3, 2.3,
and CVS:

class C(object):
    def __setitem__(self, name, value):
        print (name, value)

class D(C):
    def __setitem__(self, name, value):
        super(D, self)[name] = value

d = D()
d['foo'] = 'bar'

Here's the traceback:

Traceback (most recent call last):
  File "/home/fdrake/tmp/", line 10, in ?
    d['foo'] = 'bar'
  File "/home/fdrake/tmp/", line 7, in
    super(D, self)[name] = value
TypeError: object does not support item assignment

The problem appears to be that the item assignment
isn't getting mapped to the __setitem__ of the base
class, so this is probably somewhere deep in
Date User Action Args
2007-08-23 14:16:48adminlinkissue805304 messages
2007-08-23 14:16:48admincreate