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
5e19e444
Kaydet (Commit)
5e19e444
authored
Eyl 10, 2008
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
kill memoryview.size in favor of len(view)
Reviewer: Antoine Pitrou #3827
üst
2409dc79
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
12 deletions
+5
-12
stdtypes.rst
Doc/library/stdtypes.rst
+2
-4
test_memoryview.py
Lib/test/test_memoryview.py
+1
-1
NEWS
Misc/NEWS
+2
-0
memoryobject.c
Objects/memoryobject.c
+0
-7
No files found.
Doc/library/stdtypes.rst
Dosyayı görüntüle @
5e19e444
...
...
@@ -2246,6 +2246,8 @@ simple bytes or complex data structures.
buffer protocol. Builtin objects that support the buffer protocol include
:class:`bytes` and :class:`bytearray`.
``len(view)`` returns the total number of bytes in the memoryview, *view*.
A :class:`memoryview` supports slicing to expose its data. Taking a single
index will return a single byte. Full slicing will result in a subview::
...
...
@@ -2322,10 +2324,6 @@ simple bytes or complex data structures.
A tuple of integers the length of :attr:`ndim` giving the size in bytes to
access each element for each dimension of the array.
.. attribute:: size
The number of bytes in the buffer. Also available as ``len(view)``.
.. memoryview.suboffsets isn't documented because it only seems useful for C
...
...
Lib/test/test_memoryview.py
Dosyayı görüntüle @
5e19e444
...
...
@@ -146,7 +146,7 @@ class CommonMemoryTests:
self
.
assertEquals
(
m
.
itemsize
,
1
)
self
.
assertEquals
(
m
.
ndim
,
1
)
self
.
assertEquals
(
m
.
shape
,
(
6
,))
self
.
assertEquals
(
m
.
size
,
6
)
self
.
assertEquals
(
len
(
m
)
,
6
)
self
.
assertEquals
(
m
.
strides
,
(
1
,))
self
.
assertEquals
(
m
.
suboffsets
,
None
)
return
m
...
...
Misc/NEWS
Dosyayı görüntüle @
5e19e444
...
...
@@ -12,6 +12,8 @@ What's New in Python 3.0 release candidate 1
Core and Builtins
-----------------
- Issue #3827: memoryview lost its size attribute in favor of using len(view).
- Issue #3813: could not lanch python.exe via symbolic link on cygwin.
- Issue #3705: fix crash when given a non-ascii value on the command line for
...
...
Objects/memoryobject.c
Dosyayı görüntüle @
5e19e444
...
...
@@ -369,12 +369,6 @@ memory_suboffsets_get(PyMemoryViewObject *self)
return
_IntTupleFromSsizet
(
self
->
view
.
ndim
,
self
->
view
.
suboffsets
);
}
static
PyObject
*
memory_size_get
(
PyMemoryViewObject
*
self
)
{
return
PyLong_FromSsize_t
(
self
->
view
.
len
);
}
static
PyObject
*
memory_readonly_get
(
PyMemoryViewObject
*
self
)
{
...
...
@@ -393,7 +387,6 @@ static PyGetSetDef memory_getsetlist[] ={
{
"shape"
,
(
getter
)
memory_shape_get
,
NULL
,
NULL
},
{
"strides"
,
(
getter
)
memory_strides_get
,
NULL
,
NULL
},
{
"suboffsets"
,
(
getter
)
memory_suboffsets_get
,
NULL
,
NULL
},
{
"size"
,
(
getter
)
memory_size_get
,
NULL
,
NULL
},
{
"readonly"
,
(
getter
)
memory_readonly_get
,
NULL
,
NULL
},
{
"ndim"
,
(
getter
)
memory_ndim_get
,
NULL
,
NULL
},
{
NULL
,
NULL
,
NULL
,
NULL
},
...
...
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