User 12692182
User 12692182

Reputation: 991

Python int too large to convert to C int

Before you mark me as a duplicate, other questions are about Python ints being too long too convert into C longs, not C ints. When I try and do this:

sys.setrecursionlimit(10000000000)

I get this:

Traceback (most recent call last):
  File "<pyshell#44>", line 1, in <module>
    sys.setrecursionlimit(10000000000)
OverflowError: Python int too large to convert to C int

is there any way to surpass this, or override it?

Upvotes: 2

Views: 2274

Answers (1)

hobbs
hobbs

Reputation: 240649

No. The variable is the type that it is. You can't set it to a value bigger than what it can hold. You'll have to live with a recursion depth of a mere two billion and change, instead of ten billion; I suspect you'll run out of memory before you get that many call frames deep anyway.

Upvotes: 3

Related Questions