Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Python: python

LCD 47 edited this page Jun 12, 2016 · 8 revisions

This file is no longer maintained

This file exists only as a historic reference. Documentation for syntastic checkers is now included in the manual, please see :help syntastic-checkers in Vim.


Maintainer: LCD 47 [email protected]

This checker uses Python's builtin compile() function for detecting syntax errors.

Codecs

In Python you have the ability to specify a particular codec at the top of the file with a special comment that looks something like # coding: spec. Python will see this comment at import time and use the corresponding codec to transform the file before using it. The python checker has an option g:syntastic_python_python_use_codec that will make syntastic aware of such comments before running compiler checks on the file.

Please note that transforming a file like this affects line numbers and column numbers, and syntastic has no way to make the necessary adjustments. Consequently, errors might appear on surprising lines if you enable this feature and the transformed file has code on different lines than the raw file. For this reason the use of these transformations should be limitted to codecs that preserve line numbers, such as the spec codec provided by NoseOfYeti.

Checker option

g:syntastic_python_python_use_codec (boolean; default: 0)
Enables handling of # coding: spec comments.

Requirement

The checker needs Python version 2.6 or later.

Clone this wiki locally