Skip to content

Use correct line for # type: ignore's in typeshed #2623

Closed
@emmatyping

Description

@emmatyping

In python/typed_ast#61 I am aiming to backport a fix to a longstanding bug in the ast module that sets decorated nodes line numbers incorrectly. After typed_ast is updated, I was hoping to move the type ignores in typeshed to the correct line numbers (the line of the def or class keywords). I believe @rchen152 has said that pytype will not be affected by this, but I wanted to check with the pyre team (@dkgi are you a good person to mention for these things?) and anyone else who may be interested.

Basically the changes would look like changing

@foo  # type: ignore
def bar:
    ...

to

@foo
def bar:  # type: ignore
    ...

and similar changes.

If this presents a problem, we could likely put # type: ignores on both lines for a time, but I'd prefer not to need to do that.

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