Please, use builtin `isinstance()` function.