Skip to content

Commit 63dd638

Browse files
committed
gh-149050: Fix return type of ConfigParser.items() in documentation
When called without a section argument, ConfigParser.items() delegates to dict.items() and returns a collections.abc.ItemsView, not a list. The docs previously described both overloads as returning a list.
1 parent 517d3d2 commit 63dd638

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/library/configparser.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,8 @@ ConfigParser Objects
12141214
.. method:: items(raw=False, vars=None)
12151215
items(section, raw=False, vars=None)
12161216

1217-
When *section* is not given, return a list of *section_name*,
1217+
When *section* is not given, return a
1218+
:class:`~collections.abc.ItemsView` of *section_name*,
12181219
*section_proxy* pairs, including DEFAULTSECT.
12191220

12201221
Otherwise, return a list of *name*, *value* pairs for the options in the

0 commit comments

Comments
 (0)