How to test for type or instance of dict_values?

Thorsten Kampe thorsten at thorstenkampe.de
Thu Nov 17 07:24:54 EST 2016


How can I test for type or instance of dictviews like dict_values?

`isinstance({}.values, dict_values)` gives
`NameError: name 'dict_values' is not defined`

"""
>>> type({}.values())
<class 'dict_values'>
"""

Thorsten





More information about the Python-list mailing list