Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> float(10**1000)
Traceback (most recent call last):
File "", line 1, in
OverflowError: long int too large to convert to float
来想一想(我想我看到评论中的第一个已经消失了,所以我不确定应该归功于谁):
>>> 10.0**1000
Traceback (most recent call last):
File "", line 1, in
OverflowError: (34, 'Result too large')
>>> 10j**1000
Traceback (most recent call last):
File "", line 1, in
OverflowError: complex exponentiation
这些都是x-to-int-power或int-to-float(或复杂的工作)类型.
而且 – 因为它出现在相关问题的右边! – 有:
>>> xrange(10**100)
Traceback (most recent call last):
File "", line 1, in
OverflowError: Python int too large to convert to C long
这是另一种类型.