Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
emmatyping opened this issue Nov 23, 2018 · 3 comments
Closed

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

emmatyping opened this issue Nov 23, 2018 · 3 comments

Comments

@emmatyping
Copy link
Contributor

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.

@JelleZijlstra
Copy link
Member

If you move the ignores at once, you'll have to coordinate changes to typed_ast and typeshed (and possibly mypy), or CI will break in various places. It's probably easier to duplicate the ignores first, then remove them once there's a new typed-ast release.

@emmatyping
Copy link
Contributor Author

Hm, that is a good point. I suppose I will have to put in both, at least for a time.

@emmatyping
Copy link
Contributor Author

I believe this is no longer an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants