https://github.com/python/cpython/commit/a6f65a681c2005210e8b54c46510e6fcef8c0dc2
commit: a6f65a681c2005210e8b54c46510e6fcef8c0dc2
branch: main
author: Shamil <[email protected]>
committer: eendebakpt <[email protected]>
date: 2026-10-29T11:20:28+01:00
summary:

gh-160679: Сombine argument conversion loops (#160838)

* refactor(ceval): combine argument conversion loops

* choore(docs): remove news

files:
M Python/ceval.c

diff --git a/Python/ceval.c b/Python/ceval.c
index 223106065c603c..aba8d2c0c762ed 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2242,15 +2242,9 @@ _PyEval_Vector(PyThreadState *tstate, PyFunctionObject 
*func,
     /* _PyEvalFramePushAndInit consumes the references
      * to func, locals and all its arguments */
     Py_XINCREF(locals);
-    for (size_t i = 0; i < argcount; i++) {
+    for (size_t i = 0; i < total_args; i++) {
         arguments[i] = PyStackRef_FromPyObjectNew(args[i]);
     }
-    if (kwnames) {
-        Py_ssize_t kwcount = PyTuple_GET_SIZE(kwnames);
-        for (Py_ssize_t i = 0; i < kwcount; i++) {
-            arguments[i+argcount] = 
PyStackRef_FromPyObjectNew(args[i+argcount]);
-        }
-    }
     _PyInterpreterFrame *frame = _PyEvalFramePushAndInit(
         tstate, PyStackRef_FromPyObjectNew(func), locals,
         arguments, argcount, kwnames, NULL);

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to