Benjamin Peterson avatar Benjamin Peterson committed 4313b4d

Merged revisions 69438 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
r69438 | benjamin.peterson | 2009-02-08 09:00:52 -0600 (Sun, 08 Feb 2009) | 1 line

remove memoryview.__str__ #5182
........

Comments (0)

Files changed (2)

 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

Objects/memoryobject.c

     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 */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.