Skip to content

Failure on `# type: ignore[code]' comments #108

@algorythmic

Description

@algorythmic

Environment data

  • Language Server version: 2020.7.1
  • OS and version: macOS 10.15
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.7 from Homebrew

Expected behaviour

# type: ignore[code] treated same as # type: ignore (or, at least, does not generate its own error)

Actual behaviour

A line with e.g. # type: ignore[attr-defined] produces a number of errors:

image
image

Note that Type annotation not supported for this type of expression is reported even if python.analysis.typeCheckingMode is off.

Code Snippet / Additional information

Mypy uses this syntax since 0.730 (python/mypy#7239). See e.g. PyCQA/pyflakes#455 and google/pytype#485 for other tools' changes to adapt to this syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed in next version (main)A fix has been implemented and will appear in an upcoming version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions