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
e370c381
Kaydet (Commit)
e370c381
authored
Eyl 03, 2012
tarafından
Alexander Belopolsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #15855: added docstrings for memoryview methods and data descriptors (merge 3.2).
üst
3561901c
397e5c98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
10 deletions
+41
-10
memoryobject.c
Objects/memoryobject.c
+41
-10
No files found.
Objects/memoryobject.c
Dosyayı görüntüle @
e370c381
...
...
@@ -2861,27 +2861,58 @@ memory_contiguous(PyMemoryViewObject *self, PyObject *dummy)
return
PyBool_FromLong
(
MV_ANY_CONTIGUOUS
(
self
->
flags
));
}
PyDoc_STRVAR
(
memory_format_doc
,
"A string containing the format (in struct module style)
\n
"
" for each element in the view."
);
PyDoc_STRVAR
(
memory_itemsize_doc
,
"The size in bytes of each element of the memoryview."
);
PyDoc_STRVAR
(
memory_shape_doc
,
"A tuple of ndim integers giving the shape of the memory
\n
"
" as an N-dimensional array."
);
PyDoc_STRVAR
(
memory_strides_doc
,
"A tuple of ndim integers giving the size in bytes to access
\n
"
" each element for each dimension of the array."
);
PyDoc_STRVAR
(
memory_suboffsets_doc
,
"A tuple of integers used internally for PIL-style arrays."
);
PyDoc_STRVAR
(
memory_readonly_doc
,
"A bool indicating whether the memory is read only."
);
PyDoc_STRVAR
(
memory_ndim_doc
,
"An integer indicating how many dimensions of a multi-dimensional
\n
"
" array the memory represents."
);
static
PyGetSetDef
memory_getsetlist
[]
=
{
{
"obj"
,
(
getter
)
memory_obj_get
,
NULL
,
NULL
},
{
"nbytes"
,
(
getter
)
memory_nbytes_get
,
NULL
,
NULL
},
{
"readonly"
,
(
getter
)
memory_readonly_get
,
NULL
,
NULL
},
{
"itemsize"
,
(
getter
)
memory_itemsize_get
,
NULL
,
NULL
},
{
"format"
,
(
getter
)
memory_format_get
,
NULL
,
NULL
},
{
"ndim"
,
(
getter
)
memory_ndim_get
,
NULL
,
NULL
},
{
"shape"
,
(
getter
)
memory_shape_get
,
NULL
,
NULL
},
{
"strides"
,
(
getter
)
memory_strides_get
,
NULL
,
NULL
},
{
"suboffsets"
,
(
getter
)
memory_suboffsets_get
,
NULL
,
NULL
},
{
"readonly"
,
(
getter
)
memory_readonly_get
,
NULL
,
memory_readonly_doc
},
{
"itemsize"
,
(
getter
)
memory_itemsize_get
,
NULL
,
memory_itemsize_doc
},
{
"format"
,
(
getter
)
memory_format_get
,
NULL
,
memory_format_doc
},
{
"ndim"
,
(
getter
)
memory_ndim_get
,
NULL
,
memory_ndim_doc
},
{
"shape"
,
(
getter
)
memory_shape_get
,
NULL
,
memory_shape_doc
},
{
"strides"
,
(
getter
)
memory_strides_get
,
NULL
,
memory_strides_doc
},
{
"suboffsets"
,
(
getter
)
memory_suboffsets_get
,
NULL
,
memory_suboffsets_doc
},
{
"c_contiguous"
,
(
getter
)
memory_c_contiguous
,
NULL
,
NULL
},
{
"f_contiguous"
,
(
getter
)
memory_f_contiguous
,
NULL
,
NULL
},
{
"contiguous"
,
(
getter
)
memory_contiguous
,
NULL
,
NULL
},
{
NULL
,
NULL
,
NULL
,
NULL
},
};
PyDoc_STRVAR
(
memory_release_doc
,
"M.release() -> None
\n
\
\n
\
Release the underlying buffer exposed by the memoryview object."
);
PyDoc_STRVAR
(
memory_tobytes_doc
,
"M.tobytes() -> bytes
\n
\
\n
\
Return the data in the buffer as a byte string."
);
PyDoc_STRVAR
(
memory_tolist_doc
,
"M.tolist() -> list
\n
\
\n
\
Return the data in the buffer as a list of elements."
);
static
PyMethodDef
memory_methods
[]
=
{
{
"release"
,
(
PyCFunction
)
memory_release
,
METH_NOARGS
,
NULL
},
{
"tobytes"
,
(
PyCFunction
)
memory_tobytes
,
METH_NOARGS
,
NULL
},
{
"tolist"
,
(
PyCFunction
)
memory_tolist
,
METH_NOARGS
,
NULL
},
{
"release"
,
(
PyCFunction
)
memory_release
,
METH_NOARGS
,
memory_release_doc
},
{
"tobytes"
,
(
PyCFunction
)
memory_tobytes
,
METH_NOARGS
,
memory_tobytes_doc
},
{
"tolist"
,
(
PyCFunction
)
memory_tolist
,
METH_NOARGS
,
memory_tolist_doc
},
{
"cast"
,
(
PyCFunction
)
memory_cast
,
METH_VARARGS
|
METH_KEYWORDS
,
NULL
},
{
"__enter__"
,
memory_enter
,
METH_NOARGS
,
NULL
},
{
"__exit__"
,
memory_exit
,
METH_VARARGS
,
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