Fix: use isinstance
instead of type comparison
#2973
Merged
isinstance
instead of type comparison
#2973