Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8779f64

Browse files
committed
Added descriptions of the t#, w, and w# PyArg_ParseTuple() format
characters; these are the ones for the buffer interface.
1 parent 7f1fdfc commit 8779f64

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Doc/ext/ext.tex

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,27 @@ \section{Format Strings for \cfunction{PyArg_ParseTuple()}
708708
Raises a \exception{TypeError} exception if the object is not a string
709709
object. The C variable may also be declared as \ctype{PyObject *}.
710710

711+
\item[\samp{t\#} (read-only character buffer) {[char *, int]}]
712+
Like \samp{s\#}, but accepts any object which implements the read-only
713+
buffer interface. The \ctype{char *} variable is set to point to the
714+
first byte of the buffer, and the \ctype{int} is set to the length of
715+
the buffer. Only single-segment buffer objects are accepted;
716+
\exception{TypeError} is raised for all others.
717+
718+
\item[\samp{w} (read-write character buffer) {[char *]}]
719+
Similar to \samp{s}, but accepts any object which implements the
720+
read-write buffer interface. The caller must determine the length of
721+
the buffer by other means, or use \samp{w\#} instead. Only
722+
single-segment buffer objects are accepted; \exception{TypeError} is
723+
raised for all others.
724+
725+
\item[\samp{w\#} (read-write character buffer) {[char *, int]}]
726+
Like \samp{s\#}, but accepts any object which implements the
727+
read-write buffer interface. The \ctype{char *} variable is set to
728+
point to the first byte of the buffer, and the \ctype{int} is set to
729+
the length of the buffer. Only single-segment buffer objects are
730+
accepted; \exception{TypeError} is raised for all others.
731+
711732
\item[\samp{(\var{items})} (tuple) {[\var{matching-items}]}]
712733
The object must be a Python sequence whose length is the number of
713734
format units in \var{items}. The C arguments must correspond to the

0 commit comments

Comments
 (0)