[Python-Dev] What to do for bytes in 2.6? (original) (raw)

Christian Heimes lists at cheimes.de
Fri Jan 18 09:27:26 CET 2008


Guido van Rossum wrote:

Oh, you won't. Just don't use the -3 command-line flag and don't put "from future import " at the top of your modules, and you won't have to change your ways at all. You can continue to distribute your packages in 2.5 syntax that will also work with 2.6, and your users will be happy (as long as they don't want to use your code on 3.0 -- but if you want to give them that, that is when you will finally be forced to face the issue. :-)

from future import bytes ? What should the future statement change?

Note that I believe that the -3 flag should not change semantics -- it should only add warnings. Semantic changes must either be backwards compatible or be requested explicitly with a forward import (which 2to3 can remove).

Agreed! Should the -3 flag also warn about deprecated features which can easily migrated with 2to3? In the past a warning for `` (back ticks) were added. The feature is deprecated but the migration is very simple.

A 2to26 fixer may be worth implementing, too. It could migrate minor changes like `` -> repr and "except egg, spam" -> "except egg as spam".

Christian



More information about the Python-Dev mailing list