function arguments
Mike Fletcher
mfletch at tpresence.com
Thu Jul 6 12:06:18 EDT 2000
PythonWin 1.5.42+ (#0, Mar 29 2000, 20:23:26) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
Portions Copyright 1994-2000 Mark Hammond (MHammond at skippinet.com.au)
>>> def x( fred, lisa ):
... pass
...
>>> x.func_code.co_varnames
('fred', 'lisa')
>>> class A:
... def x( fred, lisa ):
... pass
...
>>> b = A()
>>> b.x.im_func.func_code.co_varnames
('fred', 'lisa')
>>>
Neat thing about pythonwin is that you can do that in the interactive
interpreter with it telling you which elements are available :) . Of
course, you can also use the Pythonwin browser :) .
Yes, her name was Lola.
Yes, she wanted to be a show girl.
She was tired of the jokes.
She'd show them all, Las Vegas was only a bus ticket away.
Yeah, that's the ticket, she'd show them all! :o)
Mike
-----Original Message-----
From: david_ullrich at my-deja.com [mailto:david_ullrich at my-deja.com]
Sent: Thursday, July 06, 2000 11:44 AM
To: python-list at python.org
Subject: Re: function arguments
In article
<Pine.LNX.4.21.0007061257160.17492-100000 at krispc6.physik.uni-karlsruhe.d
e>,
Johannes Zellner <johannes at zellner.org> wrote:
...
> def fun(fred, lola):
> ...
>
> something like `arglist(fun)' should return [ 'fred', 'lola' ]
...
More information about the Python-list
mailing list