[Python-checkins] python/dist/src/Modules arraymodule.c,2.92,2.93
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Sat Mar 13 13:18:53 EST 2004
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5879/Modules
Modified Files:
arraymodule.c
Log Message:
SF bug #910986: copy.copy fails for array.array
Added support for the copy module.
Index: arraymodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/arraymodule.c,v
retrieving revision 2.92
retrieving revision 2.93
diff -C2 -d -r2.92 -r2.93
*** arraymodule.c 12 Oct 2003 19:09:36 -0000 2.92
--- arraymodule.c 13 Mar 2004 18:18:51 -0000 2.93
***************
*** 618,621 ****
--- 618,632 ----
static PyObject *
+ array_copy(arrayobject *a, PyObject *unused)
+ {
+ return array_slice(a, 0, a->ob_size);
+ }
+
+ PyDoc_STRVAR(copy_doc,
+ "copy(array)\n\
+ \n\
+ Return a copy of the array.");
+
+ static PyObject *
array_concat(arrayobject *a, PyObject *bb)
{
***************
*** 1410,1415 ****
--- 1421,1430 ----
{"byteswap", (PyCFunction)array_byteswap, METH_NOARGS,
byteswap_doc},
+ {"__copy__", (PyCFunction)array_copy, METH_NOARGS,
+ copy_doc},
{"count", (PyCFunction)array_count, METH_O,
count_doc},
+ {"__deepcopy__",(PyCFunction)array_copy, METH_NOARGS,
+ copy_doc},
{"extend", (PyCFunction)array_extend, METH_O,
extend_doc},
More information about the Python-checkins
mailing list