Skip to content

Tweak scope of # type: ignore in PEP 484Β #292

Closed
@gvanrossum

Description

@gvanrossum

PEP 484 currently says:

A # type: ignore comment on a line by itself disables all type checking for the rest of the file.

I think that's excessive. It should probably be limited to the current indented block, e.g.

if blargh():
    # type: ignore
    1 + 'a'  # No error here
2 + 'b'  # Should be an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions