Syntastic: Type annotations not considered valid Python

Created on 18 Jul 2014  路  3Comments  路  Source: vim-syntastic/syntastic

The below example is valid Python but it gives invalid syntax on both type annotations at 1:12 and 1:19.

def log(msg: str) -> None:
    print("Logging: " + msg)

So in a nutshell: syntastic does not seem to support PEP3107.

obsolete solution

Most helpful comment

A more constructive answer: you probably want to set python checker to run python3, and also make sure your other checkers are compiled against python3. The first part is achieved by something like this:

let g:syntastic_python_python_exec = 'python3'

All 3 comments

That's fine: syntastic is not supposed to know, or care, about Python syntax. :) What syntastic is supposed to do is run third party checkers, and show you the results.

Now, do you have any problems to report about syntastic behaviour?

A more constructive answer: you probably want to set python checker to run python3, and also make sure your other checkers are compiled against python3. The first part is achieved by something like this:

let g:syntastic_python_python_exec = 'python3'

Thanks, worked great! :+1: :clap:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasonkuhrt picture jasonkuhrt  路  8Comments

yoshuawuyts picture yoshuawuyts  路  6Comments

ijanos picture ijanos  路  7Comments

symbolix picture symbolix  路  8Comments

lemeb picture lemeb  路  6Comments