tlc.core.base_object¶

Lightweight base class providing init-parameter assignment and type identity for all 3LC objects.

Module Contents¶

Classes¶

Class

Description

BaseObject

Lightweight base for all 3LC objects: type identity and init-parameter assignment.

API¶

class BaseObject(
*,
init_parameters: Any = None,
)¶

Lightweight base for all 3LC objects: type identity and init-parameter assignment.

This level carries no type/version fields, no schema, no URL, and no persistence logic.

Parameters:

init_parameters – A dictionary containing the initial values of the object’s properties.

initial_value(
property_name: str,
new_value: Any,
default_value: Any = None,
) Any¶

Return the initial value of a property.

Returns self.<property_name> if it already exists (set via init_parameters), otherwise new_value if not None, otherwise default_value. This lets every object be fully initialized through its constructor.

Parameters:
  • property_name – The name of the property to get the initial value for.

  • new_value – The value to return if self.<property_name> is not set.

  • default_value – The value to return if self.<property_name> is not set and new_value is None.

Returns:

The initial value of the property.

classmethod type_name() str¶

The type name of the class, used to resolve factory methods.