]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 69438 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Sun, 8 Feb 2009 15:07:39 +0000 (15:07 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sun, 8 Feb 2009 15:07:39 +0000 (15:07 +0000)
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
........

Misc/NEWS
Objects/memoryobject.c

index c72642b08d07e2bedc5eeb118c5df107b68dfca0..7267172ba4c13557f30a569e0e4b175f1beaf7a6 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 3.0.1?
 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
index 0f7d71d006aa580aa3b24c747dd63570385bde7d..b19ea51a6a428011b13d3792771e0270dc4e03a9 100644 (file)
@@ -498,22 +498,6 @@ memory_repr(PyMemoryViewObject *self)
     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)
@@ -812,7 +796,7 @@ PyTypeObject PyMemoryView_Type = {
     &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 */