Posted By

jvc on 07/12/09


Tagged


Versions (?)

__FUNCTION__ and __LINE__ in Python


 / Published in: Python
 

URL: http://juliobiason.net/2006/06/16/255306/

  1. def __line__ ():
  2. caller = inspect.stack()[1]
  3. return int (caller[2])
  4.  
  5. def __function__ ():
  6. caller = inspect.stack()[1]
  7. return caller[3]

Report this snippet  

You need to login to post a comment.