classification
Title: Deprecate deleting with PyObject_SetAttr, PyObject_SetAttrString and PySequence_SetItem
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, martin.panter, ncoghlan, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-12-01 15:44 by serhiy.storchaka, last changed 2015-12-18 16:54 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
PyObject_SetAttr_deleting.patch serhiy.storchaka, 2015-12-01 15:44 review
Messages (2)
msg255655 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-12-01 15:44
If the third argument of PyObject_SetAttr(), PyObject_SetAttrString() or PySequence_SetItem() is NULL, these functions delete an attribute or an item. This is rather undocumented implementation detail. There are special counterparts for deleting:  PyObject_DelAttr(), PyObject_DelAttrString() and PySequence_DelItem(). May be worth to depre

Proposed patch deprecates using these Set* functions for deleting and replaces them with appropriate Del* functions if needed.

Discussion on Python-Dev: http://comments.gmane.org/gmane.comp.python.devel/155474

Issue that documents deleting with Set* APIs: issue25701.
msg256696 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-12-18 16:54
The conclusion of the discussion is to not deprecate this behavior in the code, but just warn in the documentation. That has done in issue25701.
History
Date User Action Args
2015-12-18 16:54:41serhiy.storchakasetstatus: open -> closed
resolution: rejected
messages: + msg256696

stage: patch review -> resolved
2015-12-01 15:44:28serhiy.storchakacreate