
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. 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. Cheers, Steve Top-posted from my Windows Phone ________________________________ From: Alexander Belopolsky<mailto:alexander.belopolsky@gmail.com> Sent: 7/20/2015 18:40 To: Eric V. Smith<mailto:eric@trueblade.com> Cc: python-ideas<mailto:python-ideas@python.org> Subject: Re: [Python-ideas] Briefer string format On Mon, Jul 20, 2015 at 4:20 PM, Eric V. Smith <eric@trueblade.com<mailto:eric@trueblade.com>> wrote: And thinking about it yet some more, I think the easiest and most consistent thing to do would be to translate it like: f'{a[0]}{b[c]}' == '{[0]}{[c]}'.format(a, b) I think Python can do more at compile time and translate f"Result1={expr1:fmt1};Result2={expr2:fmt2}" to bytecode equivalent of "Result1=%s;Result2=%s" % ((expr1).__format__(fmt1), (expr2).__format__(fmt2))