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: Error in rich comparisons
Type: Stage:
Components: Interpreter Core Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: tim.peters Nosy List: nobody, tim.peters
Priority: normal Keywords:

Created on 2001-05-07 20:13 by tim.peters, last changed 2022-04-10 16:04 by admin. This issue is now closed.

Messages (3)
msg4675 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2001-05-07 20:13
try_rich_to_3way_compare is documented as returning -2 
for an exception.  However, in the loop, when 
try_rich_compare_bool returns -1, 
try_rich_to_3way_compare returns -1 instead of -2.  
try_rich_compare_bool does return -1 in case of 
exception.

Unclear whether this is a bug in the code or the 
comment.  The only caller of try_rich_to_3way_compare 
is do_cmp, and the latter's return conditions aren't 
documented, although at least one of do_cmp's callers 
documents its own return conditions as "-2 for an 
exception" too.

So best guess is that the code is in error, and 
that "return -1" should be replaced by "return -2" in 
try_rich_to_3way_compare.
msg4676 - (view) Author: Nobody/Anonymous (nobody) Date: 2001-05-07 20:33
Logged In: NO 

Yup, looks right.  Go for it.

--Guido
msg4677 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2001-05-07 20:54
Logged In: YES 
user_id=31435

Fixed in Objects/object.c, new revision: 2.130.
History
Date User Action Args
2022-04-10 16:04:02adminsetgithub: 34470
2001-05-07 20:13:57tim.peterscreate