Fix issues gh-86199 gh-86795 - #92192
Conversation
|
Figured it out, managed to reset the authorship and repush so it's now credited to my new private GitHub e-mail that CLA-bot recognizes, so everything should be good now. |
Preventing compiler from inserting unnecessary dict build and merge when only **kwargs passed Make PyObject_Call copy any incoming keyword argument dicts when the callable in question is not vectorcall to avoid possibility of callee modifying caller's dict Add tests that verify documented equivalence between callable(**kwargs) and PyObject_Call(callable, (), kwargs)
Preventing compiler from inserting unnecessary dict build and merge when only **kwargs passed Make PyObject_Call copy any incoming keyword argument dicts when the callable in question is not vectorcall to avoid possibility of callee modifying caller's dict Add tests that verify documented equivalence between callable(**kwargs) and PyObject_Call(callable, (), kwargs)
4a8517f to
b205d6b
Compare
There was a problem hiding this comment.
Looks good, apart from one more reST nit.
Also: @mentioning people in commit messages has historically led to an awful lot of unneeded pinging from forks, other PR's, etc. I don't know if GitHub addressed this problem1, but I find it best to stay on the cautious side, and just not do that; reducing the number of pings is a welcome consideration 😉
Footnotes
-
UPDATE: confirming that I actually got an extra ping because of the commit message ↩
…e-86199.IZbF0m.rst Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
Accepted as given.
Oops, did not know that would happen. Will avoid in the future. |
…ut dict is plain dict with no history of deletions (the common case)
|
Please resolve conflicts. Also, please fix the PR title to |
|
@MojoVampire, are you planning to follow up this PR? If not, I suggest closing it. |
|
Sorry, I've had a hell of a year. I'm going to try to rebase this soon. |
|
The following commit authors need to sign the Contributor License Agreement: |
|
This PR is stale because it has been open for 30 days with no activity. |
|
is this issue still exist? |
|
Hello! I'm sorry but I'm closing this PR as it is stale and has requested changes that have not been addressed in quite some time. |
Instead of a new _MAKE_KWARGS_A_DICT uop and an interpreter-side no-alias helper, follow the structure of the original pythonGH-92192: - The mapping-to-exact-dict conversion is folded into the existing _MAKE_CALLARGS_A_TUPLE op (no new uop, no macro changes). - The callee-cannot-mutate-caller-kwargs guarantee moves into _PyObject_Call: the tp_call branch now receives a copy of the kwargs dict (empty dicts are passed as NULL), making the documented equivalence with callable(*args, **kwargs) hold for all C API callers as well (pythongh-86795). - On free-threaded builds the interpreter simply always copies the kwargs dict (status quo semantics); the zero-copy optimization only applies to default builds for now. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fix issues #86199 and #86795 by centralizing copying of keyword arguments in
PyObject_Callonly when needed