API Reference for Enthought Tool Suite 3.0.1

A reverse mapped TraitPrefixMap. This handler allows for something like the following:

>>> class A(HasTraits):
...     a = Trait('ab', TraitRevPrefixMap({'ab':1, 'cd':2}))
...
>>> a = A()
>>> a.a = 'c'
>>> print a.a
'cd'
>>> a.a = 1
>>> print a.a
'ab'

That is, you can set the trait to the value itself. If multiple keys map to the same value, one of the valid keys will be used.

Method summary

Methods

© Copyright 2002-2008 Enthought, Inc.