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.

Title: Incorrect error message (somewhat)
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gerrit, rhettinger
Priority: normal Keywords:

Created on 2004-12-04 19:44 by gerrit, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg23538 - (view) Author: Gerrit Holl (gerrit) Date: 2004-12-04 19:44
Comparing complex numbers with cmp yields:

>>> cmp(1+3j, 1+3j)
>>> cmp(1+3j, 3+4j)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: cannot compare complex numbers using <, <=,
>, >=

Well, I didn't use <, <=, > or >=. It's not a major
bug, but it doesn't look too nice... would it be
possible to return NotImplemented? Or would that be
semantically incorrect?
msg23539 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-12-10 17:31
Logged In: YES 

That is incorrect be == and != are implemented.

The message is slightly weird but still helpful. Any
rewording I can think of makes the message more obtuse, so I
recommend leaving it alone and closing this bug.
msg23540 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-12-19 20:47
Logged In: YES 

Rewrote the error message.

See Objects/complexobject.c 2.73 and
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41281
2004-12-04 19:44:05gerritcreate