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
MAINT: Fix METH_NOARGS function signatures #20368
Conversation
The METH_NOARGS calling convention is required to take a second PyObject* which will always be NULL. This is a continuation of numpy#19058
Thanks! Would you be up to making it throughout But changes look good, just thought a bit more uniform naming will be easier to understand. |
I don't understand the failing doctests. |
Also, if you want me to clean the history I am happy to rebase and squash all the commits. |
We can just squash-merge, curious what is "closure"? (I think I just come form a different angle, I thought "args", because most python functions get args or arg passed in, but here it is always NULL.) No need to squash, if you don't we will probably just squash-merge. |
I think The See here: https://docs.python.org/3/c-api/structures.html?highlight=getset#c.PyGetSetDef
In the CPython source, sometimes the extra noargs arguments are called The last argument to getters and setters is variously called This is more than you wanted to know I'm sure =) |
Well, could be to save some branching. Or just historical, maybe
Hehehe, thanks :). I was just confused why Anyway, thanks! Let me put this in, before I find something else to nitpick about ;). |
Marking as backport candidate, since it is harmless and you mentioned you need it for |
Thanks! |
The METH_NOARGS calling convention is required to take a second PyObject* which will always be NULL. This is a continuation of numpy#19058
The circleci failures are legitimate. |
But I don't see exactly how the CircleCI failure is related to this. |
Hmmm, and only on this PR! Very strange... |
Also in the backport. |
After the most recent commit, these tests are passing on main again. At a glance it is very unclear why the most recent commit would have any effect on these tests either. |
MAINT: Fix METH_NOARGS function signatures (#20368)
The METH_NOARGS calling convention is required to take a second PyObject* which will always be NULL. This is a continuation of numpy#19058
This is a continuation of @joemarshall's work #19058.
This fixes all of the incorrect
METH_NOARGS
signatures that I managed to track down.We need this for pyodide/pyodide#1677.