Add _PyDict_CheckConsistency()

Issue #28127: Add a function to check that a dictionary remains consistent
after any change.

By default, tables are not checked, only basic attributes. Define DEBUG_PYDICT
(ex: gcc -D DEBUG_PYDICT) to also check dictionary "content".
This commit is contained in:
Victor Stinner 2016-09-14 15:02:01 +02:00
parent 4659ccff70
commit 611b0fa94c
3 changed files with 91 additions and 7 deletions

View file

@ -33,7 +33,7 @@ typedef struct {
PyDictKeysObject *ma_keys;
/* If ma_values is NULL, the table is "combined": keys and values
are stored in ma_keys (and ma_keys->dk_refcnt == 1).
are stored in ma_keys.
If ma_values is not NULL, the table is splitted:
keys are stored in ma_keys and values are stored in ma_values */