En Tue, 12 Feb 2008 14:41:20 -0200, Jeff Schwab <[EMAIL PROTECTED]> escribi�:
> def line(): > try: > raise Exception > except: > return sys.exc_info()[2].tb_frame.f_back.f_lineno > def file(): > return inspect.currentframe().f_code.co_filename It's not a good idea to shadow the file type; I'd suggest current_file and current_line. file() should return inspect.currentframe().f_back.f_code.co_filename, else you're using the filename for file() itself, not the caller's And why the assymetry? Using try/except might help Jython, but that should be an implementation detail of inspect.currentframe() anyway. line() should just return inspect.currentframe().f_back.f_lineno -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list