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 martin.panter
Recipients docs@python, martin.panter, serhiy.storchaka
Date 2015-11-30.05:43:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1448862210.55.0.569777596582.issue25701@psf.upfronthosting.co.za>
In-reply-to
Content
In the python-dev thread, Nick Coghlan gave some arguments and examples where PyObject_SetAttr() is intended to be used for deletion. So I will keep my changes for PyObject_SetAttr(), and also _SetAttrString() for consistency.

My second patch documents deletion with sq_ass_item(), mp_ass_subscript(), and PySequence_SetItem().

PyObject_SetItem() does not look like it deletes items. It explicitly considers value == NULL to be an error. As a consequence, PyMapping_SetItemString() does not delete either.

PySequence_SetItem() does accept NULL to delete the item. I think this is reasonable, to keep it consistent with sq_ass_item(), so I documented it.

PySequence_SetSlice() also accepts NULL to delete the slice. But I am more reluctant to document this, because I don’t know of any slot or other code that would benefit. So I have left it as is for the time being.
History
Date User Action Args
2015-11-30 05:43:30martin.pantersetrecipients: + martin.panter, docs@python, serhiy.storchaka
2015-11-30 05:43:30martin.pantersetmessageid: <1448862210.55.0.569777596582.issue25701@psf.upfronthosting.co.za>
2015-11-30 05:43:30martin.panterlinkissue25701 messages
2015-11-30 05:43:28martin.pantercreate