mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +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
|
|
@ -1109,7 +1109,7 @@ class RawConfigParserTestCase(BasicTestCase, unittest.TestCase):
|
|||
self.assertEqual(cf.get(123, 'this is sick'), True)
|
||||
if cf._dict is configparser._default_dict:
|
||||
# would not work for SortedDict; only checking for the most common
|
||||
# default dictionary (OrderedDict)
|
||||
# default dictionary (dict)
|
||||
cf.optionxform = lambda x: x
|
||||
cf.set('non-string', 1, 1)
|
||||
self.assertEqual(cf.get('non-string', 1), 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue