[issue10001] ~Py_buffer.obj field is undocumented, though not hidden

Antoine Pitrou <pitrou@free.fr> added the comment: The recommended way is to use PyBuffer_FillInfo() (and then fill in any additional data if necessary), which will set the pointer and incref it itself. I agree all this is a bit poorly documented. ---------- assignee: -> docs@python components: +Documentation -Interpreter Core nosy: +docs@python, pitrou stage: -> needs patch versions: +Python 2.7, Python 3.1 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10001> _______________________________________

Lenard Lindstrom <len-l@telus.net> added the comment: This will work for bf_getbuffer, though having PyObject_GetBuffer set the obj field before passing it to the callback might be safer. Also, this does not address the case with wrapper types like memoryview. What happens if ~Py_buffer.obj is not visited in tp_traverse? Should this be documented? ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10001> _______________________________________
participants (2)
-
Antoine Pitrou
-
Lenard Lindstrom