Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'mathematics': 0.05; 'subject:Python': 0.06; 'debugging': 0.07; '#print': 0.09; 'integers': 0.09; 'def': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'heap': 0.16; 'limit.': 0.16; 'through.': 0.16; 'demonstrate': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'stack': 0.19; 'python?': 0.22; 'integer': 0.24; 'post': 0.26; 'somewhere': 0.26; 'header:In-Reply-To:1': 0.27; 'appear': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'depth': 0.31; "we're": 0.32; 'checking': 0.33; 'problem': 0.35; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'version': 0.36; 'two': 0.37; 'received:209': 0.37; 'system,': 0.38; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'space': 0.40; 'skip:n 10': 0.64; 'hey,': 0.75; 'this...': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=LPmqYsrrwutr3Z+LxyvL3SWiA5AfunIZh4AkVv5ox+A=; b=irHDA+b0bGv0Mq3CkzyGua192715tTnxq4PQtKmKQhGBx5HnZHgLHo1veFiNfkjW4f RDcxK/GlY5gO18+m0yMrfTvjrxKVJIg0ElLfaG2aVb1Je110UZFirz8mMs1Iu4UYwigF qNyXDR5bOm4EHvHbogaMGdyJxh6ZC/g8W/FgQ9I3H9+EAxAiF2M6dTsP2gpwzjioxyQc HJFS357SkNEbjCg8EY5tDjvthPsOfmr7ufsjOHuLLnPZt72v8tcPL1yWGECv6mFBNChg 73ndksIynhLQthpWvOAmoknfiQESvIwpTh/4dzK3yILBGFVotNYMgl9sx+KgMVaAfJkr LSWA== MIME-Version: 1.0 X-Received: by 10.52.155.133 with SMTP id vw5mr6882455vdb.43.1368921885164; Sat, 18 May 2013 17:04:45 -0700 (PDT) In-Reply-To: <52b7a255-51f2-4b62-9c99-f8fcda5b7e97@googlegroups.com> References: <519052df$0$29997$c3e8da3$5496439d@news.astraweb.com> <5e2c6b41-e9af-4604-ad05-47fbea32ae15@zo5g2000pbb.googlegroups.com> <52b7a255-51f2-4b62-9c99-f8fcda5b7e97@googlegroups.com> Date: Sun, 19 May 2013 10:04:45 +1000 Subject: Re: Python for philosophers From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1368921893 news.xs4all.nl 15939 [2001:888:2000:d::a6]:53802 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45538 On Sun, May 19, 2013 at 9:56 AM, 88888 Dihedral 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