Skip to contents

Whether Python code contains at least one complete triple-quoted string block ("""...""" or '''...'''). code_remove_comments()'s Python branch deliberately never strips a triple-quoted string as a comment (doing so would also destroy real docstrings, which are themselves string literals — see that function's own comment), so a Python file documented ONLY via docstrings reports 0% comments from code_line_stats() even though it carries real documentation. This is a separate, additive signal for that case: it does not change what counts as a "comment" for the existing percent_comments metric, it only reports whether docstrings are present at all, alongside it. Confirmed against a real corpus: 200 of 280 zero-comment-flagged Python files (71.4%) contain at least one such block — see the code_check validation.

Usage

.code_has_docstring(code_text)

Arguments

code_text

the code text for a single file

Value

TRUE if at least one complete triple-quoted block is found, else FALSE