]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-92203: Add closure support to exec(). (#92204)
authorlarryhastings <larry@hastings.org>
Fri, 6 May 2022 17:09:35 +0000 (10:09 -0700)
committerGitHub <noreply@github.com>
Fri, 6 May 2022 17:09:35 +0000 (10:09 -0700)
commit50210643902d28405a57a9672347f43215dbdb3b
tree736c0a00668e4781b5db125c557f094b65302f8b
parent973a5203c151efb7a86a478140f7b0c9ae70438f
gh-92203: Add closure support to exec(). (#92204)

Add a closure keyword-only parameter to exec(). It can only be specified when exec-ing a code object that uses free variables. When specified, it must be a tuple, with exactly the number of cell variables referenced by the code object. closure has a default value of None, and it must be None if the code object doesn't refer to any free variables.
Doc/library/functions.rst
Lib/test/test_builtin.py
Misc/NEWS.d/next/Core and Builtins/2022-05-02-17-12-49.gh-issue-92203.-igcjS.rst [new file with mode: 0644]
Python/bltinmodule.c
Python/clinic/bltinmodule.c.h