[Python-projects] python compiler package's future and pylint

Jeremy Hylton jeremy at alum.mit.edu
Tue Jul 24 15:16:19 CEST 2007


Just wanted to inquire after pylint and AST status again, since we've
been using pylint for a work project lately.

On 7/5/07, Neal Norwitz <nnorwitz at gmail.com> wrote:
> Sylvain, Nicolas,
>
> It's been quite a while since we last chatted about pylint.  How are
> things going?  I see that you guys are putting out pylint releases
> fairly often which is nice to see.
>
> I'm not sure if you are following what's happening with py3k.  The
> compiler package in the stdlib (which AFAIK pylint still requires) has
> been removed.  We probably will need to add some support utilities
> back.  However our plan moving forward is to use the AST that is
> included in 2.5.
>
> * How does this affect pylint?
> * What is the minimum support you will need in the standard library to
> allow pylint to continue working?
> * Would you guys be able to contribute the pieces you need to the stdlib?

It looks like pylint depends pretty deeply on the compiler package.
It appears to extend the transformer module, which converts parser
module output to the AST.  It also extends (monkey patches, if I'm
using the term right) the base AST Node class provided by the compiler
package.  The python 2.5 builtin AST is different than the compiler
package AST, which also poses a compatibility problem.

It looks like a big project to make the pylint code work with the new
AST.  If I wanted to invest the minimum effort required, I'd probably

a) import most of the old compiler package code into astng
b) re-write the compiler.transformer module to convert from a builtin
AST to its own AST representation.

This solution sounds ugly but expedient.  A more substantial effort
would change pylint/astng to use the native AST directly, but that
involves a pretty thorough restructuring.

Jeremy

> One feature we have planned is to allow an AST to be converted to
> bytecode.  This probably doesn't affect pylint though.
>
> Cheers,
> n
>



More information about the Python-Projects mailing list