Use isinstance()
over hasattr()
for type guard
#27211
Merged
isinstance()
over hasattr()
for type guard
#27211