What is required to support keyword argument unpacking for a custom class in Python? In both the Python 2.7 and Python 3.6 interpreters the following error message is given when trying to unpack an incompatible type:
>>> dict(**None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: type object argument after ** must be a mapping, not NoneType
Does mapping mean the object has to specifically subclass collections.Mapping? Or is mapping in this case one of those pseudo types such as iterable where you don't have to explicitly subclass collections.Iterable to support iter()? Does this behavior differ between Python 2 and 3?