New submission from Stefan Behnel <stefan...@behnel.de>:

As far as I can see it in typeslots.h [1], the buffer protocol is still not 
supported when using type specs:

/* Disabled, see #10181 */
#undef Py_bf_getbuffer
#undef Py_bf_releasebuffer

It seems that the discussion in issue 10181 did not lead anywhere at the time 
(2010-2012).

I'm not talking about the limited API or the stable ABI here, I'm talking about 
using type specs to define an extension type. The work-around is to manually 
set "PyTypeObject->tp_as_buffer" after creating the type, but since 
PyType_Ready() then does not see that struct pointer, you also still have to 
make sure that the type correctly inherits the slots from the base type if 
you're not defining all of them yourself.

Can we just add support for the above slots?

[1] 
https://github.com/python/cpython/blob/ca829102213c466ffecb1e464be5c8cb3967d961/Include/typeslots.h#L2-L4

----------
components: C API
messages: 369561
nosy: ncoghlan, paul.moore, petr.viktorin, pitrou, scoder, skrah, vstinner
priority: normal
severity: normal
status: open
title: Support buffer protocol with type specs
type: enhancement
versions: Python 3.10, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40724>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to