[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-22 Thread Michael J. Sullivan


Michael J. Sullivan  added the comment:

I think this is done!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-22 Thread Guido van Rossum


Guido van Rossum  added the comment:

Thanks!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-22 Thread miss-islington


miss-islington  added the comment:


New changeset d8a82e2897b735e2b7e9e086f1d709365a2ad72c by Miss Islington (bot) 
(Michael J. Sullivan) in branch 'master':
bpo-36878: Only allow text after `# type: ignore` if first character ASCII 
(GH-13504)
https://github.com/python/cpython/commit/d8a82e2897b735e2b7e9e086f1d709365a2ad72c


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-22 Thread Michael J. Sullivan


Change by Michael J. Sullivan :


--
pull_requests: +13419

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-22 Thread Michael Sullivan


Michael Sullivan  added the comment:

I think there will be one more PR to disallow non-ASCII characters immediately 
after a `# type: ignore`, but otherwise I think this is done

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-22 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset 933e1509ec6efa8e6ab8c8c7ce02059ce2b6d9b9 by Ivan Levkivskyi 
(Michael J. Sullivan) in branch 'master':
bpo-36878: Track extra text added to 'type: ignore' in the AST (GH-13479)
https://github.com/python/cpython/commit/933e1509ec6efa8e6ab8c8c7ce02059ce2b6d9b9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-21 Thread Guido van Rossum


Guido van Rossum  added the comment:

How many more PRs do you plan? Or is this it?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-21 Thread Michael Sullivan


Change by Michael Sullivan :


--
pull_requests: +13391

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-11 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:


New changeset d8320ecb86da8df7c13d8bf8582507f736aa2924 by Ivan Levkivskyi 
(Michael J. Sullivan) in branch 'master':
bpo-36878: Allow extra text after `# type: ignore` comments (GH-13238)
https://github.com/python/cpython/commit/d8320ecb86da8df7c13d8bf8582507f736aa2924


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-10 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

I like the idea of separate smaller PRs, the first one looks good.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-10 Thread Michael Sullivan


Change by Michael Sullivan :


--
keywords: +patch
pull_requests: +13148
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36878] ast.parse with type_comments=True should allow extra text after # type: ignore

2019-05-10 Thread Michael Sullivan


New submission from Michael Sullivan :

Per discussion during the typing summit at PyCon, it would be a good idea to 
allow extra information to be included in `# type: ignore` comments, in order 
to allow behavior such as suppressing individual errors (for example, with 
syntax like `# type: ignore[E1000]`, to suppress error 1000).

My proposal, then, is to generalize the definition of type: ignore comments to 
be `# type: ignore followed by a non-alphanumeric character. Then `# type: 
ignore[E1000]` and `# type: ignore E1000` would be valid type ignore comments 
while `# type: ignoreE1000` would not 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.

--
components: Interpreter Core
messages: 342130
nosy: gvanrossum, levkivskyi, msullivan
priority: normal
severity: normal
status: open
title: ast.parse with type_comments=True should allow extra text after # type: 
ignore
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com