Py_CLEAR assigns its argument to a PyObject pointer without a cast. This causes a warning if the argument is PyObject- compatible but not actually a PyObject. The other reference counting macros accept non-PyObjects without a cast by the user, so Py_CLEAR should too. The patch is hard to read since it realigns the backslashes on the macro. diff -b (ignore whitespace) is good in these cases.