I think this wants to use `isinstance`.