Skip to content

Docs: fix API names, references, and examples - #161072

Merged
methane merged 2 commits into
python:mainfrom
methane:fix-doc3
Nov 2, 2026
Merged

methane merged 2 commits into
python:mainfrom
methane:fix-doc3

Conversation

@methane

@methane methane commented Nov 1, 2026

Copy link
Copy Markdown
Member
  1. c-api/init_config.rst: Correct the output parameter name in PyInitConfig_GetStrList() from value to items.

  2. c-api/init_config.rst: Describe -E as a command-line option, rather than an environment variable.

  3. c-api/interp-lifecycle.rst: Correct the Windows platform identifier returned by Py_GetPlatform() from 'win' to 'win32'.

  4. c-api/long.rst: Replace PyLong_FromLongLong with PyLong_AsLongLong in the possible aliases for PyLong_AsPid().

  5. c-api/module.rst: Correct the Py_mod_create callback argument name from slots to spec.

  6. c-api/slots.rst: Fix the misspelled Py_SLOT_STATIC flag in the macro example to PySlot_STATIC.

  7. c-api/type.rst: Describe Py_tp_bases as specifying base types, rather than type flags.

  8. c-api/type.rst: Replace the duplicated Py_tp_bases reference with Py_tp_base when describing the precedence of the explicit bases argument.

  9. c-api/type.rst: Use the actual PyType_Slot.pfunc member instead of the nonexistent func member in the conversion example.

  10. extending/newtypes.rst: Identify PyMemberDef.name as the sentinel field for the members table, rather than PyMethodDef.ml_name.

  11. howto/instrumentation.rst: Describe python.function.return as the converse of python.function.entry, rather than of itself.

  12. library/cmd.rst: Rename the documented Cmd.onecmd() parameter from str to line, matching the implementation.

  13. library/configparser.rst: Correct the parameter names to comment_prefixes and inline_comment_prefixes.

  14. library/ctypes.rst: Correct the platform-dependent alias of c_ulonglong to c_ulong, rather than the signed c_long.

  15. library/optparse.rst: Replace the nonexistent optparse.OptionValues class name with optparse.Values.

  16. library/sys.rst: Fix the misspelling breakpointhooks() to breakpointhook().

  17. library/time.rst: Correct the displayed leap-second note number from 2 to 3.

  18. library/tkinter.ttk.rst: Assign the pressed and active images to img2 and img3, matching their subsequent use instead of repeatedly overwriting img1.

  19. library/tomllib.rst: Replace the Unicode minus sign in the range() expression with an ASCII hyphen so the example is valid Python.

  20. library/unittest.mock-examples.rst: Change test_module.ClassName2 to package.module.ClassName2, matching the preceding patch decorator.

  21. library/unittest.rst: Correct the assertWarns() parameter reference from warnings to warning.

  22. library/unittest.rst: Use assertWarnsRegex() in both nested context managers that take regular expressions; assertWarns() treats the second argument as a callable.

  23. library/venv.rst: Replace the nonexistent virtualize() method name with install_script(), which actually invokes the progress callback.

  24. library/xml.etree.elementtree.rst: Refer to xml.etree.ElementInclude as the module that processes XInclude directives, matching the example.

  25. library/zlib.rst: Correct the input parameter reference in Decompress.decompress() from string to data.

  26. using/configure.rst: Add the missing hyphen in --enable-shared.

  27. using/unix.rst: Add .tar.gz to the OpenSSL archive name in the extraction command, matching the downloaded file.

  28. whatsnew/2.2.rst: Replace the nonexistent memberst_mtime attribute with a reference to os.stat_result.st_mtime.

  29. whatsnew/2.6.rst: Correct the parameter name from time to timer in the timeit() and repeat() signatures.

  30. whatsnew/3.2.rst: Correct sqlite3.Connection.in_transit to sqlite3.Connection.in_transaction.

  31. whatsnew/3.8.rst: Correct the development-mode command-line option from -X env to -X dev.

@read-the-docs-community

read-the-docs-community Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are recorded for these documentation-only corrections.

No open issues 🎉

What changed in this PR

This documentation-only PR aligns CPython’s API descriptions, references, and examples with the implementation. It does not change runtime behavior.

Changes:

  • Correct API names, parameters, type aliases, and member references.
  • Repair code examples and shell commands.
  • Fix cross-references and historical release-note inaccuracies.
File Description
Doc/​whatsnew/​3.8.rst Corrects the development-mode option to -X dev.
Doc/​whatsnew/​3.2.rst Fixes the SQLite in_transaction reference.
Doc/​whatsnew/​2.6.rst Corrects timeit parameter names to timer.
Doc/​whatsnew/​2.2.rst Links to os.stat_result.st_mtime.
Doc/​using/​unix.rst Fixes the OpenSSL archive extraction command.
Doc/​using/​configure.rst Corrects the spelling of --enable-shared.
Doc/​library/​zlib.rst Uses the documented data parameter name.
Doc/​library/​xml.etree.elementtree.rst Identifies the XInclude processing module correctly.
Doc/​library/​venv.rst Corrects the progress-callback method reference.
Doc/​library/​unittest.rst Fixes warning parameter references and regex examples.
Doc/​library/​unittest.mock-examples.rst Aligns the explanatory patch target with the example.
Doc/​library/​tomllib.rst Uses a valid ASCII minus in the range expression.
Doc/​library/​tkinter.ttk.rst Fixes image variable assignments in the example.
Doc/​library/​time.rst Corrects the displayed leap-second note number.
Doc/​library/​sys.rst Fixes the breakpointhook() spelling.
Doc/​library/​optparse.rst Corrects the class name to optparse.Values.
Doc/​library/​ctypes.rst Corrects the unsigned integer type alias.
Doc/​library/​configparser.rst Fixes comment-prefix parameter names.
Doc/​library/​cmd.rst Aligns Cmd.onecmd() documentation with its line parameter.
Doc/​howto/​instrumentation.rst Corrects the entry/return probe relationship.
Doc/​extending/​newtypes.rst Identifies the correct members-table sentinel field.
Doc/​c-api/​type.rst Fixes base-type slot descriptions and the conversion example.
Doc/​c-api/​slots.rst Corrects the PySlot_STATIC flag spelling.
Doc/​c-api/​module.rst Corrects the callback argument reference to spec.
Doc/​c-api/​long.rst Corrects the possible PyLong_AsPid() conversion alias.
Doc/​c-api/​interp-lifecycle.rst Corrects the Windows platform identifier to win32.
Doc/​c-api/​init_config.rst Fixes an output parameter name and the description of -E.

Review effort: Balanced

Comment thread Doc/library/zlib.rst Resolved
Co-authored-by: Stan Ulbrych <stan@python.org>
@methane
methane merged commit 4594f5a into python:main Nov 2, 2026
30 checks passed
@methane
methane deleted the fix-doc3 branch November 2, 2026 02:53
@miss-islington-app

Copy link
Copy Markdown

Thanks @methane for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Nov 2, 2026
@miss-islington-app

Copy link
Copy Markdown

Sorry, @methane, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 4594f5a685aa5e491bcbb80e5f8d43a5838e6649 3.14

@bedevere-app

bedevere-app Bot commented Nov 2, 2026

Copy link
Copy Markdown

GH-161150 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Nov 2, 2026
@bedevere-app

bedevere-app Bot commented Nov 2, 2026

Copy link
Copy Markdown

GH-161151 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 2, 2026
methane added a commit that referenced this pull request Nov 2, 2026
(cherry picked from commit 4594f5a)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
methane added a commit that referenced this pull request Nov 2, 2026
(cherry picked from commit 4594f5a)

Co-authored-by: Stan Ulbrych <stan@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants