[Python-Dev] Division of tool labour in porting Python 2 code to 2/3 (original) (raw)
Brett Cannon bcannon at gmail.com
Sat Jun 7 17:37:47 CEST 2014
- Previous message: [Python-Dev] Division of tool labour in porting Python 2 code to 2/3
- Next message: [Python-Dev] namedtuple implementation grumble
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat Jun 07 2014 at 9:11:54 AM, Claudiu Popa <pcmanticore at gmail.com> wrote:
On Fri, Jun 6, 2014 at 7:37 PM, Brett Cannon <bcannon at gmail.com> wrote: > After Glyph and Alex's email about their asks for assisting in writing > Python 2/3 code, it got me thinking about where in the toolchain various > warnings and such should go in order to help direct energy to help develop > whatever future toolchain to assist in porting. > > There seems to be three places where issues are/can be caught once a project > has embarked down the road of 2/3 source compatibility: > > -3 warnings > Some linter tool
Pylint could help here. We already have a couple of checks which addresses the issue of porting between Python 2 and 3, checks like: raising-string old-style-class slots-on-old-class super-on-old-class old-raise-syntax old-ne-operator lowercase-l-suffix backtick unpacking-in-except indexing-exception property-on-old-class There was an idea on Pylint's bugtracker to implement a plugin for Python 2, with warnings dedicated to porting and this solution seems easier than the alternatives.
Yes, pylint is definitely an option. I have not looked at how hard it would be to write the rules, though, and how easy it would be to run with just those rules (if I remember correctly pylint can take a config, but I have not run it manually in a while).
Having something which walked the 2.7 CST or AST wouldn't be difficult to write either, so it's just a matter of balance of work required. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140607/78b43dd1/attachment.html>
- Previous message: [Python-Dev] Division of tool labour in porting Python 2 code to 2/3
- Next message: [Python-Dev] namedtuple implementation grumble
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]