From db1ae5bfa21516e65c6eb1b34c19288418cbeffe Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Tue, 2 Jul 2024 15:06:28 +0800 Subject: [PATCH] Update py_list.c --- src/public/py_list.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/public/py_list.c b/src/public/py_list.c index 5c28db68..8f7e9c0b 100644 --- a/src/public/py_list.c +++ b/src/public/py_list.c @@ -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); -} \ No newline at end of file +} + +//////////////////////////////// +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; +}