Message416093
OverflowError sometimes (but not always) includes some sort of numeric code:
>>> 1e+300 ** 2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: (34, 'Numerical result out of range')
but the meaning of the 34 is not documented:
https://docs.python.org/3/library/exceptions.html#OverflowError
help(OverflowError) is no more insightful, saying only:
__init__(self, /, *args, **kwargs)
Initialize self. See help(type(self)) for accurate signature.
Other OverflowError exceptions do not include the numeric code:
>>> math.exp(10000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: math range error
Is it an error code from C? Something to do with the number of digits of precision? An easter-egg to do with The Count Of Monte Cristo? |
|
Date |
User |
Action |
Args |
2022-03-26 22:10:10 | steven.daprano | set | recipients:
+ steven.daprano, docs@python |
2022-03-26 22:10:10 | steven.daprano | set | messageid: <1648332610.23.0.998137740503.issue47134@roundup.psfhosted.org> |
2022-03-26 22:10:10 | steven.daprano | link | issue47134 messages |
2022-03-26 22:10:10 | steven.daprano | create | |
|