I was reading PEP-3119, and I discovered that builtins derive from ABCs.
From PEP-3119:
The built-in type set derives from MutableSet. The built-in type frozenset derives from Set and Hashable.
In Python:
<code>from collections.abc import Mapping
>>> print('y' if issubclass(dict, Mapping) else 'n')
y
</code>
<code>from collections.abc import Mapping
>>> print('y' if issubclass(dict, Mapping) else 'n')
y
</code>
from collections.abc import Mapping
>>> print('y' if issubclass(dict, Mapping) else 'n')
y
With the above, I would assume that dict’s metaclass should be ABCMeta since it has the ABCMeta metaclass in its inheritance chain. (dict > MutableMapping > Mapping)
However, Python shows dict’s metaclass is type:
<code>>>> type(dict)
<class 'type'>
</code>
<code>>>> type(dict)
<class 'type'>
</code>
>>> type(dict)
<class 'type'>
Can someone explain this to me? Thank you.