Update py_list.c

This commit is contained in:
blueloveTH 2024-07-02 15:06:28 +08:00
parent 8319cb2ad4
commit db1ae5bfa2

View File

@ -64,4 +64,12 @@ void py_list__clear(py_Ref self) {
void py_list__insert(py_Ref self, int i, const py_Ref val) {
List* userdata = py_touserdata(self);
c11_vector__insert(py_TValue, userdata, i, *val);
}
}
////////////////////////////////
bool _py_list__len__(int argc, py_Ref argv){
py_checkargc(1);
py_i64 res = py_list__len(py_arg(0));
py_newint(py_retval(), res);
return true;
}