<div dir="ltr">Sorry, I meant to write <span style="font-size:12.8000001907349px">'foo'r'\bar' at the end of my previous message.</span></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 23, 2015 at 10:08 PM, Alexander Belopolsky <span dir="ltr"><<a href="mailto:alexander.belopolsky@gmail.com" target="_blank">alexander.belopolsky@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Thu, Jul 23, 2015 at 10:22 AM, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="overflow:hidden"><span class="">I don't think I want this behaviour:<br>
<br>
f'{spam}' '{eggs}'<br>
=> format(spam) + '{eggs}'<br>
<br></span>
for two reasons. Firstly, I already have (at least!) one way of getting<br>
that behaviour, such as explicit + concatenation as above.<span class=""><br>
<br>
Secondly, it feels that this does the concatenation in the wrong order.<br>
Implicit concatenation occurs as early as possible in every other case.<br>
But here, we're delaying the concatenation until after the format. So<br>
this feels wrong to me.<br>
<br></span>
(Again, I'm talking semantics, not implementation. Clever tricks with<br>
escaping the brackets don't matter.)</div></blockquote></div><br>I don't know what you would call "Clever tricks with escaping", but I would expect</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"> f'{spam}' '{eggs}'<br></div><div class="gmail_extra"> => '{spam}{{eggs}}'.format(**ChainMap(locals(), globals())</div><div class="gmail_extra"><br></div><div class="gmail_extra">just as </div><div class="gmail_extra"><br></div><div class="gmail_extra">'foo'r'bar'</div><div class="gmail_extra">=> 'foo\\bar'</div></div>
</blockquote></div><br></div>