Inherits from
- TraitType: enthought.traits.trait_handlers.TraitType
Attributes
- default_value_type
default_value_type = 6
- info_trait
info_trait = None
Method summary
- __init__(self, key_trait = None, value_trait = None, value = None, items = True, **metadata)
- create_editor(self)
- full_info(self, object, name, value)
- inner_traits(self)
- items_event(self)
- validate(self, object, name, value)
Inherited from base classes
- arg_error(self, method, arg_num, object, name, value)
- dup_arg_error(self, method, arg_num, object, name)
- error(self, object, name, value)
- get_editor(self, trait = None)
- info(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, key_trait = None, value_trait = None, value = None, items = True, **metadata)
Returns a Dict trait.
Parameters
- key_trait : a trait or value that can convert to a trait using Trait()
- The trait type for keys in the dictionary; if not specified, any values can be used as keys.
- value_trait : a trait or value that can convert to a trait using Trait()
- The trait type for values in the dictionary; if not specified, any values can be used as dictionary values.
- value : a dictionary
- The default value for the returned trait
- items : Boolean
- Indicates whether the value contains items
Default Value
value or {}
- create_editor(self)
Returns the default UI editor for the trait.
- full_info(self, object, name, value)
Returns a description of the trait.
- inner_traits(self)
Returns the inner trait (or traits) for this trait.
- items_event(self)
- validate(self, object, name, value)
Validates that the value is a valid dictionary.