@@ -324,10 +324,6 @@ PyType_Modified(PyTypeObject *type)
324324
325325 Invariants:
326326
327- - Py_TPFLAGS_VALID_VERSION_TAG is never set if
328- Py_TPFLAGS_HAVE_VERSION_TAG is not set (in case of a
329- bizarre MRO, see type_mro_modified()).
330-
331327 - before Py_TPFLAGS_VALID_VERSION_TAG can be set on a type,
332328 it must first be set on all super types.
333329
@@ -379,9 +375,6 @@ type_mro_modified(PyTypeObject *type, PyObject *bases) {
379375 PyObject * mro_meth = NULL ;
380376 PyObject * type_mro_meth = NULL ;
381377
382- if (!_PyType_HasFeature (type , Py_TPFLAGS_HAVE_VERSION_TAG ))
383- return ;
384-
385378 if (custom ) {
386379 mro_meth = lookup_maybe_method (
387380 (PyObject * )type , & PyId_mro , & unbound );
@@ -404,17 +397,15 @@ type_mro_modified(PyTypeObject *type, PyObject *bases) {
404397 assert (PyType_Check (b ));
405398 cls = (PyTypeObject * )b ;
406399
407- if (!_PyType_HasFeature (cls , Py_TPFLAGS_HAVE_VERSION_TAG ) ||
408- !PyType_IsSubtype (type , cls )) {
400+ if (!PyType_IsSubtype (type , cls )) {
409401 goto clear ;
410402 }
411403 }
412404 return ;
413405 clear :
414406 Py_XDECREF (mro_meth );
415407 Py_XDECREF (type_mro_meth );
416- type -> tp_flags &= ~(Py_TPFLAGS_HAVE_VERSION_TAG |
417- Py_TPFLAGS_VALID_VERSION_TAG );
408+ type -> tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG ;
418409 type -> tp_version_tag = 0 ; /* 0 is not a valid version tag */
419410}
420411
@@ -431,8 +422,6 @@ assign_version_tag(struct type_cache *cache, PyTypeObject *type)
431422
432423 if (_PyType_HasFeature (type , Py_TPFLAGS_VALID_VERSION_TAG ))
433424 return 1 ;
434- if (!_PyType_HasFeature (type , Py_TPFLAGS_HAVE_VERSION_TAG ))
435- return 0 ;
436425 if (!_PyType_HasFeature (type , Py_TPFLAGS_READY ))
437426 return 0 ;
438427
@@ -5978,14 +5967,6 @@ type_ready_pre_checks(PyTypeObject *type)
59785967 _PyObject_ASSERT ((PyObject * )type , type -> tp_call != NULL );
59795968 }
59805969
5981- /* Consistency check for Py_TPFLAGS_HAVE_AM_SEND - flag requires
5982- * type->tp_as_async->am_send to be present.
5983- */
5984- if (type -> tp_flags & Py_TPFLAGS_HAVE_AM_SEND ) {
5985- _PyObject_ASSERT ((PyObject * )type , type -> tp_as_async != NULL );
5986- _PyObject_ASSERT ((PyObject * )type , type -> tp_as_async -> am_send != NULL );
5987- }
5988-
59895970 /* Consistency checks for pattern matching
59905971 * Py_TPFLAGS_SEQUENCE and Py_TPFLAGS_MAPPING are mutually exclusive */
59915972 _PyObject_ASSERT ((PyObject * )type , (type -> tp_flags & COLLECTION_FLAGS ) != COLLECTION_FLAGS );
0 commit comments