You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new public function for doing a call with an argument vector and a dict. As @markshannon suggested, this is a cleaner API than having a single function with two meanings.
I don't agree with the rename. The semantics are almost the same as _PyObject_FastCallDict – with one exception, the argument offset, which is a backwards compatible change.
Also, I wouldn't even call the "array+dict" calling convention vectorcall. Vectorcall is array+tuple.
Would there be any issues with keeping _PyObject_FastCallDict, just extending it to use the argument offset?
(If the function is widely useful, we'd drop the initial underscore in Python 3.9 – but that doesn't need to go in the current PEP.)
(whether or not you want to keep the old names for backwards compatibility is another discussion which shouldn't influence the PEP).
Would there be any issues with keeping _PyObject_FastCallDict, just extending it to use the argument offset?
I would argue that the names PyObject_Vectorcall and PyObject_FastCallDict are too different to indicate that they are in fact closely related (imagine that you're reading the C API documentation, this would be the only public function with FastCall in its name). Also, it goes against my idea of reserving the name "fast call" for METH_FASTCALL and using "vectorcall" for the generic API.
Also, I wouldn't even call the "array+dict" calling convention vectorcall. Vectorcall is array+tuple.
It's a variation on vectorcall, I don't think it's that hard to understand. CPython has plenty of PyObject_CallXXX functions which are variations on the plain PyObject_Call.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new public function for doing a call with an argument vector and a dict. As @markshannon suggested, this is a cleaner API than having a single function with two meanings.
CC @encukou @scoder