tough-to-explain Python

Piet van Oostrum piet at
Wed Jul 8 10:11:35 CEST 2009

>>>>> Simon Forman <sajmikins at> (SF) wrote:

>SF> Why would you even tell the poor bastards about "+=" before they were
>SF> comfortable with (python's style of) function calls, immutable
>SF> integers, mutable lists and immutable tuples?

>SF> Let them use "x = x + y" until they have enough knowledge to
>SF> understand "augmented" assignment.

And *then* you can tell them that "x += y" can be subtly different from 
"x = x + y", which is what happened in the example that the OP gave.
Piet van Oostrum <piet at>
URL: [PGP 8DAE142BE17999C4]
Private email: piet at

More information about the Python-list mailing list