Open thorwhalen opened 2 years ago
To reproduce:
from i2 import partialx @partialx(partialx, x=2, _allow_reordering=True) def foo(x, y, z=0): return x + y * z
leads to:
ValueError: wrong parameter order: variadic keyword parameter before keyword-only parameter
We don't get the problem if we use functools.partial on the external partial:
functools.partial
import functools @functools.partial(partialx, x=2, _allow_reordering=True) ...
The problem is that we find ourselves in this situation:
[<Parameter "func">, <Parameter "*args">, <Parameter "**kwargs">, <Parameter "__name__=None">, <Parameter "_rm_partialize=False">, <Parameter "_allow_reordering=False">]
Hypothesis: Somewhere in the process, the parameters should probably be loosely reordered. We don't want to allow complete reordering, but just enough to allow variadics to be in their proper place (the keyword arguments before the kwargs.
kwargs
┆Issue is synchronized with this Asana task by Unito
To reproduce:
leads to:
We don't get the problem if we use
functools.partial
on the external partial:The problem is that we find ourselves in this situation:
Hypothesis: Somewhere in the process, the parameters should probably be loosely reordered. We don't want to allow complete reordering, but just enough to allow variadics to be in their proper place (the keyword arguments before the
kwargs
.┆Issue is synchronized with this Asana task by Unito