Skip to content

Commit

Permalink
bpo-33800: Fix default argument for parameter dict_type of ConfigPars…
Browse files Browse the repository at this point in the history
…er/RawConfigParser (pythonGH-7494) (pythonGH-7542)

(cherry picked from commit 3b0b90c)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
  • Loading branch information
2 people authored and ned-deily committed Jun 8, 2018
1 parent 9bb9b53 commit dc20d9d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Doc/library/configparser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ interpolation if an option used is not defined elsewhere. ::
ConfigParser Objects
--------------------

.. class:: ConfigParser(defaults=None, dict_type=collections.OrderedDict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section=configparser.DEFAULTSECT, interpolation=BasicInterpolation(), converters={})
.. class:: ConfigParser(defaults=None, dict_type=dict, allow_no_value=False, delimiters=('=', ':'), comment_prefixes=('#', ';'), inline_comment_prefixes=None, strict=True, empty_lines_in_values=True, default_section=configparser.DEFAULTSECT, interpolation=BasicInterpolation(), converters={})

The main configuration parser. When *defaults* is given, it is initialized
into the dictionary of intrinsic defaults. When *dict_type* is given, it
Expand Down Expand Up @@ -949,6 +949,9 @@ ConfigParser Objects
providing consistent behavior across the parser: non-string
keys and values are implicitly converted to strings.

.. versionchanged:: 3.7
The default *dict_type* is :class:`dict`, since it now preserves
insertion order.

.. method:: defaults()

Expand Down Expand Up @@ -1205,7 +1208,7 @@ ConfigParser Objects
RawConfigParser Objects
-----------------------

.. class:: RawConfigParser(defaults=None, dict_type=collections.OrderedDict, \
.. class:: RawConfigParser(defaults=None, dict_type=dict, \
allow_no_value=False, *, delimiters=('=', ':'), \
comment_prefixes=('#', ';'), \
inline_comment_prefixes=None, strict=True, \
Expand All @@ -1218,6 +1221,10 @@ RawConfigParser Objects
names, and values via its unsafe ``add_section`` and ``set`` methods,
as well as the legacy ``defaults=`` keyword argument handling.

.. versionchanged:: 3.7
The default *dict_type* is :class:`dict`, since it now preserves
insertion order.

.. note::
Consider using :class:`ConfigParser` instead which checks types of
the values to be stored internally. If you don't want interpolation, you
Expand Down

0 comments on commit dc20d9d

Please sign in to comment.