[pypy-dev] import analysis of pypy

Michael Hudson mwh at python.net
Thu Oct 27 20:39:32 CEST 2005

If you've been reading pypy-svn you'll know I've written an import
analysis tool (pypy/tool/importfun.py).  While its implementation is
currently completely inscrutable, here's some of its results.

There are currently 242 import cycles in PyPy :(:


A 'summary' function gave this:

the average module
was imported 4.40 times
imported 5.68 other modules
defined 14.17 names

there were 49 import *s
the average one produced 5.33 names that were actually used

Tests and tools aside, we have very few modules that aren't imported
anywhere -- at least we're not too bad on this front :)

And here's an analysis of the import *s in the code base (excluding
tests, roughly speaking):



  <sjj> dash: you certainly are an enigma wrapped in a riddle
        wrapped in a hat.                       -- from Twisted.Quotes

More information about the Pypy-dev mailing list