

Understanding python *args and **kwargs - rama_vadakattu
http://blog.dpeepul.com/2009/10/02/django-guys-let-us-understand-python-args-and-kwargs/

======
jeff18

      def test(a, b, *args, **kwargs):
        print a, b, args, kwargs
    
      >>> test(1, 2, 3, 4, aa=5, bb=6)
      1 2 (3, 4) {'aa': 5, 'bb': 6}
    

'nuff said

------
TommyWiseau
Jesus, does this really require such a long article? Just open the interpreter
and check it out. Took me 5 minutes when I decided to figure it out.

~~~
plinkplonk
The number of upvotes such a content-lite article gets on HN is interesting,
and maybe an indicator of a changing demographic here.

What's next? a few pages on Ruby's method_missing? :-)

------
DannoHung
I've noticed quite a bit of introductory level Python stuff showing up on HN
lately, and while there's nothing wrong with that (and I appreciated the link
to the Decorator PEP because I'd forgotten about the decorator generator 3rd
party module), I wonder what's driving it.

~~~
juvenn
Because there're unqualified hackers here.

~~~
scott_s
I was unfamiliar with args and kwargs in Python, despite using the language
for lots of scripting, and liking the language immensely. It's a simple
concept and now I get it, but I'm still unclear on what _star_ and _starstar_
mean, which is something I keep meaning to look up.

Does that make me an unqualified hacker?

~~~
mattyb
[http://docs.python.org/dev/tutorial/controlflow.html#unpacki...](http://docs.python.org/dev/tutorial/controlflow.html#unpacking-
argument-lists)

