Skip to content

gh-134160: "First extension module" tutorial improvements - #144183

Merged
encukou merged 1 commit into
python:mainfrom
encukou:tutorial-fixes
Feb 2, 2026
Merged

gh-134160: "First extension module" tutorial improvements#144183
encukou merged 1 commit into
python:mainfrom
encukou:tutorial-fixes

Conversation

@encukou

@encukouencukou commented Jan 23, 2026

Copy link
Copy Markdown
Member

I've run through the tutorial with a mentee (best way to test tutorials btw!) and found some things to improve.

  • Pass -v to pip, so compiler output is visible
  • Move the call spam.system(3) up so that error handling is tested right after it's added
  • Use PyUnicode_AsUTF8AndSize as PyUnicode_AsUTF8 is not in the Limited API.
  • Add a footnote about embedded NULs.

📚 Documentation preview 📚: https://cpython-previews--144183.org.readthedocs.build/

- Pass -v to pip, so compiler output is visible
- Move the call ``spam.system(3)`` up so that error handling is tested
right after it's added
- Use `PyUnicode_AsUTF8AndSize` as `PyUnicode_AsUTF8` is not in the
Limited API.
- Add a footnote about embedded NULs.
@encukou

Copy link
Copy Markdown
MemberAuthor

I'll merge around Friday if there are no objections.

@encukou
encukou merged commit afc2aeb into python:mainFeb 2, 2026
38 checks passed
@github-project-automationgithub-project-automationBot moved this from Todo to Done in Docs PRsFeb 2, 2026
Aniketsy pushed a commit to Aniketsy/cpython that referenced this pull request Feb 3, 2026
…onGH-144183)
- Pass -v to pip, so compiler output is visible
- Move the call ``spam.system(3)`` up so that error handling is tested
right after it's added
- Use `PyUnicode_AsUTF8AndSize` as `PyUnicode_AsUTF8` is not in the
Limited API.
- Add a footnote about embedded NULs.
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
…onGH-144183)
- Pass -v to pip, so compiler output is visible
- Move the call ``spam.system(3)`` up so that error handling is tested
right after it's added
- Use `PyUnicode_AsUTF8AndSize` as `PyUnicode_AsUTF8` is not in the
Limited API.
- Add a footnote about embedded NULs.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip newstopic-C-API

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant

@encukou