Why not use `isinstance`?