You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from traits.api import HasTraits, PrototypedFrom, Instance
from enable.api import ColorTrait
class Configuration (HasTraits):
line_color = ColorTrait('red')
class Plot(HasTraits):
config = Instance(Configuration, ())
line_color = PrototypedFrom('config')
if __name__ == '__main__':
s = Plot()
print s.line_color
# raises a KeyError on line_color_
s.line_color = 'black'
Executing the code leads to the following traceback ::
dpinte:Downloads dpinte$ python bug_delagated_mapped_traits.py
red
Traceback (most recent call last):
File "bug_delagated_mapped_traits.py", line 21, in <module>
s.line_color = 'black'
File "/Users/dpinte/projects/ets/traits/traits/trait_handlers.py", line 2124, in _post_setattr
setattr( object, name + '_', value )
File "/Users/dpinte/projects/ets/traits/traits/has_traits.py", line 3703, in _remove_trait_delegate_listener
name, self.__class__.__listener_traits__[ name ][1] ),
KeyError: 'line_color_'
The text was updated successfully, but these errors were encountered:
Here is a simple test case ::
Executing the code leads to the following traceback ::
The text was updated successfully, but these errors were encountered: