En Sun, 17 Feb 2008 16:25:44 -0200, Alex <[EMAIL PROTECTED]> escribi�:
> Can I get reference to module object of current module (from which the > code is currently executed)? I know __import__('filename') should > probably do that, but the call contains redundant information (filename, > which needs to be updated), and it'll perform unnecessary search in > loaded modules list. > > It shouldn't be a real problem (filename can probably be extracted from > the traceback anyway), but I wonder if there is more direct and less > verbose way. sys.modules[__name__] Why do you want to get the module object? globals() returns the module namespace, its __dict__, perhaps its only useful attribute... -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list