[Python-Dev] cpython (3.2): remove unused import

Brett Cannon brett at python.org
Mon Feb 6 18:57:38 CET 2012


On Sun, Feb 5, 2012 at 19:53, Christian Heimes <lists at cheimes.de> wrote:

> Am 06.02.2012 01:39, schrieb Brett Cannon:
> > I'm going to assume pylint or pyflakes would throw too many warnings on
> > the stdlib, but would it be worth someone's time to write a simple
> > unused import checker to run over the stdlib on occasion? I bet even one
> > that did nothing more than a regex search for matched import statements
> > would be good enough.
>
> Zope 3 has an import checker that uses the compiler package and AST tree
> to check for unused imports. It seems like a better approach than a
> simple regex search.
>
>
> http://svn.zope.org/Zope3/trunk/utilities/importchecker.py?rev=25177&view=auto
>
> The importorder tool uses the tokenizer module to order import statements.
>
>
> http://svn.zope.org/Zope3/trunk/utilities/importorder.py?rev=25177&view=auto
>
> Both are written by Jim Fulton.
>

 Ah, but does it run against Python 3? If so then this is something to
suggest on python-mentor for someone to get their feet wet for contributing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120206/f6ce39eb/attachment.html>


More information about the Python-Dev mailing list