alain wrote:
> On Feb 12, 7:44 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote:
> 
>> It still would be nice to have syntax as clean as __FILE__ and __LINE__.
> 
> There exists an undocumented builtin called __file__, but
> unfortunately no corresponding __line__

Drat!  So close!  Thanks for the info.  Oh well, I guess special cases 
aren't all that special, anyway.

Maybe a function called srcinfo.here() could return a tuple of the file 
name and line number, to allow syntax like:

     print("The program has reached %f:%d" % srcinfo.here())

Methods names like file_name() and line_no() aren't too hideous, either.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to