enthought / enthought/traitsui
Enum style RangeEditor are not classes but functions
- Dominant language
- Python
- Stars
- 306
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
`EditorFactory` expects subclass of `Editor` to be provided, but the `enum` style of `RangeEditor` are implemented using functions in both qt and wx (the following example show the qt version):
https://github.com/enthought/traitsui/blob/35ebe367d3b84d57a8389745f46564ee69fd2eeb/traitsui/qt4/range_editor.py#L722-L724
This is violation of the interface defined by the editor factory could cause surprises when the editor factory changes assuming it always gets a subclass of `Editor`, e.g. calling a class method.
It would be better to write the enum style of `RangeEditor` as subclass of `Editor`, perhaps making use of the `BaseEnumEditor` base class to reuse the common enumeration logic.
The enumeration logic is actually toolkit-agnostic, see #857 as well.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.