Inherits from
- Instance: enthought.traits.trait_types.Instance
Attributes
Inherited from base classes
Method summary
- __init__(self, klass = 'enthought.traits.has_traits.HasTraits', allow_none = False, adapt = 'yes', **metadata)
- get(self, object, name)
- resolve_class(self, object, name, value)
- set(self, object, name, value)
Inherited from base classes
- __call__(self, *args, **kw)
- __getattr__(self, name)
- allow_none(self)
- arg_error(self, method, arg_num, object, name, value)
- as_ctrait(self)
- clone(self, default_value = Missing, **metadata)
- create_default_value(self, *args, **kw)
- create_editor(self)
- dup_arg_error(self, method, arg_num, object, name)
- error(self, object, name, value)
- find_class(self, klass)
- full_info(self, object, name, value)
- get_default_value(self)
- get_editor(self, trait = None)
- get_value(self, object, name, trait = None)
- info(self)
- 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)
- validate(self, object, name, value)
- validate_class(self, klass)
- validate_failed(self, object, name, value)
Methods
- __init__(self, klass = 'enthought.traits.has_traits.HasTraits', allow_none = False, adapt = 'yes', **metadata)
Returns a WeakRef trait.
Only a weak reference is maintained to any object assigned to a WeakRef trait. If no other references exist to the assigned value, the value may be garbage collected, in which case the value of the trait becomes None. In all other cases, the value returned by the trait is the original object.
Parameters
- klass : class or instance
- The object that forms the basis for the trait. If klass is omitted, then values must be an instance of HasTraits.
- allow_none : boolean
- Indicates whether None can be assigned
Default Value
None (even if allow_none==False)
- get(self, object, name)
- resolve_class(self, object, name, value)
- set(self, object, name, value)