New submission from Fred L. Drake, Jr. <[EMAIL PROTECTED]>: There's a strange condition where cmp() of tuples of unorderable values returns -1 even though using the unorderable values raises an exception.
If I have these two unorderable values, cmp() raises an expected exception: >>> s0 = frozenset(['testing 0']) >>> s1 = frozenset(['testing 1']) >>> cmp(s0, s1) Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: cannot compare sets using cmp() Comparing tuples of the values returns -1: >>> cmp((s0,), (s1,)) -1 Py3k does raise a TypeError, but the message is indecipherable: >>> cmp((s0,), (s1,)) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unorderable types: 'tuple' != 'tuple' (The Py3k message for the set comparison is the same as for Python 2.) I believe that this is an error; the exception from the underlying item comparison should be propagated. ---------- components: Interpreter Core messages: 72981 nosy: fdrake severity: normal status: open title: Tuple comparison masking exception type: behavior versions: Python 2.4, Python 2.5, Python 2.6, Python 3.0 _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3829> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com