Author skrah
Recipients adamtj, bertchughes, facundobatista, jdunck, lorg, mark.dickinson, rhettinger, skrah
Date 2010-01-24.12:33:27
SpamBayes Score 1.66533e-16
Marked as misclassified No
Message-id <1264336409.96.0.544856377977.issue2531@psf.upfronthosting.co.za>
In-reply-to
Content
I'm new to this thread, so I hope I didn't miss anything that has been
said already. I don't fully understand why TypeError cannot be raised
in 2.x. The 2.6 documentation for tp_richcompare says:

"If you want to implement a type for which only a limited set of comparisons makes sense (e.g. == and !=, but not < and friends), directly raise TypeError in the rich comparison function."


I just tried that in the 2.7 version of cdecimal, and it works well:


>>> from cdecimal import *
>>> Decimal(9) < 2.5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: conversion from float to Decimal is not supported
History
Date User Action Args
2010-01-24 12:33:31skrahsetrecipients: + skrah, rhettinger, facundobatista, mark.dickinson, jdunck, lorg, adamtj, bertchughes
2010-01-24 12:33:29skrahsetmessageid: <1264336409.96.0.544856377977.issue2531@psf.upfronthosting.co.za>
2010-01-24 12:33:28skrahlinkissue2531 messages
2010-01-24 12:33:27skrahcreate