On Aug 09, 2015, at 06:14 PM, David Mertz wrote: >That said, there *is* one small corner where I believe f-strings add >something helpful to the language. There is no really concise way to spell: > > collections.ChainMap(locals(), globals(), __builtins__.__dict__). > >If we could spell that as, say `lgb()`, that would let str.format() or >%-formatting pick up the full "what's in scope". To my mind, that's the >only good thing about the f-string idea.
That would certainly be useful to avoid sys._getframe() calls in my library, although I'd probably want the third argument to be optional (I wouldn't use it). If '{foo}' or '${foo}' syntax is adopted (with no allowance for '$foo'), it's very unlikely I'd use that over string.Template for internationalization, but the above would still be useful. Cheers, -Barry _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com