@@ -445,20 +445,19 @@ the :meth:`__init__` options:
445445 Hint: if you want to specify default values for a specific section, use
446446 :meth: `read_dict ` before you read the actual file.
447447
448- * *dict_type *, default value: :class: `collections.OrderedDict `
448+ * *dict_type *, default value: :class: `dict `
449449
450450 This option has a major impact on how the mapping protocol will behave and how
451- the written configuration files look. With the default ordered
452- dictionary, every section is stored in the order they were added to the
453- parser. Same goes for options within sections.
451+ the written configuration files look. With the standard dictionary, every
452+ section is stored in the order they were added to the parser. Same goes for
453+ options within sections.
454454
455455 An alternative dictionary type can be used for example to sort sections and
456- options on write-back. You can also use a regular dictionary for performance
457- reasons.
456+ options on write-back.
458457
459458 Please note: there are ways to add a set of key-value pairs in a single
460459 operation. When you use a regular dictionary in those operations, the order
461- of the keys may be random . For example:
460+ of the keys will be ordered . For example:
462461
463462 .. doctest ::
464463
@@ -474,40 +473,9 @@ the :meth:`__init__` options:
474473 ... ' baz' : ' z' }
475474 ... })
476475 >>> parser.sections() # doctest: +SKIP
477- ['section3', 'section2', 'section1']
478- >>> [option for option in parser[' section3' ]] # doctest: +SKIP
479- ['baz', 'foo', 'bar']
480-
481- In these operations you need to use an ordered dictionary as well:
482-
483- .. doctest ::
484-
485- >>> from collections import OrderedDict
486- >>> parser = configparser.ConfigParser()
487- >>> parser.read_dict(
488- ... OrderedDict((
489- ... (' s1' ,
490- ... OrderedDict((
491- ... (' 1' , ' 2' ),
492- ... (' 3' , ' 4' ),
493- ... (' 5' , ' 6' ),
494- ... ))
495- ... ),
496- ... (' s2' ,
497- ... OrderedDict((
498- ... (' a' , ' b' ),
499- ... (' c' , ' d' ),
500- ... (' e' , ' f' ),
501- ... ))
502- ... ),
503- ... ))
504- ... )
505- >>> parser.sections() # doctest: +SKIP
506- ['s1', 's2']
507- >>> [option for option in parser[' s1' ]] # doctest: +SKIP
508- ['1', '3', '5']
509- >>> [option for option in parser[' s2' ].values()] # doctest: +SKIP
510- ['b', 'd', 'f']
476+ ['section1', 'section2', 'section3']
477+ >>> [option for option in parser[' section3' ]] # doctest: +SKIP
478+ ['foo', 'bar', 'baz']
511479
512480* *allow_no_value *, default value: ``False ``
513481
0 commit comments