Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Detecting repeated subsequences of identical items Date: Fri, 22 Apr 2016 00:12:23 +1000 Lines: 16 Message-ID: References: <571843f9$0$1585$c3e8da3$5496439d@news.astraweb.com> <5718c457$0$1605$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 1PaL3tkBQa7MJAW/BM+m1AUhOfmTRLg5gTKIeqUK3+rg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'overflow': 0.07; 'see.': 0.07; 'cc:addr:python-list': 0.09; '22,': 0.09; 'benjamin': 0.09; 'exceptions,': 0.09; 'finite': 0.09; 'exception': 0.13; 'stack': 0.13; '2016': 0.16; 'cc:name:python list': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hits': 0.16; 'problem).': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sequence.': 0.16; 'subject:Detecting': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; 'bit': 0.23; 'header:In- Reply-To:1': 0.24; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'sequence': 0.27; 'usually': 0.33; 'received:google.com': 0.35; 'there': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; "won't": 0.38; 'received:209': 0.38; 'end': 0.39; "you'll": 0.61; 'leading': 0.61; 'limit': 0.65; 'increasing': 0.76; 'chrisa': 0.84; 'oscar': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=zboi+q+uIQ13pfCmcvXXq8/NtlYAflVOzfAvjtJGOus=; b=MziS1wI94RG9labIqjG0xRD97edCcvT1VtpJF1z0f/KQCwTjo6hx35Ua1cerwL2eCV jg8fagQG7mVv8/HbA2eUjwmUYcit9ZxOTaxjGjEY0furVQJWn6iLuneuTnOXH7y8ck+t QEarpMq8DYQ2kiGw1GX9ewgWPSZWBxU1FckOyR0sApingfOwP/nCyyNLifqICDX1yeEG 7EFgYDUIPehOK5IfOeafaJMoBnRtx3ktsUw94kewiWoPjE10vmorzkOXD0TVu6eXGorL NuM900YFHtZ5PXAHFck7V6dVS93M3kDLm+ayQ74BnV4Heajzu2tgSXeWw74ZZbL7zL8n XOCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=zboi+q+uIQ13pfCmcvXXq8/NtlYAflVOzfAvjtJGOus=; b=g2EJ5FQuovRL+2bOxv1I2NVpL7WRtjhkcQdO5M8Cu/iWxVPaAcM9Y7IBlX8jdbGpaT ppBXkJYwDz/TuIXH87a7BzWVH2XV3x+lsz9EcnAfSQNt9Z+Ojtr7NoFcaKuH/7zw/7Od 9frrUUmmWvE7aAnNG9XJDIYua+qmszJCglkL5nGSgGIhomkFufV99a+VLtsmAp9cf3T3 reLcIwbCumvrv31Jmx93X0j/jpsIlRMEa+DRCs1As+Njvh+omHR+GBDps6xd49Cl/dXq iwnCskSEB3xEpnZTg46KfmWVE/hcoo0Q592Mhlf3hf54BoSgEk5efz9Fx8EjHIweZZ6X KuzQ== X-Gm-Message-State: AOPr4FXVHqO5thJLgd7YuL9TrE3LaHSTASMmYcYAyTReIQIXfrWf480iMRh9So23ee2CDMJNzgSXgYki3hLVLg== X-Received: by 10.107.169.13 with SMTP id s13mr13205051ioe.19.1461247943868; Thu, 21 Apr 2016 07:12:23 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <571843f9$0$1585$c3e8da3$5496439d@news.astraweb.com> <5718c457$0$1605$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:107453 On Fri, Apr 22, 2016 at 12:01 AM, Oscar Benjamin wrote: > In the recursive stack overflow case what you'll usually have is > > 1) A few frames leading up to the start of recursion > 2) A long repetitive sequence of frames > 3) A few frames at the end showing how the exception was ultimately triggered. > > You just need to find the cycle that makes that big long sequence. If the stack got overflowed, there won't usually be a part 3, as part 2 is the bit that hits sys.recursionlimit (unless increasing the recursion limit by a finite number would solve the problem). For other exceptions, yes, this is what you'd see. ChrisA