[Python-Dev] Counting collisions for the win
Guido van Rossum
guido at python.org
Sat Jan 21 02:02:53 CET 2012
It should derive from BaseException.
--Guido van Rossum (sent from Android phone)
On Jan 20, 2012 4:59 PM, "Steven D'Aprano" <steve at pearwood.info> wrote:
> Guido van Rossum wrote:
>> On Fri, Jan 20, 2012 at 11:51 AM, Donald Stufft <donald.stufft at gmail.com>
>> 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
>>> 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?
> Python-Dev mailing list
> Python-Dev at python.org
> Unsubscribe: http://mail.python.org/**mailman/options/python-dev/**
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev