Simply the isinstance check by checking for two types at once