[Python-bugs-list] [Bug #128220] cmp() broken with Unicode?

noreply@sourceforge.net noreply@sourceforge.net
Tue, 09 Jan 2001 15:47:48 -0800


Bug #128220, was updated on 2001-Jan-09 14:03
Here is a current snapshot of the bug.

Project: Python
Category: Unicode
Status: Closed
Resolution: Invalid
Bug Group: Not a Bug
Priority: 5
Submitted by: beazley
Assigned to : nobody
Summary: cmp() broken with Unicode?

Details: Is cmp() supposed to return the same result as == below?

>>> a = "Hello"
>>> b = u"Hello"
>>> a == b
1
>>> cmp(a,b)
0
>>> 


Follow-Ups:

Date: 2001-Jan-09 15:47
By: tim_one

Comment:
Suggest that you read the docs for cmp (Library Ref, under builtin
functions).

>>> 42 == 42
1
>>> cmp(42, 42)
0
>>>

cmp is supposed to return 0 iff its arguments compare equal.

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

Date: 2001-Jan-09 14:34
By: nobody

Comment:
I don't understand your request: cmp(a,b) == 0 means that
a equals b.
--
Marc-Andre
-------------------------------------------------------

Date: 2001-Jan-09 14:17
By: beazley

Comment:
Argh!  Okay, my head is fried from too much Unicode....
sorry about this :-).

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

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=128220&group_id=5470