You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
<p>There are two ways for a consumer of the buffer interface to acquire a buffer
233
233
over a target object:</p>
234
234
<ulclass="simple">
235
-
<li><p>call<aclass="reference internal"href="#c.PyObject_GetBuffer"title="PyObject_GetBuffer"><codeclass="xref c c-func docutils literal notranslate"><spanclass="pre">PyObject_GetBuffer()</span></code></a> with the right parameters;</p></li>
235
+
<li><p>以適當的參數呼叫<aclass="reference internal"href="#c.PyObject_GetBuffer"title="PyObject_GetBuffer"><codeclass="xref c c-func docutils literal notranslate"><spanclass="pre">PyObject_GetBuffer()</span></code></a>;</p></li>
236
236
<li><p>call<aclass="reference internal"href="arg.html#c.PyArg_ParseTuple"title="PyArg_ParseTuple"><codeclass="xref c c-func docutils literal notranslate"><spanclass="pre">PyArg_ParseTuple()</span></code></a> (or one of its siblings) with one of the
the contents of a single item. If this is<codeclass="docutils literal notranslate"><spanclass="pre">NULL</span></code>,<codeclass="docutils literal notranslate"><spanclass="pre">"B"</span></code> (unsigned bytes)
334
334
is assumed.</p>
335
-
<p>This field is controlled by the<aclass="reference internal"href="#c.PyBUF_FORMAT"title="PyBUF_FORMAT"><codeclass="xref c c-macro docutils literal notranslate"><spanclass="pre">PyBUF_FORMAT</span></code></a>flag.</p>
335
+
<p>此欄位受<aclass="reference internal"href="#c.PyBUF_FORMAT"title="PyBUF_FORMAT"><codeclass="xref c c-macro docutils literal notranslate"><spanclass="pre">PyBUF_FORMAT</span></code></a>旗標控制。</p>
<p>The logical structure of NumPy-style arrays is defined by<aclass="reference internal"href="#c.Py_buffer.itemsize"title="Py_buffer.itemsize"><codeclass="xref c c-member docutils literal notranslate"><spanclass="pre">itemsize</span></code></a>,
707
707
<aclass="reference internal"href="#c.Py_buffer.ndim"title="Py_buffer.ndim"><codeclass="xref c c-member docutils literal notranslate"><spanclass="pre">ndim</span></code></a>,<aclass="reference internal"href="#c.Py_buffer.shape"title="Py_buffer.shape"><codeclass="xref c c-member docutils literal notranslate"><spanclass="pre">shape</span></code></a> and<aclass="reference internal"href="#c.Py_buffer.strides"title="Py_buffer.strides"><codeclass="xref c c-member docutils literal notranslate"><spanclass="pre">strides</span></code></a>.</p>
708
708
<p>If<codeclass="docutils literal notranslate"><spanclass="pre">ndim</span><spanclass="pre">==</span><spanclass="pre">0</span></code>, the memory location pointed to by<aclass="reference internal"href="#c.Py_buffer.buf"title="Py_buffer.buf"><codeclass="xref c c-member docutils literal notranslate"><spanclass="pre">buf</span></code></a> is
<dd><emclass="stableabi"> 為<aclass="reference internal"href="stable.html#stable"><spanclass="std std-ref">穩定 ABI 的一部分</span></a> 自 3.11 版本開始.</em><p>Copy<em>len</em> bytes from<em>src</em> to its contiguous representation in<em>buf</em>.
852
852
<em>order</em> can be<codeclass="docutils literal notranslate"><spanclass="pre">'C'</span></code> or<codeclass="docutils literal notranslate"><spanclass="pre">'F'</span></code> or<codeclass="docutils literal notranslate"><spanclass="pre">'A'</span></code> (for C-style or Fortran-style
853
853
ordering or either one).<codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> is returned on success,<codeclass="docutils literal notranslate"><spanclass="pre">-1</span></code> on error.</p>
854
-
<p>This function fails if<em>len</em> !=<em>src->len</em>.</p>