@@ -240,9 +240,18 @@ typevar_reduce_impl(typevarobject *self)
240
240
return PyUnicode_FromString (self -> name );
241
241
}
242
242
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
+
243
251
static PyMethodDef typevar_methods [] = {
244
252
TYPEVAR_TYPING_SUBST_METHODDEF
245
253
TYPEVAR_REDUCE_METHODDEF
254
+ {"__mro_entries__" , typevar_mro_entries , METH_O },
246
255
{0 }
247
256
};
248
257
@@ -697,10 +706,19 @@ paramspec_reduce_impl(paramspecobject *self)
697
706
return PyUnicode_FromString (self -> name );
698
707
}
699
708
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
+
700
717
static PyMethodDef paramspec_methods [] = {
701
718
PARAMSPEC_TYPING_SUBST_METHODDEF
702
719
PARAMSPEC_TYPING_PREPARE_SUBST_METHODDEF
703
720
PARAMSPEC_REDUCE_METHODDEF
721
+ {"__mro_entries__" , paramspec_mro_entries , METH_O },
704
722
{0 }
705
723
};
706
724
@@ -902,10 +920,19 @@ typevartuple_reduce_impl(typevartupleobject *self)
902
920
return PyUnicode_FromString (self -> name );
903
921
}
904
922
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
+
905
931
static PyMethodDef typevartuple_methods [] = {
906
932
TYPEVARTUPLE_TYPING_SUBST_METHODDEF
907
933
TYPEVARTUPLE_TYPING_PREPARE_SUBST_METHODDEF
908
934
TYPEVARTUPLE_REDUCE_METHODDEF
935
+ {"__mro_entries__" , typevartuple_mro_entries , METH_O },
909
936
{0 }
910
937
};
911
938
0 commit comments