Re: [Tutor] Combining dictionaries

2005-09-07 Thread Eric Walker
On Wednesday 07 September 2005 11:10 am, bob wrote: > I enjoy "philosophical" discussions like this. To help us have common > terminology I present some quotes from dictionary.com: > > --- > bug: > > An unwanted and unintended property of

Re: [Tutor] Combining dictionaries

2005-09-07 Thread bob
I enjoy "philosophical" discussions like this. To help us have common terminology I present some quotes from dictionary.com: --- bug: An unwanted and unintended property of a program or piece of hardware, especially one that causes it t

Re: [Tutor] Combining dictionaries

2005-09-06 Thread bob
At 04:14 PM 9/6/2005, Mike Cheponis wrote: >On Tue, 6 Sep 2005, Danny Yoo wrote:[snip] > >How can I actively help fix these Python bugs? I am concerned when you use the term "bugs". The behaviors you describe are part of the design of Python, and they work as designed. To me a bug is a failure o

Re: [Tutor] Combining dictionaries

2005-09-06 Thread Danny Yoo
> >> He wants c = a + b to work when a and b are dictionaries. > >> > >> Why is Python broken in such an obvious way? > > > It might not be obvious. If a and b overlap so that they share keys, > > then we might have the following situation: > > I did consider that, but of course, "update" has to

Re: [Tutor] Combining dictionaries

2005-09-06 Thread Mike Cheponis
On Tue, 6 Sep 2005, Danny Yoo wrote: >> No, that's not what he wants. >> >> He wants c = a + b to work when a and b are dictionaries. >> >> Why is Python broken in such an obvious way? > It might not be obvious. If a and b overlap so that they share keys, then > we might have the following situ

Re: [Tutor] Combining dictionaries

2005-09-06 Thread Danny Yoo
> No, that's not what he wants. > > He wants c = a + b to work when a and b are dictionaries. > > Why is Python broken in such an obvious way? Hi Mike: It might not be obvious. If a and b overlap so that they share keys, then we might have the following situation: c1 = a + b c2 = b + a

[Tutor] Combining dictionaries

2005-09-06 Thread Mike Cheponis
>Is this what you want ? > >c = dict(a) >c.update(b) > >Pierre >> Is there an easy way to combine dictionaries? >> >> a = {} >> b = {} >> >> a = {'a':'a', 'b':'b', 'c':'c'} >> b = {'1':1, '2':2, '3':3} >> c = a + b # doesn't seem to work >> >> desired: >> c = {'a':'a', 'b':'b', 'c':'c', '1':1,