On Wed, Sep 1, 2010 at 2:35 AM, Emile Anclin <[email protected]>wrote: > > I had some thoughts on the py3k port: > > * as I understand it, pylint for python 2.X will only run against 2.X > and pylint3 will have to run against 3.X: the reason is that the _ast > module used for astng will parse the code as 2.X / 3.X, and throws > SyntaxErrors if the code is not acceptable for the running python > version. > > * imho, the py3k branch in logilab-common is not very usefull: it is just > passing 2to3 on the whole package. Following the python doc, > > http://docs.python.org/release/3.0.1/whatsnew/3.0.html#porting-to-python-3-0 > we should not go along this way. > > I'll try to propose a plan corresponding to what is explained on python > doc: > > 1) make logilab-common run on py3k (i.e. make the tests work). > this should also make pytest run on python3.X > I believe we need that to run the tests on astng and pylint; > > > 2) astng: > > a) we will have some work to make the old tests pass, related to this: > > b) quote my mail from Mon Apr 12 10:58:24 CEST 2010: > """ > we will have to parse new kind of nodes (Nonlocal, Dict/SetGenerator, > Starred (at least for extended literal unpacking), SetComp etc. hence a > lot of new 'visit_%' methods in astng > """ > > c) deal with 'print' as a function and the other modifications > > *) there is actually not that much stuff concerning python <=2.4, > just one module, hence not much work to save... > > > 3) pylint; make tests pass with py3k, write new visit_* methods and > test... > > > Fully Automated conversion will not work. We have more than syntactic > changes to do: we have different trees with new nodes, nodes that > disappear... > > I don't know if it is possible to have only one version of astng + pylint > code, but we could try it. > > I hope that my informations helped, and I hope I will work on astng :)
Thanks for your thoughts. Now might be a good time to send out this page again: http://wiki.python.org/moin/PyLint-3k Do you feel that the conversion will of necessity be more complex than what sa2to3 and perhaps some if's or conditional imports can handle? -- Dan Stromberg
_______________________________________________ Python-Projects mailing list [email protected] http://lists.logilab.org/mailman/listinfo/python-projects
