[Python-Dev] Other library code transformations

Guido van Rossum guido@python.org
Mon, 03 Jun 2002 01:09:09 -0400

> What about "foo = foo + 1" => "foo += 1"?

I'm not for making peephole changes like this.  It's easy to make
mistakes (even if you run the test suite) if you don't guess the type
of a variable right.  I think it's better to bring code up to date in
style only as part of a serious rewrite of the module containing it --
so you can fix up all different aspects.  It's often kind of strange
to see a modernization like this in code that otherwise shows it
hasn't been modified in 5 years...

(Exceptions are to get rid of deprecation warnings, or outright
failures, of course.)

--Guido van Rossum (home page: http://www.python.org/~guido/)