Skip to content

Commit a5d96f8

Browse files
committed
bpo-27351: Fix ConfigParser.read() documentation and docstring
Switch "list" with "iterable" to match with the implementation.
1 parent 483422f commit a5d96f8

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

Doc/library/configparser.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -963,16 +963,17 @@ ConfigParser Objects
963963

964964
.. method:: read(filenames, encoding=None)
965965

966-
Attempt to read and parse a list of filenames, returning a list of
966+
Attempt to read and parse an iterable of filenames, returning a list of
967967
filenames which were successfully parsed.
968968

969969
If *filenames* is a string, a :class:`bytes` object or a
970970
:term:`path-like object`, it is treated as
971971
a single filename. If a file named in *filenames* cannot be opened, that
972-
file will be ignored. This is designed so that you can specify a list of
973-
potential configuration file locations (for example, the current
974-
directory, the user's home directory, and some system-wide directory),
975-
and all existing configuration files in the list will be read.
972+
file will be ignored. This is designed so that you can specify an
973+
iterable of potential configuration file locations (for example, the
974+
current directory, the user's home directory, and some system-wide
975+
directory), and all existing configuration files in the iterable will be
976+
read.
976977

977978
If none of the named files exist, the :class:`ConfigParser`
978979
instance will contain an empty dataset. An application which requires

Lib/configparser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
Return list of configuration options for the named section.
8181
8282
read(filenames, encoding=None)
83-
Read and parse the list of named configuration files, given by
83+
Read and parse the iterable of named configuration files, given by
8484
name. A single filename is also allowed. Non-existing files
8585
are ignored. Return list of successfully read files.
8686
@@ -677,13 +677,13 @@ def options(self, section):
677677
return list(opts.keys())
678678

679679
def read(self, filenames, encoding=None):
680-
"""Read and parse a filename or a list of filenames.
680+
"""Read and parse a filename or an iterable of filenames.
681681
682682
Files that cannot be opened are silently ignored; this is
683-
designed so that you can specify a list of potential
683+
designed so that you can specify an iterable of potential
684684
configuration file locations (e.g. current directory, user's
685685
home directory, systemwide directory), and all existing
686-
configuration files in the list will be read. A single
686+
configuration files in the iterable will be read. A single
687687
filename may also be given.
688688
689689
Return list of successfully read files.

0 commit comments

Comments
 (0)