Skip to content

PEP 590: Use PyObject *kwnames, which may be NULL #1039

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

Merged
merged 2 commits into from
May 11, 2019

Conversation

jdemeyer
Copy link
Contributor

@jdemeyer jdemeyer commented May 9, 2019

This simply codifies what's already in the reference implementation, so it should be uncontroversial:

  • the nargs argument comes after args in vectorcall functions.
  • kwnames is passed as PyObject * instead of PyTupleObject * (like most other C API functions, the generic PyObject * is used instead of a specific struct like PyTupleObject *)
  • the argument kwnames may be NULL

CC @encukou @markshannon

@encukou encukou requested a review from markshannon May 9, 2019 15:20
@jdemeyer
Copy link
Contributor Author

I noticed another difference with the reference implementation: nargs should come after args.

@markshannon
Copy link
Member

Thanks for correcting the order of nargs and args.

I am in two minds about whether kwnames should be PyObject * or PyTupleObject *.
On one hand PyObject * is more in keeping with the rest of the API, on the other hand we loose compile type checking. Merging for now, we can revisit this decision later if necessary.

@markshannon markshannon merged commit 3f0a21e into python:master May 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants