Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"They ought to make butt-flavored cat food." --Gallagher


devel / comp.lang.python / Re: why this code giving recursion error????

SubjectAuthor
o Re: why this code giving recursion error????dn

1
Re: why this code giving recursion error????

<mailman.718.1656240926.20749.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=23177&group=comp.lang.python#23177

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonList@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: why this code giving recursion error????
Date: Sun, 26 Jun 2022 22:55:16 +1200
Organization: DWM
Lines: 40
Message-ID: <mailman.718.1656240926.20749.python-list@python.org>
References: <CAC8x_z3-WSQ6tT6hHk9LQQ4DngE38FEyX57PRNFdit77tZOZxQ@mail.gmail.com>
<06db728d-446d-0058-462f-0f2914102953@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de r6iIdb5wQbGMhzLKsFpGAAgMeZomuzx0jUM1t0VPQ0Rw==
Return-Path: <PythonList@DancesWithMice.info>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=danceswithmice.info header.i=@danceswithmice.info
header.b=WVkVSCZM; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'def': 0.04;
'subject:error': 0.07; '=dn': 0.09; 'else:': 0.09; 'flags': 0.09;
'from:addr:danceswithmice.info': 0.09; 'from:addr:pythonlist':
0.09; 'error?': 0.16; 'handful': 0.16; 'items,': 0.16; 'message-
id:@DancesWithMice.info': 0.16; 'predictable': 0.16;
'received:51.254': 0.16; 'received:51.254.211': 0.16;
'received:51.254.211.219': 0.16; 'received:cloud': 0.16;
'received:rangi.cloud': 0.16; 'recursion': 0.16; 'subject:code':
0.16; 'wrote:': 0.16; 'to:addr:python-list': 0.20; 'code': 0.23;
'pattern': 0.26; 'header:User-Agent:1': 0.30; 'code,': 0.31;
'header:Organization:1': 0.31; 'question': 0.32; 'header:In-Reply-
To:1': 0.34; 'built': 0.36; 'received:192.168': 0.37; 'list':
0.39; 'format': 0.62; 'internal': 0.63; 'received:51': 0.64;
'thus': 0.64; 'subject:this': 0.67
DKIM-Filter: OpenDKIM Filter v2.11.0 vps.rangi.cloud 0197543C5
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1656240924;
bh=eAUlPRUwToPdh3eQ6FZjEjjAW3UtISoAijWf7fP7gzA=;
h=Date:Subject:To:References:From:In-Reply-To:From;
b=WVkVSCZMPkJgGRuTHePE2SGvu37cI57fmR8NKdnjUeZvn4jClNMOp/p7oFpk/F2hT
BVm5zIAH1vx8bJcVAmteUwIVAEcvHURiWlEH0dhrxFIB3ngBt3OYyeaPjALGk3OToR
vVGeUnyqHJx0l+fn+sj3agjukp+0DSfbbv+u/g3VXCXhPpcazxwxGfDiII1VhnlYBN
V3JEvxh2GzOj/jatzUBA189DmnW/VoJuuQZ7NUF0pDfEagIa/iTbsCHkB0jSZL6oh3
gBOL26t+tY7HEwdn+Xdictc2rW4TldQ3X0fMMIiI6YMoy7orJae643hZCVvdo9ukyI
cO85WML4E2DnA==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Content-Language: en-GB
In-Reply-To: <CAC8x_z3-WSQ6tT6hHk9LQQ4DngE38FEyX57PRNFdit77tZOZxQ@mail.gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <06db728d-446d-0058-462f-0f2914102953@DancesWithMice.info>
X-Mailman-Original-References: <CAC8x_z3-WSQ6tT6hHk9LQQ4DngE38FEyX57PRNFdit77tZOZxQ@mail.gmail.com>
 by: dn - Sun, 26 Jun 2022 10:55 UTC

On 26/06/2022 22.48, נתי שטרן wrote:
> def compile(p, flags=0):
> # internal: convert pattern list to internal format
>
> if (isinstance(p,str)):
> pattern = p
> p = sre_parse.parse(p, flags)
> else:
> pattern = None
>
> code = _code(p, flags)
>
> if flags & SRE_FLAG_DEBUG:
> print()
> dis(code)
>
> # map in either direction
> groupindex = p.state.groupdict
> indexgroup = [None] * p.state.groups
> for k, i in groupindex.items():
> indexgroup[i] = k
>
> return sre_compile.compile(
> pattern, flags | p.state.flags, code,
> p.state.groups-1,
> groupindex, tuple(indexgroup)
> )

Why would any code give a recursion error?

With recursion problems, the first question to ask is: how does this
thing stop?

Have you built some test-data with only a handful of items, and thus a
predictable result. Does that result occur? If not, where are the
differences occurring?
--
Regards,
=dn


devel / comp.lang.python / Re: why this code giving recursion error????

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor