[Python-bugs-list] [ python-Bugs-625698 ] Errors with recursive objects

SourceForge.net noreply@sourceforge.net
Tue, 07 Jan 2003 16:59:47 -0800


Bugs item #625698, was opened at 2002-10-19 15:27
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=625698&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
>Resolution: Works For Me
Priority: 5
Submitted By: Erik Andersén (erik_andersen)
Assigned to: Nobody/Anonymous (nobody)
Summary: Errors with recursive objects

Initial Comment:
List and dictionaries put Python into an infinite loop if they contain 
more than one reference to itself

>>> d = {}
>>> d[1] = 
d
>>> d == d  # OK Python can handle one 
recursion
1
>>> d[2] = d 
>>> d == d  # Crash with 
two

Lists are similar

>>> l=[]
>>> 
l.append(l)
>>> l==l  # OK
1
>>> l.append(l)
>>> 
l==l # Crash

>>> l>l  # Also crash

Tested with 
ActivePython 2.2.1 under Windows 98
and (the first part) 
Python 2.2.2 under Linux


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

>Comment By: Neal Norwitz (nnorwitz)
Date: 2003-01-07 19:59

Message:
Logged In: YES 
user_id=33168

Erik, do you still have this problem with 2.2.2?  I can't
reproduce your problem under Linux.  mly can't reproduce the
problems with 2.2.1 on Windows (2000).  Do you only have the
problem on Windows?  

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

Comment By: Magnus Lyckå (mly)
Date: 2002-10-26 19:12

Message:
Logged In: YES 
user_id=95217

I tried the above under 

Python 2.2.1 (#34, Sep 27 2002, 18:37:42) [MSC 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more
information.
(ActiveState on Win 2000)

and 

Python 2.1.1 (#1, Aug 20 2001, 20:23:29)
[GCC 2.96 20000731 (Mandrake Linux 8.1 2.96-0.60mdk)] on
linux-i386

In both cases it works correctly. No crash.
It takes a lot of time though, Several seconds
on Duron 700 w/ Win2k, and tens of seconds 
on K6-233 w/ Linux.



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

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