This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: "rich comparison'' methods hide stack overflow
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: boyanb, brett.cannon, rhettinger, tim.peters
Priority: normal Keywords:

Created on 2004-08-30 15:01 by boyanb, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg22277 - (view) Author: boyanb (boyanb) Date: 2004-08-30 15:01
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
msg22278 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2004-09-07 03:15
Logged In: YES 
user_id=357491

This problem does not exist in 2.4 but seems to still be in 2.3 CVS.
msg22279 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-09-07 03:18
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.
msg22280 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-09-07 03:29
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.
History
Date User Action Args
2022-04-11 14:56:06adminsetgithub: 40845
2004-08-30 15:01:08boyanbcreate