Mark Dickinson <dicki...@gmail.com> added the comment:

Here's a version of the patch that adds exact comparisons between the various 
numeric types.  The only slightly tricky comparison is the Fraction <-> Decimal 
one:  an obvious strategy is to convert the Decimal exactly to a Fraction and 
then use the fraction comparison, but this is inefficient for Decimal instances 
with large exponent.  So instead, we compare a Decimal `x` with a Fraction 
`n/d` by comparing `x*d` with `n` in the Decimal domain.

----------
Added file: http://bugs.python.org/file16675/numeric_hash5.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8188>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to