STINNER Victor <vstin...@python.org> added the comment:

PyType_FromSpec() doesn't support 11 slots:

* tp_dict
* tp_mro
* tp_cache
* tp_subclasses
* tp_weaklist
* tp_vectorcall
* tp_weaklistoffset (see PyMemberDef)
* tp_dictoffset (see PyMemberDef)
* tp_vectorcall_offset (see PyMemberDef)
* bf_getbuffer
* bf_releasebuffer

https://docs.python.org/dev/c-api/type.html#c.PyType_Slot

But it is possible to define tp_weaklistoffset, tp_dictoffset and 
tp_vectorcall_offset via Py_tp_members slot:
https://docs.python.org/dev/c-api/structures.html#pymemberdef-offsets

* "__dictoffset__" => tp_dictoffset
* "__weaklistoffset__" => tp_weaklistoffset
* "__vectorcalloffset__" => tp_vectorcall_offset

Maybe we can do add new members for the 8 missing slots, especially 
bf_getbuffer and bf_releasebuffer?

commit f7c4e236429606e1c982cacf24e10fc86ef4462f of bpo-40724 added 
Py_bf_getbuffer and Py_bf_releasebuffer slots to the C API, but these slots are 
still not available in the limited C API: see bpo-10181.

----------

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

Reply via email to