Add the PyBUF_CHARACTER flag to properly handle the CharBuffer case for at least the unicode type.

This commit is contained in:
Travis E. Oliphant 2007-08-12 06:19:14 +00:00
parent 827969e3d1
commit 10a3df9553
1 changed files with 8 additions and 1 deletions

View File

@ -193,6 +193,13 @@ without that information, then a ``PyErr_BufferError`` should be raised.
needs to be \|'d to the others. The exporter will raise an error if
it cannot provide such a contiguous buffer of bytes.
``PyBUF_CHARACTER``
This essentially replaces the separate function for getting a character
buffer (which is useful in at least the unicode type). If an object
should do something different when it is requested as a character
buffer then it should detect this flag and respond differently.
``PyBUF_REQ_WRITEABLE``
The returned buffer must be writeable. If it is not writeable,
@ -558,7 +565,7 @@ the base object for the returned memory view object.
The buffertype argument can be PyBUF_READ, PyBUF_WRITE,
PyBUF_UPDATEIFCOPY to determine whether the returned buffer should be
READONLY, WRITEABLE, or set to update the original buffer if a copy
readable, writeable, or set to update the original buffer if a copy
must be made. If buffertype is PyBUF_WRITE and the buffer is not
contiguous an error will be raised. In this circumstance, the user
can use PyBUF_UPDATEIFCOPY to ensure that a a writeable temporary