Any tools to print source code call hierarchy

Michael Peuser mpeuser at web.de
Sun Sep 7 01:37:22 EDT 2003


"Simon Burton" <simonb at webone.com.au> schrieb im Newsbeitrag
news:pan.2003.09.06.23.51.35.802469 at webone.com.au...
> On Sat, 06 Sep 2003 16:34:21 -0700, Lothar Scholz wrote:
>
> ...
> >
> > Because python is a dynamical typed non image language there is no
> > tool that can do this and there never will be any (at least one that
> > is not using heuristics or sampled data from previous runs).
>
> hmmm... I think (some) static analysis may be possible. The main
> thing to exclude is eval/exec but even then, yes you're right, some
> programs would just have to be run to find out what they do.

It it is not only eval/exec. You can create methods dynamically. And static
analysis will already run into trouble when you import moduls dynamically.

What I do very often is "rename" a procedure, e.g. in cases as:
def pVersion1(): ...
def pVersion2(): ...

if....
     p=pVersion1

This is not even tricky.
Kindly
Michael P

>
> I remember reading some interesting things here:
> http://www.python.org/doc/essays/cp4e.html
>
> In particular:
> "Cormac Flanagan and Matthias Felleisen.
> Componential Set-Based Analysis.
> ACM Transactions of Programming Languages and Systems"
>
> Simon.
>
>
>
>






More information about the Python-list mailing list