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

Wes Turner wes.turner at gmail.com
Tue Aug 18 02:57:05 CEST 2015


On Aug 17, 2015 2: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")

* Is this more testable?
* mutability of e.g. end.__sub__
   * (do I add this syntax highlighting for Python < 3.6?)

>
>
> Best,
> -Nikolaus
>
> --
> GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
> Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F
>
>              »Time flies like an arrow, fruit flies like a Banana.«
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
https://mail.python.org/mailman/options/python-dev/wes.turner%40gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150817/629a9e51/attachment.html>


More information about the Python-Dev mailing list