attribut of the current module

Ignacio Vazquez-Abrams ignacio at openservices.net
Fri Sep 21 08:59:59 CEST 2001


On Fri, 21 Sep 2001, Oleg Orlov11980884 wrote:

> How can i get attribut of the current module?
>
> Ugly way: getattr(__import__(__name__), attribname)

How about getattr(sys.modules[__name__], attribname)?

-- 
Ignacio Vazquez-Abrams  <ignacio at openservices.net>





More information about the Python-list mailing list