make the constant names match the py3k branch reality
This commit is contained in:
parent
1dcb3fa928
commit
76e4916286
34
pep-3118.txt
34
pep-3118.txt
|
@ -200,12 +200,12 @@ without that information, then a ``PyErr_BufferError`` should be raised.
|
|||
should do something different when it is requested as a character
|
||||
buffer then it should detect this flag and respond differently.
|
||||
|
||||
``PyBUF_REQ_WRITEABLE``
|
||||
``PyBUF_WRITEABLE``
|
||||
|
||||
The returned buffer must be writeable. If it is not writeable,
|
||||
then raise an error.
|
||||
|
||||
``PyBUF_REQ_LOCKDATA``
|
||||
``PyBUF_LOCKDATA``
|
||||
|
||||
The returned buffer must be readonly. If the object is already
|
||||
read-only or it can make its memory read-only (and there are no
|
||||
|
@ -214,7 +214,7 @@ without that information, then a ``PyErr_BufferError`` should be raised.
|
|||
read-only memory (or cannot make it read-only), then an error
|
||||
should be raised.
|
||||
|
||||
``PyBUF_REQ_FORMAT``
|
||||
``PyBUF_FORMAT``
|
||||
|
||||
The returned buffer must have true format information if this flag
|
||||
is provided. This would be used when the consumer is going to be
|
||||
|
@ -239,9 +239,9 @@ without that information, then a ``PyErr_BufferError`` should be raised.
|
|||
an error if cannot provide a strided-only representation of the
|
||||
data (i.e. without the suboffsets).
|
||||
|
||||
| ``PyBUF_REQ_C_CONTIGUOUS``
|
||||
| ``PyBUF_REQ_F_CONTIGUOUS``
|
||||
| ``PyBUF_REQ_ANY_CONTIGUOUS``
|
||||
| ``PyBUF_C_CONTIGUOUS``
|
||||
| ``PyBUF_F_CONTIGUOUS``
|
||||
| ``PyBUF_ANY_CONTIGUOUS``
|
||||
|
||||
These flags indicate that the returned buffer must be respectively,
|
||||
C-contiguous (last dimension varies the fastest), Fortran
|
||||
|
@ -262,34 +262,34 @@ Specialized combinations of flags for specific kinds of memory_sharing.
|
|||
|
||||
Multi-dimensional (but contiguous)
|
||||
|
||||
| ``PyBUF_CONTIG`` (``PyBUF_ALW_ND | PyBUF_REQ_WRITEABLE``)
|
||||
| ``PyBUF_CONTIG`` (``PyBUF_ALW_ND | PyBUF_WRITEABLE``)
|
||||
| ``PyBUF_CONTIG_RO`` (``PyBUF_ALW_ND``)
|
||||
| ``PyBUF_CONTIG_LCK`` (``PyBUF_ALW_ND | PyBUF_REQ_LOCKDATA``)
|
||||
| ``PyBUF_CONTIG_LCK`` (``PyBUF_ALW_ND | PyBUF_LOCKDATA``)
|
||||
|
||||
Multi-dimensional using strides but aligned
|
||||
|
||||
| ``PyBUF_STRIDED`` (``PyBUF_ALW_STRIDES | PyBUF_REQ_WRITEABLE``)
|
||||
| ``PyBUF_STRIDED`` (``PyBUF_ALW_STRIDES | PyBUF_WRITEABLE``)
|
||||
| ``PyBUF_STRIDED_RO`` (``PyBUF_ALW_STRIDES``)
|
||||
| ``PyBUF_STRIDED_LCK`` (``PyBUF_ALW_STRIDES | PyBUF_REQ_LOCKDATA``)
|
||||
| ``PyBUF_STRIDED_LCK`` (``PyBUF_ALW_STRIDES | PyBUF_LOCKDATA``)
|
||||
|
||||
Multi-dimensional using strides and not necessarily aligned
|
||||
|
||||
| ``PyBUF_RECORDS`` (``PyBUF_ALW_STRIDES | PyBUF_REQ_WRITEABLE | PyBUF_REQ_FORMAT``)
|
||||
| ``PyBUF_RECORDS_RO`` (``PyBUF_ALW_STRIDES | PyBUF_REQ_FORMAT``)
|
||||
| ``PyBUF_RECORDS_LCK`` (``PyBUF_ALW_STRIDES | PyBUF_REQ_LOCKDATA | PyBUF_REQ_FORMAT``)
|
||||
| ``PyBUF_RECORDS`` (``PyBUF_ALW_STRIDES | PyBUF_WRITEABLE | PyBUF_FORMAT``)
|
||||
| ``PyBUF_RECORDS_RO`` (``PyBUF_ALW_STRIDES | PyBUF_FORMAT``)
|
||||
| ``PyBUF_RECORDS_LCK`` (``PyBUF_ALW_STRIDES | PyBUF_LOCKDATA | PyBUF_FORMAT``)
|
||||
|
||||
Multi-dimensional using sub-offsets
|
||||
|
||||
| ``PyBUF_FULL`` (``PyBUF_ALW_INDIRECT | PyBUF_REQ_WRITEABLE | PyBUF_REQ_FORMAT``)
|
||||
| ``PyBUF_FULL_RO`` (``PyBUF_ALW_INDIRECT | PyBUF_REQ_FORMAT``)
|
||||
| ``PyBUF_FULL_LCK`` (``PyBUF_ALW_INDIRECT | PyBUF_REQ_LOCKDATA | PyBUF_REQ_FORMAT``)
|
||||
| ``PyBUF_FULL`` (``PyBUF_ALW_INDIRECT | PyBUF_WRITEABLE | PyBUF_FORMAT``)
|
||||
| ``PyBUF_FULL_RO`` (``PyBUF_ALW_INDIRECT | PyBUF_FORMAT``)
|
||||
| ``PyBUF_FULL_LCK`` (``PyBUF_ALW_INDIRECT | PyBUF_LOCKDATA | PyBUF_FORMAT``)
|
||||
|
||||
Thus, the consumer simply wanting a contiguous chunk of bytes from
|
||||
the object would use ``PyBUF_SIMPLE``, while a consumer that understands
|
||||
how to make use of the most complicated cases could use ``PyBUF_FULL``.
|
||||
|
||||
The format information is only guaranteed to be non-NULL if
|
||||
``PyBUF_REQ_FORMAT`` is in the flag argument, otherwise it is expected the
|
||||
``PyBUF_FORMAT`` is in the flag argument, otherwise it is expected the
|
||||
consumer will assume unsigned bytes.
|
||||
|
||||
There is a C-API that simple exporting objects can use to fill-in the
|
||||
|
|
Loading…
Reference in New Issue