[Python-ideas] dict '+' operator and slicing support for pop

Andrii V. Mishkovskyi mishok13 at gmail.com
Wed Mar 18 08:52:35 CET 2009

On Tue, Mar 17, 2009 at 8:17 PM, Raymond Hettinger <python at rcn.com> wrote:
>>> a.update(b)
>>> return a
> Why take two short, simple lines with unequivocal meaning
> and then abbreviate them with something mysterious (or
> at least something with multiple possible interpretations)?
> Mappings exist in many languages now.  Can you point
> to another language that has found it worthwhile to have
> both an update() method and an addition operator?
> Also, consider that dicts are one of our most basic APIs
> and many other objects model that API.  It behooves us
> to keep that API as simple and thin as possible.
> IMO, this change would be gratuituous.  None of the code
> presented so far is significantly improved.  Essentially, we're
> looking at a trivial abbreviation, not an actual offering of
> new capabilities.

Reasonable enough.

> -1 all the way around.

Does that also mean -1 on list.pop() accepting slices proposal?

> Raymond
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas

Wbr, Andrii V. Mishkovskyi.

He's got a heart of a little child, and he keeps it in a jar on his desk.

More information about the Python-ideas mailing list