diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-02-08 15:00:52 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-02-08 15:00:52 (GMT) |
commit | 876185542d7d21701d8ee56af10ee88f6f8a516d (patch) | |
tree | 2fb003ab2dd5cfc2fdd4102c29930e6430d04281 /Objects/memoryobject.c | |
parent | f1ffeb598a2aa066125bbd314a072a623aa5a1c9 (diff) | |
download | cpython-876185542d7d21701d8ee56af10ee88f6f8a516d.zip cpython-876185542d7d21701d8ee56af10ee88f6f8a516d.tar.gz cpython-876185542d7d21701d8ee56af10ee88f6f8a516d.tar.bz2 |
remove memoryview.__str__ #5182
Diffstat (limited to 'Objects/memoryobject.c')
-rw-r--r-- | Objects/memoryobject.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index 0f7d71d..b19ea51 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -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 */ |