Pep 3105: the end of print?

"Martin v. Löwis" martin at v.loewis.de
Mon Feb 26 23:46:35 EST 2007


Edward K Ream schrieb:
> In other words, the consequence of pep 3105 will be that *nobody* who wants 
> their app to be portable will be able to use print until *everybody* has 
> converted to Python 3.x.   I doubt that is what Guido had in mind, but I may 
> be mistaken :-)

That's not true. Many uses of print work just fine whether print is a
function. For example, from the standard library:

quopri.py: print "-t: quote tabs"
can be rewritten as
           print("-t: quote tabs")


shlex.py: print 'shlex: reading from %s, line %d' \
                % (self.instream, self.lineno)
can be rewritten as
          print('shlex: reading from %s, line %d' \
                % (self.instream, self.lineno))

So people can rewrite their code so that it uses print, and still works
in both Python 1.5 and 3.0.

Of course, there are many uses that cannot be converted this way, but
it's not true that *nobody* who want there app to be portable will be
able to use print until *everybody* has converted to Python 3.x.

Regards,
Martin



More information about the Python-list mailing list