Onyx logo

Previous topic

Containers

Next topic

onyx.containers.objectset – Indexed set of runtime objects constructed from text serialization

This Page

onyx.containers.serializable – Mixin class for a set of serializable classes

class onyx.containers.serializable.Serializable

Bases: object

This mix-in class supports serialization of objects and their subsequent deserialization by IndexedObjectSet, q.v.. Classes inheriting from Serializable must override get_serial_version() and may also choose to override get_serial_module_name, get_serial_factory_name, and get_serial_factory_args.

Note that this class can’t be actually be used:

>>> t0 = Serializable()
>>> t0.serialize()
Traceback (most recent call last):
    ...
NotImplementedError: Class 'Serializable' derived from Serializable must implement get_serial_version()
get_serial_factory_args()
get_serial_factory_name()
get_serial_module_name()
get_serial_version()
serialize()

Return a serialized version of this object as a tuple of strings. The form of the tuple is: (module_name, factory_name, version, arg0, arg1, ...) where the version and the args will be passed to the factory to construct the object.