[ python-Bugs-851001 ] comparing reference looped lists causes RuntimeError

SourceForge.net noreply at sourceforge.net
Fri Nov 28 20:43:29 EST 2003


Bugs item #851001, was opened at 2003-11-29 10:43
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=851001&group_id=5470

Category: Python Interpreter Core
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: George Yoshida (quiver)
Assigned to: Nobody/Anonymous (nobody)
Summary: comparing reference looped lists causes RuntimeError

Initial Comment:
On CVS HEAD Python(2.4), comparing reference 
looped lists causes RuntimeError.

>>> import sys
>>> print sys.version
2.4a0 (#1, Nov 28 2003, 11:18:42)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)]
>>> l = []
>>> l.append(l)
>>> m = l[:]
>>> l, m
([[...]], [[[...]]])
>>> l == m
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
RuntimeError: maximum recursion depth exceeded 
in cmp
>>> m == l
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
RuntimeError: maximum recursion depth exceeded 
in cmp

On Python 2.3 & 2.2, this doesn't happen.

>>> import sys
>>> print sys.version
2.3.2 (#1, Oct  6 2003, 10:07:16)
[GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)]
>>> l = []
>>> l.append(l)
>>> m = l[:]
>>> l, m
([[...]], [[[...]]])
>>> l == m
True

The results of Python 2.2 is same as Python 2.3 
except that True/False is denoted as 1/0.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=851001&group_id=5470



More information about the Python-bugs-list mailing list