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.

classification
Title: Decimal comparison with None fails in Windows
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: facundobatista Nosy List: facundobatista, pablohoffman
Priority: normal Keywords:

Created on 2007-07-31 16:34 by pablohoffman, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg32576 - (view) Author: pablohoffman.com (pablohoffman) Date: 2007-07-31 16:34
The version used to test this was:
Python 2.5.1 (r251:54863, May  2 2007, 16:56:35) 

In Linux:
>>> from decimal import Decimal
>>> Decimal('1') < None
False
>>>

In Windows:
>>> from decimal import Decimal
>>> Decimal('1') < None
True
>>>

This is probably a Windows bug since both platforms do:

>>> 1 < None
False
msg32577 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2007-08-03 02:59
Solved, the problem was that __cmp__ was returning NotImplemented, which is not allowed (is not defined, that's why the different behaviour in different systems).

The solution was commited in revision 56682, in the decimal branch.
History
Date User Action Args
2022-04-11 14:56:25adminsetgithub: 45262
2007-07-31 16:34:28pablohoffmancreate