Esempio n. 1
0
def _to_entity_int32(value):
    if sys.version_info < (3,):
        value = long(value)
    else:
        value = int(value)
    if value >= 2 ** 31 or value < -(2 ** 31):
        raise TypeError(_ERROR_VALUE_TOO_LARGE.format(str(value), EdmType.INT32))
    return None, value
Esempio n. 2
0
def _to_entity_int32(value):
    if sys.version_info < (3,):
        value = long(value)
    else:
        value = int(value)
    if value >= 2 ** 31 or value < -(2 ** 31):
        raise TypeError(_ERROR_VALUE_TOO_LARGE.format(str(value), EdmType.INT32))
    return None, value
Esempio n. 3
0
def _to_entity_int64(value):
    if sys.version_info < (3,):
        ivalue = long(value)
    else:
        ivalue = int(value)
    if ivalue >= 2 ** 63 or ivalue < -(2 ** 63):
        raise TypeError(_ERROR_VALUE_TOO_LARGE.format(str(value), EdmType.INT64))
    return EdmType.INT64, str(value)
Esempio n. 4
0
def _to_entity_int64(value):
    if sys.version_info < (3,):
        ivalue = long(value)
    else:
        ivalue = int(value)
    if ivalue >= 2 ** 63 or ivalue < -(2 ** 63):
        raise TypeError(_ERROR_VALUE_TOO_LARGE.format(str(value), EdmType.INT64))
    return EdmType.INT64, str(value)