summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorXuanteng Huang <44627253+xuantengh@users.noreply.github.com>2024-10-30 09:01:09 (GMT)
committerGitHub <noreply@github.com>2024-10-30 09:01:09 (GMT)
commit35df4eb959b3923c08aaaeff728c5ed1706f31cf (patch)
tree0066d2a27b47aaa3fc3dde9debcfd9b553579565 /Doc/library
parent2ab377a47c8290f8bf52c8ffb5d7fc4c45452611 (diff)
downloadcpython-35df4eb959b3923c08aaaeff728c5ed1706f31cf.zip
cpython-35df4eb959b3923c08aaaeff728c5ed1706f31cf.tar.gz
cpython-35df4eb959b3923c08aaaeff728c5ed1706f31cf.tar.bz2
gh-126072: do not add `None` to `co_consts` if there is no docstring (GH-126101)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/inspect.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index 892f5ba..ca5dac8 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -1700,6 +1700,14 @@ which is a bitmap of the following flags:
.. versionadded:: 3.6
+.. data:: CO_HAS_DOCSTRING
+
+ The flag is set when there is a docstring for the code object in
+ the source code. If set, it will be the first item in
+ :attr:`~codeobject.co_consts`.
+
+ .. versionadded:: 3.14
+
.. note::
The flags are specific to CPython, and may not be defined in other
Python implementations. Furthermore, the flags are an implementation