← Back to index
directives_type_ignore.py
TP: 0
FP: 0
FN: 0
Optional: 0 / 0
2Tests "# type: ignore" comments.
5# Specification: https://typing.readthedocs.io/en/latest/spec/directives.html#type-ignore-comments
7# The following type violation should be suppressed.
8x: int = "" # type: ignore
10# The following type violation should be suppressed.
11y: int = "" # type: ignore - additional stuff
13# The following type violation should be suppressed.
14z: int = "" # type: ignore[additional_stuff]
16# > In some cases, linting tools or other comments may be needed on the same
17# > line as a type comment. In these cases, the type comment should be before
18# > other comments and linting markers.
20a: int = "" # type: ignore # other comment