Anti-registration of various ABC methods.

- Issue #25958: Support "anti-registration" of special methods from
  various ABCs, like __hash__, __iter__ or __len__.  All these (and
  several more) can be set to None in an implementation class and the
  behavior will be as if the method is not defined at all.
  (Previously, this mechanism existed only for __hash__, to make
  mutable classes unhashable.)  Code contributed by Andrew Barnert and
  Ivan Levkivskyi.
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index c458cfe..dae166d 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -250,6 +250,13 @@
         return NULL;
 
     reversed_meth = _PyObject_LookupSpecial(seq, &PyId___reversed__);
+    if (reversed_meth == Py_None) {
+        Py_DECREF(reversed_meth);
+        PyErr_Format(PyExc_TypeError,
+                     "'%.200s' object is not reversible",
+                     Py_TYPE(seq)->tp_name);
+        return NULL;
+    }
     if (reversed_meth != NULL) {
         PyObject *res = PyObject_CallFunctionObjArgs(reversed_meth, NULL);
         Py_DECREF(reversed_meth);
@@ -259,8 +266,9 @@
         return NULL;
 
     if (!PySequence_Check(seq)) {
-        PyErr_SetString(PyExc_TypeError,
-                        "argument to reversed() must be a sequence");
+        PyErr_Format(PyExc_TypeError,
+                     "'%.200s' object is not reversible",
+                     Py_TYPE(seq)->tp_name);
         return NULL;
     }