@@ -914,7 +914,7 @@ new_dict_with_shared_keys(PyDictKeysObject *keys)
914914static PyDictKeysObject *
915915clone_combined_dict_keys (PyDictObject * orig )
916916{
917- assert (PyDict_Check (orig ));
917+ assert (_PyAnyDict_Check (orig ));
918918 assert (Py_TYPE (orig )-> tp_iter == dict_iter );
919919 assert (orig -> ma_values == NULL );
920920 assert (orig -> ma_keys != Py_EMPTY_KEYS );
@@ -2374,7 +2374,7 @@ _PyDict_GetItem_KnownHash(PyObject *op, PyObject *key, Py_hash_t hash)
23742374 PyDictObject * mp = (PyDictObject * )op ;
23752375 PyObject * value ;
23762376
2377- if (!PyDict_Check (op )) {
2377+ if (!_PyAnyDict_Check (op )) {
23782378 PyErr_BadInternalCall ();
23792379 return NULL ;
23802380 }
@@ -3280,8 +3280,8 @@ _PyDict_FromKeys(PyObject *cls, PyObject *iterable, PyObject *value)
32803280 return NULL ;
32813281
32823282
3283- if (PyDict_CheckExact (d )) {
3284- if (PyDict_CheckExact (iterable )) {
3283+ if (_PyAnyDict_CheckExact (d )) {
3284+ if (_PyAnyDict_CheckExact (iterable )) {
32853285 PyDictObject * mp = (PyDictObject * )d ;
32863286
32873287 Py_BEGIN_CRITICAL_SECTION2 (d , iterable );
@@ -3496,7 +3496,7 @@ dict_subscript(PyObject *self, PyObject *key)
34963496 if (ix == DKIX_ERROR )
34973497 return NULL ;
34983498 if (ix == DKIX_EMPTY || value == NULL ) {
3499- if (!PyDict_CheckExact (mp )) {
3499+ if (!_PyAnyDict_CheckExact (mp )) {
35003500 /* Look up __missing__ method if we're a subclass. */
35013501 PyObject * missing , * res ;
35023502 missing = _PyObject_LookupSpecial (
@@ -3535,7 +3535,7 @@ keys_lock_held(PyObject *dict)
35353535{
35363536 ASSERT_DICT_LOCKED (dict );
35373537
3538- if (dict == NULL || !PyDict_Check (dict )) {
3538+ if (dict == NULL || !_PyAnyDict_Check (dict )) {
35393539 PyErr_BadInternalCall ();
35403540 return NULL ;
35413541 }
@@ -3584,7 +3584,7 @@ values_lock_held(PyObject *dict)
35843584{
35853585 ASSERT_DICT_LOCKED (dict );
35863586
3587- if (dict == NULL || !PyDict_Check (dict )) {
3587+ if (dict == NULL || !_PyAnyDict_Check (dict )) {
35883588 PyErr_BadInternalCall ();
35893589 return NULL ;
35903590 }
@@ -3632,7 +3632,7 @@ items_lock_held(PyObject *dict)
36323632{
36333633 ASSERT_DICT_LOCKED (dict );
36343634
3635- if (dict == NULL || !PyDict_Check (dict )) {
3635+ if (dict == NULL || !_PyAnyDict_Check (dict )) {
36363636 PyErr_BadInternalCall ();
36373637 return NULL ;
36383638 }
@@ -3712,7 +3712,7 @@ dict_fromkeys_impl(PyTypeObject *type, PyObject *iterable, PyObject *value)
37123712static int
37133713dict_update_arg (PyObject * self , PyObject * arg )
37143714{
3715- if (PyDict_CheckExact (arg )) {
3715+ if (_PyAnyDict_CheckExact (arg )) {
37163716 return PyDict_Merge (self , arg , 1 );
37173717 }
37183718 int has_keys = PyObject_HasAttrWithError (arg , & _Py_ID (keys ));
@@ -3982,7 +3982,7 @@ dict_merge(PyInterpreterState *interp, PyObject *a, PyObject *b, int override)
39823982 }
39833983 mp = (PyDictObject * )a ;
39843984 int res = 0 ;
3985- if (PyDict_Check (b ) && (Py_TYPE (b )-> tp_iter == dict_iter )) {
3985+ if (_PyAnyDict_Check (b ) && (Py_TYPE (b )-> tp_iter == dict_iter )) {
39863986 other = (PyDictObject * )b ;
39873987 int res ;
39883988 Py_BEGIN_CRITICAL_SECTION2 (a , b );
@@ -4243,7 +4243,7 @@ PyDict_Copy(PyObject *o)
42434243Py_ssize_t
42444244PyDict_Size (PyObject * mp )
42454245{
4246- if (mp == NULL || !PyDict_Check (mp )) {
4246+ if (mp == NULL || !_PyAnyDict_Check (mp )) {
42474247 PyErr_BadInternalCall ();
42484248 return -1 ;
42494249 }
@@ -5789,7 +5789,7 @@ dictreviter_iter_lock_held(PyDictObject *d, PyObject *self)
57895789{
57905790 dictiterobject * di = (dictiterobject * )self ;
57915791
5792- assert (PyDict_Check (d ));
5792+ assert (_PyAnyDict_Check (d ));
57935793 ASSERT_DICT_LOCKED (d );
57945794
57955795 if (di -> di_used != d -> ma_used ) {
@@ -5919,7 +5919,7 @@ static PyObject *
59195919dict___reversed___impl (PyDictObject * self )
59205920/*[clinic end generated code: output=e674483336d1ed51 input=23210ef3477d8c4d]*/
59215921{
5922- assert (PyDict_Check (self ));
5922+ assert (_PyAnyDict_Check (self ));
59235923 return dictiter_new (self , & PyDictRevIterKey_Type );
59245924}
59255925
@@ -6194,7 +6194,7 @@ dictviews_to_set(PyObject *self)
61946194 if (PyDictKeys_Check (self )) {
61956195 // PySet_New() has fast path for the dict object.
61966196 PyObject * dict = (PyObject * )((_PyDictViewObject * )self )-> dv_dict ;
6197- if (PyDict_CheckExact (dict )) {
6197+ if (_PyAnyDict_CheckExact (dict )) {
61986198 left = dict ;
61996199 }
62006200 }
@@ -7714,7 +7714,7 @@ validate_watcher_id(PyInterpreterState *interp, int watcher_id)
77147714int
77157715PyDict_Watch (int watcher_id , PyObject * dict )
77167716{
7717- if (!PyDict_Check (dict )) {
7717+ if (!_PyAnyDict_Check (dict )) {
77187718 PyErr_SetString (PyExc_ValueError , "Cannot watch non-dictionary" );
77197719 return -1 ;
77207720 }
@@ -7729,7 +7729,7 @@ PyDict_Watch(int watcher_id, PyObject* dict)
77297729int
77307730PyDict_Unwatch (int watcher_id , PyObject * dict )
77317731{
7732- if (!PyDict_Check (dict )) {
7732+ if (!_PyAnyDict_Check (dict )) {
77337733 PyErr_SetString (PyExc_ValueError , "Cannot watch non-dictionary" );
77347734 return -1 ;
77357735 }
0 commit comments