Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
3aa82c07
Kaydet (Commit)
3aa82c07
authored
Mar 13, 2004
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SF bug #910986: copy.copy fails for array.array
Added support for the copy module.
üst
42bec93e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
test_array.py
Lib/test/test_array.py
+7
-0
NEWS
Misc/NEWS
+2
-0
arraymodule.c
Modules/arraymodule.c
+15
-0
No files found.
Lib/test/test_array.py
Dosyayı görüntüle @
3aa82c07
...
@@ -73,6 +73,13 @@ class BaseTest(unittest.TestCase):
...
@@ -73,6 +73,13 @@ class BaseTest(unittest.TestCase):
b
.
byteswap
()
b
.
byteswap
()
self
.
assertEqual
(
a
,
b
)
self
.
assertEqual
(
a
,
b
)
def
test_copy
(
self
):
import
copy
a
=
array
.
array
(
self
.
typecode
,
self
.
example
)
b
=
copy
.
copy
(
a
)
self
.
assertNotEqual
(
id
(
a
),
id
(
b
))
self
.
assertEqual
(
a
,
b
)
def
test_insert
(
self
):
def
test_insert
(
self
):
a
=
array
.
array
(
self
.
typecode
,
self
.
example
)
a
=
array
.
array
(
self
.
typecode
,
self
.
example
)
a
.
insert
(
0
,
self
.
example
[
0
])
a
.
insert
(
0
,
self
.
example
[
0
])
...
...
Misc/NEWS
Dosyayı görüntüle @
3aa82c07
...
@@ -180,6 +180,8 @@ Core and builtins
...
@@ -180,6 +180,8 @@ Core and builtins
Extension modules
Extension modules
-----------------
-----------------
- array objects now support the copy module
- cStringIO.writelines() now accepts any iterable argument and writes
- cStringIO.writelines() now accepts any iterable argument and writes
the lines one at a time rather than joining them and writing once.
the lines one at a time rather than joining them and writing once.
Made a parallel change to StringIO.writelines(). Saves memory and
Made a parallel change to StringIO.writelines(). Saves memory and
...
...
Modules/arraymodule.c
Dosyayı görüntüle @
3aa82c07
...
@@ -616,6 +616,17 @@ array_slice(arrayobject *a, int ilow, int ihigh)
...
@@ -616,6 +616,17 @@ array_slice(arrayobject *a, int ilow, int ihigh)
return
(
PyObject
*
)
np
;
return
(
PyObject
*
)
np
;
}
}
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
*
static
PyObject
*
array_concat
(
arrayobject
*
a
,
PyObject
*
bb
)
array_concat
(
arrayobject
*
a
,
PyObject
*
bb
)
{
{
...
@@ -1409,8 +1420,12 @@ PyMethodDef array_methods[] = {
...
@@ -1409,8 +1420,12 @@ PyMethodDef array_methods[] = {
buffer_info_doc
},
buffer_info_doc
},
{
"byteswap"
,
(
PyCFunction
)
array_byteswap
,
METH_NOARGS
,
{
"byteswap"
,
(
PyCFunction
)
array_byteswap
,
METH_NOARGS
,
byteswap_doc
},
byteswap_doc
},
{
"__copy__"
,
(
PyCFunction
)
array_copy
,
METH_NOARGS
,
copy_doc
},
{
"count"
,
(
PyCFunction
)
array_count
,
METH_O
,
{
"count"
,
(
PyCFunction
)
array_count
,
METH_O
,
count_doc
},
count_doc
},
{
"__deepcopy__"
,(
PyCFunction
)
array_copy
,
METH_NOARGS
,
copy_doc
},
{
"extend"
,
(
PyCFunction
)
array_extend
,
METH_O
,
{
"extend"
,
(
PyCFunction
)
array_extend
,
METH_O
,
extend_doc
},
extend_doc
},
{
"fromfile"
,
(
PyCFunction
)
array_fromfile
,
METH_VARARGS
,
{
"fromfile"
,
(
PyCFunction
)
array_fromfile
,
METH_VARARGS
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment