traits.ctrait Module

Defines the core CTrait class.

The CTrait class extends the C-level cTrait type to provide the full CTrait API. CTraits are the core objects that are used to generate defaults and validate as well as maintaining a list of notifiers and calling them when values are modified.

Classes

class traits.ctrait.CTrait[source]

Extends the underlying C-based cTrait type.

property comparison_mode

Get or set the comparison mode on the trait. Getter returns a ComparisonMode enum. Setter acceps either an int or a ComparisonMode enum.

property property_fields

Return a tuple of callables (fget, fset, validate) for the property trait.

is_trait_type(trait_type)[source]

Returns whether or not this trait is of a specified trait type.

get_editor()[source]

Returns the user interface editor associated with the trait.

get_help(full=True)[source]

Returns the help text for a trait.

If full is False or the trait does not have a help string, the returned string is constructed from the desc attribute on the trait and the info string on the trait’s handler.

Parameters

full (bool) – Indicates whether to return the value of the help attribute of the trait itself.

full_info(object, name, value)[source]

Returns a description of the trait.

info()[source]

Returns a description of the trait.

as_ctrait()[source]

Method that returns self for trait converters.