[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2016-11-30 Thread Martin Panter
Martin Panter added the comment: I made one minor change: element → slice -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2016-11-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 83e3c863594c by Martin Panter in branch '2.7': Issue #25701: Document that some C APIs can both set and delete items https://hg.python.org/cpython/rev/83e3c863594c -- ___ Python tracker

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2016-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please do this yourself. This is mainly your patch. -- ___ Python tracker ___ ___ Python-bugs-list

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2016-11-23 Thread Martin Panter
Martin Panter added the comment: The 2.7 patch looks okay to me. I confirmed that sq_ass_slice gets called to delete slices, and I presume the other stuff is similar to Python 3. Do you want to commit this to 2.7 Serhiy? -- stage: patch review -> commit review

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In 2.7 all is the same except that there is the sq_ass_slice slot and the PySequence_SetSlice() function. -- Added file: http://bugs.python.org/file41370/setattr-2.7.patch ___ Python tracker

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-12-07 Thread Martin Panter
Martin Panter added the comment: I committed my patch to 3.5+. I will leave this open in case someone wants to look into how things work in 2.7. I presume things might be different in Python 2; all I know is there are two kinds of classes and objects, and the slots are a bit different (__setsl

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-12-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 50711c80ff76 by Martin Panter in branch '3.5': Issue #25701: Document C API functions that both set and delete objects https://hg.python.org/cpython/rev/50711c80ff76 New changeset 7bb7173cd97a by Martin Panter in branch 'default': Issue #25701: Merg

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-12-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch LGTM. Thanks Martin. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-12-06 Thread Martin Panter
Martin Panter added the comment: setattr.3.patch changes to documenting setting as the main purpose, but mentions deleting also works but is deprecated in favour of the main deletion functions. I also clarified that the slots have to support deleting via NULL. -- Added file: http://bug

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-12-06 Thread Martin Panter
Martin Panter added the comment: Okay, I will look at making it say deleting via SetAttr etc is possible but is not the main purpose, and using DelAttr etc is recommended instead. -- ___ Python tracker ___

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-12-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think the conclusion of Python_Dev discussion is that it is not worth to deprecate this behavior in the code. Current behavior of PyObject_SetAttr and PySequence_SetItem should be documented with a deprecation notice. -- _

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-29 Thread Martin Panter
Martin Panter added the comment: 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

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Python-Dev discussion: http://comments.gmane.org/gmane.comp.python.devel/155474 -- ___ Python tracker ___ ___

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-24 Thread Martin Panter
Martin Panter added the comment: I agree it might be safer not to document that PyObject_SetAttr etc can delete (move that change to the tp_setattro etc method slot). I’ll also review the other functions you mentioned when I get a chance. -- ___ Pyt

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Martin. In general the patch LGTM, but I'm not expert in English writing. There are other functions and slots with twofold purpose: PyObject_SetItem, PySequence_SetItem, PySequence_SetSlice, PyMapping_SetItemString, PySequenceMethods.sq_ass_item,

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-23 Thread Martin Panter
Martin Panter added the comment: Here is a patch. The same problem happens with getset descriptors: >>> del sys.stdout._CHUNK_SIZE SystemError: null argument to internal routine So I also changed the documentation for “setter” descriptor functions and the tp_descr_set() method. I only looked

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-22 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: tp_setattro and tp_setattr fields of PyTypeObject are used for deleting attributes. In this case the third argument is NULL. This should be documented. Not awareness of this can cause a segmentation fail (for example see issue25691). -- _

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-22 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- priority: normal -> high ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-22 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- Removed message: http://bugs.python.org/msg255130 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue25701] Document that tp_setattro and tp_setattr are used for deleting attributes

2015-11-22 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: tp_setattro and tp_setattr fields of PyTypeObject are used for deleting attributes. In this case the third argument is NULL. This should be documented. Not awareness of this can cause a segmentation fail (for example see issue25698). -- assignee: