Message98217
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 |
|
Date |
User |
Action |
Args |
2010-01-24 12:33:31 | skrah | set | recipients:
+ skrah, rhettinger, facundobatista, mark.dickinson, jdunck, lorg, adamtj, bertchughes |
2010-01-24 12:33:29 | skrah | set | messageid: <1264336409.96.0.544856377977.issue2531@psf.upfronthosting.co.za> |
2010-01-24 12:33:28 | skrah | link | issue2531 messages |
2010-01-24 12:33:27 | skrah | create | |
|