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.

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