auto increment operator??

Michael Hudson mwh21 at cam.ac.uk
Tue May 30 08:08:14 EDT 2000


Thomas Wouters <thomas at xs4all.net> writes:

> Not that it isn't a very helpful operator, in C, regardless of the
> underlying assembler :-) I would like to see the +=-style operators in
> Python, as they (imho) clearly fit in, and using '+= 1' is not that much
> more typing than '++'. It also stays an assignment statement, and it still
> *looks* like an assignment operator. I hope Guido or someone with Guido's
> ear (or permission) in time grabs Michael Hudsons' patch and incorporates it
> into the CVS tree... Hopefully even before 1.6, but I'm not putting up any
> bets ;-P

To make this more likely modify my patch so that one can implement
__addeq__ (or equivalent) methods, but so Python falls back to __add__
in the default case.

This requires a large rewriting of the patch, btw, and my finals start
in less than a week...

Cheers,
Michael

-- 
42. You can measure a programmer's perspective by noting his 
    attitude on the continuing vitality of FORTRAN.
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html



More information about the Python-list mailing list