Python ABI typeslots for buffer protocol

nerdynelsons at gmail.com nerdynelsons at gmail.com
Tue Jan 7 00:19:34 EST 2020


Hello, 

I am trying to implement the buffer API for the JPype Python module.  Unfortunately the required type slots (Py_bf_getbuffer, Py_bf_releasebuffer) are currently disabled due to the long since closed issue #10181.  JPype is a bridge module between Java and Python and as such it is required to create a many dynamic types.  Thus I am forced to use the ABI interface.  

I read through all of Issue #10181 in which the developers were discussing various problems with the implementation of the buffer interface for Python 3.3.  At some point they decided to disable that part of the ABI, but then they closed the issue leaving the ABI interface disabled with a reference to the closed issue.

I have read through the CPython code and do not see anyway short of hacking the tables to implement the buffer interface for dynamically created types. Is there an alternative way to use the buffer feature?  Is the PyBuffer protocol actually usable or is it intended to be disabled?

--Karl Nelson


More information about the Python-list mailing list