This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: New _PyObject_MakeTpCall() function
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.8
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: Mark.Shannon, jdemeyer, petr.viktorin, vstinner
Priority: normal Keywords: patch

Created on 2019-05-16 09:59 by jdemeyer, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 13358 closed jdemeyer, 2019-05-16 10:43
Messages (6)
msg342632 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2019-05-16 09:59
Add a new private function

PyObject *_PyObject_MakeTpCall(PyObject *callable, PyObject *const *args, Py_ssize_t nargs, PyObject *keywords)

to call "callable" using tp_call, but with arguments given using the FastCallKeywords or FastCallDict convention (both are allowed, see also https://github.com/python/peps/pull/1038).

The code is not new, it's essentially moving the tp_call case out of _PyObject_FastCallKeywords() and _PyObject_FastCallDict().

This was first proposed (as public API under the name PyCall_MakeTpCall) for PEP 590 but it makes sense to do this independently.
msg342639 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2019-05-16 10:44
I forgot to mention that the idea and first implementation comes from Mark Shannon.
msg342989 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2019-05-21 09:10
Avoiding the duplication makes sense, but without the rest of PEP 590 it could just be a static function in call.c.
msg342991 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2019-05-21 09:31
So what are you trying to say? That it *should* be a static function? It most likely won't be a static function after PEP 590 is fully implemented.
msg342992 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2019-05-21 09:35
Ah, sorry, I didn't get the message through.

I'll merge it with the rest of PEP 590. Adding the symbol doesn't make sense *right* now.
msg342995 - (view) Author: Jeroen Demeyer (jdemeyer) * (Python triager) Date: 2019-05-21 09:41
In that case, there is no point a making a separate issue or PR.
History
Date User Action Args
2022-04-11 14:59:15adminsetgithub: 81118
2019-05-21 09:41:09jdemeyersetstatus: open -> closed
resolution: duplicate
messages: + msg342995

stage: patch review -> resolved
2019-05-21 09:35:10petr.viktorinsetmessages: + msg342992
2019-05-21 09:31:17jdemeyersetmessages: + msg342991
2019-05-21 09:10:56petr.viktorinsetmessages: + msg342989
2019-05-16 10:44:59jdemeyersetmessages: + msg342639
2019-05-16 10:43:44jdemeyersetkeywords: + patch
stage: patch review
pull_requests: + pull_request13267
2019-05-16 09:59:07jdemeyercreate