-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
ast.parse with type_comments=True should allow extra text after # type: ignore #81059
Comments
Per discussion during the typing summit at PyCon, it would be a good idea to allow extra information to be included in My proposal, then, is to generalize the definition of type: ignore comments to be Now that ast.parse can parse type_comments, this needs to make it into 3.8, basically, if we want to do this and be able to use the ast type_comment feature. Ideally, the text of the type ignore would be actually included in the produced AST. As a bare minimum first step, we need to recognize type ignores with extra information and report them (and, critically, not detect them as regular type comments and produce errors when they appear in unexpected places). I'll put up a PR to do the second part shortly. |
I like the idea of separate smaller PRs, the first one looks good. |
How many more PRs do you plan? Or is this it? |
I think there will be one more PR to disallow non-ASCII characters immediately after a |
Thanks! |
I think this is done! |
# type: ignore
comments #13238# type: ignore
if first character ASCII #13504Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: