This could be implemented as a MultiValueInputWidget special case. It would make sense to prefil the list widget with n items, hide add and remove button, and rename 'update' to set (the latter maybe an attractive shorter alternative anyways).
A closely related, but not identical issue is the disambiguation of nargs= and action='append'. ATM nargs=* is interpreted identical to action=append. While this may be OK in practice, the particular combination of values matters. For example nargs=2 plus action='append' actually aims to assemble a list of 2-tuples (this is what subdatasets(set_property=) is doing).
If the fixed-n case is implemented via MultiValueInputWidget, we need to specifically (re-)enabled the nexting of two such widgets -- which is currently prevented (in _get_parameter_widget_factory()).
i.e. a fixed number of arguments.
This is needed for
subdatasets(set_property=)
This could be implemented as a
MultiValueInputWidget
special case. It would make sense to prefil the list widget withn
items, hideadd
andremove
button, and rename 'update' to set (the latter maybe an attractive shorter alternative anyways).A closely related, but not identical issue is the disambiguation of
nargs=
andaction='append'
. ATMnargs=*
is interpreted identical toaction=append
. While this may be OK in practice, the particular combination of values matters. For examplenargs=2
plusaction='append'
actually aims to assemble a list of 2-tuples (this is whatsubdatasets(set_property=)
is doing).If the fixed-n case is implemented via MultiValueInputWidget, we need to specifically (re-)enabled the nexting of two such widgets -- which is currently prevented (in
_get_parameter_widget_factory()
).