How to access args as a list?

Rolando Espinoza La Fuente darkrho at gmail.com
Sat Apr 3 19:21:38 EDT 2010


On Sat, Apr 3, 2010 at 6:28 PM, kj <no.email at please.post> wrote:
> 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.)
>

def spam(*args, **kwargs):
    print args
    print kwargs

class Spam:
    def __init__(self, *args, **kwargs):
        print args
        print kwargs

That's what are you looking for?

Regards,

~Rolando



More information about the Python-list mailing list