codeable_models.CAttribute

class codeable_models.CAttribute(**kwargs)

CAttribute is internally used for storing attributes, and can be used by the user for detailed setting or introspection of attribute data.

The attributes getter of CClassifier returns CAttribute objects. They can be used as an alternative method in the attributes setter of CClassifier to define attributes of a classifier.

Parameters

**kwargs

CAttribute accepts: type, default.

  • The type kwarg accepts a type argument in the form acceptable to the type property.

  • The default kwarg accepts a default value in the form acceptable to the default property.

property classifier

Property used to get the classifier of the attribute.

The attribute classifier is set automatically when the attribute is created on a classifier.

Type

CClassifier

property default

Property used to set or get the default value of the attribute.

If an attribute type is set before the default value, the default value must conform to the type. Else the type is guessed from the provided default value.

Type

default_value

property name

Property used to get the name of the attribute.

Will be set automatically if the attribute is created on a classifier.

Type

str

property type

Property used to set or get the type of the attribute.

If a default value is set before the type, an exception will be raised if the new type does not match the default value.

Supported types of attributes are documented in the documentation of the attributes property of CClassifier.

Type

supported_type