[issue23316] Incorrect evaluation order of function arguments with *args

Guido van Rossum report at bugs.python.org
Wed Jun 16 14:17:22 EDT 2021


Guido van Rossum <guido at python.org> added the comment:

> "The one exception is in function calls with *expression after a keyword argument: f(x=expr2, *expr1)."

So the question before us is whether to add this phrase to the docs, or to tweak the compiler to fix it. It is certainly convenient to update the docs rather than expend the resources to change the compiler for what looks like a rare corner case.

How certain are we that this is truly the only exception? Can someone read the compiler source code related to argument order, or experiment with all the different permutations of positional args, keyword args, *args, and **kwargs? (Fortunately the evaluation order is independent from the function definition, so it's really just all permutations of those four things.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue23316>
_______________________________________


More information about the Python-bugs-list mailing list