Pylint error when using metaclass

I am trying to fix all pylint errors and pylint warnings in a project. but I keep getting the error when I install the metaclass ( https://www.python.org/dev/peps/pep-3115/ ).

here is my sample code:

#!/usr/bin/env python3 class MyMeta(type): pass class MyObject(object, metaclass=MyMeta): # pylint error here pass 

the error simply says "invalid syntax". I use pylint through the vim plugin syntax ( https://github.com/scrooloose/syntastic ).

my version of pylint (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 syntax plugin has been updated with github.

any ideas?

+6
source share
1 answer

In the docs in section 4.2. Q. The python controller complains about the syntax-correct constructs of Python 3 ...:

a. Configure python checker to invoke the Python 3 interpreter, not Python 2, for example:

 let g:syntastic_python_python_exec = '/path/to/python3' 
+3
source

Source: https://habr.com/ru/post/989228/


All Articles