[Python-Dev] Deleting with setting C API functions (original) (raw)
Guido van Rossum guido at python.org
Tue Nov 24 16:33:09 EST 2015
- Previous message (by thread): [Python-Dev] Deleting with setting C API functions
- Next message (by thread): [Python-Dev] Deleting with setting C API functions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Ooooh, that's probably really old code. I guess for the slots the reasoning is to save on slots. For the public functions, alas it will be hard to know if anyone is depending on it, even if it's undocumented. Perhaps add a deprecation warning to these if the value is NULL for one release cycle?
On Tue, Nov 24, 2015 at 1:21 PM, Serhiy Storchaka <storchaka at gmail.com> wrote:
Slots like PyTypeObject.tpsetattr, PySequenceMethods.sqassitem, PyMappingMethods.mpasssubscript are used not only for setting attribute/item value, but also for deleting attribute/item (if value is NULL). This is not documented and should be. [1] Correspondingly public API functions like PyObjectSetAttr, PyObjectSetItem, PySequenceSetItem, PySequenceSetSlice, PyMappingSetItemString can be used for deleting. But all these functions have special counterparts for deleting: PyObjectDelAttr etc.
The question is wherever deleting ability of Set-functions is intentional, should we document this or deprecate and then delete? [1] http://bugs.python.org/issue25701
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido%40python.org
-- --Guido van Rossum (python.org/~guido)
- Previous message (by thread): [Python-Dev] Deleting with setting C API functions
- Next message (by thread): [Python-Dev] Deleting with setting C API functions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]