Identifing current function

Ben Finney bignose-hates-spam at and-benfinney-does-too.id.au
Wed Jan 21 21:11:43 EST 2004


On Thu, 22 Jan 2004 02:21:54 GMT, Brian Donovan wrote:
>   Is there a way to identify the current function. For example:
> 
> class A:
>    def B(self):
>       print current_function_name

Functions, like all objects, have no inherent name.  Names are bound to
objects; each object can have zero, one or more names bound to it.  None
of the names has any particular status as "the" name of the object.

-- 
 \          "I moved into an all-electric house. I forgot and left the |
  `\   porch light on all day. When I got home the front door wouldn't |
_o__)                                         open."  -- Steven Wright |
Ben Finney <http://bignose.squidly.org/>



More information about the Python-list mailing list