enthought / enthought/traitsui

InstanceEditor requires values to be InstanceChoiceItems, but code allows anything that can be adapted

Open
#1,476 1 comment 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.