GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.14] gh-134160: Split extension module init from PyModule docs; emphasize multi-phase init (GH-135126) by miss-islington · Pull Request #135470 · python/cpython

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 13, 2025 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Document behaviour of single-phase init. Call it "legacy".

Reorganize PyModule docs.

Move PyInit_modulename docs from the tutorial to reference documentation.

Move PyMODINIT_FUNC docs from generic macros to the new page.

Add doc stubs for PYTHON_API_VERSION & PYTHON_ABI_VERSION

Remove incorrect refcounts.dat entry for PyModuleDef_Init.
This removes the "Return value: Borrowed reference." note.
Instead, note that the function sometimes returns a borrowed reference,
sometimes as strong one.
(IMO, it's best to not think of PyModuleDef as a PyObject at all,
and act like it can't be reference-counted.)

(cherry picked from commit f4bc3a9)

Co-authored-by: Petr Viktorin [email protected]
Co-authored-by: Adam Turner [email protected]
Co-authored-by: Stan Ulbrych [email protected]
Co-authored-by: Hugo van Kemenade [email protected]

  • Issue: Docs Examples Focus on Outdated Single-Phase Init Modules and Static Types #134160

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@encukou @AA-Turner
@StanFromIreland @hugovk @miss-islington
pythongh-134160: Split extension module init from PyModule docs; emph…
1f7a3ff
…asize multi-phase init (pythonGH-135126)

Document behaviour of single-phase init. Call it "legacy".

Reorganize PyModule docs.

Move PyInit_modulename docs from the tutorial to reference documentation.

Move PyMODINIT_FUNC docs from generic macros to the new page.

Add doc stubs for `PYTHON_API_VERSION` & `PYTHON_ABI_VERSION`

Remove incorrect refcounts.dat entry for `PyModuleDef_Init`.
This removes the "Return value: Borrowed reference." note.
Instead, note that the function sometimes returns a borrowed reference,
sometimes as strong one.
(IMO, it's best to not think of `PyModuleDef` as a `PyObject` at all,
and act like it can't be reference-counted.)

(cherry picked from commit f4bc3a9)

Co-authored-by: Petr Viktorin <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
@miss-islington
miss-islington requested a review from ericsnowcurrently as a code owner June 13, 2025 14:39
@bedevere-app bedevere-app Bot added awaiting review skip news labels Jun 13, 2025
This was referenced Jun 13, 2025
gh-134160: Split extension module init from PyModule docs; emphasize multi-phase init #135126
Merged
Docs Examples Focus on Outdated Single-Phase Init Modules and Static Types #134160
Open
@hugovk
hugovk merged commit 0e0ad7b into python:3.14 Jun 16, 2025
@bedevere-app bedevere-app Bot removed the awaiting review label Jun 16, 2025
@miss-islington
miss-islington deleted the backport-f4bc3a9-3.14 branch January 2, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@miss-islington @hugovk @encukou
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.