On 17 April 2013 00:32, Des.P <[hidden email]> wrote:
> If x is a HasTraits object, is there an API function available to check if:
> x.a = y
> would succeed per the Traits spec, without actually doing the assignment? If so, what check(s) does it do?
Yes, but it is not really user friendly:
# Get the ctrait reference
ca = x.traits()['a']
# Call the validate function (requires object, name, value
ca.validate(x, 'a', '11')
print 'Validation failed'