PEP 498: Clarify the prohibition on locals() and globals(). (GH-529)

It applies to the implementation, not to end users passing these in to
f-string -- the latter is fine (e.g. print(f"Locals are {locals()}")).
This commit is contained in:
Guido van Rossum 2018-01-03 16:35:52 -08:00 committed by Mariatta
parent 6905c6ce66
commit b414323bfb
1 changed files with 4 additions and 1 deletions

View File

@ -164,7 +164,10 @@ globals() has access to far more information than needed to do the
string interpolation.
Guido stated [#]_ that any solution to better string interpolation
would not use locals() or globals().
would not use locals() or globals() in its implementation. (This does
not forbid users from passing locals() or globals() in, it just
doesn't require it, nor does it allow using these functions under the
hood.)
Specification
=============