def get_element_offset ( self , ty , position ) : offset = ffi . lib . LLVMPY_OffsetOfElement ( self , ty , position ) if offset == - 1 : raise ValueError ( "Could not determined offset of {}th " "element of the type '{}'. Is it a struct type?" . format ( position , str ( ty ) ) ) return offset
python calculate struct offset
Get byte offset of type s ty element at the given position
def get_element_offset(self, ty, position):
        """
        Get byte offset of type's ty element at the given position
        """

        offset = ffi.lib.LLVMPY_OffsetOfElement(self, ty, position)
        if offset == -1:
            raise ValueError("Could not determined offset of {}th "
                    "element of the type '{}'. Is it a struct type?".format(
                    position, str(ty)))
        return offset