4 ms·
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.
by TommyWiseau 17y ago
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.
- algorias 17y ago5 minutes followed by a sweet aha! moment. What the article seems to miss, though (only skimmed it), is that you need to be incredibly careful with taking kwargs, specially if you're passing them along into secondary functions within the called function. Hidden bugs lie that way, as you could end up with bad/misspelled args that you think are having an effect, but aren't. Always make sure all kwargs get unpacked.
- ubernostrum 17y agoIt's also covered in the official Python tutorial.
- plinkplonk 17y agoThe 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? :-)
- drawkbox 17y agoNo kidding. A much, much more simple way to put it is anything *args is a list, anything **kwargs is a dictionary. The * simply means list (set). ** simply means dictionary (name/value pairs) * and ** has a much different meaning in other languages as parameters. * args is very similar to ... in other languages that let you send n arguments.