17.1.1.1.1.8. cobra.core.object

Define base Object class in Cobra.

17.1.1.1.1.8.1. Module Contents

17.1.1.1.1.8.1.1. Classes

Object

Defines common behavior of object in cobra.core.

class cobra.core.object.Object(id: Optional[str] = None, name: str = '')[source]

Defines common behavior of object in cobra.core.

property id(self) → str[source]

Get the Object id.

Returns

id

Return type

str

_set_id_with_model(self, value) → None[source]

Set id with model.

This appears to be a stub so it can be modified in dependant classes.

Parameters

value (str) – The string to set the id to.

property annotation(self) → dict[source]

Get annotation dictionary.

Returns

_annotation – Returns _annotation as a dictionary.

Return type

dict

__getstate__(self) → dict[source]

Get state of annotation.

To prevent excessive replication during deepcopy, ignores _model in state.

Returns

state – Dictionary of state, excluding _model.

Return type

dict

__repr__(self) → str[source]

Return string representation of Object, with class.

Returns

Composed of class.name, id and hexadecimal of id.

Return type

str

__str__(self) → str[source]

Return string representation of object.

Returns

Object.id as string.

Return type

str