gpt4 book ai didi

python - Python 3 中的 sys.maxint 是什么?

转载 作者:IT老高 更新时间:2023-10-28 12:34:32 25 4
gpt4 key购买 nike

我一直在尝试找出如何表示最大整数,并且我已经阅读过使用 "sys.maxint"。但是,在 Python 3 中,当我调用它时,我得到:

AttributeError: module 'object' has no attribute 'maxint'

最佳答案

The sys.maxint constant was removed, since there is no longer a limit to the value of integers. However, sys.maxsize can be used as an integer larger than any practical list or string index. It conforms to the implementation’s “natural” integer size and is typically the same as sys.maxint in previous releases on the same platform (assuming the same build options).

http://docs.python.org/3.1/whatsnew/3.0.html#integers

关于python - Python 3 中的 sys.maxint 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13795758/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com