<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<meta content="text/html; charset=utf-8">
</head>
<body>
<div>
<div style="font-family:Calibri,sans-serif; font-size:11pt">I'd rather keep the transform as simple as possible. If text formatting is your bottleneck, congratulations on fixing your network, disk, RAM and probably your users.<br>
<br>
Those who need to micro-optimize this code can do what you suggested by hand - there's no need for us to make our lives more complicated for the straw man who has a string formatting bottleneck and doesn't know enough to research another approach.<br>
<br>
Cheers,<br>
Steve<br>
<br>
Top-posted from my Windows Phone</div>
</div>
<div dir="ltr">
<hr>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">From:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt"><a href="mailto:alexander.belopolsky@gmail.com">Alexander Belopolsky</a></span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">Sent:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt">ý7/ý20/ý2015 18:40</span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">To:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt"><a href="mailto:eric@trueblade.com">Eric V. Smith</a></span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">Cc:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt"><a href="mailto:python-ideas@python.org">python-ideas</a></span><br>
<span style="font-family:Calibri,sans-serif; font-size:11pt; font-weight:bold">Subject:
</span><span style="font-family:Calibri,sans-serif; font-size:11pt">Re: [Python-ideas] Briefer string format</span><br>
<br>
</div>
<div>
<div dir="ltr">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Jul 20, 2015 at 4:20 PM, Eric V. Smith <span dir="ltr">
<<a href="mailto:eric@trueblade.com" target="_blank">eric@trueblade.com</a>></span> wrote:<br>
<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 id=":1zl" class="" style="overflow:hidden">And thinking about it yet some more, I think the easiest and most<br>
consistent thing to do would be to translate it like:<br>
<br>
f'{a[0]}{b[c]}' == '{[0]}{[c]}'.format(a, b)</div>
</blockquote>
</div>
<br>
I think Python can do more at compile time and translate </div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">f"Result1={expr1:fmt1};Result2={expr2:fmt2}"</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">to bytecode equivalent of</div>
<div class="gmail_extra"><br>
</div>
<div class="gmail_extra">"Result1=%s;Result2=%s" % ((expr1).__format__(fmt1), (expr2).__format__(fmt2))</div>
<div class="gmail_extra"><br>
</div>
</div>
</div>
</body>
</html>