def to_python_not_null()

in pyignite/datatypes/standard.py [0:0]


    def to_python_not_null(cls, ctypes_object, **kwargs):
        sign = 1 if ctypes_object.data[0] & 0x80 else 0
        data = ctypes_object.data[1:]
        data.insert(0, ctypes_object.data[0] & 0x7f)
        # decode n-byte integer
        result = sum([
            [x for x in reversed(data)][i] * 0x100 ** i for i in
            range(len(data))
        ])
        # apply scale
        result = result / decimal.Decimal('10') ** decimal.Decimal(ctypes_object.scale)
        if sign:
            # apply sign
            result = -result
        return result