Here is an interactive Python session which uses components of the Enthought Tool Suite (ETS):
>>> import sys
>>> sys.version
'2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)]'
>>> import traits
>>> traits.__version__
'4.5.0'
>>> from traits.api import HasTraits, Range
>>> class Foo(HasTraits):
... bar = Range (low=1, high=10)
...
>>> foo = Foo()
>>> foo.bar
1
>>> foo.bar._low
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
AttributeError: 'int' object has no attribute '_low'
I would like to be able to access the predefined limits on the bar
attribute of a Foo
instance. How can this be done?
Thanks!