Thanks, but I don't think this is going to work for me. I need to be able to get to the module.__dict__ from with a function of that module. For a method of a class object, I can get to the class data via self.__dict__
I've found that I can recursively import the module within one of its own functions and get the __dict__ attribute this way, but something tells me this is probably a bad idea or a waste of memory.
> -------Original Message-------
> Hi Brad,
>
> You can try to loop on the globals and check if any has the type class:
> import copy, types
> for name, obj in copy.copy(globals()).items():
> print type(obj)
> if type(obj) == types.ClassType:
> print name
>
> Cheers,
>
> Aloys
>
>
> On 3/31/06, BRAD <[LINK: mailto:brad(at)cg-soup.com] brad(at)cg-soup.com> wrote:
> Here's a fun Python situation. I have a function that needs to check its
> input by looking at other Classes living inside the same module. Is there
> an attribute I can call that points to the instance of the module where it
> lives? This would be analogous to using the self attribute in an object
> class.
>
> def MyFunction():
> myModuleInstance = ?
>
>
> Cheers!
> -Brad
> ---
> Unsubscribe? Mail [LINK: mailto:Majordomo(at)Softimage.COM]
> Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
>
> --
> Aloys Baillet - XSI Technical Director
> Character Dpt - Animal Logic
> --
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi