maxon.UnknownDataType

Description

Class for all data objects, that have no proper wrapper class in Python. This can happen, if a function returns an instance of an object, that is unknown to Python. To still be able to receive the object, an instance of this class is returned instead. It’s use is limited, since Python doesn’t know, how the underlying object looks like, or which functions it has on the C++ side. However, it can be automatically passed to a function, which accepts an object which matches the data type of it. If the data type of the object got registered via MAXON_DATATYPE_REGISTER_STRUCT on the C++ side, you can use UnknownDataType.MaxonConvert() to convert its members to a dict. The dict can alternatively be used then to pass to a function that expects a type of this object.

Warning

This function is only there to expose a C++ Object to Python.
As a Python developer you normally don’t have to deal with this function.

Inheritance diagram

Inheritance

Parent Class:

Methods Signature

GetId() Retrieves the maxon.Id of the current Data.
GetType() Returns the data type of the underlying data object.
MaxonConvert([expected])
If the data type of the underlying object is a ‘known’ struct, the object will be converted

Methods Definition

UnknownDataType.GetId()

Retrieves the maxon.Id of the current Data.

Returns:The maxon.Id of the current Data holds by the current maxon.UnknownDataType instance.
Return type:maxon.Id
UnknownDataType.GetType()

Returns the data type of the underlying data object. This function overwrites maxon.Data.GetType() because the data type of UnknownDataType would be returned instead.

Returns:Data type of the underlying data type.
Return type:maxon.DataType
UnknownDataType.MaxonConvert(expected=dict)
If the data type of the underlying object is a ‘known’ struct, the object will be converted to a dict, where each key and value matches the name and values of the C++ struct.
A ‘known struct’ is a data type, that got registered via MAXON_DATATYPE_REGISTER_STRUCT in the originated C++ module. If no proper conversion can be found, self will be returned.
Returns:Converted object or self if the datatype is not registered internally as a struct via MAXON_DATATYPE_REGISTER_STRUCT.
Return type:Any