@@ -240,9 +240,18 @@ typevar_reduce_impl(typevarobject *self)
240240 return PyUnicode_FromString (self -> name );
241241}
242242
243+ static PyObject *
244+ typevar_mro_entries (PyObject * self , PyObject * args )
245+ {
246+ PyErr_SetString (PyExc_TypeError ,
247+ "Cannot subclass an instance of TypeVar" );
248+ return NULL ;
249+ }
250+
243251static PyMethodDef typevar_methods [] = {
244252 TYPEVAR_TYPING_SUBST_METHODDEF
245253 TYPEVAR_REDUCE_METHODDEF
254+ {"__mro_entries__" , typevar_mro_entries , METH_O },
246255 {0 }
247256};
248257
@@ -697,10 +706,19 @@ paramspec_reduce_impl(paramspecobject *self)
697706 return PyUnicode_FromString (self -> name );
698707}
699708
709+ static PyObject *
710+ paramspec_mro_entries (PyObject * self , PyObject * args )
711+ {
712+ PyErr_SetString (PyExc_TypeError ,
713+ "Cannot subclass an instance of ParamSpec" );
714+ return NULL ;
715+ }
716+
700717static PyMethodDef paramspec_methods [] = {
701718 PARAMSPEC_TYPING_SUBST_METHODDEF
702719 PARAMSPEC_TYPING_PREPARE_SUBST_METHODDEF
703720 PARAMSPEC_REDUCE_METHODDEF
721+ {"__mro_entries__" , paramspec_mro_entries , METH_O },
704722 {0 }
705723};
706724
@@ -902,10 +920,19 @@ typevartuple_reduce_impl(typevartupleobject *self)
902920 return PyUnicode_FromString (self -> name );
903921}
904922
923+ static PyObject *
924+ typevartuple_mro_entries (PyObject * self , PyObject * args )
925+ {
926+ PyErr_SetString (PyExc_TypeError ,
927+ "Cannot subclass an instance of TypeVarTuple" );
928+ return NULL ;
929+ }
930+
905931static PyMethodDef typevartuple_methods [] = {
906932 TYPEVARTUPLE_TYPING_SUBST_METHODDEF
907933 TYPEVARTUPLE_TYPING_PREPARE_SUBST_METHODDEF
908934 TYPEVARTUPLE_REDUCE_METHODDEF
935+ {"__mro_entries__" , typevartuple_mro_entries , METH_O },
909936 {0 }
910937};
911 938
0 commit comments