On Apr 5, 11:49 am, kj <no.em...@please.post> wrote: > In <4bb802f7$0$8827$c3e8...@news.astraweb.com> Steven D'Aprano > <st...@remove-this-cybersource.com.au> writes: > > >On Sat, 03 Apr 2010 22:58:43 +0000, kj wrote: > >> Suppose I have a function with the following signature: > > >> def spam(x, y, z): > >> # etc. > > >> Is there a way to refer, within the function, to all its arguments as a > >> single list? (I.e. I'm looking for Python's equivalent of Perl's @_ > >> variable.) > >Does this help? > >>>> def spam(a, b, c=3, d=4): > >... pass > >... > >>>> spam.__code__.co_varnames > >('a', 'b', 'c', 'd') > > That's very handy. Thanks! > > >The hardest part is having the function know its own name. > > Indeed. Why Python does not provide this elmentary form of > introspection as a built-in variable is extremely puzzling to me > (even--no, *more so*--after reading PEP 3130). >
The Rejection Notice in the PEP certainly not give very many details for why the PEP was rejected. The first question in the Open Issues could easily be answered "yes." -- http://mail.python.org/mailman/listinfo/python-list