Author vstinner
Recipients vstinner
Date 2020-06-25.09:09:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1593076188.01.0.344313351375.issue41111@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-06-25 09:09:48vstinnersetrecipients: + vstinner
2020-06-25 09:09:48vstinnersetmessageid: <1593076188.01.0.344313351375.issue41111@roundup.psfhosted.org>
2020-06-25 09:09:48vstinnerlinkissue41111 messages
2020-06-25 09:09:47vstinnercreate