[Python-ideas] Briefer string format
Chris Angelico
rosuav at gmail.com
Fri Aug 7 12:09:57 CEST 2015
On Fri, Aug 7, 2015 at 6:12 PM, Guido van Rossum <guido at python.org> wrote:
> Maybe in the end the f-string proposal is the right one -- it's minimally
> obtrusive and yet explicit, *and* backwards compatible? This isn't saying
> I'm giving up on always-interpolation; there seems to be at least an even
> split between languages that always interpolate (PHP?), languages that have
> a way to explicitly disable it (like single quotes in shell), and languages
> that require some sort of signal (like C#).
PHP, like shell languages, has "interpolated strings with $double
$quotes" and 'uninterpreted strings with single quotes'. At my last
PHP job, the style guide eschewed any use of double quoted strings,
but that job's style guide wasn't something I'd recommend, so that may
not be all that significant. (Part of the problem was that one of the
programmers used string interpolation in ways that killed readability,
so I can understand the complaint.)
ChrisA
More information about the Python-ideas
mailing list