【发布时间】:2013-11-23 23:31:02
【问题描述】:
Google App Engine Python 中 IntegerProperty、LongProperty 的最大值是多少?
【问题讨论】:
标签: google-app-engine google-cloud-datastore
Google App Engine Python 中 IntegerProperty、LongProperty 的最大值是多少?
【问题讨论】:
标签: google-app-engine google-cloud-datastore
IntegerProperty 是 int 或 long:
int 或 long 一个整数值,最多 64 位。
Python int 值在存储之前转换为 Python long 值。存储为 int 的值将作为 long 返回。
如果分配了大于 64 位的 long,则仅存储最低有效 64 位。
为了更清楚起见,您可以使用 sys.maxint 来查找实际值(在 shell 中运行它并首先“导入 sys”)
【讨论】:
Google App Engine 上没有 LongProperty,而只有 IntegerProperty,并且如前所述,它是一个 64 位有符号整数。
此号码的最小值为−9,223,372,036,854,775,808,最大值为9,223,372,036,854,775,807。
【讨论】: