Allows passing functools.partial objects in the subgroups dict
lambda expressions aren't allowed as the default_factory yet!
This is because we need to know what the default key is for that choice, and it isn't in the subgroup dict.
This is also because we can't inspect the default values for the fields without actually calling the factory.
Therefore, you should use functools.partial for now.
Also somewhat related to #191, in that it makes this kind of thing possible again.
Future work: Integrating the Partials feature of #156 with this. This should work out-of-the box, since those are dataclasses that also inherit from functools.partial, but we'll see! :)
Partially solves #195
functools.partial
objects in the subgroups dictlambda expressions aren't allowed as the default_factory yet!
Therefore, you should use
functools.partial
for now.Also somewhat related to #191, in that it makes this kind of thing possible again.
Future work: Integrating the
Partials
feature of #156 with this. This should work out-of-the box, since those are dataclasses that also inherit fromfunctools.partial
, but we'll see! :)