mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
Added buffer_info() docs.
This commit is contained in:
parent
98046b90d0
commit
8f06247b51
2 changed files with 20 additions and 0 deletions
|
@ -60,6 +60,16 @@ The length in bytes of one array item in the internal representation.
|
||||||
Append a new item with value \var{x} to the end of the array.
|
Append a new item with value \var{x} to the end of the array.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
|
\begin{funcdesc}{buffer_info}{}
|
||||||
|
Return a tuple \code{(\var{address}, var{length})} giving the current
|
||||||
|
memory address and the length in bytes of the buffer used to hold
|
||||||
|
array's contents. This is occasionally useful when working with
|
||||||
|
low-level (and inherently unsafe) I/O interfaces that require memory
|
||||||
|
addresses, such as certain \code{ioctl} operations. The returned
|
||||||
|
numbers are valid as long as the array exists and no length-changing
|
||||||
|
operations are applied to it.
|
||||||
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{byteswap}{x}
|
\begin{funcdesc}{byteswap}{x}
|
||||||
``Byteswap'' all items of the array. This is only supported for
|
``Byteswap'' all items of the array. This is only supported for
|
||||||
integer values. It is useful when reading data from a file written
|
integer values. It is useful when reading data from a file written
|
||||||
|
|
|
@ -60,6 +60,16 @@ The length in bytes of one array item in the internal representation.
|
||||||
Append a new item with value \var{x} to the end of the array.
|
Append a new item with value \var{x} to the end of the array.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
|
\begin{funcdesc}{buffer_info}{}
|
||||||
|
Return a tuple \code{(\var{address}, var{length})} giving the current
|
||||||
|
memory address and the length in bytes of the buffer used to hold
|
||||||
|
array's contents. This is occasionally useful when working with
|
||||||
|
low-level (and inherently unsafe) I/O interfaces that require memory
|
||||||
|
addresses, such as certain \code{ioctl} operations. The returned
|
||||||
|
numbers are valid as long as the array exists and no length-changing
|
||||||
|
operations are applied to it.
|
||||||
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{byteswap}{x}
|
\begin{funcdesc}{byteswap}{x}
|
||||||
``Byteswap'' all items of the array. This is only supported for
|
``Byteswap'' all items of the array. This is only supported for
|
||||||
integer values. It is useful when reading data from a file written
|
integer values. It is useful when reading data from a file written
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue