Skip to content

Any() trait not validated #428

@jasongrout

Description

@jasongrout

I'm seeing the following in traitlets 4.3.2. It appears that the validation for x is not getting called. If I change x = Any(()) to x = Tuple( () ), the validator is called.

In [2]: from traitlets import HasTraits, Unicode, Any, validate, Tuple
   ...: class A(HasTraits):
   ...:     x = Any(())
   ...:     
   ...:     @validate('x')
   ...:     def f(self, proposal):
   ...:         print(proposal)
   ...:         return (1,2)
   ...: A().x
   ...: 
Out[2]: ()

In [3]: import traitlets
   ...: traitlets.__version__
   ...: 
Out[3]: '4.3.2'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions