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 co_consts.
inspect/CO_HAS_DOCSTRING
CO_HAS_DOCSTRING