pyflakes
pyflakes copied to clipboard
Use `ast.parse(type_comments=True)` instead of `file_tokens` on Python 3.8+
Python 3.8 added the ability to include type comments in the abstract syntax tree.
Currently pyflakes uses tokenize
to find the comments, which is slow. Using type_comments from ast
when available would be much faster.
maybe a better option would be to drop the type comments support entirely -- now that python 2 is very obsolete
the problem with type_comments=True
is pyflakes has no way to signal to flake8 that it needs a special ast parse
Ahh, yeah, that makes sense.
let's keep this open in case we decide to drop comments