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

Created on 2004-12-04 19:44 by gerrit, last changed 2004-12-19 20:47 by rhettinger.

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)
0
>>> 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) Date: 2004-12-10 17:31
Logged In: YES 
user_id=80475

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) Date: 2004-12-19 20:47
Logged In: YES 
user_id=80475

Rewrote the error message.

See Objects/complexobject.c 2.73 and 2.72.2.1
History
Date User Action Args
2004-12-04 19:44:05gerritcreate