From b414323bfb35e88bd7b0be6abc447d40f2481cb3 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 3 Jan 2018 16:35:52 -0800 Subject: [PATCH] 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()}")). --- pep-0498.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pep-0498.txt b/pep-0498.txt index 9833f44e2..c0f03f683 100644 --- a/pep-0498.txt +++ b/pep-0498.txt @@ -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 =============