← every case · 2000 · string forms
the # inside the docstring is text and not a comment symbol, and the docstring around it is a triple quoted string like any other, opening a line on its own. Case 2100 is the same shape where the block is data the program prints, and the two together separate a counter that decides by where the block sits from one that decides by what it is
| 1 | codecodecodecodecode | def f(): |
| 2 | commentscodecodecommentscode | """ |
| 3 | commentscodecodecommentscode | # this is not a comment, it is inside the docstring |
| 4 | commentscodecodecommentscode | """ |
| 5 | codecodecodecodecode | return 1 |
stringcommentthe tag around another language
cloc --json cases/2000-string_forms/2090-docstring_holding_a_comment_symbol/input.py
mezura cases/2000-string_forms/2090-docstring_holding_a_comment_symbol/input.py --output json --hide timing --counting content
mezura cases/2000-string_forms/2090-docstring_holding_a_comment_symbol/input.py --output json --hide timing --counting region
any triple quoted block that opens a line is read as documentation, so the three lines of this one are comments by the definition it declares and not by a mistake
scc --format json cases/2000-string_forms/2090-docstring_holding_a_comment_symbol/input.py
tokei --output json cases/2000-string_forms/2090-docstring_holding_a_comment_symbol/input.py