3.7. Packing and Unpacking#
-
PyObject *CpAtom_TypeOf(PyObject *value)#
- Return value: New reference.
Returns the type of the given atom object.
-
int CpAtom_Pack(PyObject *pAtom, PyObject *pObj, PyObject *pContext)#
Packs the object
ousing the provided context and returns-1on error. The Proper use would be:PyObject *nAtom = ..., *nContext = ..., *nValue = ...; if (CpAtom_Pack(nAtom, nValue, nContext) < 0) goto error;
The provided context object must support the Context Protocol, which is not validated in this method.This function may raise NotImplementedError to indicate that this class does not support packing.
Added in version 2.6.0.
-
PyObject *CpAtom_Size(PyObject *pAtom, PyObject *pContext)#
- Return value: New reference.
Calculates the size of the object
pAtomusing contextpContextand returns the result. This method will return NULL if an error occurs while calling the target function.Added in version 2.6.0.
TODO