summaryrefslogtreecommitdiffstats
path: root/Objects/dictobject.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2000-12-13 19:58:25 (GMT)
committerTim Peters <tim.peters@gmail.com>2000-12-13 19:58:25 (GMT)
commitf1c7c884b32d26cbe8f604dd9038a3af9d0e457a (patch)
tree6d6d4d2c045e5e5081652d6c377fa7a7fc4c144b /Objects/dictobject.c
parent24d6da3eae604cda552267920089b6e10caa52e8 (diff)
downloadcpython-f1c7c884b32d26cbe8f604dd9038a3af9d0e457a.zip
cpython-f1c7c884b32d26cbe8f604dd9038a3af9d0e457a.tar.gz
cpython-f1c7c884b32d26cbe8f604dd9038a3af9d0e457a.tar.bz2
Typo repair in comments. Fell for GregS's .popitem() poke.
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r--Objects/dictobject.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 32bf647..35b1b2b 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -65,12 +65,16 @@ There are three kinds of slots in the table:
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
+3. Dummy. me_key == dummy and 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.
+
+Note: .popitem() abuses the me_hash field of an Unused or Dummy slot to
+hold a search finger. The me_hash field of Unused or Dummy slots has no
+meaning otherwise.
*/
typedef struct {
long me_hash; /* cached hash code of me_key */
@@ -82,7 +86,7 @@ typedef struct {
} dictentry;
/*
-To ensure the lookup algorithm terminates, there must be at least one Unsused
+To ensure the lookup algorithm terminates, there must be at least one Unused
slot (NULL key) in the table.
The value ma_fill is the number of non-NULL keys (sum of Active and Dummy);
ma_used is the number of non-NULL, non-dummy keys (== the number of non-NULL