Skip to content

Commit 462ef30

Browse files
committed
update co_flags docs
1 parent 9604b16 commit 462ef30

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Doc/reference/datamodel.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -1526,15 +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-
Bits ``0x10``, ``0x1000``, and ``0x2000`` were used in earlier
1530-
versions of Python.
1529+
Future feature declarations (e.g. `from __future__ import divisions`) also use
1530+
in :attr:`~codeobject.co_flags` to indicate whether a code object was compiled with a
1531+
particular feature enabled. See :attr:`~__future__._Feature.compiler_flag`.
15311532

15321533
Other bits in :attr:`~codeobject.co_flags` are reserved for internal use.
15331534

15341535
.. index:: single: documentation string
15351536

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

15401542
Methods on code objects

0 commit comments

Comments
 (0)