Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
">

(original) (raw)

It should derive from BaseException.

--Guido van Rossum (sent from Android phone)

On Jan 20, 2012 4:59 PM, "Steven D&apos;Aprano" <steve@pearwood.info> wrote:
Guido van Rossum wrote:
On Fri, Jan 20, 2012 at 11:51 AM, Donald Stufft <donald.stufft@gmail.com>wrote:

�On Friday, January 20, 2012 at 2:36 PM, Tres Seaver wrote:

On 01/20/2012 02:04 PM, Donald Stufft wrote:

Even if a MemoryException is raised I believe that is still a
fundamental change in the documented contract of dictionary API.

How so? Dictionary inserts can \*already\* raise that error.

Because it's raising it for a fundamentally different thing. "You have
plenty of memory, but we decided to add an arbitrary limit that has nothing
to do with memory and pretend you are out of memory anyways".


Actually due to fragmentation that can already happen.

Whether you have run out of total memory, or a single contiguous block, it is still a memory error.

An arbitrary limit on collisions is not a memory error. If we were designing this API from scratch, would anyone propose using MemoryError for "you have reached a limit on collisions"? It has nothing to do with memory. Using MemoryError for something which isn't a memory error is ugly.

How about RuntimeError?



\--
Steven

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org