[ python-Bugs-1019129 ] "rich comparison'' methods hide stack
overflow
SourceForge.net
noreply at sourceforge.net
Tue Sep 7 05:29:28 CEST 2004
Bugs item #1019129, was opened at 2004-08-30 11:01
Message generated for change (Comment added) made by tim_one
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1019129&group_id=5470
Category: Python Interpreter Core
Group: Python 2.3
Status: Closed
Resolution: Wont Fix
Priority: 5
Submitted By: boyanb (boyanb)
Assigned to: Nobody/Anonymous (nobody)
Summary: "rich comparison'' methods hide stack overflow
Initial Comment:
I've tried the code below for both 2.2.2 and 2.3.2
>>> class DontCare(str):
... def __eq__(self, other):
... # stack overflow expected!
... return self == other
...
...
>>> print (DontCare("1") == "2")
1
----------------------------------------------------------------------
>Comment By: Tim Peters (tim_one)
Date: 2004-09-06 23:29
Message:
Logged In: YES
user_id=31435
Just nothing that this was still thought to be "a feature" in
2.3. NEWS for 2.4a1 contained:
"""
- Python no longer tries to be smart about recursive
comparisons. When comparing containers with cyclic
references to themselves it will now just hit the recursion
limit. See SF patch 825639.
"""
More info can be found by looking at the patch, and the bug
reports it addressed.
----------------------------------------------------------------------
Comment By: Raymond Hettinger (rhettinger)
Date: 2004-09-06 23:18
Message:
Logged In: YES
user_id=80475
Armin fixed this for Py2.4.
It is a behaviour change that may affect existing, working
code, so it was not backported.
----------------------------------------------------------------------
Comment By: Brett Cannon (bcannon)
Date: 2004-09-06 23:15
Message:
Logged In: YES
user_id=357491
This problem does not exist in 2.4 but seems to still be in 2.3 CVS.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1019129&group_id=5470
More information about the Python-bugs-list
mailing list