When the closure parameter was added to exec and eval for Python 3.11, it rendered the "Interaction with dynamic features" part of the execution model reference slightly out of date: https://docs.python.org/3/reference/executionmodel.html#interaction-with-dynamic-features
The text remains accurate for string execution, but needs updating to correctly cover execution of code objects with closure variable references.
Linked PRs
When the
closureparameter was added toexecandevalfor Python 3.11, it rendered the "Interaction with dynamic features" part of the execution model reference slightly out of date: https://docs.python.org/3/reference/executionmodel.html#interaction-with-dynamic-featuresThe text remains accurate for string execution, but needs updating to correctly cover execution of code objects with closure variable references.
Linked PRs