API Reference for Enthought Tool Suite 3.0.1

Ensures that a trait attribute lies within a specified numeric range. The range itself is obtained from the traits named via 'low_name' and 'high_name' on the object.

TraitSimpleDRange is the underlying handler for the SimpleDRange() trait factory.

Any value assigned to a trait containing a TraitRange handler must be of the correct type and in the numeric range defined by the traits 'low_name' and 'high_name'. No automatic coercion takes place. For example:

class Person(HasTraits):
    age = Trait(0, TraitSimpleDRange(low_name='_low', high_name='_high'))
    _low = Int(0)
    _high = Int(150)

This example defines a Person class, which has an age trait attribute, which must be an integer/long in the range from 0 to 150.

Inherits from

Attributes

Inherited from base classes

Method summary

Inherited from base classes

Methods

© Copyright 2002-2008 Enthought, Inc.