newbie question - identifying name of method

Terry Reedy tjreedy at udel.edu
Mon Feb 14 13:23:14 EST 2005


<mirandacascade at yahoo.com> wrote in message 
news:1108396343.218224.79980 at c13g2000cwb.googlegroups.com...
> Does Python provide some sort of mechanism for answering the question:
> what method am I in?

I believe that Python, the language defined in the Ref Manual, does not. 
The CPython implementation adds enough introspection into its workings that 
you can get at the function code definition name, with the simplest method 
being the one given by Fredrik.  If you want the names currently bound to 
the function object in a particular namespace, you have to do something 
else.

Terry J. Reedy






More information about the Python-list mailing list