Getting method name from within the class method

Ben Finney bignose+hates-spam at benfinney.id.au
Fri Oct 20 04:11:17 CEST 2006


Mitko Haralanov <mitko at qlogic.com> writes:

> On Thu, 19 Oct 2006 08:16:57 +0200
> Fredrik Lundh <fredrik at pythonware.com> wrote:
>
> > why are you writing functions that needs to output their own name
> > a 100 times?  why should the program's *external* behaviour depend
> > on such an irrelevant detail of its internal design?  sounds like
> > lousy design to me.
>
> I am sorry if I sound defensive in my reply here, I am not trying to
> be.

I believe Frederik's abrasive approach is an attempt to help you be
dispassionate about your design, so that possible flaws can be
examined rationally.

> What does it matter why I am doing it? I only want to know if it's
> possible and if so, how?

Most programming forums, this one included, see a steady flow of
people who, having gone some way down a particular path, believe that
all they need is to be shown how to complete the journey. An
examination of the *actual* problem to be solved often shows that
there is a better way to go.

We prefer to know what actual problem is to be solved, so that false
starts can be terminated quickly, and a practical approach suggested
instead. Without knowing what the actual problem is, we can't know
what to suggest.

-- 
 \            "There was a point to this story, but it has temporarily |
  `\                 escaped the chronicler's mind."  -- Douglas Adams |
_o__)                                                                  |
Ben Finney




More information about the Python-list mailing list