Skip to content

# type: ignore doesn't work on wrapped lines #8905

Closed
@Dreamsorcerer

Description

@Dreamsorcerer
def _exception_handler(self, loop: asyncio.AbstractEventLoop,
                       context: Mapping[str, Any]) -> None:  # type: ignore[misc]

In this example, the error produced is error: Explicit "Any" is not allowed [misc].
It says the error is on line 1, but clearly is on line 2.
That's not a problem in itself, I assume it's just treating the wrapped line as a single line.

However, the ignore comment, which is on the correct line, is not recognised by Mypy unless it is moved to the first line. If Mypy is going to treat wrapped lines as a single line, then the comments should also get wrapped to that same line.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions