fix union default - no need for builtin dynamic default#345
fix union default - no need for builtin dynamic default#345rmorshea wants to merge 2 commits intoipython:masterfrom
Conversation
1d698c3 to
c701dc0
Compare
c701dc0 to
a119440
Compare
|
Awesome – thanks! |
|
@rmorshea the reversion of the trait types validation is a backward incompatible change (we rely on the current order in bqplot). What is the reason for the inversion? |
|
@SylvainCorlay, since validation prefers the first given I'll put that in a separate PR though since I didn't think about compatibility when including that here. ignore deleted comments - I second guessed myself |
|
If validation order is an important part of the API, it might be worth putting in a unit test that will catch if that ever breaks. |
|
Ah now I understand. Sorry I was mistaken. I agree that it would be more logical for it to be reversed. |
It is just that the first trait type that validate is the type that will be used. So if a given value works for two of the types, it might be validated as one or the other depending of the order that is used. Then, in the case of e.g. widgets, the serialization might be different for these two types. |
|
|
Found a more fundamental bug. Will rework this shortly. |
Closes #344
No more need for dynamic default in
Unionas a result of #332.Also fixes a test case that was inheriting from
HasTraitsinstead ofTestCase, which masked #344.