You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was not aware that partial could be used to modify assignments already done by a nested partial.
So makefun.partial could not be drop-in replacement for functools.partial
Well, in most applications it can be, as the usage you mention is extremely rare :)
If you would like to propose something, I am open to a PR modifying partial to
detect that f is an already partialized function (by us). We can rely on the existence of the func attribute but this is not enough.
update the dict in the appropriate closure if this is the case, rather than re-partialize it
Note that storing the preset_kwargs outside of the closure (i.e. on an explicit attribute on the function) could be a solution, but I have not enough knowledge of python internals to be sure that this would not impact performance or have side-effects...
There is function
When it is used by
functiools.partial
:When it is used by
makefun.partial
:So
makefun.partial
could not be drop-in replacement forfunctools.partial
The text was updated successfully, but these errors were encountered: