[Tutor] A de-aliaser for large projects.

Chad Crabtree flaxeater at yahoo.com
Sat Mar 27 21:26:30 EST 2004


I've had this idea for a de-aliaser for large
projects.  In the past when if have tried to learn the
sourcecode of a large project (in a specific case
lyntin)  I was counfounded by the aliasing of modules
or functions.  for example

from FTP import *
#now the namespace is the same.
connect=blah blah

so on and so fourth.  If you are not intimatly aware
of the module api's and names then it's easy to get
lost.  Especially if you are really only interested in
one class in a large file.  

I propose making a program that will turn the above
call to connection back to
ftp.connection=blah blah

So that one could more easily understand references to
other modules or if the programer decided he wanted to
change the name of a function previous to the item of
interest.  If there is already one of these please let
me know.  Other wise I would appreciate a little input
on how I might use the introspection available to do
this.  I was thinking about using dir().  for modules
maybe with type checking to see if dir shows reference
to another class or what ever.  In addition keeping a
dictionary holding all assignments and then chekcing
to see if one name really equals another.

Thanks for your input.

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html



More information about the Tutor mailing list