This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients docs@python, steven.daprano
Date 2022-03-26.22:10:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648332610.23.0.998137740503.issue47134@roundup.psfhosted.org>
In-reply-to
Content
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?
History
Date User Action Args
2022-03-26 22:10:10steven.dapranosetrecipients: + steven.daprano, docs@python
2022-03-26 22:10:10steven.dapranosetmessageid: <1648332610.23.0.998137740503.issue47134@roundup.psfhosted.org>
2022-03-26 22:10:10steven.dapranolinkissue47134 messages
2022-03-26 22:10:10steven.dapranocreate