On Wed, 14 Nov 2012 14:53:11 -0600
Mark Adam <[email protected]> wrote:
> On Wed, Nov 14, 2012 at 1:37 PM, Xavier Morel <[email protected]> wrote:
> > On 2012-11-14, at 19:54 , Mark Adam wrote:
> >>
> >> Merging of two dicts is done with dict.update.
> >
> > No, dict.update merges one dict (or two) into a third one.
>
> No. I think you need to read the docs.
>
> >> How do you do it on
> >> initialization? This doesn't make sense.
> >
> > dict(d1, **d2)
>
> That's not valid syntax is it?
Why don't you try it for yourself:
>>> d1 = {1:2}
>>> d2 = {3:4}
>>> dict(d1, **d2)
{1: 2, 3: 4}
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com