GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-98586: Add vector call APIs to the Limited API by wjakob · Pull Request #98587 · python/cpython Conversation
|
|
@markshannon might be interested in reviewing this as the author of PEP 590. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Could you add tests to Modules/_testcapimodule/vectorcall_limited.c and also adjust the NEWS entry to use Sphinx directives for linking to the relevant parts of the C-API docs and PEP-590?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
85d09f5 to
8732fb0
Compare
|
@erlend-aasland Done. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
8732fb0 to
9934529
Compare
|
What is the reason for not adding |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It seemed like sort of an implementation detail. I am happy to add it (& tests) if there is consensus to do so. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I've never had use for it myself, so I have no opinion about this; I was just curious. Let's hear what the others say when they chime in. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Two questions. First questionWhy include Second questionThe vectorcall API has two parts.
Any plans to add the ability to declare classes as having "vector callable" instances? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks for the review @markshannon.
I am happy to hear it. I have never found use for this function myself. I included in the PR for reasons of symmetry, and because it was prominently advertised in the docs next to
I think that this was already done in PR #93274. Please let me know if I misunderstood. Finally, do you have any thoughts on |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
One other question. Why add This is a sketch and is probably missing some error handling and/or incref/decrefs. PyObject *PyObject_VectorcallMethod( PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames) { /* Error if nargs < 1 */ PyObject *obj = args[0]; PyObject *callable = LoadMethod(obj, name, &args[0]); /* TO DO --- Handle error if callable == NULL */ if (args[0] == NULL) { /* No self */ return PyObject_Vectorcall(callable, args+1, (nargsf-1) | PY_VECTORCALL_ARGUMENTS_OFFSET, kwnames); } return PyObject_Vectorcall(callable, args, nargsf, kwnames); } |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I'd rather not add it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It is convenient to use a 1-function-does-it-all interface like Altogether, it sounds to me more like a general question about why |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Is this okay @markshannon? (with a goto to avoid lots of I have made the requested changes; please review again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @erlend-aasland, @markshannon: please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It's a known issue that will be fixed by #98704 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I also have a nitpick, otherwise LGTM.
I'll push a commit to your branch to avoid another round of review ping-pong.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| * (Empty list left here as template/example, since using | ||
| * PyModule_AddFunctions isn't very common.) | ||
| */ |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The comment can go away now.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you for the PR! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Awesome, many thanks for your help in getting it merged! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Expose the facilities for making vector calls through Python's limited API.
|
I realized that I forgot to add an entry to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Open a new PR please. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR python#98587 addressing issue python#98586 lacked a "what's new" entry. While making those changes, I noticed an inconsistency in how ``PY_VECTORCALL_ARGUMENTS_OFFSET`` is declared in the underlying Sphinx markup when compared to other macro constants like ``Py_TPFLAGS_HAVE_VECTORCALL``. This PR fixes that as well, which should connect a few currently broken cross-references
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Add vector call functions to the limited API
There was an error while loading. Please reload this page.