<p dir="ltr">I know. I elided including the nonexistent `nonlocals()` in there. But it *should* be `lngb()`. Or call it scope(). :-)</p>
<div class="gmail_quote">On Aug 10, 2015 10:09 AM, "Steven D'Aprano" <<a href="mailto:steve@pearwood.info">steve@pearwood.info</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, Aug 09, 2015 at 06:14:18PM -0700, David Mertz wrote:<br>
<br>
[...]<br>
> That said, there *is* one small corner where I believe f-strings add<br>
> something helpful to the language. There is no really concise way to spell:<br>
><br>
> collections.ChainMap(locals(), globals(), __builtins__.__dict__).<br>
<br>
I think that to match the normal name resolution rules, nonlocals()<br>
needs to slip in there between locals() and globals(). I realise that<br>
there actually isn't a nonlocals() function (perhaps there should be?).<br>
<br>
> If we could spell that as, say `lgb()`, that would let str.format() or<br>
> %-formatting pick up the full "what's in scope". To my mind, that's the<br>
> only good thing about the f-string idea.<br>
<br>
I like the concept, but not the name. Initialisms tend to be hard<br>
to remember and rarely self-explanatory. How about scope()?<br>
<br>
<br>
--<br>
Steve<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/mertz%40gnosis.cx" rel="noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/mertz%40gnosis.cx</a><br>
</blockquote></div>