Reviewed: https://review.opendev.org/c/openstack/swift/+/801095 Committed: https://opendev.org/openstack/swift/commit/775ad9a56882b387e834eae7635f9f1ffa7c2f2c Submitter: "Zuul (22348)" Branch: master
commit 775ad9a56882b387e834eae7635f9f1ffa7c2f2c Author: Takashi Kajinami <email address hidden> Date: Sat Jul 17 01:07:54 2021 +0900
Remove redundant usage of collections(.abc).Mapping
The json.loads method returns a normal python dict without any hook defined, and type check using the Mapping class is redundant.
In Python 3.8 >>> import json >>> type(json.loads('{"foo": {"var": "baz"}}')) <class 'dict'>
In Python 2.7 >>> import json >>> type(json.loads('{"foo": {"var": "baz"}}')) <class 'dict'>
With this change we don't have to handle difference between Python 2 and Python 3 and later about import path we should use to import that abstract class
Closes-Bug: #1936667 Change-Id: I9232311784d1feff2d669455dafde17ed9f751ad
Reviewed: https:/ /review. opendev. org/c/openstack /swift/ +/801095 /opendev. org/openstack/ swift/commit/ 775ad9a56882b38 7e834eae7635f9f 1ffa7c2f2c
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 775ad9a56882b38 7e834eae7635f9f 1ffa7c2f2c
Author: Takashi Kajinami <email address hidden>
Date: Sat Jul 17 01:07:54 2021 +0900
Remove redundant usage of collections( .abc).Mapping
The json.loads method returns a normal python dict without any hook
defined, and type check using the Mapping class is redundant.
In Python 3.8 loads(' {"foo": {"var": "baz"}}'))
>>> import json
>>> type(json.
<class 'dict'>
In Python 2.7 loads(' {"foo": {"var": "baz"}}'))
>>> import json
>>> type(json.
<class 'dict'>
With this change we don't have to handle difference between Python 2
and Python 3 and later about import path we should use to import that
abstract class
Closes-Bug: #1936667 ff2d669455dafde 17ed9f751ad
Change-Id: I9232311784d1fe