[Python-ideas] Draft PEP on string interpolation

MRAB python at mrabarnett.plus.com
Fri Aug 21 02:28:08 CEST 2015


On 2015-08-21 00:10, Mike Miller wrote:
> The ground seems to be settling on the issue, so I have tried my hand at a grand
> unified pep for string interpolation.
>
> I originally started writing thinking I would fight arbitrary expressions,
> though agreeing they would be very useful.  In my research however, I discovered
> that they've become an industry standard of sorts.  So, I pivoted and started
> thinking of mitigation strategies to reduce their downsides instead.
>
> There's still plenty to do and details to iron out, I'd appreciate your help.
> If this PEP doesn't stick I hope fragments of it can be useful for others.
>
> https://bitbucket.org/mixmastamyk/docs/src/default/pep/pep-05XX.rst
>
> (Pls excuse the inline links, I've not moved them to the footer yet.)
>
In the "Composition with other prefixes" section, I don't like how
f'...' uses {} syntax but fb'...' uses % syntax.

In the "Environment Access" section, I would've expected f'Home folder: 
${HOME}' to do ''.join('Home folder: $', HOME.__format__('')).

BTW, in the "Reference Implementation(s)" section, it's "its work", not
"it's work".



More information about the Python-ideas mailing list