mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
Update py_list.c
This commit is contained in:
parent
78390b8eb9
commit
894ef0a5b5
@ -244,9 +244,10 @@ static bool list__repr__(int argc, py_Ref argv) {
|
|||||||
static bool list_extend(int argc, py_Ref argv) {
|
static bool list_extend(int argc, py_Ref argv) {
|
||||||
PY_CHECK_ARGC(2);
|
PY_CHECK_ARGC(2);
|
||||||
List* self = py_touserdata(py_arg(0));
|
List* self = py_touserdata(py_arg(0));
|
||||||
PY_CHECK_ARG_TYPE(1, tp_list);
|
py_TValue* p;
|
||||||
List* other = py_touserdata(py_arg(1));
|
int length = pk_arrayview(py_arg(1), &p);
|
||||||
c11_vector__extend(py_TValue, self, other->data, other->length);
|
if(length == -1) return TypeError("extend() argument must be a list or tuple");
|
||||||
|
c11_vector__extend(py_TValue, self, p, length);
|
||||||
py_newnone(py_retval());
|
py_newnone(py_retval());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user