[Python-ideas] Adding "+" and "+=" operators to dict
Chris Barker - NOAA Federal
chris.barker at noaa.gov
Thu Feb 12 17:00:41 CET 2015
+1 on +=
Isn't that confusing ;-)
Yes, we have dict.update(), but the entire reason += exists (all the
augmented assignment operators -- they are called that, yes?) is
because we didn't want methods for everything.
It particular, I believe a major motivator was numpy, where in-place
operations are a major performance boost. Sure, numpy could have added
methods for all those, but the operator syntax is so much nicer, why
not use it where we can?
And I prefer + to | ... Seems much more obvious to me.
Chris
-Chris
More information about the Python-ideas
mailing list