summaryrefslogtreecommitdiffstats
path: root/Doc/library/inspect.rst
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2023-05-04 15:23:40 (GMT)
committerGitHub <noreply@github.com>2023-05-04 15:23:40 (GMT)
commitb7a0a521960a6e9ea46b79b51cbcc3c4ffcc7057 (patch)
treeb77c5170d60ab85bf3cba18b6dbdf09b38c77425 /Doc/library/inspect.rst
parent04f673327530f47f002e784459037231de478412 (diff)
downloadcpython-b7a0a521960a6e9ea46b79b51cbcc3c4ffcc7057.zip
cpython-b7a0a521960a6e9ea46b79b51cbcc3c4ffcc7057.tar.gz
cpython-b7a0a521960a6e9ea46b79b51cbcc3c4ffcc7057.tar.bz2
gh-102500: Document PEP 688 (#102571)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Diffstat (limited to 'Doc/library/inspect.rst')
-rw-r--r--Doc/library/inspect.rst33
1 files changed, 33 insertions, 0 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index 88f843c..7884308 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -1603,6 +1603,39 @@ the following flags:
for any introspection needs.
+Buffer flags
+------------
+
+.. class:: BufferFlags
+
+ This is an :class:`enum.IntFlag` that represents the flags that
+ can be passed to the :meth:`~object.__buffer__` method of objects
+ implementing the :ref:`buffer protocol <bufferobjects>`.
+
+ The meaning of the flags is explained at :ref:`buffer-request-types`.
+
+ .. attribute:: BufferFlags.SIMPLE
+ .. attribute:: BufferFlags.WRITABLE
+ .. attribute:: BufferFlags.FORMAT
+ .. attribute:: BufferFlags.ND
+ .. attribute:: BufferFlags.STRIDES
+ .. attribute:: BufferFlags.C_CONTIGUOUS
+ .. attribute:: BufferFlags.F_CONTIGUOUS
+ .. attribute:: BufferFlags.ANY_CONTIGUOUS
+ .. attribute:: BufferFlags.INDIRECT
+ .. attribute:: BufferFlags.CONTIG
+ .. attribute:: BufferFlags.CONTIG_RO
+ .. attribute:: BufferFlags.STRIDED
+ .. attribute:: BufferFlags.STRIDED_RO
+ .. attribute:: BufferFlags.RECORDS
+ .. attribute:: BufferFlags.RECORDS_RO
+ .. attribute:: BufferFlags.FULL
+ .. attribute:: BufferFlags.FULL_RO
+ .. attribute:: BufferFlags.READ
+ .. attribute:: BufferFlags.WRITE
+
+ .. versionadded:: 3.12
+
.. _inspect-module-cli:
Command Line Interface