[Python-checkins] bpo-27351: Fix ConfigParser.read() documentation and docstring (GH-8123)
Brian Curtin
webhook-mailer at python.org
Sat Sep 29 12:33:08 EDT 2018
https://github.com/python/cpython/commit/b0b8f9bd4e6f78ac7383b4e56cfb6cbacc77da89
commit: b0b8f9bd4e6f78ac7383b4e56cfb6cbacc77da89
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Brian Curtin <brian at python.org>
date: 2018-09-29T10:33:05-06:00
summary:
bpo-27351: Fix ConfigParser.read() documentation and docstring (GH-8123)
Switch "list" with "iterable" to match with the implementation.
(cherry picked from commit e45473e3ca31e5b78dc85cab575f5bb60d5b7f8f)
Co-authored-by: Zackery Spytz <zspytz at gmail.com>
files:
M Doc/library/configparser.rst
M Lib/configparser.py
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst
index 4e55623f5360..0bd03b6259ee 100644
--- a/Doc/library/configparser.rst
+++ b/Doc/library/configparser.rst
@@ -995,16 +995,17 @@ ConfigParser Objects
.. method:: read(filenames, encoding=None)
- Attempt to read and parse a list of filenames, returning a list of
+ Attempt to read and parse an iterable of filenames, returning a list of
filenames which were successfully parsed.
If *filenames* is a string, a :class:`bytes` object or a
:term:`path-like object`, it is treated as
a single filename. If a file named in *filenames* cannot be opened, that
- file will be ignored. This is designed so that you can specify a list of
- potential configuration file locations (for example, the current
- directory, the user's home directory, and some system-wide directory),
- and all existing configuration files in the list will be read.
+ file will be ignored. This is designed so that you can specify an
+ iterable of potential configuration file locations (for example, the
+ current directory, the user's home directory, and some system-wide
+ directory), and all existing configuration files in the iterable will be
+ read.
If none of the named files exist, the :class:`ConfigParser`
instance will contain an empty dataset. An application which requires
diff --git a/Lib/configparser.py b/Lib/configparser.py
index 445fa99ccb4b..4caf3faadc75 100644
--- a/Lib/configparser.py
+++ b/Lib/configparser.py
@@ -80,7 +80,7 @@
Return list of configuration options for the named section.
read(filenames, encoding=None)
- Read and parse the list of named configuration files, given by
+ Read and parse the iterable of named configuration files, given by
name. A single filename is also allowed. Non-existing files
are ignored. Return list of successfully read files.
@@ -676,13 +676,13 @@ def options(self, section):
return list(opts.keys())
def read(self, filenames, encoding=None):
- """Read and parse a filename or a list of filenames.
+ """Read and parse a filename or an iterable of filenames.
Files that cannot be opened are silently ignored; this is
- designed so that you can specify a list of potential
+ designed so that you can specify an iterable of potential
configuration file locations (e.g. current directory, user's
home directory, systemwide directory), and all existing
- configuration files in the list will be read. A single
+ configuration files in the iterable will be read. A single
filename may also be given.
Return list of successfully read files.
More information about the Python-checkins
mailing list