Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
87618554
Commit
87618554
authored
Feb 08, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove memoryview.__str__ #5182
parent
f1ffeb59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
17 deletions
+3
-17
Misc/NEWS
Misc/NEWS
+2
-0
Objects/memoryobject.c
Objects/memoryobject.c
+1
-17
No files found.
Misc/NEWS
View file @
87618554
...
...
@@ -12,6 +12,8 @@ What's New in Python 3.1 alpha 0
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
View file @
87618554
...
...
@@ -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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment