Implement `is_instance`.