Augmented assignment (ie. += and friends) for Python!

Michael Hudson mwh21 at
Fri May 12 20:30:47 CEST 2000

Michael Hudson <mwh21 at> writes:

> You can read about it and find a patch here:
> Questions, comments, flames, praise, abuse - all welcome.

Well, that provoked a lot of noise, didn't it?

Undeterred I have put a new version of the patch on starship.  The
main change is to support more operators; I now support

+= -= *= /= %= &= ^= |= <<= >>= **=

(does C have &&= and ||=?  I can't remember, and Python's not getting
them anyway).

The patch also contains the changes to the built grammar, so you don't
need to rebuild it to try the patch, but it's bigger.


48. The best book on programming for the layman is "Alice in
    Wonderland";  but  that's because it's  the best book on 
    anything for the layman.
     -- Alan Perlis,

More information about the Python-list mailing list