Skip to content

Commit 3cd5e8e

Browse files
miss-islingtonZackerySpytz
authored andcommitted
bpo-27351: Fix ConfigParser.read() documentation and docstring (GH-8123)
Switch "list" with "iterable" to match with the implementation. (cherry picked from commit e45473e) Co-authored-by: Zackery Spytz <[email protected]>
1 parent 207bb5f commit 3cd5e8e

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
@@ -982,15 +982,16 @@ ConfigParser Objects
982982

983983
.. method:: read(filenames, encoding=None)
984984

985-
Attempt to read and parse a list of filenames, returning a list of
985+
Attempt to read and parse an iterable of filenames, returning a list of
986986
filenames which were successfully parsed.
987987

988988
If *filenames* is a string or :term:`path-like object`, it is treated as
989989
a single filename. If a file named in *filenames* cannot be opened, that
990-
file will be ignored. This is designed so that you can specify a list of
991-
potential configuration file locations (for example, the current
992-
directory, the user's home directory, and some system-wide directory),
993-
and all existing configuration files in the list will be read.
990+
file will be ignored. This is designed so that you can specify an
991+
iterable of potential configuration file locations (for example, the
992+
current directory, the user's home directory, and some system-wide
993+
directory), and all existing configuration files in the iterable will be
994+
read.
994995

995996
If none of the named files exist, the :class:`ConfigParser`
996997
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)