8000 Delete now-unused static function Array_ass_slice(). · python/cpython@3f6d44e · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f6d44e

Browse files
committed
Delete now-unused static function Array_ass_slice().
1 parent 85ac28d commit 3f6d44e

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

Modules/_ctypes/_ctypes.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3832,48 +3832,6 @@ Array_ass_item(PyObject *_self, Py_ssize_t index, PyObject *value)
38323832
index, size, ptr);
38333833
}
38343834

3835-
static int
3836-
Array_ass_slice(PyObject *_self, Py_ssize_t ilow, Py_ssize_t ihigh, PyObject *value)
3837-
{
3838-
CDataObject *self = (CDataObject *)_self;
3839-
Py_ssize_t i, len;
3840-
3841-
if (value == NULL) {
3842-
PyErr_SetString(PyExc_TypeError,
3843-
"Array does not support item deletion");
3844-
return -1;
3845-
}
3846-
3847-
if (ilow < 0)
3848-
ilow = 0;
3849-
else if (ilow > self->b_length)
3850-
ilow = self->b_length;
3851-
if (ihigh < 0)
3852-
ihigh = 0;
3853-
if (ihigh < ilow)
3854-
ihigh = ilow;
3855-
else if (ihigh > self->b_length)
3856-
ihigh = self->b_length;
3857-
3858-
len = PySequence_Length(value);
3859-
if (len != ihigh - ilow) {
3860-
PyErr_SetString(PyExc_ValueError,
3861-
"Can only assign sequence of same size");
3862-
return -1;
3863-
}
3864-
for (i = 0; i < len; i++) {
3865-
PyObject *item = PySequence_GetItem(value, i);
3866-
int result;
3867-
if (item == NULL)
3868-
return -1;
3869-
result = Array_ass_item(_self, i+ilow, item);
3870-
Py_DECREF(item);
3871-
if (result == -1)
3872-
return -1;
3873-
}
3874-
return 0;
3875-
}
3876-
38773835
static int
38783836
Array_ass_subscript(PyObject *_self, PyObject *item, PyObject *value)
38793837
{

0 commit comments

Comments
 (0)
0