Sitelet https://github.com/python/cpython/commit/b6d1f48c14b7a3bc7047138dc0bf5aadfe6be480
Skip to content

Commit b6d1f48

Browse files
committed
Issue #21559: Add alternative (historical) reason for OverflowError.
1 parent f2fb73f commit b6d1f48

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎Doc/library/exceptions.rst‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,10 @@ The following exceptions are the exceptions that are usually raised.
274274

275275
Raised when the result of an arithmetic operation is too large to be
276276
represented. This cannot occur for integers (which would rather raise
277-
:exc:`MemoryError` than give up). Because of the lack of standardization of
278-
floating point exception handling in C, most floating point operations also
279-
aren't checked.
277+
:exc:`MemoryError` than give up). However, for historical reasons,
278+
OverflowError is sometimes raised for integers that are outside a required
279+
range. Because of the lack of standardization of floating point exception
280+
handling in C, most floating point operations are not checked.
280281

281282

282283
.. exception:: ReferenceError

0 commit comments

Comments
 (0)