A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2016-November/146823.html below:

[Python-Dev] Parsing f-strings from PEP 498 -- Literal String Interpolation

[Python-Dev] Parsing f-strings from PEP 498 -- Literal String Interpolation [Python-Dev] Parsing f-strings from PEP 498 -- Literal String InterpolationEric V. Smith eric at trueblade.com
Wed Nov 9 17:14:37 EST 2016
On 11/9/2016 11:35 AM, Paul Moore wrote:
> On 9 November 2016 at 16:20, Fabio Zadrozny <fabiofz at gmail.com> wrote:
>> Also, as a feedback, I found it a bit odd that there can't be any space nor
>> new line between the last format specifiers and '}'
>
> FWIW, that is the case for normal format strings, as well:
>
>>>> print("{!r\n}".format(12))
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ValueError: expected ':' after conversion specifier
>
> I guess the behaviour is simply inherited from there.

Right. That and the fact that whitespace is significant inside the 
format specifier portion:

 >>> '{:%H:%M:%S\n}'.format(datetime.datetime.now())
'17:14:10\n'

I don't think it's worth changing this to allow whitespace after the 
optional one-character conversion flag.

Eric.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4