<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Aug 6, 2015 at 9:02 PM, Wes Turner <span dir="ltr"><<a href="mailto:wes.turner@gmail.com" target="_blank">wes.turner@gmail.com</a>></span> wrote:<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"><div class="gmail_quote"><span class="">On Wed, Aug 5, 2015 at 8:58 PM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu" target="_blank">tjreedy@udel.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 8/5/2015 3:34 PM, Yury Selivanov wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
'\{..}' feels unbalanced and weird.<br>
</blockquote>
<br></span>
Escape both. The closing } is also treated specially, and not inserted into the string. The compiler scans linearly from left to right, but human eyes are not so constrained.<br>
<br>
s = "abc\{kjljid some long expression jk78738}def"<br>
<br>
versus<br>
<br>
s = "abc\{kjljid some long expression jk78738\}def"<br>
<br>
and how about<br>
<br>
s = "abc\{kjljid some {long} expression jk78738\}def"</blockquote><div><br></div></span><div>+1: escape \{both\}.</div></div></div></div></blockquote><div><br></div><div>That looks worse to me. In my eyes, the construct has two parts: the \ and the {...}. (Similar to \N{...}, whose parts are \N and {...}.) Most of the time the expression is short and sweet -- either something like \{width} or \{obj.width}, or perhaps a simple expression like \{width(obj)}. Adding an extra \ does nothing to enhance readability.<br><br>Giving long or obfuscated expressions that *could* be written using some proposed feature to argue against it is a long-standing rhetoric strategy, similar to "strawman".<br clear="all"></div></div><br>-- <br><div class="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>