replace PyPtr<'p, PyObject<'p>> with PyObject<'p> Borrowed python pointers stay &PyObject<'p>. Note: this means the internal representation of borrowed python pointers changes from "*mut PyObject" to "&*mut PyObject".