Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pylint Error when using metaclass

i try to fix all pylint errors and pylint warnings in a project. but i keep getting an error when i set a metaclass (https://www.python.org/dev/peps/pep-3115/).

here is my example code:

#!/usr/bin/env python3

class MyMeta(type):
    pass

class MyObject(object, metaclass=MyMeta): # pylint error here
    pass

the error just says "invalid syntax". i use pylint via the vim plugin syntastic (https://github.com/scrooloose/syntastic).

my pylint version is (pylint --version):

pylint 1.4.3, 
astroid 1.3.6, common 0.63.2
Python 3.4.2 (default, Oct  8 2014, 10:45:20) 
[GCC 4.9.1]

my syntastic plugin is up to date with github.

any ideas?

like image 283
linluk Avatar asked Jun 16 '15 16:06

linluk


1 Answers

In the docs under 4.2. Q. The python checker complains about syntactically valid Python 3 constructs...:

A. Configure the python checker to call a Python 3 interpreter rather than Python 2, e.g:

let g:syntastic_python_python_exec = '/path/to/python3'
like image 61
Padraic Cunningham Avatar answered Oct 21 '22 06:10

Padraic Cunningham