'# type: ignore' comment without a known inspection code
Reports a # type: ignore or # pycharm: ignore comment that names no inspection code of this IDE. An unknown code with the pycharm: namespace gets a report from a different inspection.
Such a comment suppresses every inspection on its line. A comment in the leading comments of the file suppresses every inspection in the file. It can therefore hide a problem that appears there later.
A code of another type checker, such as mypy's attr-defined, names no inspection of this IDE. Such a comment gets the same report.
Name the inspection codes in brackets to suppress only the problems that you accept. For example, write # type: ignore[unsupported-operator] or # type: ignore[pycharm:PyTypeChecker]. For a comment on a line of code, the quick fix adds the codes of the problems on that line.
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
PyTypeIgnoreWithoutCode- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Inspection ID: PyTypeIgnoreWithoutCodeInspection
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: | CLion 2026.3, IntelliJ IDEA 2026.3, PyCharm 2026.3, Qodana for JVM 2026.3, |