Skip to content

Commit 3b0b90c

Browse files
andresdelfinoned-deily
authored andcommitted
bpo-33800: Fix default argument for parameter dict_type of ConfigParser/RawConfigParser (GH-7494)
1 parent 4f54867 commit 3b0b90c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Doc/library/configparser.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ interpolation if an option used is not defined elsewhere. ::
855855
ConfigParser Objects
856856
--------------------
857857

858-
.. 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={})
858+
.. 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={})
859859

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

920+
.. versionchanged:: 3.7
921+
The default *dict_type* is :class:`dict`, since it now preserves
922+
insertion order.
920923

921924
.. method:: defaults()
922925

@@ -1178,7 +1181,7 @@ ConfigParser Objects
11781181
RawConfigParser Objects
11791182
-----------------------
11801183

1181-
.. class:: RawConfigParser(defaults=None, dict_type=collections.OrderedDict, \
1184+
.. class:: RawConfigParser(defaults=None, dict_type=dict, \
11821185
allow_no_value=False, *, delimiters=('=', ':'), \
11831186
comment_prefixes=('#', ';'), \
11841187
inline_comment_prefixes=None, strict=True, \
@@ -1191,6 +1194,10 @@ RawConfigParser Objects
11911194
names, and values via its unsafe ``add_section`` and ``set`` methods,
11921195
as well as the legacy ``defaults=`` keyword argument handling.
11931196

1197+
.. versionchanged:: 3.7
1198+
The default *dict_type* is :class:`dict`, since it now preserves
1199+
insertion order.
1200+
11941201
.. note::
11951202
Consider using :class:`ConfigParser` instead which checks types of
11961203
the values to be stored internally. If you don't want interpolation, you

0 commit comments

Comments
 (0)