if isinstance(f, numbers.Integral): RecursionError: maximum recursion depth exceeded 解决: import sys sys.setrecursionlimit(1000000) # 例如这里设置为一百万