merge heads
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 5759eff..3051e57 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -1770,6 +1770,7 @@
             ("__format__", format, format_impl, set(), {}),
             ("__floor__", math.floor, zero, set(), {}),
             ("__trunc__", math.trunc, zero, set(), {}),
+            ("__trunc__", int, zero, set(), {}),
             ("__ceil__", math.ceil, zero, set(), {}),
             ("__dir__", dir, empty_seq, set(), {}),
             ]
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 39dffac..924ccd1 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1325,16 +1325,10 @@
 PyNumber_Long(PyObject *o)
 {
     PyNumberMethods *m;
-    static PyObject *trunc_name = NULL;
     PyObject *trunc_func;
     const char *buffer;
     Py_ssize_t buffer_len;
-
-    if (trunc_name == NULL) {
-        trunc_name = PyUnicode_InternFromString("__trunc__");
-        if (trunc_name == NULL)
-            return NULL;
-    }
+    _Py_IDENTIFIER(__trunc__);
 
     if (o == NULL)
         return null_error();
@@ -1356,7 +1350,7 @@
     }
     if (PyLong_Check(o)) /* An int subclass without nb_int */
         return _PyLong_Copy((PyLongObject *)o);
-    trunc_func = PyObject_GetAttr(o, trunc_name);
+    trunc_func = _PyObject_LookupSpecial(o, &PyId___trunc__);
     if (trunc_func) {
         PyObject *truncated = PyEval_CallObject(trunc_func, NULL);
         PyObject *int_instance;
@@ -1368,7 +1362,8 @@
             "__trunc__ returned non-Integral (type %.200s)");
         return int_instance;
     }
-    PyErr_Clear();  /* It's not an error if  o.__trunc__ doesn't exist. */
+    if (PyErr_Occurred())
+        return NULL;
 
     if (PyBytes_Check(o))
         /* need to do extra error checking that PyLong_FromString()
@@ -2411,10 +2406,8 @@
 
 /* isinstance(), issubclass() */
 
-/* abstract_get_bases() has logically 4 return states, with a sort of 0th
- * state that will almost never happen.
+/* abstract_get_bases() has logically 4 return states:
  *
- * 0. creating the __bases__ static string could get a MemoryError
  * 1. getattr(cls, '__bases__') could raise an AttributeError
  * 2. getattr(cls, '__bases__') could raise some other exception
  * 3. getattr(cls, '__bases__') could return a tuple
@@ -2440,16 +2433,11 @@
 static PyObject *
 abstract_get_bases(PyObject *cls)
 {
-    static PyObject *__bases__ = NULL;
+    _Py_IDENTIFIER(__bases__);
     PyObject *bases;
 
-    if (__bases__ == NULL) {
-        __bases__ = PyUnicode_InternFromString("__bases__");
-        if (__bases__ == NULL)
-            return NULL;
-    }
     Py_ALLOW_RECURSION
-    bases = PyObject_GetAttr(cls, __bases__);
+    bases = _PyObject_GetAttrId(cls, &PyId___bases__);
     Py_END_ALLOW_RECURSION
     if (bases == NULL) {
         if (PyErr_ExceptionMatches(PyExc_AttributeError))
@@ -2519,19 +2507,13 @@
 recursive_isinstance(PyObject *inst, PyObject *cls)
 {
     PyObject *icls;
-    static PyObject *__class__ = NULL;
     int retval = 0;
-
-    if (__class__ == NULL) {
-        __class__ = PyUnicode_InternFromString("__class__");
-        if (__class__ == NULL)
-            return -1;
-    }
+    _Py_IDENTIFIER(__class__);
 
     if (PyType_Check(cls)) {
         retval = PyObject_TypeCheck(inst, (PyTypeObject *)cls);
         if (retval == 0) {
-            PyObject *c = PyObject_GetAttr(inst, __class__);
+            PyObject *c = _PyObject_GetAttrId(inst, &PyId___class__);
             if (c == NULL) {
                 if (PyErr_ExceptionMatches(PyExc_AttributeError))
                     PyErr_Clear();
@@ -2552,7 +2534,7 @@
         if (!check_class(cls,
             "isinstance() arg 2 must be a type or tuple of types"))
             return -1;
-        icls = PyObject_GetAttr(inst, __class__);
+        icls = _PyObject_GetAttrId(inst, &PyId___class__);
         if (icls == NULL) {
             if (PyErr_ExceptionMatches(PyExc_AttributeError))
                 PyErr_Clear();
diff --git a/Python/ceval.c b/Python/ceval.c
index 5498056..4182378 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1837,10 +1837,11 @@
             if (PyGen_CheckExact(x)) {
                 retval = _PyGen_Send((PyGenObject *)x, u);
             } else {
+                _Py_IDENTIFIER(send);
                 if (u == Py_None)
                     retval = PyIter_Next(x);
                 else
-                    retval = PyObject_CallMethod(x, "send", "O", u);
+                    retval = _PyObject_CallMethodId(x, &PyId_send, "O", u);
             }
             Py_DECREF(u);
             if (!retval) {