mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Remove the simple slicing API. All slicing is now done with slice objects.
This commit is contained in:
parent
582b586617
commit
d2cf20eea2
32 changed files with 78 additions and 810 deletions
|
@ -520,22 +520,6 @@ proxy_dealloc(PyWeakReference *self)
|
|||
|
||||
/* sequence slots */
|
||||
|
||||
static PyObject *
|
||||
proxy_slice(PyWeakReference *proxy, Py_ssize_t i, Py_ssize_t j)
|
||||
{
|
||||
if (!proxy_checkref(proxy))
|
||||
return NULL;
|
||||
return PySequence_GetSlice(PyWeakref_GET_OBJECT(proxy), i, j);
|
||||
}
|
||||
|
||||
static int
|
||||
proxy_ass_slice(PyWeakReference *proxy, Py_ssize_t i, Py_ssize_t j, PyObject *value)
|
||||
{
|
||||
if (!proxy_checkref(proxy))
|
||||
return -1;
|
||||
return PySequence_SetSlice(PyWeakref_GET_OBJECT(proxy), i, j, value);
|
||||
}
|
||||
|
||||
static int
|
||||
proxy_contains(PyWeakReference *proxy, PyObject *value)
|
||||
{
|
||||
|
@ -628,9 +612,9 @@ static PySequenceMethods proxy_as_sequence = {
|
|||
0, /*sq_concat*/
|
||||
0, /*sq_repeat*/
|
||||
0, /*sq_item*/
|
||||
(ssizessizeargfunc)proxy_slice, /*sq_slice*/
|
||||
0, /*sq_slice*/
|
||||
0, /*sq_ass_item*/
|
||||
(ssizessizeobjargproc)proxy_ass_slice, /*sq_ass_slice*/
|
||||
0, /*sq_ass_slice*/
|
||||
(objobjproc)proxy_contains, /* sq_contains */
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue