[Tutor] the "**" operator?

Joel Goldstick joel.goldstick at gmail.com
Fri Dec 10 20:40:08 CET 2010


The value you provide as the second argument must be a dictionary.

Google kwargs python for lots of more in depth info

On Fri, Dec 10, 2010 at 2:14 PM, Alex Hall <mehgcap at gmail.com> wrote:

> Hi all,
> I was googling a way to do something like
> mydict=mydict.extend(additionaldict)
>
> and someone on a forum recommends this:
> mydict=dict(mydict, **additionaldict)
> What is the ** doing here? I tried to look it up, but Google seems to
> ignore it since it is punctuation. The poster on the forum says it
> will put all elements of additionaldict in mydict that are not already
> in mydict, which is the behavior I am looking for, but I am not sure
> why this would be so. TIA.
>
> --
> Have a great day,
> Alex (msg sent from GMail website)
> mehgcap at gmail.com; http://www.facebook.com/mehgcap
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
Joel Goldstick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20101210/d0fb9f0c/attachment.html>


More information about the Tutor mailing list