Make int() and long() fall back to __trunc__(). See issue 2002.
diff --git a/Include/abstract.h b/Include/abstract.h
index b7fde09..e6cbb7b 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -761,6 +761,19 @@
PyAPI_FUNC(Py_ssize_t) PyNumber_AsSsize_t(PyObject *o, PyObject *exc);
/*
+ Returns the Integral instance converted to an int. The
+ instance is expected to be int or long or have an __int__
+ method. Steals integral's reference. error_format will be
+ used to create the TypeError if integral isn't actually an
+ Integral instance. error_format should be a format string
+ that can accept a char* naming integral's type.
+ */
+
+ PyAPI_FUNC(PyObject *) _PyNumber_ConvertIntegralToInt(
+ PyObject *integral,
+ const char* error_format);
+
+ /*
Returns the object converted to Py_ssize_t by going through
PyNumber_Index first. If an overflow error occurs while
converting the int-or-long to Py_ssize_t, then the second argument