Title: Typo: "which would rather raise MemoryError than give up", than or then?
Type: Stage: resolved
Components: Documentation Versions: Python 3.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: davidlin, docs@python, josh.r, mark.dickinson
Priority: normal Keywords:

Created on 2018-09-07 06:35 by davidlin, last changed 2018-09-07 14:35 by mark.dickinson. This issue is now closed.

Messages (3)
msg324720 - (view) Author: David Lin (davidlin) Date: 2018-09-07 06:35

exception OverflowError
Raised when the result of an arithmetic operation is too large to be represented. This cannot occur for integers (which would rather raise MemoryError than give up). However, for historical reasons, OverflowError is sometimes raised for integers that are outside a required range. Because of the lack of standardization of floating point exception handling in C, most floating point operations are not checked.

In sentence: "which would rather raise MemoryError than give up", should we use "then" instead of "than"?

David Lin
msg324741 - (view) Author: Josh Rosenberg (josh.r) * (Python triager) Date: 2018-09-07 14:32
"than" is correct; "giving up" in this context would mean "not even trying to allocate the memory and just preemptively raising OverflowError, like non-integer numeric types with limited ranges". Rather than giving up that way, it chooses to try to allocate the huge integer and raises a MemoryError only if that fails.
msg324742 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2018-09-07 14:35
See for an example:

> I have no information one way or the other, but I would rather he do it
> than not do it.
Date User Action Args
2018-09-07 14:35:52mark.dickinsonsetstatus: open -> closed

nosy: + mark.dickinson
messages: + msg324742

resolution: not a bug
stage: resolved
2018-09-07 14:32:23josh.rsetnosy: + josh.r
messages: + msg324741
2018-09-07 06:35:02davidlincreate