Skip to content

Conversation

@kitchoi
Copy link
Contributor

@kitchoi kitchoi commented Apr 17, 2020

Closes #965

This PR:

For example, this:

from traits.api import HasTraits, Enum

class Foo(HasTraits):

    true_or_false = Enum([0, 1], format_func=lambda v: str(bool(v)).upper())

foo = Foo()
foo.configure_traits()

We'd expect to see the dropdown contains "TRUE" and "FALSE". enthought/traitsui#782 causes us to see "0" and "1" instead.

Checklist

@kitchoi kitchoi requested a review from ievacerny April 27, 2020 14:26
Copy link
Contributor

@ievacerny ievacerny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good and I can verify that Enum dropdown now shows "FALSE" and "TRUE" instead of "0" and "1" 👍

@kitchoi
Copy link
Contributor Author

kitchoi commented Apr 28, 2020

Thanks!

@kitchoi kitchoi merged commit 5aae6a8 into master Apr 28, 2020
@kitchoi kitchoi deleted the 965-enum-editor branch April 28, 2020 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check Enum.create_editor; add tests

2 participants