Inherits from
- BaseClass: enthought.traits.trait_types.BaseClass
Attributes
Inherited from base classes
Method summary
- __init__(self, value = None, klass = None, allow_none = True, **metadata)
- get_default_value(self)
- info(self)
- resolve(self, object, name, value)
- resolve_default_value(self)
- validate(self, object, name, value)
Inherited from base classes
- __call__(self, *args, **kw)
- __getattr__(self, name)
- arg_error(self, method, arg_num, object, name, value)
- as_ctrait(self)
- clone(self, default_value = Missing, **metadata)
- 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 = None)
- get_value(self, object, name, trait = None)
- init(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)
- set_value(self, object, name, value)
Methods
- __init__(self, value = None, klass = None, allow_none = True, **metadata)
Returns an Type trait.
Parameters
value : class or None
klass : class or None
- allow_none : boolean
- Indicates whether None is allowed as an assignable value. Even if False, the default value may be None.
Default Value
None if klass is an instance or if it is a class and args and kw are not specified. Otherwise, the default value is the instance obtained by calling klass(*args, **kw). Note that the constructor call is performed each time a default value is assigned, so each default value assigned is a unique instance.
- get_default_value(self)
Returns a tuple of the form: ( default_value_type, default_value ) which describes the default value for this trait.
- info(self)
Returns a description of the trait.
- resolve(self, object, name, value)
Resolves a class originally specified as a string into an actual class, then resets the trait so that future calls will be handled by the normal validate method.
- resolve_default_value(self)
Resolves a class name into a class so that it can be used to return the class as the default value of the trait.
- validate(self, object, name, value)
Validates that the value is a valid object instance.