We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 647d10d commit cf2eefdCopy full SHA for cf2eefd
mypyc/lib-rt/list_ops.c
@@ -29,6 +29,14 @@ PyObject *CPyList_Build(Py_ssize_t len, ...) {
29
return res;
30
}
31
32
+PyObject *CPyList_Copy(PyObject *list) {
33
+ if(PyList_CheckExact(list)) {
34
+ return PyList_GetSlice(list, 0, PyList_GET_SIZE(list));
35
+ }
36
+ _Py_IDENTIFIER(copy);
37
+ return _PyObject_CallMethodIdNoArgs(list, &PyID_copy);
38
+}
39
+
40
PyObject *CPyList_GetItemUnsafe(PyObject *list, CPyTagged index) {
41
Py_ssize_t n = CPyTagged_ShortAsSsize_t(index);
42
PyObject *result = PyList_GET_ITEM(list, n);
0 commit comments