Python crashes with large numbers
<p>I'm pretty new to Python, but I got this challenge to create a Fibonacci-generator recursively to get me going in the language. The problem is that if I find more than 3226/3227 numbers of Fibonacci, Python crashes. (Python 3)</p>

<p>Note: I have done a lot of programming in PHP, JavaScript, a little in VBA and a little in Java, but I'm completely new to Python. So if this is simply a matter of wrong data types or something, I am really sorry.</p>

<pre><code>import sys
sys.setrecursionlimit(1000000000)

cache = dict()

 def fibonacci(n, arr = False):
    global cache

    if n == 0 or n == 1:
         r = n
    else:
        nVal1 = n - 1
        nVal2 = n - 2
        if (not nVal1 in cache):
            num1 = cache[nVal1] = fibonacci(nVal1, arr)
        else:
            num1 = cache[nVal1]
        if (not nVal2 in cache):
            num2 = cache[nVal2] = fibonacci(nVal2)
        else:
            num2 = cache[nVal2]

        r = num1 + num2


     if arr != False:
        arr.append(r)


    return r

fib = list()
# 3227 is max without generating a list.
# 3226 is max when generating a list.
fibonacci(3226, fib)
for x in fib: print(x)
</code></pre>

<p>What can I do to make it go further than this? I don't suppose it has run out of memory, since this runs on my slow i3-laptop on about two seconds..</p>
