Re: Access function name from within a function

2008-03-12 Thread Steven D'Aprano
On Thu, 13 Mar 2008 00:16:13 +0100, Hellmut Weber wrote: > Hi, > i would liek to define an error routine which print amongs other things > the name of the function from which it has been called. You mean like Python exceptions already do? >>> def broken(): ... x = 100 + 'foo' ... retur

Access function name from within a function

2008-03-12 Thread Hellmut Weber
Hi, i would liek to define an error routine which print amongs other things the name of the function from which it has been called. Having tried def foo(): print dir() and all other ideas which came to my (rather python newbie) mind. Googling too did not show me a possibility. IOW what I'm