使用元类时出现 Pylint 错误
Pylint Error when using metaclass
我尝试修复项目中的所有 pylint 错误和 pylint 警告。但是当我设置元类时我总是收到错误消息 (https://www.python.org/dev/peps/pep-3115/)。
这是我的示例代码:
#!/usr/bin/env python3
class MyMeta(type):
pass
class MyObject(object, metaclass=MyMeta): # pylint error here
pass
错误只是说 "invalid syntax"。我通过 vim 插件 syntastic (https://github.com/scrooloose/syntastic) 使用 pylint。
我的 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]
我的 syntastic 插件是最新的 github。
有什么想法吗?
在docs下4.2。问:python 检查器抱怨语法有效 Python 3 构造...:
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'
我尝试修复项目中的所有 pylint 错误和 pylint 警告。但是当我设置元类时我总是收到错误消息 (https://www.python.org/dev/peps/pep-3115/)。
这是我的示例代码:
#!/usr/bin/env python3
class MyMeta(type):
pass
class MyObject(object, metaclass=MyMeta): # pylint error here
pass
错误只是说 "invalid syntax"。我通过 vim 插件 syntastic (https://github.com/scrooloose/syntastic) 使用 pylint。
我的 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]
我的 syntastic 插件是最新的 github。
有什么想法吗?
在docs下4.2。问:python 检查器抱怨语法有效 Python 3 构造...:
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'