difference between kwargs and **kwargs

A forum for general discussion of the Python programming language.

difference between kwargs and **kwargs

Postby Elbi » Wed Apr 02, 2014 4:14 pm

what's the difference between kwargs and **kwargs
Elbi
 
Posts: 3
Joined: Sun Oct 27, 2013 3:23 pm

Re: difference between kwargs and **kwargs

Postby stranac » Wed Apr 02, 2014 4:37 pm

**name is the syntax used for
  • unpacking a mapping(such as a dict) in function calls
  • defining a function that takes arbitrary keyword arguments
kwargs is just a normal python name.
It's a name often used for the dictionary of arbitrary keyword arguments in functions.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1144
Joined: Thu Feb 07, 2013 3:42 pm

Re: difference between kwargs and **kwargs

Postby Elbi » Wed Apr 02, 2014 6:12 pm

thx
Elbi
 
Posts: 3
Joined: Sun Oct 27, 2013 3:23 pm


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 2 guests