This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients Arfrever, alex, josh.r, pitrou, rhettinger, serhiy.storchaka, terry.reedy
Date 2014-04-04.22:18:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <533F2FA1.6070400@free.fr>
In-reply-to <1396648610.44.0.047429918488.issue21101@psf.upfronthosting.co.za>
Content
> PS: Try being a bit more polite.

You could definitely do some research before posting erroneous 
statements (this one isn't difficult to check, as Alex showed). 
Especially when the other posters (Alex and Raymond) are a lot more 
competent than you on the topic at hand.

If you actually try to *reason* about it, there is no other way for:
    x[k] += <some_expr>

to work in the general case than to execute
    x.__setitem__(k, x.__getitem__(k) + <some_expr>)

So, yes, the lookup is done twice, because it currently can't work 
otherwise.
History
Date User Action Args
2014-04-04 22:18:12pitrousetrecipients: + pitrou, rhettinger, terry.reedy, Arfrever, alex, serhiy.storchaka, josh.r
2014-04-04 22:18:12pitroulinkissue21101 messages
2014-04-04 22:18:12pitroucreate