Michael wrote:
def func2():
do some stuff 2
print self-name
return True
I imagine this means things like closures which I'm not familiar with
(I'm not a CS person). In this case, each function is part of a class,
so I imagine I can take a dir() of the class if necessary.
[EMAIL PROTECTED] wrote:
Hi, I was wondering how I may get a python function to know what its
name is without me having to write it manually? For example:
def func1():
do some stuff1
print 'func1'
return True
def func2():
do some stuff2
print 'func2'
return
[EMAIL PROTECTED] wrote:
How do I get some
sort of macro behavior so I don't have to write the same thing over and
over again, but which is also not neatly rolled up into a function,
such as combining the return statements with a printing of self-name?
Decorators:
Hi, I was wondering how I may get a python function to know what its
name is without me having to write it manually? For example:
def func1():
do some stuff1
print 'func1'
return True
def func2():
do some stuff2
print 'func2'
return True
should be more like
def func1():