Inherits from
- TraitCoerceType: enthought.traits.trait_handlers.TraitCoerceType
Attributes
Inherited from base classes
Method summary
Inherited from base classes
- arg_error(self, method, arg_num, object, name, value)
- create_editor(self)
- dup_arg_error(self, method, arg_num, object, name)
- error(self, object, name, value)
- full_info(self, object, name, value)
- get_editor(self, trait)
- info(self)
- inner_traits(self)
- is_valid(self, object, name, value)
- keyword_error(self, method, object, name, value)
- missing_arg_error(self, method, arg_num, object, name)
- repr(self, value)
- return_error(self, method, object, value)
Methods
- __init__(self, aType)
Creates a TraitCastType handler.
Parameters
- aType : type
- Either a Python type (e.g., str or types.StringType) or a Python value (e.g., 'cat)
Description
If aType is a Python value, it is automatically mapped to its corresponding Python type. For example, the string 'cat' is automatically mapped to str (i.e., types.StringType).
- validate(self, object, name, value)