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 <rep...@bugs.python.org> <http://bugs.python.org/issue25773> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com