[Python-3000] MemoryError oddities

Guido van Rossum guido at python.org
Wed Jul 30 18:36:40 CEST 2008


On Tue, Jul 29, 2008 at 10:07 PM, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>> +1 OverflowErrors should probably by reserved for numeric overflows.
>
> In a sense, passing sys.maxsize as a string size *is* a numeric
> overflow - the size can't be represented in the available variable.

I'm sure this is the source of the confusion. The problem is that if
you specify a small enough value that you *don't* get into
unrepresentable sizes, but still very large, you do get a MemoryError.
For continuity it would be better to treat both the same, i.e. use
MemoryError consistently.

FWIW, are there any legitimate occurrences of OverflowError in Py3k
now that ints have unlimited range?

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list