enthought / enthought/traits

`Union` doesn't handle mapped traits

Open
#1,724 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
462
Forks
90
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.