Use isinstance() rather than a check using type()
Merge pull request #6320 from angstwad/instance-redo

Use isinstance() rather than a check using type()