The ** operator ambiguous?

Klaas mike.klaas at gmail.com
Tue Jul 17 00:25:27 CEST 2007


On Jul 16, 10:40 am, Robert Dailey <rcdai... at gmail.com> wrote:
> I noticed that the ** operator is used as the power operator, however
> I've seen it used when passing variables into a function. For example,
> I was researching a way to combine dictionaries. I found that if you
> do this:
>
> a = {"t1":"a", "t2":"b"}
> b = {"t3":"c"}
> dict( a, **b )
>
> This combines the two dictionaries.

Use dict.update to combine dictionaries.

-Mike




More information about the Python-list mailing list