RE: Can synopsis (be made to) follow Python impo rts?

Stefan Seefeld <[email protected]>
Newsgroups gmane.comp.documentation.synopsis
Message-ID <20DCDD8F0FCED411AC4D001083CF504502380D43@MTL-EXCHANGE>
> From: Vicki Brown [mailto:[email protected]]

> Subject: [Synopsis-devel] Can synopsis (be made to) follow Python
> imports?
> 
> 
> (or C++ #includes, or...)

For C++ a file traversal using #include statements is definitely
possible (though currently not implemented, please open a feature
request on http://synopsis.fresco.org/issues/bug for that).

Python is an entirely different story, as name lookup is done
at runtime, and so a static analyzer can't predict what symbols
will be found when the python processor actually runs the code.

> I have (at my workplace) a set of Python source files that will 
> become a single executable process. The code is made up of many .py 
> files and assorted subdirectories. It is NOT a package.
> 
> The "main" file imports 50 additional files which, in turn, 
> import others.
> 
> What I want to see is the source, classes, functions, etc for the 
> entire executable program.
> 
> Is there a way I can get this information from synopsis?

you can process all the python code that is involved. But you
won't be able to construct something like a callgraph from that,
for example, as for that you'd have to execute the code (with
a modified interpreter).

Regards,
		Stefan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.