pylint for cython?

Stefan Behnel stefan_ml at behnel.de
Fri Sep 12 12:42:15 EDT 2014


Skip Montanaro schrieb am 12.09.2014 um 17:52:
> I have slowly been converting some Python source to Cython. I'm pretty
> conservative in what changes I make, mostly sprinkling a few "cdef",
> "float" and "int" declarations around the pyx file. Still, conservative or
> not, it's enough to choke pylint. Rather than have to maintain a pure
> Python version of my code, it would be nice if pylint had a flag or if
> there was a "cylint" tool available.

If you really just do things like "cdef int x", I recommend using pure
Python syntax for it (in a .py file). That way, you can just run pylint
over it as before.

http://docs.cython.org/src/tutorial/pure.html#static-typing

Specifically, the "@cython.locals()" decorator might be all you need, or
maybe some of the other things like "@cython.cfunc".

Stefan





More information about the Python-list mailing list