Is there any way to access attributes from an imported module?

Rhodri James rhodri at wildebst.demon.co.uk
Mon Oct 3 18:34:54 EDT 2011


On Mon, 03 Oct 2011 03:21:41 +0100, Andrew Berg  
<bahamutzero8825 at gmail.com> wrote:

> I found a way to do it, albeit a very hackish one. Since the class
> instance already catches exceptions from the modules it imports, I can
> make a custom exception (in a common area for both it and the submodules
> to import) for it to catch and have it call its own methods there based
> on information stored in the exception. I'm eventually going to redesign
> it to be cleaner and more obvious, but for now, this is a nice
> quick-and-dirty solution.

OK, I give up.  I cannot construct a mental model of what's going on that  
doesn't grievously abuse at least one of the terms you are using.  Could  
you post some illustrative code snippets, please?

-- 
Rhodri James *-* Wildebeest Herder to the Masses



More information about the Python-list mailing list