8000 doc: update co_flags reference (#132300) · python/cpython@b1f2304 · GitHub
[go: up one dir, main page]

Skip to content

Commit b1f2304

Browse files
methanehugovk
andauthored
doc: update co_flags reference (#132300)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 8047e50 commit b1f2304

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Doc/reference/datamodel.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1526,18 +1526,17 @@ positional arguments; bit ``0x08`` is set if the function uses the
15261526
if the function is a generator. See :ref:`inspect-module-co-flags` for details
15271527
on the semantics of each flags that might be present.
15281528

1529-
Future feature declarations (``from __future__ import division``) also use bits
1529+
Future feature declarations (for example, ``from __future__ import division``) also use bits
15301530
in :attr:`~codeobject.co_flags` to indicate whether a code object was compiled with a
1531-
particular feature enabled: bit ``0x2000`` is set if the function was compiled
1532-
with future division enabled; bits ``0x10`` and ``0x1000`` were used in earlier
1533-
versions of Python.
1531+
particular feature enabled. See :attr:`~__future__._Feature.compiler_flag`.
15341532

15351533
Other bits in :attr:`~codeobject.co_flags` are reserved for internal use.
15361534

15371535
.. index:: single: documentation string
15381536

15391537
If a code object represents a function and has a docstring,
1540-
the first item in :attr:`~codeobject.co_consts` is
1538+
the :data:`~inspect.CO_HAS_DOCSTRING` bit is set in :attr:`~codeobject.co_flags`
1539+
and the first item in :attr:`~codeobject.co_consts` is
15411540
the docstring of the function.
15421541

15431542
Methods on code objects

0 commit comments

Comments
 (0)
0