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 iritkatriel
Recipients hongweipeng, iritkatriel, r.david.murray, raumzeitkeks, rhettinger, xtreak
Date 2021-07-06.13:36:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1625578581.87.0.845678133965.issue31218@roundup.psfhosted.org>
In-reply-to
Content
It is still the same in 3.11:

>>> class WithoutSetItem:
...     def __getitem__(self, key):
...         return "foo"
...
>>> class WithSetItem:
...     def __getitem__(self, key):
...         return "foo"
...     def __setitem__(self, key, val):
...         return
...
>>> wo = WithoutSetItem()
>>> del wo[0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'WithoutSetItem' object doesn't support item deletion
>>> w = WithSetItem()
>>> del w[0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: __delitem__
>>>
History
Date User Action Args
2021-07-06 13:36:21iritkatrielsetrecipients: + iritkatriel, rhettinger, r.david.murray, raumzeitkeks, hongweipeng, xtreak
2021-07-06 13:36:21iritkatrielsetmessageid: <1625578581.87.0.845678133965.issue31218@roundup.psfhosted.org>
2021-07-06 13:36:21iritkatriellinkissue31218 messages
2021-07-06 13:36:21iritkatrielcreate