-
-
Notifications
You must be signed in to change notification settings - Fork 31k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-36974: expand call protocol documentation #13844
Conversation
Note that the first commit just moves the existing documentation, the second commit actually makes the changes. |
Rebased to latest master, squashed most commits. The commit simply moving the documentation and the one coming from @vstinner are still separate. Can this be reviewed please? It's a documentation-only patch, so it shouldn't be controversial. There are other PRs open for review or planned that will affect the documentation. Please also add the labels CC @methane |
I give up |
I'm rebooting this PR since I don't expect any further changes to the call API. As before, there are two commits: one to create |
I hope to look at this at this week's sprint. To make it faster, I plan to push changes directly to your branch, @jdemeyer. Let me know if you want more back-and-forth. |
Sure. But please give me a final look before merging :-) |
- Repeat the tp_call signature, for clarity - Warn that vectorcall API is provisional - Make the existing warning smaller, but move the explanation up a bit - Group calling API together and provide a summary table - Put smaller vectorcall-related sections under vectorcall - Minor rewordings
Here are my changes. Sorry for the big diff; I can't do the rewordings and reorganization separately and I don't think it's practical to split afterwards. |
@jdemeyer, are you OK with this? |
I don't mind adding
to the general section about vectorcall, but this text refers to a specific function, so it should be reworded. |
I really like the table 👍 but I have a few comments:
|
Other than that, looks good! |
- Adjust vectorcall warning to not talk about a single function - Add underscore to _PyObject_CallOneArg - Include PyObject_CallFunction and _PyObject_CallMethodNoArgs - Summarize _PyObject_FastCallDict's args handling as "vectorcall" - Use "name" rather chan "char*" when the name is a Python object
Alright. The remaining thing is to address the underscore-prefixed functions. Do we want to expose those in Python 3.9, or keep them private (in which case they shouldn't be documented externally)? |
OK, for me this can be merged. |
Now about the API: so far, I have implemented vectorcall for a few classes in CPython itself and in Cython and I haven't seen any reason to change the API. I also think that all functions which are documented in this PR are useful enough to be public API. What that means for the naming of these functions should really be discussed more openly, outside of this PR. Some core devs are very reluctant to add anything to the public API. And once you make a function like |
Do you have any notes on how useful these are in Cython? (Or other projects) |
@jdemeyer: Status check is done, and it's a success ✅ . |
Sorry, I can't merge this PR. Reason: |
Good idea to put all call documentation at the same place ;-) |
@jdemeyer: Status check is done, and it's a success ✅ . |
CC @encukou I'm also adding Petr Viktorin as contributor for vectorcall in the "what's new" section. https://bugs.python.org/issue36974 Automerge-Triggered-By: @encukou Automerge-Triggered-By: @encukou
CC @encukou I'm also adding Petr Viktorin as contributor for vectorcall in the "what's new" section. https://bugs.python.org/issue36974 Automerge-Triggered-By: @encukou Automerge-Triggered-By: @encukou
CC @encukou
I'm also adding Petr Viktorin as contributor for vectorcall in the "what's new" section.
https://bugs.python.org/issue36974
Automerge-Triggered-By: @encukou
Automerge-Triggered-By: @encukou