mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-33504: Migrate configparser from OrderedDict to dict. (#6819)
With 3.7+, dictionary are ordered by design. Configparser still uses collections.OrderedDict, which is unnecessary. This updates the module to use the standard dict implementation by default, and changes the docs and tests to match.
This commit is contained in:
parent
5f3d04fa4e
commit
3a5b0d8988
5 changed files with 15 additions and 43 deletions
|
@ -139,7 +139,7 @@ ConfigParser -- responsible for parsing a list of
|
|||
"""
|
||||
|
||||
from collections.abc import MutableMapping
|
||||
from collections import OrderedDict as _default_dict, ChainMap as _ChainMap
|
||||
from collections import ChainMap as _ChainMap
|
||||
import functools
|
||||
import io
|
||||
import itertools
|
||||
|
@ -157,6 +157,7 @@ __all__ = ["NoSectionError", "DuplicateOptionError", "DuplicateSectionError",
|
|||
"LegacyInterpolation", "SectionProxy", "ConverterMapping",
|
||||
"DEFAULTSECT", "MAX_INTERPOLATION_DEPTH"]
|
||||
|
||||
_default_dict = dict
|
||||
DEFAULTSECT = "DEFAULT"
|
||||
|
||||
MAX_INTERPOLATION_DEPTH = 10
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue