traits
traits copied to clipboard
`Union` doesn't handle mapped traits
An issue we are currently seeing trying to remove Trait(...)
and Either(...)
from Chaco: when you have Union(..., FooTrait, ...)
where FooTrait
is a mapped trait, union does not carry over the mapping behaviour, where Trait(...)
did (I have not checked exactly what it does). There may be a similar issue with post_setattr
?
I'm not sure what the right fix is in this case: you could say that a Union
with any mapped trait is a mapped trait, but what do you set into the trait for un-mapped values: the safest is probably just to pass the value through, but arguments could be made for None
or Undefined
or similar.