Pelokalan
Python ID
id en
Masuk
Proyek
c-api__buffer.po Berkas proyek · python-docs-id-3.14 · Bahasa Indonesia
Modul PO Hanya lihat
Teks sumber — English
Terjemahan — Bahasa Indonesia
Certain objects available in Python wrap access to an underlying memory array or *buffer*. Such objects include the built-in :class:`bytes` and :class:`bytearray`, and some extension types like :class:`array.array`. Third-party libraries may define their own types for special purposes, such as image processing or numeric analysis.
Objek tertentu yang tersedia dalam Python membungkus akses ke larik memori atau *buffer* yang mendasari. Objek tersebut termasuk built-in :class:`bytes` dan :class:`bytearray`, dan beberapa tipe ekstensi seperti :class:`array.array`. Pustaka pihak ketiga dapat menentukan jenisnya sendiri untuk tujuan khusus, seperti pemrosesan gambar atau analisis numerik.
All :c:type:`Py_buffer` fields are unambiguously defined by the request type.
:c:macro:`PyBUF_WRITABLE` can be \|'d to any of the flags in the next section. Since :c:macro:`PyBUF_SIMPLE` is defined as 0, :c:macro:`PyBUF_WRITABLE` can be used as a stand-alone flag to request a simple writable buffer.
All possible requests are fully defined by some combination of the flags in the previous section. For convenience, the buffer protocol provides frequently used combinations as single flags.
In the following table *U* stands for undefined contiguity. The consumer would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity.
The logical structure of NumPy-style arrays is defined by :c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer.shape` and :c:member:`~Py_buffer.strides`.
Return ``1`` if the memory defined by the *view* is C-style (*order* is ``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either one (*order* is ``'A'``). Return ``0`` otherwise. This function always succeeds.