Python for philosophers

Chris Angelico rosuav at gmail.com
Sat May 18 20:04:45 EDT 2013


On Sun, May 19, 2013 at 9:56 AM, 88888 Dihedral
<dihedral88888 at googlemail.com> wrote:
> Hey, ChisA, are you delibrately to write a recursive version
> to demonstrate the stack depth problem in Python?
>
> def fact(n):
>    ret=1
>    if n>1: # integer checking is not used but can be added
>       for x in xrange(n): ret*=x
>    #print ret # debugging only for long integers
>    return ret
>
>
>
> In a 32 or 64 bit system, this non-recursive verssion
> will be limited by the heap space not by the stack limit.

And just when we're sure Dihedral's a bot, a post like this comes through.

Dihedral, are you intelligent? I'm still in two minds about this...
which may be why you so often appear to have no minds. I dunno.
Mathematics somewhere I fancy.

ChrisA



More information about the Python-list mailing list