Python Gotcha's?

Evan Driscoll driscoll at cs.wisc.edu
Thu Apr 5 18:19:41 EDT 2012


On 4/5/2012 17:11, Evan Driscoll wrote:
> In particular, the translation of 'a+=b' to 'temp = a + b; a = temp' is
> *not* a very natural one to me.

To expand on this point slightly, because of common C++ idioms guided by
efficiency, I would be much more likely to think of 'a + b' as 'temp =
a, temp += b, temp' than the Python way: in other words, to the extent
that I think of += and + being implemented in terms of each other, I
think of + as being implemented via +=.

Evan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 552 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20120405/bed76748/attachment.sig>


More information about the Python-list mailing list