Prior to Python 3.9, the collections module contained Mapping directly. Starting from Python 3.9, Mapping is moved to collections.abc. This commit adds a compatibility check to import Mapping correctly for Python versions 3.9 and later, ensuring the code works across different Python versions. I also replaced all the instance of collections.Mapping to Mapping.
Prior to Python 3.9, the
collections
module containedMapping
directly. Starting from Python 3.9,Mapping
is moved tocollections.abc
. This commit adds a compatibility check to importMapping
correctly for Python versions 3.9 and later, ensuring the code works across different Python versions. I also replaced all the instance ofcollections.Mapping
toMapping
.