Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address code review
  • Loading branch information
corona10 committed Jan 13, 2024
commit 8281e5a0b648db1520c720c11bde693eda26c045
25 changes: 23 additions & 2 deletions Objects/clinic/listobject.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions Objects/listobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,19 +849,21 @@ py_list_clear_impl(PyListObject *self)
}

/*[clinic input]
@critical_section
list.copy

Return a shallow copy of the list.
[clinic start generated code]*/

static PyObject *
list_copy_impl(PyListObject *self)
/*[clinic end generated code: output=ec6b72d6209d418e input=6453ab159e84771f]*/
/*[clinic end generated code: output=ec6b72d6209d418e input=81c54b0c7bb4f73d]*/
{
return list_slice(self, 0, Py_SIZE(self));
}

/*[clinic input]
@critical_section
list.append

object: object
Expand All @@ -871,8 +873,8 @@ Append object to the end of the list.
[clinic start generated code]*/

static PyObject *
list_append(PyListObject *self, PyObject *object)
/*[clinic end generated code: output=7c096003a29c0eae input=43a3fe48a7066e91]*/
list_append_impl(PyListObject *self, PyObject *object)
/*[clinic end generated code: output=78423561d92ed405 input=122b0853de54004f]*/
{
if (_PyList_AppendTakeRef(self, Py_NewRef(object)) < 0) {
return NULL;
Expand Down Expand Up @@ -2655,7 +2657,7 @@ PyList_AsTuple(PyObject *v)
PyObject *ret;
PyListObject *self = (PyListObject *)v;
Comment thread
corona10 marked this conversation as resolved.
Py_BEGIN_CRITICAL_SECTION(self);
ret = _PyTuple_FromArray(((PyListObject *)v)->ob_item, Py_SIZE(v));
ret = _PyTuple_FromArray(self->ob_item, Py_SIZE(v));
Py_END_CRITICAL_SECTION();
return ret;
}
Expand Down