What is the explicit python3 type for dict_keys for isinstance() check?
Using built-in type():
isinstance(d.keys(), type({}.keys()))
You can use collections.abc.KeysView
:
In [19]: isinstance(d.keys(), collections.abc.KeysView)
Out[19]: True
collections.abc
module provides abstract base classes that can be used to test whether a class provides a particular interface