[Python-Dev] Replacement for print in Python 3.0

Antoine Pitrou solipsis at pitrou.net
Tue Sep 6 16:33:36 CEST 2005

(just my 2 cents)

Le mardi 06 septembre 2005 à 07:23 -0700, Guido van Rossum a écrit :
> On 9/6/05, Barry Warsaw <barry at python.org> wrote:
> > printf('$1 forgot to frobnicate the $2!\n', username, file.name,
> >        to=sys.stderr)
> Is it worth doing this and completely dropping the %-based formats in
> Py3k? (Just asking -- it might be if we can get people to get over the
> shock of $ becoming first class ;-).

For me, the problem with that proposal is not the precise format syntax,
but the fact that formatting is tied to a specific function which _also_
outputs stuff to screen.

There are really use cases where you want formatting without using a
"print" function in conjunction. Web pages, sending notification
e-mails, changing labels in GUI apps... anything that talks to the user
in a different way than using stdout.

IMO, printing and formatting must be distinct (*). And formatting should
be convenient and i18n-friendly (i18n is more and more important in
today's apps).

(*) they should be treated separately in the discussion, anyway



More information about the Python-Dev mailing list