Moving from Python 2 to Python 3: A 4 page "cheat sheet"

Terry Reedy tjreedy at udel.edu
Wed Dec 2 19:12:52 EST 2009


Mark Summerfield wrote:

> Well it seems clear to me that the BDFL wants to kill of % formatting,
> but wasn't able to for Python 3...

Definitely. I thought of adding autonumbering of fields (in 3.1) in 
response to his inquiry about the barriers to moving to .format. That 
solved 'simplicity of defaults'. The other, 'Autoconversion of installed 
base' still awaits.

> So I still think it is reasonable
> (1) to describe it as deprecated and (2) to only teach and use
> str.format().

At the moment (3.1) there are, unfortunately, library packages that 
require % for formatting (logging, I believe, for one). There has been 
discussion on adding a new option for 3.2, but I do not know what will 
happen. Depends on whether you want to be absolutely complete. I 
strictly use .format when I can, which so far is always.

Terry Jan Reedy




More information about the Python-list mailing list