Use isinstance
instead of checking type equality
#1459
Merged
isinstance
instead of checking type equality
#1459