[Python-Dev] PEP-498: Literal String Formatting

Guido van Rossum guido at python.org
Mon Aug 17 21:46:04 CEST 2015

On Mon, Aug 17, 2015 at 12:23 PM, Nikolaus Rath <Nikolaus at rath.org> wrote:

> On Aug 16 2015, Paul Moore <p.f.moore at gmail.com> wrote:
> > 2. By far and away the most common use for me would be things like
> > print(f"Iteration {n}: Took {end-start) seconds").
> I believe an even more common use willl be
> print(f"Iteration {n+1}: Took {end-start} seconds")
> Note that not allowing expressions would turn this into the rather
> verbose:
> iteration=n+1
> duration=end-start
> print(f"Iteration {iteration}: Took {duration} seconds")

Let's stop debating this point -- any acceptable solution will have to
support (more-or-less) arbitrary expressions. *If* we end up also
attempting to solve i18n, then it will be up to the i18n toolchain to
require a stricter syntax. (I imagine this could be done during the string
extraction phase.)

--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150817/9a26df23/attachment.html>

More information about the Python-Dev mailing list