diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-06-25 00:02:38 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-06-25 00:02:38 (GMT) |
commit | 25e8ec47244b405083b5fe7b353560666cabff44 (patch) | |
tree | 2412de21beab51e376834501ddf8beb866b40df9 /Doc/c-api | |
parent | 21e09487ac9d4365819ae4de31319ae3df9a8b17 (diff) | |
download | cpython-25e8ec47244b405083b5fe7b353560666cabff44.zip cpython-25e8ec47244b405083b5fe7b353560666cabff44.tar.gz cpython-25e8ec47244b405083b5fe7b353560666cabff44.tar.bz2 |
Issue #8850: Remove "w" and "w#" formats from PyArg_Parse*() functions, use
"w*" format instead. Add tests for "w*" format.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/arg.rst | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst index 158397a..29d3368 100644 --- a/Doc/c-api/arg.rst +++ b/Doc/c-api/arg.rst @@ -150,21 +150,11 @@ Unless otherwise stated, buffers are not NUL-terminated. any conversion. Raises :exc:`TypeError` if the object is not a Unicode object. The C variable may also be declared as :ctype:`PyObject\*`. -``w`` (:class:`bytearray` or read-write character buffer) [char \*] - Similar to ``y``, but accepts any object which implements the read-write buffer - interface. The caller must determine the length of the buffer by other means, - or use ``w#`` instead. Only single-segment buffer objects are accepted; - :exc:`TypeError` is raised for all others. - ``w*`` (:class:`bytearray` or read-write byte-oriented buffer) [Py_buffer] - This is to ``w`` what ``y*`` is to ``y``. - -``w#`` (:class:`bytearray` or read-write character buffer) [char \*, int] - Like ``y#``, but accepts any object which implements the read-write buffer - interface. The :ctype:`char \*` variable is set to point to the first byte - of the buffer, and the :ctype:`int` is set to the length of the buffer. - Only single-segment buffer objects are accepted; :exc:`TypeError` is raised - for all others. + This format accepts any object which implements the read-write buffer + interface. It fills a :ctype:`Py_buffer` structure provided by the caller. + The buffer may contain embedded null bytes. The caller have to call + :cfunc:`PyBuffer_Release` when it is done with the buffer. ``es`` (:class:`str`) [const char \*encoding, char \*\*buffer] This variant on ``s`` is used for encoding Unicode into a character buffer. |