]> granicus.if.org Git - python/commit
bpo-36878: Allow extra text after `# type: ignore` comments (GH-13238)
authorMichael J. Sullivan <sully@msully.net>
Sat, 11 May 2019 18:17:24 +0000 (11:17 -0700)
committerIvan Levkivskyi <levkivskyi@gmail.com>
Sat, 11 May 2019 18:17:24 +0000 (19:17 +0100)
commitd8320ecb86da8df7c13d8bf8582507f736aa2924
tree87fc131f7bfdda0688b1d93ab9bce801c5f8a944
parent6236c9823ef3e8e2229b0598d3d8189adf5e00f2
bpo-36878: Allow extra text after `# type: ignore` comments (GH-13238)

In the parser, when using the type_comments=True option, recognize
a TYPE_IGNORE as anything containing `# type: ignore` followed by
a non-alphanumeric character. This is to allow ignores such as
`# type: ignore[E1000]`.
Lib/test/test_type_comments.py
Misc/NEWS.d/next/Library/2019-05-10-22-00-06.bpo-36878.iigeqk.rst [new file with mode: 0644]
Parser/tokenizer.c