enthought / enthought/traitsui

Enum editor unable to display un-hashable types.

Open
#781 0 comments 0 reactions 0 assignees View on GitHub
ETS Backlog type: bug
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

The Enum editor is unable to display drop-down menus that contain unhashable types such as lists, sets, etc.
The cause of the issue is in in [traitsui.helper](https://github.com/enthought/traitsui/blob/80fa6fb6c9158cb3d27ecf6243751f313a02902b/traitsui/helper.py#L101) when trying to create the inverse mapping.

Example: The following valid declaration will raise a TypeError

```
from traits.api import *

class TestClass(HasTraits):

sets = Enum({1}, {2}, {3})

TestClass().configure_traits()
```

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.