[Python-bugs-list] [ python-Bugs-422108 ] Error in rich comparisons

noreply@sourceforge.net noreply@sourceforge.net
Mon, 07 May 2001 13:54:54 -0700


Bugs item #422108, was updated on 2001-05-07 13:13
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422108&group_id=5470

Category: Python Interpreter Core
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Tim Peters (tim_one)
>Assigned to: Tim Peters (tim_one)
Summary: Error in rich comparisons

Initial Comment:
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.


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

>Comment By: Tim Peters (tim_one)
Date: 2001-05-07 13:54

Message:
Logged In: YES 
user_id=31435

Fixed in Objects/object.c, new revision: 2.130.


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

Comment By: Nobody/Anonymous (nobody)
Date: 2001-05-07 13:33

Message:
Logged In: NO 

Yup, looks right.  Go for it.

--Guido


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

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