(beginner) question on threads...

Fred Pacquier fredp at mygale.org.nospam
Mon Sep 3 10:34:01 CEST 2001

Joseph Andrew Knapka <jknapka at earthlink.net> said :

> Had a similar experience recently. Class A had some code that would be
> very handy in class B. I thought the code in question would probably
> work unchanged, since A and B already contained all the data attributes
> needed. So I pulled the method in question (only -- the data on which
> it depended stayed put) out into a separate mixin class, had A and B
> inherit the new class, and Poof! It worked immediately. I used to be a
> static-analysis zealot, but I am gaining a really strong appreciation
> for Python's wonderful dynamicism.

Hmm. I was loath to make a fool of myself yet again, but you just offered 
the opportunity for another naive question :-)

I was wondering how people handle this class hierarchy stuff in large 
bodies of code. Right now I load a module in an editor, see it inherits 
from some class in module foo, so I load that in another window. If foo 
inherits some class in bar, I need to look that up too, and so on. I find I 
rather quickly hit the ceiling in my ability for abstraction, and the 
general picture muddies up pretty fast :)

Is there not a better way ? Some tool that will build a picture of a class 
from its code, with all its methods and attributes, inherited or not ?
>> Thanks for the tip, Skip ! (hey, that sounds like an old Paul Simon
>> song :) 
> "Just say no to C, Lee,
>  And get yourself free..."

Dead on :-))

YAFAP : http://www.multimania.com/fredp/

More information about the Python-list mailing list