[New-bugs-announce] [issue25773] Deprecate deleting with PyObject_SetAttr, PyObject_SetAttrString and PySequence_SetItem

Serhiy Storchaka report at bugs.python.org
Tue Dec 1 10:44:28 EST 2015


New submission from Serhiy Storchaka:

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.

----------
components: Interpreter Core
files: PyObject_SetAttr_deleting.patch
keywords: patch
messages: 255655
nosy: gvanrossum, martin.panter, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Deprecate deleting with PyObject_SetAttr, PyObject_SetAttrString and PySequence_SetItem
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file41200/PyObject_SetAttr_deleting.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25773>
_______________________________________


More information about the New-bugs-announce mailing list