classification
Title: PyType_FromModuleAndSpec function should add the process of tp_vectorcall_offset
Type: Stage: patch review
Components: Interpreter Core Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: petr.viktorin, shihai1991, vstinner
Priority: normal Keywords: patch

Created on 2020-05-10 17:07 by shihai1991, last changed 2020-05-11 21:41 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20026 merged shihai1991, 2020-05-10 17:11
Messages (5)
msg368589 - (view) Author: hai shi (shihai1991) * (Python triager) Date: 2020-05-10 17:07
some typeobject using `tp_vectorcall_offset`, if we use `PyType_FromModuleAndSpec` to create the the typeobject, it will be faild due to `PyType_FromModuleAndSpec` lack the process of `tp_vectorcall_offset`.

so we should adding some process  like https://github.com/python/cpython/blob/master/Objects/typeobject.c#L2966-L2976.
msg368621 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2020-05-11 08:53
That seems reasonable. See the discussion around https://bugs.python.org/issue38140 for context.

Note that __dictoffset__ and __weaklistoffset__ are also exposed as members (in PyMemberDef type_members) and documented (Doc/c-api/structures.rst). A new __vectorcalloffset__ should have that as well.
msg368633 - (view) Author: hai shi (shihai1991) * (Python triager) Date: 2020-05-11 16:37
> Note that __dictoffset__ and __weaklistoffset__ are also exposed as members (in PyMemberDef type_members) and documented (Doc/c-api/structures.rst). A new __vectorcalloffset__ should have that as well.

Thanks for your comment, petr. And I updated the doc in PR20026.
msg368659 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-11 21:39
New changeset 86d69444e7cfe758212956df0be0ec7b8a4251a6 by Hai Shi in branch 'master':
bpo-40584: Update PyType_FromModuleAndSpec() to process tp_vectorcall_offset (GH-20026)
https://github.com/python/cpython/commit/86d69444e7cfe758212956df0be0ec7b8a4251a6
msg368660 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-05-11 21:41
Thanks Hai Shi!
History
Date User Action Args
2020-05-11 21:41:29vstinnersetstage: resolved -> patch review
2020-05-11 21:41:15vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg368660

stage: patch review -> resolved
2020-05-11 21:39:22vstinnersetmessages: + msg368659
2020-05-11 16:37:58shihai1991setmessages: + msg368633
2020-05-11 08:53:28petr.viktorinsetmessages: + msg368621
2020-05-10 17:11:32shihai1991setkeywords: + patch
stage: patch review
pull_requests: + pull_request19336
2020-05-10 17:07:23shihai1991create