[New-bugs-announce] [issue1612] infinite recursion when using collections.Sequence in a recursive function (Py30a2)

Mark Summerfield report at bugs.python.org
Thu Dec 13 16:41:06 CET 2007


New submission from Mark Summerfield:

In the attached file there are two tiny functions, flatten1() and
flatten2(). There is only one difference between them:
flatten1() has the line:
    if isinstance(x, list):
and flatten2() has this line instead:
    if isinstance(x, collections.Sequence):

flatten1() works perfectly in Python 2.5.1 and Python 30a2 (just comment
out the flatten2() code).
But flatten2() goes into "infinite" recursion in Python 30a2 when trying
to flatten list "c".

----------
components: Interpreter Core
files: bug.py
messages: 58536
nosy: mark
severity: normal
status: open
title: infinite recursion when using collections.Sequence in a recursive function (Py30a2)
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8939/bug.py

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1612>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.py
Type: text/x-python
Size: 1344 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071213/b45bee93/attachment.py 


More information about the New-bugs-announce mailing list