[issue13903] New shared-keys dictionary implementation

Mark Shannon report at bugs.python.org
Wed Feb 8 17:34:13 CET 2012


Mark Shannon <mark at hotpy.org> added the comment:

Antoine Pitrou wrote:
> Antoine Pitrou <pitrou at free.fr> added the comment:
> 
> Looking at your latest patch, I worry about "any deletion
> +(including pop & popitem) causes a split table to become a combined table". Why wouldn't you use a dummy pointer (such as ((PyObject *) 1)) to signal deleted slots?

In fact here is no need for a dummy pointer.
When deleting from a split-table, the value can just be set to NULL,
the resulting key-NULL pair is legal in a split-table.
Your suggestion doesn't make the code any more complex, so I've included it.

In practice, it will very rare that a deletion occurs in a split table
(since they are only used for attribute dictionaries).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13903>
_______________________________________


More information about the Python-bugs-list mailing list