Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad default value handling for Union #1533

Closed
mdickinson opened this issue Sep 17, 2021 · 0 comments · Fixed by #1534
Closed

Bad default value handling for Union #1533

mdickinson opened this issue Sep 17, 2021 · 0 comments · Fixed by #1534
Labels
component: core Issues related to the core library priority: high High priority for current milestone / sprint type: bug
Milestone

Comments

@mdickinson
Copy link
Member

mdickinson commented Sep 17, 2021

In #1522, I introduced the following bug, which broke the Pyface test suite:

Python 3.9.7 (default, Sep  1 2021, 04:00:27) 
[Clang 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from traits.api import *
>>> class A(HasTraits):
...     foo = Union(None, Int)
... 
>>> class B(A):
...     foo = 5
... 
>>> b = B()
>>> b.foo -= 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for -=: '_Undefined' and 'int'
@mdickinson mdickinson added this to the 6.3.0 release milestone Sep 17, 2021
@mdickinson mdickinson added component: core Issues related to the core library type: bug priority: high High priority for current milestone / sprint labels Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core Issues related to the core library priority: high High priority for current milestone / sprint type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant