[issue9602] PyObject_AsCharBuffer() should only accept read-only objects

Antoine Pitrou report at bugs.python.org
Tue Sep 28 23:35:02 CEST 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

> Le mardi 28 septembre 2010 22:24:56, vous avez écrit :
> > I disagree. PyObject_As*Buffer functions are remnants of the old buffer
> > API in Python 2.x. They are here only to ease porting of existing C
> > code, but carefully written 3.x code should switch to
> > PyObject_GetBuffer() (or one of the dedicated typecodes in
> > PyArg_ParseTuple: "y*", "w*", etc.).
> 
> Do you mean that PyObject_As*Buffer functions are deprecated? The documentation 
> doesn't tell that the new buffer API should be use instead.

Well, the documentation should be updated then. Given that the old
buffer API doesn't exist anymore, the old functions don't have any
practical purpose except for ease of porting code.

----------

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


More information about the Python-bugs-list mailing list