Name of current method

Thomas Guettler pan-newsreader at thomas-guettler.de
Fri Nov 29 13:22:14 EST 2002


On Thu, 28 Nov 2002 20:26:03 +0100, Thomas Guettler wrote:

> Hi!
> 
> How can I get the name of the method which is executed?
> 
> Example:
> 
> def mymethod(self):
> 	print self.__magic__
> 
> --> "mymethod"

Thank you all for those different methods!

I try to explain why I need it:

I am writing a "prev/next" pager for a zope product.
It should work like the prev/next buttons at the
bottom of a google result. That's why I need the
methodname: href="foomethod?skip=30...."

The "pager" will be used in several methods. That's
why I can't hardcode "foomethod".

Happy Hacking!
 
  thomas

-- 
Thomas Guettler <guettli at thomas-guettler.de>
http://www.thomas-guettler.de



More information about the Python-list mailing list