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.
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index b331c4c..523930d 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 */
};