python / python/cpython

Execution model reference should cover `closure` arg to `exec` & `eval`

Open
#122,826 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.13 3.14 docs triaged
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

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
  • gh-155014

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the execution model reference's “Interaction with dynamic features” section, linked in the issue, and review the linked PR gh-155014 for existing work. Update the reference so it remains accurate for string execution and also covers code objects with closure variable references passed through exec and eval.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.