Mitko Haralanov <[EMAIL PROTECTED]> writes:
> On Thu, 19 Oct 2006 08:16:57 +0200
> Fredrik Lundh <[EMAIL PROTECTED]> 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 detai
On 18 Oct 2006 21:01:36 -0700
"George Sakkis" <[EMAIL PROTECTED]> wrote:
> from inspect import getframeinfo,currentframe
>
> class test(object):
> def a_method(self,this,that):
> print getframeinfo(currentframe())[2]
Thanx for the reply! This about the most useful one I've gotten so
On Thu, 19 Oct 2006 08:16:57 +0200
Fredrik Lundh <[EMAIL PROTECTED]> 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 t
> on that
on what
--
http://mail.python.org/mailman/listinfo/python-list
Gabriel Genellina wrote:
> I could see some merit on getting that info in an automatic way.
> The only reason I can see for knowing the name of a function is for
> debugging purposes - maybe some kind of logging utility. If you are in
> "debug mode", resources are not too important, but correct
Mitko Haralanov wrote:
> class test(object):
>> ... def a_method(self,this,that):
>> ... print self.a_method.__name__
>
> Doing the above will obviously work!
so will
print "a_method"
of course. no need to be silly when you don't have to.
> However, I don't want to have to use
Mitko Haralanov wrote:
> I need to be able to get the name of the currently executed method
> within that method. I know that the method object does have the
> __name__ attribute but I know know how to access it from withing the
> method.
>
> Something like this:
>
> class A:
>
> def a_
Mitko Haralanov wrote:
> On 18 Oct 2006 14:38:12 -0700
> [EMAIL PROTECTED] wrote:
>
> > >>> class test(object):
> > ... def a_method(self,this,that):
> > ... print self.a_method.__name__
>
> Doing the above will obviously work!
>
> However, I don't want to have to use the name of the function i
On Wed, 18 Oct 2006 13:59:55 -0700, Mitko Haralanov wrote:
> I need to be able to get the name of the currently executed method
> within that method. I know that the method object does have the
> __name__ attribute but I know know how to access it from withing the
> method.
Here is a useful (mode
At Wednesday 18/10/2006 19:30, [EMAIL PROTECTED] wrote:
> > > >>> class test(object):
> > > ... def a_method(self,this,that):
> > > ... print self.a_method.__name__
> >
> >Doing the above will obviously work!
> >
> >However, I don't want to have to use the name of the function in the
> >print
In <[EMAIL PROTECTED]>, Mitko Haralanov
wrote:
> On 18 Oct 2006 14:38:12 -0700
> [EMAIL PROTECTED] wrote:
>
>> >>> class test(object):
>> ... def a_method(self,this,that):
>> ... print self.a_method.__name__
>
> Doing the above will obviously work!
>
> However, I don't want to have to use
Gabriel Genellina wrote:
> At Wednesday 18/10/2006 18:59, Mitko Haralanov wrote:
>
> > > >>> class test(object):
> > > ... def a_method(self,this,that):
> > > ... print self.a_method.__name__
> >
> >Doing the above will obviously work!
> >
> >However, I don't want to have to use the name of the
> for f in $(ls)
> do
> sed -e "s/print self.a_method.__name__/print self.new_name.__name/g"
> done
thats a terrible bit of broken shell code, sorry !
--
http://mail.python.org/mailman/listinfo/python-list
Mitko Haralanov wrote:
> On 18 Oct 2006 14:38:12 -0700
> [EMAIL PROTECTED] wrote:
>
> > >>> class test(object):
> > ... def a_method(self,this,that):
> > ... print self.a_method.__name__
>
> Doing the above will obviously work!
>
> However, I don't want to have to use the name of the function i
At Wednesday 18/10/2006 18:59, Mitko Haralanov wrote:
> >>> class test(object):
> ... def a_method(self,this,that):
> ... print self.a_method.__name__
Doing the above will obviously work!
However, I don't want to have to use the name of the function in the
print statement (the ".a_method."
On 18 Oct 2006 14:38:12 -0700
[EMAIL PROTECTED] wrote:
> >>> class test(object):
> ... def a_method(self,this,that):
> ... print self.a_method.__name__
Doing the above will obviously work!
However, I don't want to have to use the name of the function in the
print statement (the ".a_method."
Mitko Haralanov wrote:
> I need to be able to get the name of the currently executed method
> within that method. I know that the method object does have the
> __name__ attribute but I know know how to access it from withing the
> method.
>
> Something like this:
>
> class A:
>
> def a_m
Mitko Haralanov wrote:
> I need to be able to get the name of the currently executed method
> within that method. I know that the method object does have the
> __name__ attribute but I know know how to access it from withing the
> method.
>
> Something like this:
>
> class A:
>
> def a_me
18 matches
Mail list logo