-
-
Notifications
You must be signed in to change notification settings - Fork 208
Closed
Description
from traitlets import HasTraits, Union, Unicode, Bool
class Foo(HasTraits):
bar = Union([Bool(), List(Unicode())])
Foo(bar=[1, 2, 3])TraitError: The 'bar' trait of a Foo instance must be a boolean or a list, but a value of [1, 2, 3] <type 'list'> was specified.
If you're not looking at the code for Foo, the error message isn't gonna tell you what's wrong
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels