[Python-checkins] r69439 - in python/branches/release30-maint: Misc/NEWS Objects/memoryobject.c

benjamin.peterson python-checkins at python.org
Sun Feb 8 16:07:39 CET 2009


Author: benjamin.peterson
Date: Sun Feb  8 16:07:39 2009
New Revision: 69439

Log:
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
........


Modified:
   python/branches/release30-maint/   (props changed)
   python/branches/release30-maint/Misc/NEWS
   python/branches/release30-maint/Objects/memoryobject.c

Modified: python/branches/release30-maint/Misc/NEWS
==============================================================================
--- python/branches/release30-maint/Misc/NEWS	(original)
+++ python/branches/release30-maint/Misc/NEWS	Sun Feb  8 16:07:39 2009
@@ -12,6 +12,8 @@
 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

Modified: python/branches/release30-maint/Objects/memoryobject.c
==============================================================================
--- python/branches/release30-maint/Objects/memoryobject.c	(original)
+++ python/branches/release30-maint/Objects/memoryobject.c	Sun Feb  8 16:07:39 2009
@@ -498,22 +498,6 @@
     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 @@
     &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 */


More information about the Python-checkins mailing list