Open corranwebster opened 2 years ago
Investigating this - any changes we need here can be done in a largely backwards-compatible way; they include things like:
ActionSchema
They key is to not push through null values. So this is not urgent for 8.0
Currently classes like
ActionSchema
do not have hooks in the defaultcreate
functions to permit passing in additional keyword arguments to the factory function, see: https://github.com/enthought/pyface/blob/42fbaf6e18883b8e5a662fc9ba108fd2408c91d3/pyface/action/schema/schema.py#L98-L102This means that you can't easily use a generic class (such as
Action
itself, in many cases) as the factory, because you can't pass in traits, and instead have to have a custom factory function to apply those, or subclassActionSchema
. In downstream projects we have ended up with factory function factories and Schema factories to automate the process of creating these custom things, but looking at this it would be nice to be able to say something like:and then have these passed through. Exact syntax might vary, eg. even nicer would be:
where kwargs that aren't traits are extracted and used as arguments for the factory, but that might be too magical.