Skip to content

[names] Use builtins and %run, as Python 3 and the code cells do - #654

Merged
mmcky merged 1 commit into
mainfrom
fix/names-builtins-run
Nov 2, 2026
Merged

mmcky merged 1 commit into
mainfrom
fix/names-builtins-run

Conversation

@mmcky

@mmcky mmcky commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Two small inaccuracies in lectures/names.md, reported in #634:

Line Before After
229 When we run a script using IPython's run command, … When we run a script using IPython's %run command, …
336 These definitions are stored in a module called __builtin__. These definitions are provided by the builtins module.

__builtin__ is the Python 2 name; Python 3.0 renamed the module builtins. Bare run works only because automagic is on, and the lecture's own cells use %run. No code changes.

Why it matters for the translations. The French edition corrected both during native-editor review (QuantEcon/lecture-python-programming.fr#80), with the same wording as here. Until the English agrees, a sync that touches the adjacent bullet can revert the French builtins correction. On merge, the sync opens a names.md PR in each of the fr, zh-cn and fa editions: check that the fr one keeps Emile's wording.

Closes #634

🤖 Generated with Claude Code

- The built-in definitions are provided by the `builtins` module;
  `__builtin__` is its Python 2 name.
- IPython's `run` command -> `%run`, matching the cells that use it.

The French edition already says both (QuantEcon/lecture-python-programming.fr#80).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 00:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation-only corrections were verified as accurate against the file's own code cells and Python 3 naming, leaving no outstanding issues.

No open issues 🎉

What changed in this PR

This PR fixes two factual inaccuracies in the lectures/names.md lecture, as reported in #634. It corrects a Python 2 module reference and an IPython magic command name so the prose matches both current Python 3 and the lecture's own code cells. This is a documentation-only change with no code modifications, and it also unblocks the French/Chinese/Persian translation syncs from reverting an already-applied correction.

Changes:

  • Updates the prose to reference IPython's %run magic instead of bare run, consistent with the %run mod.py code cells in the same file.
  • Replaces the Python 2 module name __builtin__ with the Python 3 builtins module, while leaving the distinct __builtins__ namespace references unchanged.
File Description
lectures/​names.md Corrects run → %run and __builtin__ → builtins in explanatory text to match Python 3 and the lecture's code cells

No issues found; the changes are correct, consistent with the surrounding code, and complete.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

@mmcky

mmcky commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

✅ Translation sync completed (fr)

Target repo: QuantEcon/lecture-python-programming.fr
Translation PR: QuantEcon/lecture-python-programming.fr#102
Files synced (1):

  • lectures/names.md

@mmcky

mmcky commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

✅ Translation sync completed (zh-cn)

Target repo: QuantEcon/lecture-python-programming.zh-cn
Translation PR: QuantEcon/lecture-python-programming.zh-cn#144
Files synced (1):

  • lectures/names.md

@mmcky

mmcky commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

✅ Translation sync completed (fa)

Target repo: QuantEcon/lecture-python-programming.fa
Translation PR: QuantEcon/lecture-python-programming.fa#177
Files synced (1):

  • lectures/names.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[names] __builtin__ is the Python 2 module name; IPython's run should be %run

2 participants