[ZODB-Dev] importchecker and the zodb

Jeremy Hylton jeremy at zope.com
Thu Feb 26 14:12:12 EST 2004


On Thu, 2004-02-26 at 14:05, Martijn Faassen wrote:
> I have a tool called importchecker which can quite reliably detect 
> unused imports in large Python packages. It's been used successfully 
> against Zope 3.
> 
> http://www.zope.org/Members/faassen/importchecker

How does it work?  I'm curious about how it differs from pychecker,
which also complains about the same thing.  Is it as static checker?  Or
does it depend on code that uses the imported module/name being
executed.

> When I run it against Zope 3, I notice that the ZODB code seems to 
> contain quite a few unused imports as well. I've however refrained in 
> the past from removing these unused imports from ZODB code.

I use pychecker every once in a while when I run the ZODB tests, and I
remove all the unused imports it finds.  So maybe your checker does a
better job of finding them.

> Do I have permission to run the tool over ZODB as well and remove unused 
> imports? Of course I'll be running the tests and the like before 
> checking in.

Sure.

> Should I run it in the ZODB tree or is it okay to run it in the Zope 3 
> tree -- are these now the same trees in CVS?

I think they should be the same, but I'm not sure if Zope3 includes all
the modules that ZODB includes, e.g. zdaemon, ZopeUndo, etc.

Jeremy





More information about the ZODB-Dev mailing list