Core and Builtins
-----------------
+- Issue #5182: Removed memoryview.__str__.
+
- Issue #1717: Removed builtin cmp() function, dropped tp_compare
slot, the C API functions PyObject_Compare and PyUnicode_Compare and
the type definition cmpfunc. The tp_compare slot has been renamed
return PyUnicode_FromFormat("<memory at %p>", self);
}
-
-static PyObject *
-memory_str(PyMemoryViewObject *self)
-{
- Py_buffer view;
- PyObject *res;
-
- if (PyObject_GetBuffer((PyObject *)self, &view, PyBUF_FULL) < 0)
- return NULL;
-
- res = PyBytes_FromStringAndSize(NULL, view.len);
- PyBuffer_ToContiguous(PyBytes_AS_STRING(res), &view, view.len, 'C');
- PyBuffer_Release(&view);
- return res;
-}
-
/* Sequence methods */
static Py_ssize_t
memory_length(PyMemoryViewObject *self)
&memory_as_mapping, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
- (reprfunc)memory_str, /* tp_str */
+ 0, /* tp_str */
PyObject_GenericGetAttr, /* tp_getattro */
0, /* tp_setattro */
&memory_as_buffer, /* tp_as_buffer */