Of course, you are right. But the Cython code seems to convert it to python and back again, since it isn't aware of doing the conversion from double to ssize_t directly. You must explicitly cast `<Py_ssize_t>`.