Repository navigation
Docs: fix API names, references, and examples - #161072
Conversation
Documentation build overview
31 files changed ·
|
There was a problem hiding this comment.
🟢 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
Co-authored-by: Stan Ulbrych <stan@python.org>
|
Thanks @methane for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
Sorry, @methane, I could not cleanly backport this to Please backport manually with cherry_picker, see the devguide for more information. |
|
GH-161150 is a backport of this pull request to the 3.15 branch. |
|
GH-161151 is a backport of this pull request to the 3.14 branch. |
(cherry picked from commit 4594f5a) Co-authored-by: Inada Naoki <songofacandy@gmail.com> Co-authored-by: Stan Ulbrych <stan@python.org>
(cherry picked from commit 4594f5a) Co-authored-by: Stan Ulbrych <stan@python.org>
c-api/init_config.rst: Correct the output parameter name inPyInitConfig_GetStrList()fromvaluetoitems.c-api/init_config.rst: Describe-Eas a command-line option, rather than an environment variable.c-api/interp-lifecycle.rst: Correct the Windows platform identifier returned byPy_GetPlatform()from'win'to'win32'.c-api/long.rst: ReplacePyLong_FromLongLongwithPyLong_AsLongLongin the possible aliases forPyLong_AsPid().c-api/module.rst: Correct thePy_mod_createcallback argument name fromslotstospec.c-api/slots.rst: Fix the misspelledPy_SLOT_STATICflag in the macro example toPySlot_STATIC.c-api/type.rst: DescribePy_tp_basesas specifying base types, rather than type flags.c-api/type.rst: Replace the duplicatedPy_tp_basesreference withPy_tp_basewhen describing the precedence of the explicitbasesargument.c-api/type.rst: Use the actualPyType_Slot.pfuncmember instead of the nonexistentfuncmember in the conversion example.extending/newtypes.rst: IdentifyPyMemberDef.nameas the sentinel field for the members table, rather thanPyMethodDef.ml_name.howto/instrumentation.rst: Describepython.function.returnas the converse ofpython.function.entry, rather than of itself.library/cmd.rst: Rename the documentedCmd.onecmd()parameter fromstrtoline, matching the implementation.library/configparser.rst: Correct the parameter names tocomment_prefixesandinline_comment_prefixes.library/ctypes.rst: Correct the platform-dependent alias ofc_ulonglongtoc_ulong, rather than the signedc_long.library/optparse.rst: Replace the nonexistentoptparse.OptionValuesclass name withoptparse.Values.library/sys.rst: Fix the misspellingbreakpointhooks()tobreakpointhook().library/time.rst: Correct the displayed leap-second note number from 2 to 3.library/tkinter.ttk.rst: Assign the pressed and active images toimg2andimg3, matching their subsequent use instead of repeatedly overwritingimg1.library/tomllib.rst: Replace the Unicode minus sign in therange()expression with an ASCII hyphen so the example is valid Python.library/unittest.mock-examples.rst: Changetest_module.ClassName2topackage.module.ClassName2, matching the preceding patch decorator.library/unittest.rst: Correct theassertWarns()parameter reference fromwarningstowarning.library/unittest.rst: UseassertWarnsRegex()in both nested context managers that take regular expressions;assertWarns()treats the second argument as a callable.library/venv.rst: Replace the nonexistentvirtualize()method name withinstall_script(), which actually invokes the progress callback.library/xml.etree.elementtree.rst: Refer toxml.etree.ElementIncludeas the module that processes XInclude directives, matching the example.library/zlib.rst: Correct the input parameter reference inDecompress.decompress()fromstringtodata.using/configure.rst: Add the missing hyphen in--enable-shared.using/unix.rst: Add.tar.gzto the OpenSSL archive name in the extraction command, matching the downloaded file.whatsnew/2.2.rst: Replace the nonexistentmemberst_mtimeattribute with a reference toos.stat_result.st_mtime.whatsnew/2.6.rst: Correct the parameter name fromtimetotimerin thetimeit()andrepeat()signatures.whatsnew/3.2.rst: Correctsqlite3.Connection.in_transittosqlite3.Connection.in_transaction.whatsnew/3.8.rst: Correct the development-mode command-line option from-X envto-X dev.