[Python-bugs-list] [ python-Bugs-422108 ] Error in rich comparisons
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 07 May 2001 13:13:58 -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: Open
Resolution: None
Priority: 5
Submitted By: Tim Peters (tim_one)
Assigned to: Guido van Rossum (gvanrossum)
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.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=422108&group_id=5470