jangada.serialization.Serializable._initialize_from_data#

Serializable._initialize_from_data(data: dict[str, Any]) None#

Initialize object properties from a dictionary.

This is an internal method called during construction and deserialization. It validates the data, removes the __class__ key if present, sets all properties, and ensures no unknown keys remain.

Parameters:
datadict[str, Any]

Dictionary mapping property names to values.

Raises:
TypeError

If data is not a dictionary.

AssertionError

If __class__ key is present but doesn’t match this class.

ValueError

If data contains keys that are not defined properties.

Notes

This method: 1. Validates data is a dict 2. Checks __class__ if present 3. Deserializes each property value 4. Sets each property via setattr (triggers parsers, observers, etc.) 5. Ensures all keys were consumed (no unknowns)