[Python-checkins] r57491 - peps/trunk/pep-3118.txt
gregory.p.smith
python-checkins at python.org
Sun Aug 26 05:04:53 CEST 2007
Author: gregory.p.smith
Date: Sun Aug 26 05:04:53 2007
New Revision: 57491
Modified:
peps/trunk/pep-3118.txt
Log:
make the constant names match the py3k branch reality
Modified: peps/trunk/pep-3118.txt
==============================================================================
--- peps/trunk/pep-3118.txt (original)
+++ peps/trunk/pep-3118.txt Sun Aug 26 05:04:53 2007
@@ -200,12 +200,12 @@
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 @@
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 @@
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 @@
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
More information about the Python-checkins
mailing list