enthought / enthought/traitsui
InstanceEditor requires values to be InstanceChoiceItems, but code allows anything that can be adapted
Open
component: core
difficulty: easy
type: enhancement
- Dominant language
- Python
- Stars
- 306
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
Here, the `InstanceEditor` factory requires that the `values` trait are `InstanceChoiceItem` instances:
https://github.com/enthought/traitsui/blob/fb8ea4a4e7df575a707e64cae8eb882a68ef995c/traitsui/editors/instance_editor.py#L41
However, here:
https://github.com/enthought/traitsui/blob/fb8ea4a4e7df575a707e64cae8eb882a68ef995c/traitsui/qt4/instance_editor.py#L186-L196
we see that the values are adapted if they are not `InstanceChoiceItem` instances (to `InstanceChoice` by default).
As a result, we should probably allow any values to be set on the `values` trait.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.