[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Objects dictobject.c,2.68,2.69
Greg Stein
gstein@lyra.org
Wed, 13 Dec 2000 00:05:05 -0800
On Tue, Dec 12, 2000 at 05:02:49PM -0800, Tim Peters wrote:
> Update of /cvsroot/python/python/dist/src/Objects
> In directory slayer.i.sourceforge.net:/tmp/cvs-serv31776/python/dist/src/objects
>
> Modified Files:
> dictobject.c
> Log Message:
> Bring comments up to date (e.g., they still said the table had to be
> a prime size, which is in fact never true anymore ...).
>...
> --- 55,78 ----
>
> /*
> ! There are three kinds of slots in the table:
> !
> ! 1. Unused. me_key == me_value == NULL
> ! Does not hold an active (key, value) pair now and never did. Unused can
> ! transition to Active upon key insertion. This is the only case in which
> ! me_key is NULL, and is each slot's initial state.
> !
> ! 2. Active. me_key != NULL and me_key != dummy and me_value != NULL
> ! Holds an active (key, value) pair. Active can transition to Dummy upon
> ! key deletion. This is the only case in which me_value != NULL.
> !
> ! 3. Dummy. me_key == dummy && me_value == NULL
> ! Previously held an active (key, value) pair, but that was deleted and an
> ! active pair has not yet overwritten the slot. Dummy can transition to
> ! Active upon key insertion. Dummy slots cannot be made Unused again
> ! (cannot have me_key set to NULL), else the probe sequence in case of
> ! collision would have no way to know they were once active.
4. The popitem finger.
:-)
Cheers,
-g
--
Greg Stein, http://www.lyra.org/