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

Eric V. Smith eric at trueblade.com
Tue Aug 11 15:47:06 CEST 2015


On 08/10/2015 04:12 PM, Mike Miller wrote:
> Here are my notes on PEP 498.
> 
> 1. Title:  Literal String Formatting
> 
>     - String Literal Formatting
>     - Format String Expressions
>     ?

I like "String Literal Formatting", but let me sleep on it.

> 2. Let's call them "format strings" not "f-strings".
>    The latter sounds slightly obnoxious, and also inconsistent with the
>    others:
> 
>         r''         raw string
>         u''         unicode object (string)
>         f''         format string

People seem to have already started using f-strings. I think it's
inevitable.

> 3. " This PEP does not propose to remove or deprecate any of the existing
>     string formatting mechanisms. "
> 
>     Should we put this farther up with the section talking about them,
>     it seems out of place where it is.
>

Done.

> 4. "The existing ways of formatting are either error prone, inflexible, or
>     cumbersome."
> 
>     I would tone this down a bit, they're not so bad, quite verbose is a
>     phrase I might use instead.
> 

I'll try and tone it down.

> 5. Discussion Section
>     How to designate f-strings, and how specify the locaton of expressions
>                                                         ^ typo

I already found that one. Thanks.

> 6. Perhaps mention string literal functionality, like triple quotes,
> line-ending backslashes, as MRAB mentions, in addition to the
> concatenation rules.

Good idea.

Eric.

> -Mike
> 
> 
> On 08/07/2015 06:39 PM, Eric V. Smith wrote:
> _______________________________________________
> 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/eric%2Ba-python-dev%40trueblade.com
> 
> 



More information about the Python-Dev mailing list