summaryrefslogtreecommitdiff
path: root/Objects/funcobject.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-02-18 12:35:37 +0100
committerGitHub <noreply@github.com>2021-02-18 12:35:37 +0100
commita3c3ffa68e6fc4524b1149a6a14d56c3a2e9b612 (patch)
tree3dd6f26b5a5fe9b3e2d3bcb0f465bfd28d5bb6b1 /Objects/funcobject.c
parent366dc3a1354078e38808b9c16276e97cca5b8aaf (diff)
downloadcpython-git-a3c3ffa68e6fc4524b1149a6a14d56c3a2e9b612.tar.gz
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 'Objects/funcobject.c')
-rw-r--r--Objects/funcobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index b331c4c4d6..523930da8d 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -250,6 +250,7 @@ static PyMemberDef func_memberlist[] = {
{"__doc__", T_OBJECT, OFF(func_doc), 0},
{"__globals__", T_OBJECT, OFF(func_globals), READONLY},
{"__module__", T_OBJECT, OFF(func_module), 0},
+ {"__builtins__", T_OBJECT, OFF(func_builtins), READONLY},
{NULL} /* Sentinel */
};