| [3225] | 1 | #ifndef Py_DICTOBJECT_H
|
|---|
| 2 | #define Py_DICTOBJECT_H
|
|---|
| 3 | #ifdef __cplusplus
|
|---|
| 4 | extern "C" {
|
|---|
| 5 | #endif
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 | /* Dictionary object type -- mapping from hashable object to object */
|
|---|
| 9 |
|
|---|
| 10 | /* The distribution includes a separate file, Objects/dictnotes.txt,
|
|---|
| 11 | describing explorations into dictionary design and optimization.
|
|---|
| 12 | It covers typical dictionary use patterns, the parameters for
|
|---|
| 13 | tuning dictionaries, and several ideas for possible optimizations.
|
|---|
| 14 | */
|
|---|
| 15 |
|
|---|
| 16 | /*
|
|---|
| 17 | There are three kinds of slots in the table:
|
|---|
| 18 |
|
|---|
| 19 | 1. Unused. me_key == me_value == NULL
|
|---|
| 20 | Does not hold an active (key, value) pair now and never did. Unused can
|
|---|
| 21 | transition to Active upon key insertion. This is the only case in which
|
|---|
| 22 | me_key is NULL, and is each slot's initial state.
|
|---|
| 23 |
|
|---|
| 24 | 2. Active. me_key != NULL and me_key != dummy and me_value != NULL
|
|---|
| 25 | Holds an active (key, value) pair. Active can transition to Dummy upon
|
|---|
| |
|---|