enthought / enthought/traits

Overriding Trait definitions does not respect MRO

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

Description

I don't think this is a duplicate; and this behaviour seems wrong:
```
from traits.api import HasTraits, Unicode

class A(HasTraits):
x = Unicode('test')

class B(A):
pass

class C(A):
x = Unicode('override')

class D(B, C):
pass

d = D()
print(d.x)
print(D.mro())
```
which gives result
```
test
[, , , , , , ]
```

I would expect that the default value from `C` would be used. Note that it does work as expected when overriding the definition in `B` or `D`.

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.