Skip to content

gh-150132: Document the no-argument overload of ConfigParser.items()#150133

Open
Taeknology wants to merge 1 commit into
python:mainfrom
Taeknology:gh-150132-configparser-items-docstring
Open

gh-150132: Document the no-argument overload of ConfigParser.items()#150133
Taeknology wants to merge 1 commit into
python:mainfrom
Taeknology:gh-150132-configparser-items-docstring

Conversation

@Taeknology
Copy link
Copy Markdown

The docstring of configparser.ConfigParser.items() only described
the call with a section argument (returning a list of (name, value)
tuples). The no-argument call delegates to
collections.abc.MutableMapping.items() and returns an ItemsView of
(section_name, section_proxy) pairs, which was previously
undocumented.

This PR rewords the docstring so that both overloads are described and
their return types match the actual behaviour, matching what was done
for Doc/library/configparser.rst in gh-149050 / gh-150059.

Verified locally

Loaded the modified Lib/configparser.py with importlib.util:

no-arg type:   ItemsView
with-arg type: list

and confirmed help(ConfigParser.items) now describes both overloads.

No code change. No Misc/NEWS.d entry (docstring-only).

Fixes #150132

…ems()

The docstring of ConfigParser.items() only described the call with a
section argument (returning a list of (name, value) tuples).  The
no-argument call delegates to MutableMapping.items() and returns an
ItemsView of (section_name, section_proxy) pairs, which was previously
undocumented.  Reword the docstring so that both overloads are
described and their return types match the actual behaviour.
@Taeknology Taeknology requested a review from jaraco as a code owner May 19, 2026 23:38
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 19, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@Taeknology
Copy link
Copy Markdown
Author

The single failing job (Ubuntu (free-threading) / build and test (ubuntu-24.04)) terminated with exit code 143 (SIGTERM) at make: *** [Makefile:2434: ci] Terminated after the runner received a shutdown signal — this looks like a GitHub Actions infrastructure issue unrelated to this PR (which only modifies a docstring). test_configparser never started in that job, and all 31 other jobs passed.

Verified locally on a free-threading build matching the failing job (./configure --disable-gil --enable-shared && make -j16, Python 3.16.0a0 free-threading):

$ LD_LIBRARY_PATH=. ./python -m test test_configparser -v
Ran 344 tests in 0.738s
OK (skipped=5)
== Tests result: SUCCESS ==

I'll close and reopen to re-trigger CI since I don't have rerun permissions.

@Taeknology Taeknology closed this May 20, 2026
@Taeknology Taeknology reopened this May 20, 2026
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 20, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ConfigParser.items() docstring does not describe the no-argument overload

1 participant