Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,13 @@ However, there are a few differences that should be taken into account:
a fallback value. Note however that the section-level ``get()`` methods are
compatible both with the mapping protocol and the classic configparser API.

* ``parser.items()`` is compatible with the mapping protocol (returns a list of
*section_name*, *section_proxy* pairs including the DEFAULTSECT). However,
this method can also be invoked with arguments: ``parser.items(section, raw,
vars)``. The latter call returns a list of *option*, *value* pairs for
a specified ``section``, with all interpolations expanded (unless
``raw=True`` is provided).
* ``parser.items()`` is compatible with the mapping protocol (when invoked
with no arguments, returns an :class:`~collections.abc.ItemsView` of
*section_name*, *section_proxy* pairs including the DEFAULTSECT).
However, this method can also be invoked with arguments:
``parser.items(section, raw, vars)``. The latter call returns a
:class:`list` of *option*, *value* pairs for a specified ``section``,
with all interpolations expanded (unless ``raw=True`` is provided).

The mapping protocol is implemented on top of the existing legacy API so that
subclasses overriding the original interface still should have mappings working
Expand Down Expand Up @@ -1214,7 +1215,8 @@ ConfigParser Objects
.. method:: items(raw=False, vars=None)
items(section, raw=False, vars=None)

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

Otherwise, return a list of *name*, *value* pairs for the options in the
Expand Down
Loading