In questo frammento di codice,Come usare flake8 per Python 3?
def add(x:int, y:int) -> int:
return x + y
ci sono le annotazioni di funzione che sono supportati solo dopo che Python 3.0
Quando eseguo flake8 per questo codice python:
$ flake8 7.3.py -vv
checking 7.3.py
def add(x: int, y: int) -> int:
return x + y
7.3.py:1:11: E901 SyntaxError: invalid syntax
ho avuto la sintassi non valida errore, ma dovrebbe essere una sintassi valida. Come posso usare flake8 per verificare la sintassi supportata solo in Python 3.x?
Vedere: https://bugs.launchpad.net/pyflakes/+bug/989203 –