A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-October/113943.html below:

[Python-Dev] counterintuitive behavior (bug?) in Counter with +=

[Python-Dev] counterintuitive behavior (bug?) in Counter with += [Python-Dev] counterintuitive behavior (bug?) in Counter with +=Raymond Hettinger raymond.hettinger at gmail.com
Fri Oct 7 13:39:32 CEST 2011
On Oct 3, 2011, at 6:12 AM, Lars Buitinck wrote:

>  After some digging, I found out that Counter [2] does not
> have __iadd__ and += copies the entire left-hand side in __add__!

This seems like a reasonable change for Py3.3.


> I also figured out that I should use the update method instead, which
> I will, but I still find that uglier than +=. I would submit a patch
> to implement __iadd__, but I first want to know if that's considered
> the right behavior, since it changes the semantics of +=:

Yes, update() is the fastest way.


Raymond

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20111007/11e4170a/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4