summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-02-18 11:35:37 (GMT)
committerGitHub <noreply@github.com>2021-02-18 11:35:37 (GMT)
commita3c3ffa68e6fc4524b1149a6a14d56c3a2e9b612 (patch)
tree3dd6f26b5a5fe9b3e2d3bcb0f465bfd28d5bb6b1 /Doc/whatsnew
parent366dc3a1354078e38808b9c16276e97cca5b8aaf (diff)
downloadcpython-a3c3ffa68e6fc4524b1149a6a14d56c3a2e9b612.zip
cpython-a3c3ffa68e6fc4524b1149a6a14d56c3a2e9b612.tar.gz
cpython-a3c3ffa68e6fc4524b1149a6a14d56c3a2e9b612.tar.bz2
bpo-42990: Add __builtins__ attribute to functions (GH-24559)
Expose the new PyFunctionObject.func_builtins member in Python as a new __builtins__ attribute on functions. Document also the behavior change in What's New in Python 3.10.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.10.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst
index 0fba27c..b903b3e 100644
--- a/Doc/whatsnew/3.10.rst
+++ b/Doc/whatsnew/3.10.rst
@@ -280,6 +280,11 @@ Other Language Changes
* Assignment expressions can now be used unparenthesized within set literals
and set comprehensions, as well as in sequence indexes (but not slices).
+* Functions have a new ``__builtins__`` attribute which is used to look for
+ builtin symbols when a function is executed, instead of looking into
+ ``__globals__['__builtins__']``.
+ (Contributed by Mark Shannon in :issue:`42990`.)
+
New Modules
===========