Python 2.0b1 is released!

Dan Schmidt dfan at harmonixmusic.com
Fri Sep 8 09:39:47 EDT 2000


I probably shouldn't be jumping into this discussion, especially since
now augmented assignment is a done deal, but here's the reason I find
augmented assignment natural:

  x = x + 1

Here it looks to me like we're retrieving a value from x, mucking with
it, and then assigning the result of the muckage to x.  Accurate, but
convoluted.

  x += 1

Here it looks to me like we're saying directly to x, "Hey, increment
yourself by one."  It almost feels like a method call.

To me, the second example mirrors much more directly the way I think
about the operation.  So, thanks, Python implementors!

While I'm at it, here are a couple of obscure new things I'd like to
thank them for.  Things like augmented assignment and list comprehensions
get all the attention, but these two new features are very handy for me:

 - The beginswith and endswith methods for strings, which I was doing
   by hand before (though I'm surprised that they're not also in the
   string module).

 - The updating of ftplib to allow REST commands for resuming
   downloads.  I had made my own local hacks to the 1.5.2 ftplib (just
   a few days ago!) to do this, and now I don't need to.

-- 
                 Dan Schmidt | http://www.dfan.org
Honest Bob CD now available! | http://www.dfan.org/honestbob/cd.html



More information about the Python-list mailing list