← every case · 2000 · string forms

2100-triple_quoted_data_not_documentation

a triple quoted string that is data the program prints and not documentation, with its opening symbol at the start of a line. Case 2090 is the same shape where the block really is documentation

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.py
1codedata = (
2comments"""
3commentsalpha
4comments"""
5code)
6codeprint(data)

stringcommentthe tag around another language

What each tool answered

cloc.default ✓ agrees

a triple quoted string is documentation wherever it opens, so the three lines of this block are comments although the program prints their text

the rules ask6 lines · 0 blanks · 3 code · 3 comments
it answers6 lines · 0 blanks · 3 code · 3 comments

cloc --json cases/2000-string_forms/2100-triple_quoted_data_not_documentation/input.py

mezura.content ✓ agrees
the rules ask6 lines · 5 code · 0 comments · 1 extra
it answers6 lines · 5 code · 0 comments · 1 extra

mezura cases/2000-string_forms/2100-triple_quoted_data_not_documentation/input.py --output json --hide timing --counting content

mezura.region ✓ agrees
the rules ask6 lines · 0 blanks · 6 code · 0 comments
it answers6 lines · 0 blanks · 6 code · 0 comments

mezura cases/2000-string_forms/2100-triple_quoted_data_not_documentation/input.py --output json --hide timing --counting region

scc.default ✓ agrees

the same definition reaches a block that is data the program prints, so three lines of program data land in the comment count

the rules ask6 lines · 0 blanks · 3 code · 3 comments
it answers6 lines · 0 blanks · 3 code · 3 comments

scc --format json cases/2000-string_forms/2100-triple_quoted_data_not_documentation/input.py

tokei.default ✓ agrees
the rules ask6 lines · 0 blanks · 6 code · 0 comments
it answers6 lines · 0 blanks · 6 code · 0 comments

tokei --output json cases/2000-string_forms/2100-triple_quoted_data_not_documentation/input.py