Skip to content

Commit 0f00e2e

Browse files
Comment on backslash non-escaping
1 parent 7292da6 commit 0f00e2e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test-data/unit/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ with text "abc..."
3434
this allows for multiple comments on the same line. Example: `# E: ... # This type fails`.
3535
Use `\` to escape a `#` character to include it in the error message. Example:
3636
`# E: This error message includes the \# character once # new comment`.
37+
Note that there is no support by the test file format for using `\\` to escape a backslash;
38+
the sequence `\\#` is interpreted as `\` followed by an escaped `#`, and `\\\#` as
39+
two `\` followed by an escaped `#`.
40+
Note also: in all other contexts, such as line-continuation, the backslash acts
41+
as it normally would in a Python source file.
3742
- repeating ` # E: ` several times in one line indicates multiple expected errors in one line
3843
- `W: ...` and `N: ...` works exactly like `E: ...`, but report a warning and a note respectively
3944
- lines that don't contain the above should cause no type check errors

0 commit comments

Comments
 (0)