Need a better understanding on how MRO works?

Steven D'Aprano steve at REMOVE-THIScybersource.com.au
Sun Aug 26 11:53:55 EDT 2007


On Sun, 26 Aug 2007 07:55:39 -0400, Steven W. Orr wrote:

> In fact, I wanted to make a common routine that could be called from
> multiple modules. I have classes that need to be created from those
> multiple modules. I did run into trouble when I created a common routine
> even though I passed globals() as one of the args.

I'm thinking that you should cross out "even though" and insert 
"because" :-)

Perhaps I'm misunderstanding exactly what you're trying to accomplish, 
but if you want to call a routine (a function? class?) from multiple 
modules, the simplest way is the best: create the routine in one module, 
then import it into all the others.

-- 
Steven.



More information about the Python-list mailing list