-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix METH_VARARGS method signatures #21628
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
Conversation
Okay I just realized that I only fixed one file but grepping for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers
or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
Does pyodide care about the difference between |
I milestoned this as 3.5.1 as I think it is safe to do in a patch release and would like to get this out for pyodide ASAP, but do not want to hold 3.5.0 for it. |
No it doesn't since they both have signature If you want the details: Wasm32 uses 32 bit pointers so from the point of view of the wasm type system this has signature Web assembly has a The problem here comes from trying to call a function with signature |
@hoodmane Have you overlooked |
Looks like it, thanks. |
…628-on-v3.5.x Backport PR #21628 on branch v3.5.x (Fix METH_VARARGS method signatures )
PR Summary
A bunch of functions are declared with
METH_VARARGS
calling convention which should have signaturePYCFunction
. However, they are declared instead with an extraPyObject* kwds
argument as if they hadMETH_VARARGS | METH_KEYWORDS
calling convention. They just ignore this argument.I am coming from Pyodide. Web assembly has no native support for function pointer casting -- a function declared with a certain signature must be called with the same signature, or it will fail with
RuntimeError: function signature mismatch
. Emscripten has support for emulating function pointer casts which we are currently using, but it imposes a significant performance and stack space cost and we are trying to remove the pointer cast emulation pyodide/pyodide#1677. To do this, we need to patch Python packages so that they have function signatures that match the calling conventions they declare.PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).