Yet another string formatting proposal (Was: python-dev Summary for 2002-11-16 through 2002-11-30)

Mike Rovner mike at bindkey.com
Tue Dec 3 15:09:21 EST 2002


> __ http://mail.python.org/pipermail/python-dev/2002-November/030304.html
>
> Oren Tirosh proposed something (read the title to figure out what).
> He proposed the following syntax::
>
> >>> "\(a) + \(b) = \(a+b)\n"
>    >>> r"\(a) + \(b) = \(a+b)\n".cook()

Why we should follow that expression idiom at all?
Python follows more statement-wise approach that expression-wise.
In another thread we have GvR's regret of expressions filter, map and
lambda.

We already have print notion for that purpose. Instead of introducing
another one, IMHO better extend print to output to a string.
Syntax may be like
    print >>var, <expr-list>
or we can do better.

Regards,
Mike











More information about the Python-list mailing list