Re: What's the use of changing func_name?

2005-05-19 Thread Michael Hudson
Robert Kern <[EMAIL PROTECTED]> writes: > could ildg wrote: > > Thank you for your help. > > I know the function g is changed after setting the func_name. > > But I still can't call funciton g by using f(), when I try to do > > this, error will occur: > > > > > g.func_name="f" > print g

Re: What's the use of changing func_name?

2005-05-19 Thread could ildg
Thanks to Robert Kern. You mean that though we can change the func_name of a function, but we still can't call it by func_name, and the func_name is only useful in some other circumstances? I also think so now after I have tried so many times on this puzzled func_name property. On 5/19/05, Robert K

Re: What's the use of changing func_name?

2005-05-18 Thread Robert Kern
could ildg wrote: > Thank you for your help. > I know the function g is changed after setting the func_name. > But I still can't call funciton g by using f(), when I try to do > this, error will occur: > > g.func_name="f" print g > > > f() > > Traceback (most recent call last): >

Re: What's the use of changing func_name?

2005-05-18 Thread hemanth
could ildg wrote: > Thank you for your help. > I know the function g is changed after setting the func_name. > But I still can't call funciton g by using f(), when I try to do > this, error will occur: > > >>> g.func_name="f" > >>> print g > > >>> f() > Traceback (most recent call last): > File

Re: What's the use of changing func_name?

2005-05-18 Thread Steven Bethard
could ildg wrote: > Thank you for your help. > I know the function g is changed after setting the func_name. > But I still can't call funciton g by using f(), when I try to do > this, error will occur: > > g.func_name="f" print g > > > f() > > Traceback (most recent call last): >

Re: What's the use of changing func_name?

2005-05-18 Thread could ildg
Thank you for your help. I know the function g is changed after setting the func_name. But I still can't call funciton g by using f(), when I try to do this, error will occur: >>> g.func_name="f" >>> print g >>> f() Traceback (most recent call last): File "", line 1, in ? NameError: name 'f' is

Re: What's the use of changing func_name?

2005-05-18 Thread Robert Kern
could ildg wrote: > def a(func): > def _inner(*args, **kwds): > print "decorating..." > return func(*args, **kwds) > _inner.func_name = func.func_name -->when I delete this line, the > rusult is the same. why? > return _inner > > @a > def g(*args): > for x in args:

What's the use of changing func_name?

2005-05-18 Thread could ildg
def a(func): def _inner(*args, **kwds): print "decorating..." return func(*args, **kwds) _inner.func_name = func.func_name -->when I delete this line, the rusult is the same. why? return _inner @a def g(*args): for x in args: print x print "this is in fu