Skip to content

ProtototypedFrom issue using ColorTrait (maybe all the mapped traits) #9

dpinte opened this Issue Jul 11, 2011 · 0 comments

1 participant

Enthought, Inc. member
dpinte commented Jul 11, 2011

Here is a simple test case ::

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 
Traceback (most recent call last):
  File "", line 21, in <module>
    s.line_color =  'black'
  File "/Users/dpinte/projects/ets/traits/traits/", line 2124, in _post_setattr
    setattr( object, name + '_', value )
  File "/Users/dpinte/projects/ets/traits/traits/", line 3703, in _remove_trait_delegate_listener
    name, self.__class__.__listener_traits__[ name ][1] ),
KeyError: 'line_color_'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.