Skip to content

Add cpython-source-code-guide materials folder - #1010

Merged
realpython-bot merged 2 commits into
masterfrom
maintenance/cpython-source-code-guide-20261205
Dec 6, 2026
Merged

realpython-bot merged 2 commits into
masterfrom
maintenance/cpython-source-code-guide-20261205

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Adds a materials folder for the updated tutorial Your Guide to the CPython Source Code. The article was rewritten against CPython 3.15.2 (update draft: https://realpython.com/pbjt/blog/post/2528/change/, card: https://trello.com/c/hZry588l).

Files (copied from the update draft's filename= blocks and its generator REPL session):

  • test_tokens.py, instaviz_example.py, instaviz_example_power.py, instaviz_compiler.py, trace_opcodes.py, example_stack.py, generator_example.py
  • requirements.txt pins instaviz==0.6.0, which matches the article's dependencies field
  • README.md with setup and a per-file usage table

pyproject.toml: excludes cpython-source-code-guide/test_tokens.py from ruff. The tutorial's tokenize -e output shows that file's 3-space indent and column offsets, so formatting it would make the output in the article wrong. This follows the existing how-to-indent-in-python/sample_code.py exclude.

Verification:

  • test_tokens.py, trace_opcodes.py, example_stack.py, and generator_example.py ran on a --with-pydebug build of the v3.15.2 tag, and their output matches the article.
  • The three instaviz scripts ran on uv's Python 3.15.2 with instaviz==0.6.0, and each served HTTP 200 on localhost:8080.
  • ruff==0.14.1 format --check and check pass, and so does dircheck.py.

🤖 Generated with Claude Code

realpython-bot and others added 2 commits December 5, 2026 14:35
Scripts from the CPython 3.15.2 update of 'Your Guide to the CPython
Source Code'. test_tokens.py is excluded from ruff because the
tutorial's tokenize output depends on its exact 3-space indentation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@realpython-bot
realpython-bot merged commit 1c34f1f into master Dec 6, 2026
1 check passed
@realpython-bot
realpython-bot deleted the maintenance/cpython-source-code-guide-20261205 branch December 6, 2026 07:07
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.

1 participant