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
Methods Signature¶
|
Retrieves the |
|
Returns the data type of the underlying data object. |
|
If the data type of the underlying object is a ‘known’ struct, the object will be converted
|
|
Returns the string representation of a data. |
Methods Definition¶
-
UnknownDataType.
GetId
()¶ Retrieves the
maxon.Id
of the current Data.- Returns
The
maxon.Id
of the current Data holds by the currentmaxon.UnknownDataType
instance.- Return type
-
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
-
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
Union[Self, dict]
-
UnknownDataType.
__str__
()¶ Returns the string representation of a data.
- Return type
str