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
a0f169cd
Kaydet (Commit)
a0f169cd
authored
Eki 02, 2013
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Close #19078: memoryview now supports reversed
Patch by Claudiu Popa
üst
dff9e253
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
test_memoryview.py
Lib/test/test_memoryview.py
+9
-0
NEWS
Misc/NEWS
+4
-0
memoryobject.c
Objects/memoryobject.c
+1
-1
No files found.
Lib/test/test_memoryview.py
Dosyayı görüntüle @
a0f169cd
...
@@ -352,6 +352,15 @@ class AbstractMemoryTests:
...
@@ -352,6 +352,15 @@ class AbstractMemoryTests:
self
.
assertIs
(
wr
(),
None
)
self
.
assertIs
(
wr
(),
None
)
self
.
assertIs
(
L
[
0
],
b
)
self
.
assertIs
(
L
[
0
],
b
)
def
test_reversed
(
self
):
for
tp
in
self
.
_types
:
b
=
tp
(
self
.
_source
)
m
=
self
.
_view
(
b
)
aslist
=
list
(
reversed
(
m
.
tolist
()))
self
.
assertEqual
(
list
(
reversed
(
m
)),
aslist
)
self
.
assertEqual
(
list
(
reversed
(
m
)),
list
(
m
[::
-
1
]))
# Variations on source objects for the buffer: bytes-like objects, then arrays
# Variations on source objects for the buffer: bytes-like objects, then arrays
# with itemsize > 1.
# with itemsize > 1.
# NOTE: support for multi-dimensional objects is unimplemented.
# NOTE: support for multi-dimensional objects is unimplemented.
...
...
Misc/NEWS
Dosyayı görüntüle @
a0f169cd
...
@@ -10,6 +10,10 @@ Projected release date: 2013-10-20
...
@@ -10,6 +10,10 @@ Projected release date: 2013-10-20
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #19078: memoryview now correctly supports the reversed builtin
(Patch by Claudiu Popa)
Library
Library
-------
-------
...
...
Objects/memoryobject.c
Dosyayı görüntüle @
a0f169cd
...
@@ -2402,7 +2402,7 @@ static PyMappingMethods memory_as_mapping = {
...
@@ -2402,7 +2402,7 @@ static PyMappingMethods memory_as_mapping = {
/* As sequence */
/* As sequence */
static
PySequenceMethods
memory_as_sequence
=
{
static
PySequenceMethods
memory_as_sequence
=
{
0
,
/* sq_length */
(
lenfunc
)
memory_length
,
/* sq_length */
0
,
/* sq_concat */
0
,
/* sq_concat */
0
,
/* sq_repeat */
0
,
/* sq_repeat */
(
ssizeargfunc
)
memory_item
,
/* sq_item */
(
ssizeargfunc
)
memory_item
,
/* sq_item */
...
...
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