Inherits from
- TraitHandler: enthought.traits.trait_handlers.TraitHandler
Attributes
- default_value_type
default_value_type = 6
- info_trait
info_trait = None
Method summary
- __init__(self, key_trait = None, value_trait = None, has_items = True)
- clone(self)
- full_info(self, object, name, value)
- get_editor(self, trait)
- items_event(self)
- validate(self, object, name, value)
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)
- 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, key_trait = None, value_trait = None, has_items = True)
Creates a TraitDict handler.
Parameters
- key_trait : trait
- The type for the dictionary keys
- value_trait : trait
- The type for the dictionary values
- has_items : boolean
- Flag indicating whether the dictionary contains entries
Description
If key_trait is None or omitted, the keys in the dictionary can be of any type. Otherwise, key_trait must be either a trait, or a value that can be converted to a trait using the Trait() function. In this case, all dictionary keys are checked to ensure that they are of the type specified by key_trait.
If value_trait is None or omitted, the values in the dictionary can be of any type. Otherwise, value_trait must be either a trait, or a value that can be converted to a trait using the Trait() function. In this case, all dictionary values are checked to ensure that they are of the type specified by value_trait.
- clone(self)
- full_info(self, object, name, value)
- get_editor(self, trait)
- items_event(self)
- validate(self, object, name, value)