Closed thorwhalen closed 1 year ago
See what the i2.deco.FuncFactory._process_args_and_kwargs
method does. Might be good inspiration for solving this issue.
The thing that might be unintuitive to the novice here is that a FuncFactory
instance is a particular kind of callable.
Most callables can only be called if all their required arguments (i.e. those that don't have defaults) are given.
But in the case of a FuncFactory
instance it is not so because it is meant to be a factory where any thing between all and none of the arguments of the wrapped function can be given (having the effect of making a version of the wrapped function where that subset of specified argument have be given default values).
For this reason, made issue: Using a NotSet sentinel to solve make FuncFactory instances' signature more truthful about argument requirements.
This works:
But this doesn't:
But it should.
The reason the above code doesn't work is probably because we should have
allow_partial=True
in this call toIngress
(in theinclude_exclude_ingress_factory
function)But should it be
include_exclude_ingress_factory
that knows when to haveallow_partial=True
or not (or should it be always?)? Or shouldinclude_exclude_ingress_factory
have anallow_partial
argument so the user can decide?